temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1 | // Generated by the protocol buffer compiler. DO NOT EDIT! |
| 2 | |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 3 | #define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4 | #include "google/protobuf/descriptor.pb.h" |
kenton@google.com | c65c041 | 2010-02-01 20:35:34 +0000 | [diff] [blame] | 5 | |
| 6 | #include <algorithm> |
| 7 | |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 8 | #include <google/protobuf/stubs/once.h> |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 9 | #include <google/protobuf/io/coded_stream.h> |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 10 | #include <google/protobuf/wire_format_lite_inl.h> |
| 11 | #include <google/protobuf/descriptor.h> |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 12 | #include <google/protobuf/reflection_ops.h> |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 13 | #include <google/protobuf/wire_format.h> |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 14 | // @@protoc_insertion_point(includes) |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 15 | |
| 16 | namespace google { |
| 17 | namespace protobuf { |
| 18 | |
| 19 | namespace { |
| 20 | |
temporal | 779f61c | 2008-08-13 03:15:00 +0000 | [diff] [blame] | 21 | const ::google::protobuf::Descriptor* FileDescriptorSet_descriptor_ = NULL; |
| 22 | const ::google::protobuf::internal::GeneratedMessageReflection* |
| 23 | FileDescriptorSet_reflection_ = NULL; |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 24 | const ::google::protobuf::Descriptor* FileDescriptorProto_descriptor_ = NULL; |
temporal | 779f61c | 2008-08-13 03:15:00 +0000 | [diff] [blame] | 25 | const ::google::protobuf::internal::GeneratedMessageReflection* |
| 26 | FileDescriptorProto_reflection_ = NULL; |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 27 | const ::google::protobuf::Descriptor* DescriptorProto_descriptor_ = NULL; |
temporal | 779f61c | 2008-08-13 03:15:00 +0000 | [diff] [blame] | 28 | const ::google::protobuf::internal::GeneratedMessageReflection* |
| 29 | DescriptorProto_reflection_ = NULL; |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 30 | const ::google::protobuf::Descriptor* DescriptorProto_ExtensionRange_descriptor_ = NULL; |
temporal | 779f61c | 2008-08-13 03:15:00 +0000 | [diff] [blame] | 31 | const ::google::protobuf::internal::GeneratedMessageReflection* |
| 32 | DescriptorProto_ExtensionRange_reflection_ = NULL; |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 33 | const ::google::protobuf::Descriptor* FieldDescriptorProto_descriptor_ = NULL; |
temporal | 779f61c | 2008-08-13 03:15:00 +0000 | [diff] [blame] | 34 | const ::google::protobuf::internal::GeneratedMessageReflection* |
| 35 | FieldDescriptorProto_reflection_ = NULL; |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 36 | const ::google::protobuf::EnumDescriptor* FieldDescriptorProto_Type_descriptor_ = NULL; |
| 37 | const ::google::protobuf::EnumDescriptor* FieldDescriptorProto_Label_descriptor_ = NULL; |
| 38 | const ::google::protobuf::Descriptor* EnumDescriptorProto_descriptor_ = NULL; |
temporal | 779f61c | 2008-08-13 03:15:00 +0000 | [diff] [blame] | 39 | const ::google::protobuf::internal::GeneratedMessageReflection* |
| 40 | EnumDescriptorProto_reflection_ = NULL; |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 41 | const ::google::protobuf::Descriptor* EnumValueDescriptorProto_descriptor_ = NULL; |
temporal | 779f61c | 2008-08-13 03:15:00 +0000 | [diff] [blame] | 42 | const ::google::protobuf::internal::GeneratedMessageReflection* |
| 43 | EnumValueDescriptorProto_reflection_ = NULL; |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 44 | const ::google::protobuf::Descriptor* ServiceDescriptorProto_descriptor_ = NULL; |
temporal | 779f61c | 2008-08-13 03:15:00 +0000 | [diff] [blame] | 45 | const ::google::protobuf::internal::GeneratedMessageReflection* |
| 46 | ServiceDescriptorProto_reflection_ = NULL; |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 47 | const ::google::protobuf::Descriptor* MethodDescriptorProto_descriptor_ = NULL; |
temporal | 779f61c | 2008-08-13 03:15:00 +0000 | [diff] [blame] | 48 | const ::google::protobuf::internal::GeneratedMessageReflection* |
| 49 | MethodDescriptorProto_reflection_ = NULL; |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 50 | const ::google::protobuf::Descriptor* FileOptions_descriptor_ = NULL; |
temporal | 779f61c | 2008-08-13 03:15:00 +0000 | [diff] [blame] | 51 | const ::google::protobuf::internal::GeneratedMessageReflection* |
| 52 | FileOptions_reflection_ = NULL; |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 53 | const ::google::protobuf::EnumDescriptor* FileOptions_OptimizeMode_descriptor_ = NULL; |
| 54 | const ::google::protobuf::Descriptor* MessageOptions_descriptor_ = NULL; |
temporal | 779f61c | 2008-08-13 03:15:00 +0000 | [diff] [blame] | 55 | const ::google::protobuf::internal::GeneratedMessageReflection* |
| 56 | MessageOptions_reflection_ = NULL; |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 57 | const ::google::protobuf::Descriptor* FieldOptions_descriptor_ = NULL; |
temporal | 779f61c | 2008-08-13 03:15:00 +0000 | [diff] [blame] | 58 | const ::google::protobuf::internal::GeneratedMessageReflection* |
| 59 | FieldOptions_reflection_ = NULL; |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 60 | const ::google::protobuf::EnumDescriptor* FieldOptions_CType_descriptor_ = NULL; |
| 61 | const ::google::protobuf::Descriptor* EnumOptions_descriptor_ = NULL; |
temporal | 779f61c | 2008-08-13 03:15:00 +0000 | [diff] [blame] | 62 | const ::google::protobuf::internal::GeneratedMessageReflection* |
| 63 | EnumOptions_reflection_ = NULL; |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 64 | const ::google::protobuf::Descriptor* EnumValueOptions_descriptor_ = NULL; |
temporal | 779f61c | 2008-08-13 03:15:00 +0000 | [diff] [blame] | 65 | const ::google::protobuf::internal::GeneratedMessageReflection* |
| 66 | EnumValueOptions_reflection_ = NULL; |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 67 | const ::google::protobuf::Descriptor* ServiceOptions_descriptor_ = NULL; |
temporal | 779f61c | 2008-08-13 03:15:00 +0000 | [diff] [blame] | 68 | const ::google::protobuf::internal::GeneratedMessageReflection* |
| 69 | ServiceOptions_reflection_ = NULL; |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 70 | const ::google::protobuf::Descriptor* MethodOptions_descriptor_ = NULL; |
temporal | 779f61c | 2008-08-13 03:15:00 +0000 | [diff] [blame] | 71 | const ::google::protobuf::internal::GeneratedMessageReflection* |
| 72 | MethodOptions_reflection_ = NULL; |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 73 | const ::google::protobuf::Descriptor* UninterpretedOption_descriptor_ = NULL; |
| 74 | const ::google::protobuf::internal::GeneratedMessageReflection* |
| 75 | UninterpretedOption_reflection_ = NULL; |
| 76 | const ::google::protobuf::Descriptor* UninterpretedOption_NamePart_descriptor_ = NULL; |
| 77 | const ::google::protobuf::internal::GeneratedMessageReflection* |
| 78 | UninterpretedOption_NamePart_reflection_ = NULL; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 79 | const ::google::protobuf::Descriptor* SourceCodeInfo_descriptor_ = NULL; |
| 80 | const ::google::protobuf::internal::GeneratedMessageReflection* |
| 81 | SourceCodeInfo_reflection_ = NULL; |
| 82 | const ::google::protobuf::Descriptor* SourceCodeInfo_Location_descriptor_ = NULL; |
| 83 | const ::google::protobuf::internal::GeneratedMessageReflection* |
| 84 | SourceCodeInfo_Location_reflection_ = NULL; |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 85 | |
| 86 | } // namespace |
| 87 | |
| 88 | |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 89 | void protobuf_AssignDesc_google_2fprotobuf_2fdescriptor_2eproto() { |
| 90 | protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); |
| 91 | const ::google::protobuf::FileDescriptor* file = |
| 92 | ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName( |
| 93 | "google/protobuf/descriptor.proto"); |
| 94 | GOOGLE_CHECK(file != NULL); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 95 | FileDescriptorSet_descriptor_ = file->message_type(0); |
kenton@google.com | 3e91fcd | 2008-11-06 04:37:30 +0000 | [diff] [blame] | 96 | static const int FileDescriptorSet_offsets_[1] = { |
| 97 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorSet, file_), |
| 98 | }; |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 99 | FileDescriptorSet_reflection_ = |
| 100 | new ::google::protobuf::internal::GeneratedMessageReflection( |
| 101 | FileDescriptorSet_descriptor_, |
| 102 | FileDescriptorSet::default_instance_, |
kenton@google.com | 3e91fcd | 2008-11-06 04:37:30 +0000 | [diff] [blame] | 103 | FileDescriptorSet_offsets_, |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 104 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorSet, _has_bits_[0]), |
| 105 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorSet, _unknown_fields_), |
| 106 | -1, |
kenton@google.com | 26bd9ee | 2008-11-21 00:06:27 +0000 | [diff] [blame] | 107 | ::google::protobuf::DescriptorPool::generated_pool(), |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 108 | ::google::protobuf::MessageFactory::generated_factory(), |
kenton@google.com | 26bd9ee | 2008-11-21 00:06:27 +0000 | [diff] [blame] | 109 | sizeof(FileDescriptorSet)); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 110 | FileDescriptorProto_descriptor_ = file->message_type(1); |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 111 | static const int FileDescriptorProto_offsets_[9] = { |
kenton@google.com | 3e91fcd | 2008-11-06 04:37:30 +0000 | [diff] [blame] | 112 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, name_), |
| 113 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, package_), |
| 114 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, dependency_), |
| 115 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, message_type_), |
| 116 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, enum_type_), |
| 117 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, service_), |
| 118 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, extension_), |
| 119 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, options_), |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 120 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, source_code_info_), |
kenton@google.com | 3e91fcd | 2008-11-06 04:37:30 +0000 | [diff] [blame] | 121 | }; |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 122 | FileDescriptorProto_reflection_ = |
| 123 | new ::google::protobuf::internal::GeneratedMessageReflection( |
| 124 | FileDescriptorProto_descriptor_, |
| 125 | FileDescriptorProto::default_instance_, |
kenton@google.com | 3e91fcd | 2008-11-06 04:37:30 +0000 | [diff] [blame] | 126 | FileDescriptorProto_offsets_, |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 127 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, _has_bits_[0]), |
| 128 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, _unknown_fields_), |
| 129 | -1, |
kenton@google.com | 26bd9ee | 2008-11-21 00:06:27 +0000 | [diff] [blame] | 130 | ::google::protobuf::DescriptorPool::generated_pool(), |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 131 | ::google::protobuf::MessageFactory::generated_factory(), |
kenton@google.com | 26bd9ee | 2008-11-21 00:06:27 +0000 | [diff] [blame] | 132 | sizeof(FileDescriptorProto)); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 133 | DescriptorProto_descriptor_ = file->message_type(2); |
kenton@google.com | 3e91fcd | 2008-11-06 04:37:30 +0000 | [diff] [blame] | 134 | static const int DescriptorProto_offsets_[7] = { |
| 135 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, name_), |
| 136 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, field_), |
| 137 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, extension_), |
| 138 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, nested_type_), |
| 139 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, enum_type_), |
| 140 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, extension_range_), |
| 141 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, options_), |
| 142 | }; |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 143 | DescriptorProto_reflection_ = |
| 144 | new ::google::protobuf::internal::GeneratedMessageReflection( |
| 145 | DescriptorProto_descriptor_, |
| 146 | DescriptorProto::default_instance_, |
kenton@google.com | 3e91fcd | 2008-11-06 04:37:30 +0000 | [diff] [blame] | 147 | DescriptorProto_offsets_, |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 148 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, _has_bits_[0]), |
| 149 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, _unknown_fields_), |
| 150 | -1, |
kenton@google.com | 26bd9ee | 2008-11-21 00:06:27 +0000 | [diff] [blame] | 151 | ::google::protobuf::DescriptorPool::generated_pool(), |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 152 | ::google::protobuf::MessageFactory::generated_factory(), |
kenton@google.com | 26bd9ee | 2008-11-21 00:06:27 +0000 | [diff] [blame] | 153 | sizeof(DescriptorProto)); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 154 | DescriptorProto_ExtensionRange_descriptor_ = DescriptorProto_descriptor_->nested_type(0); |
kenton@google.com | 3e91fcd | 2008-11-06 04:37:30 +0000 | [diff] [blame] | 155 | static const int DescriptorProto_ExtensionRange_offsets_[2] = { |
| 156 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto_ExtensionRange, start_), |
| 157 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto_ExtensionRange, end_), |
| 158 | }; |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 159 | DescriptorProto_ExtensionRange_reflection_ = |
| 160 | new ::google::protobuf::internal::GeneratedMessageReflection( |
| 161 | DescriptorProto_ExtensionRange_descriptor_, |
| 162 | DescriptorProto_ExtensionRange::default_instance_, |
kenton@google.com | 3e91fcd | 2008-11-06 04:37:30 +0000 | [diff] [blame] | 163 | DescriptorProto_ExtensionRange_offsets_, |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 164 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto_ExtensionRange, _has_bits_[0]), |
| 165 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto_ExtensionRange, _unknown_fields_), |
| 166 | -1, |
kenton@google.com | 26bd9ee | 2008-11-21 00:06:27 +0000 | [diff] [blame] | 167 | ::google::protobuf::DescriptorPool::generated_pool(), |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 168 | ::google::protobuf::MessageFactory::generated_factory(), |
kenton@google.com | 26bd9ee | 2008-11-21 00:06:27 +0000 | [diff] [blame] | 169 | sizeof(DescriptorProto_ExtensionRange)); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 170 | FieldDescriptorProto_descriptor_ = file->message_type(3); |
kenton@google.com | 3e91fcd | 2008-11-06 04:37:30 +0000 | [diff] [blame] | 171 | static const int FieldDescriptorProto_offsets_[8] = { |
| 172 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, name_), |
| 173 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, number_), |
| 174 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, label_), |
| 175 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, type_), |
| 176 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, type_name_), |
| 177 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, extendee_), |
| 178 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, default_value_), |
| 179 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, options_), |
| 180 | }; |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 181 | FieldDescriptorProto_reflection_ = |
| 182 | new ::google::protobuf::internal::GeneratedMessageReflection( |
| 183 | FieldDescriptorProto_descriptor_, |
| 184 | FieldDescriptorProto::default_instance_, |
kenton@google.com | 3e91fcd | 2008-11-06 04:37:30 +0000 | [diff] [blame] | 185 | FieldDescriptorProto_offsets_, |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 186 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, _has_bits_[0]), |
| 187 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, _unknown_fields_), |
| 188 | -1, |
kenton@google.com | 26bd9ee | 2008-11-21 00:06:27 +0000 | [diff] [blame] | 189 | ::google::protobuf::DescriptorPool::generated_pool(), |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 190 | ::google::protobuf::MessageFactory::generated_factory(), |
kenton@google.com | 26bd9ee | 2008-11-21 00:06:27 +0000 | [diff] [blame] | 191 | sizeof(FieldDescriptorProto)); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 192 | FieldDescriptorProto_Type_descriptor_ = FieldDescriptorProto_descriptor_->enum_type(0); |
| 193 | FieldDescriptorProto_Label_descriptor_ = FieldDescriptorProto_descriptor_->enum_type(1); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 194 | EnumDescriptorProto_descriptor_ = file->message_type(4); |
kenton@google.com | 3e91fcd | 2008-11-06 04:37:30 +0000 | [diff] [blame] | 195 | static const int EnumDescriptorProto_offsets_[3] = { |
| 196 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumDescriptorProto, name_), |
| 197 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumDescriptorProto, value_), |
| 198 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumDescriptorProto, options_), |
| 199 | }; |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 200 | EnumDescriptorProto_reflection_ = |
| 201 | new ::google::protobuf::internal::GeneratedMessageReflection( |
| 202 | EnumDescriptorProto_descriptor_, |
| 203 | EnumDescriptorProto::default_instance_, |
kenton@google.com | 3e91fcd | 2008-11-06 04:37:30 +0000 | [diff] [blame] | 204 | EnumDescriptorProto_offsets_, |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 205 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumDescriptorProto, _has_bits_[0]), |
| 206 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumDescriptorProto, _unknown_fields_), |
| 207 | -1, |
kenton@google.com | 26bd9ee | 2008-11-21 00:06:27 +0000 | [diff] [blame] | 208 | ::google::protobuf::DescriptorPool::generated_pool(), |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 209 | ::google::protobuf::MessageFactory::generated_factory(), |
kenton@google.com | 26bd9ee | 2008-11-21 00:06:27 +0000 | [diff] [blame] | 210 | sizeof(EnumDescriptorProto)); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 211 | EnumValueDescriptorProto_descriptor_ = file->message_type(5); |
kenton@google.com | 3e91fcd | 2008-11-06 04:37:30 +0000 | [diff] [blame] | 212 | static const int EnumValueDescriptorProto_offsets_[3] = { |
| 213 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueDescriptorProto, name_), |
| 214 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueDescriptorProto, number_), |
| 215 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueDescriptorProto, options_), |
| 216 | }; |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 217 | EnumValueDescriptorProto_reflection_ = |
| 218 | new ::google::protobuf::internal::GeneratedMessageReflection( |
| 219 | EnumValueDescriptorProto_descriptor_, |
| 220 | EnumValueDescriptorProto::default_instance_, |
kenton@google.com | 3e91fcd | 2008-11-06 04:37:30 +0000 | [diff] [blame] | 221 | EnumValueDescriptorProto_offsets_, |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 222 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueDescriptorProto, _has_bits_[0]), |
| 223 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueDescriptorProto, _unknown_fields_), |
| 224 | -1, |
kenton@google.com | 26bd9ee | 2008-11-21 00:06:27 +0000 | [diff] [blame] | 225 | ::google::protobuf::DescriptorPool::generated_pool(), |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 226 | ::google::protobuf::MessageFactory::generated_factory(), |
kenton@google.com | 26bd9ee | 2008-11-21 00:06:27 +0000 | [diff] [blame] | 227 | sizeof(EnumValueDescriptorProto)); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 228 | ServiceDescriptorProto_descriptor_ = file->message_type(6); |
kenton@google.com | 3e91fcd | 2008-11-06 04:37:30 +0000 | [diff] [blame] | 229 | static const int ServiceDescriptorProto_offsets_[3] = { |
| 230 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceDescriptorProto, name_), |
| 231 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceDescriptorProto, method_), |
| 232 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceDescriptorProto, options_), |
| 233 | }; |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 234 | ServiceDescriptorProto_reflection_ = |
| 235 | new ::google::protobuf::internal::GeneratedMessageReflection( |
| 236 | ServiceDescriptorProto_descriptor_, |
| 237 | ServiceDescriptorProto::default_instance_, |
kenton@google.com | 3e91fcd | 2008-11-06 04:37:30 +0000 | [diff] [blame] | 238 | ServiceDescriptorProto_offsets_, |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 239 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceDescriptorProto, _has_bits_[0]), |
| 240 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceDescriptorProto, _unknown_fields_), |
| 241 | -1, |
kenton@google.com | 26bd9ee | 2008-11-21 00:06:27 +0000 | [diff] [blame] | 242 | ::google::protobuf::DescriptorPool::generated_pool(), |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 243 | ::google::protobuf::MessageFactory::generated_factory(), |
kenton@google.com | 26bd9ee | 2008-11-21 00:06:27 +0000 | [diff] [blame] | 244 | sizeof(ServiceDescriptorProto)); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 245 | MethodDescriptorProto_descriptor_ = file->message_type(7); |
kenton@google.com | 3e91fcd | 2008-11-06 04:37:30 +0000 | [diff] [blame] | 246 | static const int MethodDescriptorProto_offsets_[4] = { |
| 247 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodDescriptorProto, name_), |
| 248 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodDescriptorProto, input_type_), |
| 249 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodDescriptorProto, output_type_), |
| 250 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodDescriptorProto, options_), |
| 251 | }; |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 252 | MethodDescriptorProto_reflection_ = |
| 253 | new ::google::protobuf::internal::GeneratedMessageReflection( |
| 254 | MethodDescriptorProto_descriptor_, |
| 255 | MethodDescriptorProto::default_instance_, |
kenton@google.com | 3e91fcd | 2008-11-06 04:37:30 +0000 | [diff] [blame] | 256 | MethodDescriptorProto_offsets_, |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 257 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodDescriptorProto, _has_bits_[0]), |
| 258 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodDescriptorProto, _unknown_fields_), |
| 259 | -1, |
kenton@google.com | 26bd9ee | 2008-11-21 00:06:27 +0000 | [diff] [blame] | 260 | ::google::protobuf::DescriptorPool::generated_pool(), |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 261 | ::google::protobuf::MessageFactory::generated_factory(), |
kenton@google.com | 26bd9ee | 2008-11-21 00:06:27 +0000 | [diff] [blame] | 262 | sizeof(MethodDescriptorProto)); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 263 | FileOptions_descriptor_ = file->message_type(8); |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 264 | static const int FileOptions_offsets_[9] = { |
kenton@google.com | 3e91fcd | 2008-11-06 04:37:30 +0000 | [diff] [blame] | 265 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, java_package_), |
| 266 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, java_outer_classname_), |
| 267 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, java_multiple_files_), |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 268 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, java_generate_equals_and_hash_), |
kenton@google.com | 3e91fcd | 2008-11-06 04:37:30 +0000 | [diff] [blame] | 269 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, optimize_for_), |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 270 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, cc_generic_services_), |
| 271 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, java_generic_services_), |
| 272 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, py_generic_services_), |
kenton@google.com | 3e91fcd | 2008-11-06 04:37:30 +0000 | [diff] [blame] | 273 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, uninterpreted_option_), |
| 274 | }; |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 275 | FileOptions_reflection_ = |
| 276 | new ::google::protobuf::internal::GeneratedMessageReflection( |
| 277 | FileOptions_descriptor_, |
| 278 | FileOptions::default_instance_, |
kenton@google.com | 3e91fcd | 2008-11-06 04:37:30 +0000 | [diff] [blame] | 279 | FileOptions_offsets_, |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 280 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, _has_bits_[0]), |
| 281 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, _unknown_fields_), |
| 282 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, _extensions_), |
kenton@google.com | 26bd9ee | 2008-11-21 00:06:27 +0000 | [diff] [blame] | 283 | ::google::protobuf::DescriptorPool::generated_pool(), |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 284 | ::google::protobuf::MessageFactory::generated_factory(), |
kenton@google.com | 26bd9ee | 2008-11-21 00:06:27 +0000 | [diff] [blame] | 285 | sizeof(FileOptions)); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 286 | FileOptions_OptimizeMode_descriptor_ = FileOptions_descriptor_->enum_type(0); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 287 | MessageOptions_descriptor_ = file->message_type(9); |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 288 | static const int MessageOptions_offsets_[3] = { |
kenton@google.com | 3e91fcd | 2008-11-06 04:37:30 +0000 | [diff] [blame] | 289 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MessageOptions, message_set_wire_format_), |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 290 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MessageOptions, no_standard_descriptor_accessor_), |
kenton@google.com | 3e91fcd | 2008-11-06 04:37:30 +0000 | [diff] [blame] | 291 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MessageOptions, uninterpreted_option_), |
| 292 | }; |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 293 | MessageOptions_reflection_ = |
| 294 | new ::google::protobuf::internal::GeneratedMessageReflection( |
| 295 | MessageOptions_descriptor_, |
| 296 | MessageOptions::default_instance_, |
kenton@google.com | 3e91fcd | 2008-11-06 04:37:30 +0000 | [diff] [blame] | 297 | MessageOptions_offsets_, |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 298 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MessageOptions, _has_bits_[0]), |
| 299 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MessageOptions, _unknown_fields_), |
| 300 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MessageOptions, _extensions_), |
kenton@google.com | 26bd9ee | 2008-11-21 00:06:27 +0000 | [diff] [blame] | 301 | ::google::protobuf::DescriptorPool::generated_pool(), |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 302 | ::google::protobuf::MessageFactory::generated_factory(), |
kenton@google.com | 26bd9ee | 2008-11-21 00:06:27 +0000 | [diff] [blame] | 303 | sizeof(MessageOptions)); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 304 | FieldOptions_descriptor_ = file->message_type(10); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 305 | static const int FieldOptions_offsets_[5] = { |
kenton@google.com | 3e91fcd | 2008-11-06 04:37:30 +0000 | [diff] [blame] | 306 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldOptions, ctype_), |
kenton@google.com | 2d6daa7 | 2009-01-22 01:27:00 +0000 | [diff] [blame] | 307 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldOptions, packed_), |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 308 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldOptions, deprecated_), |
kenton@google.com | 3e91fcd | 2008-11-06 04:37:30 +0000 | [diff] [blame] | 309 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldOptions, experimental_map_key_), |
| 310 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldOptions, uninterpreted_option_), |
| 311 | }; |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 312 | FieldOptions_reflection_ = |
| 313 | new ::google::protobuf::internal::GeneratedMessageReflection( |
| 314 | FieldOptions_descriptor_, |
| 315 | FieldOptions::default_instance_, |
kenton@google.com | 3e91fcd | 2008-11-06 04:37:30 +0000 | [diff] [blame] | 316 | FieldOptions_offsets_, |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 317 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldOptions, _has_bits_[0]), |
| 318 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldOptions, _unknown_fields_), |
| 319 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldOptions, _extensions_), |
kenton@google.com | 26bd9ee | 2008-11-21 00:06:27 +0000 | [diff] [blame] | 320 | ::google::protobuf::DescriptorPool::generated_pool(), |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 321 | ::google::protobuf::MessageFactory::generated_factory(), |
kenton@google.com | 26bd9ee | 2008-11-21 00:06:27 +0000 | [diff] [blame] | 322 | sizeof(FieldOptions)); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 323 | FieldOptions_CType_descriptor_ = FieldOptions_descriptor_->enum_type(0); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 324 | EnumOptions_descriptor_ = file->message_type(11); |
kenton@google.com | 3e91fcd | 2008-11-06 04:37:30 +0000 | [diff] [blame] | 325 | static const int EnumOptions_offsets_[1] = { |
| 326 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumOptions, uninterpreted_option_), |
| 327 | }; |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 328 | EnumOptions_reflection_ = |
| 329 | new ::google::protobuf::internal::GeneratedMessageReflection( |
| 330 | EnumOptions_descriptor_, |
| 331 | EnumOptions::default_instance_, |
kenton@google.com | 3e91fcd | 2008-11-06 04:37:30 +0000 | [diff] [blame] | 332 | EnumOptions_offsets_, |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 333 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumOptions, _has_bits_[0]), |
| 334 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumOptions, _unknown_fields_), |
| 335 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumOptions, _extensions_), |
kenton@google.com | 26bd9ee | 2008-11-21 00:06:27 +0000 | [diff] [blame] | 336 | ::google::protobuf::DescriptorPool::generated_pool(), |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 337 | ::google::protobuf::MessageFactory::generated_factory(), |
kenton@google.com | 26bd9ee | 2008-11-21 00:06:27 +0000 | [diff] [blame] | 338 | sizeof(EnumOptions)); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 339 | EnumValueOptions_descriptor_ = file->message_type(12); |
kenton@google.com | 3e91fcd | 2008-11-06 04:37:30 +0000 | [diff] [blame] | 340 | static const int EnumValueOptions_offsets_[1] = { |
| 341 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueOptions, uninterpreted_option_), |
| 342 | }; |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 343 | EnumValueOptions_reflection_ = |
| 344 | new ::google::protobuf::internal::GeneratedMessageReflection( |
| 345 | EnumValueOptions_descriptor_, |
| 346 | EnumValueOptions::default_instance_, |
kenton@google.com | 3e91fcd | 2008-11-06 04:37:30 +0000 | [diff] [blame] | 347 | EnumValueOptions_offsets_, |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 348 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueOptions, _has_bits_[0]), |
| 349 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueOptions, _unknown_fields_), |
| 350 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueOptions, _extensions_), |
kenton@google.com | 26bd9ee | 2008-11-21 00:06:27 +0000 | [diff] [blame] | 351 | ::google::protobuf::DescriptorPool::generated_pool(), |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 352 | ::google::protobuf::MessageFactory::generated_factory(), |
kenton@google.com | 26bd9ee | 2008-11-21 00:06:27 +0000 | [diff] [blame] | 353 | sizeof(EnumValueOptions)); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 354 | ServiceOptions_descriptor_ = file->message_type(13); |
kenton@google.com | 3e91fcd | 2008-11-06 04:37:30 +0000 | [diff] [blame] | 355 | static const int ServiceOptions_offsets_[1] = { |
| 356 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceOptions, uninterpreted_option_), |
| 357 | }; |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 358 | ServiceOptions_reflection_ = |
| 359 | new ::google::protobuf::internal::GeneratedMessageReflection( |
| 360 | ServiceOptions_descriptor_, |
| 361 | ServiceOptions::default_instance_, |
kenton@google.com | 3e91fcd | 2008-11-06 04:37:30 +0000 | [diff] [blame] | 362 | ServiceOptions_offsets_, |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 363 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceOptions, _has_bits_[0]), |
| 364 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceOptions, _unknown_fields_), |
| 365 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceOptions, _extensions_), |
kenton@google.com | 26bd9ee | 2008-11-21 00:06:27 +0000 | [diff] [blame] | 366 | ::google::protobuf::DescriptorPool::generated_pool(), |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 367 | ::google::protobuf::MessageFactory::generated_factory(), |
kenton@google.com | 26bd9ee | 2008-11-21 00:06:27 +0000 | [diff] [blame] | 368 | sizeof(ServiceOptions)); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 369 | MethodOptions_descriptor_ = file->message_type(14); |
kenton@google.com | 3e91fcd | 2008-11-06 04:37:30 +0000 | [diff] [blame] | 370 | static const int MethodOptions_offsets_[1] = { |
| 371 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodOptions, uninterpreted_option_), |
| 372 | }; |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 373 | MethodOptions_reflection_ = |
| 374 | new ::google::protobuf::internal::GeneratedMessageReflection( |
| 375 | MethodOptions_descriptor_, |
| 376 | MethodOptions::default_instance_, |
kenton@google.com | 3e91fcd | 2008-11-06 04:37:30 +0000 | [diff] [blame] | 377 | MethodOptions_offsets_, |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 378 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodOptions, _has_bits_[0]), |
| 379 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodOptions, _unknown_fields_), |
| 380 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodOptions, _extensions_), |
kenton@google.com | 26bd9ee | 2008-11-21 00:06:27 +0000 | [diff] [blame] | 381 | ::google::protobuf::DescriptorPool::generated_pool(), |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 382 | ::google::protobuf::MessageFactory::generated_factory(), |
kenton@google.com | 26bd9ee | 2008-11-21 00:06:27 +0000 | [diff] [blame] | 383 | sizeof(MethodOptions)); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 384 | UninterpretedOption_descriptor_ = file->message_type(15); |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 385 | static const int UninterpretedOption_offsets_[7] = { |
kenton@google.com | 3e91fcd | 2008-11-06 04:37:30 +0000 | [diff] [blame] | 386 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption, name_), |
| 387 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption, identifier_value_), |
| 388 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption, positive_int_value_), |
| 389 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption, negative_int_value_), |
| 390 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption, double_value_), |
| 391 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption, string_value_), |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 392 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption, aggregate_value_), |
kenton@google.com | 3e91fcd | 2008-11-06 04:37:30 +0000 | [diff] [blame] | 393 | }; |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 394 | UninterpretedOption_reflection_ = |
| 395 | new ::google::protobuf::internal::GeneratedMessageReflection( |
| 396 | UninterpretedOption_descriptor_, |
| 397 | UninterpretedOption::default_instance_, |
kenton@google.com | 3e91fcd | 2008-11-06 04:37:30 +0000 | [diff] [blame] | 398 | UninterpretedOption_offsets_, |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 399 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption, _has_bits_[0]), |
| 400 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption, _unknown_fields_), |
| 401 | -1, |
kenton@google.com | 26bd9ee | 2008-11-21 00:06:27 +0000 | [diff] [blame] | 402 | ::google::protobuf::DescriptorPool::generated_pool(), |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 403 | ::google::protobuf::MessageFactory::generated_factory(), |
kenton@google.com | 26bd9ee | 2008-11-21 00:06:27 +0000 | [diff] [blame] | 404 | sizeof(UninterpretedOption)); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 405 | UninterpretedOption_NamePart_descriptor_ = UninterpretedOption_descriptor_->nested_type(0); |
kenton@google.com | 3e91fcd | 2008-11-06 04:37:30 +0000 | [diff] [blame] | 406 | static const int UninterpretedOption_NamePart_offsets_[2] = { |
| 407 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption_NamePart, name_part_), |
| 408 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption_NamePart, is_extension_), |
| 409 | }; |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 410 | UninterpretedOption_NamePart_reflection_ = |
| 411 | new ::google::protobuf::internal::GeneratedMessageReflection( |
| 412 | UninterpretedOption_NamePart_descriptor_, |
| 413 | UninterpretedOption_NamePart::default_instance_, |
kenton@google.com | 3e91fcd | 2008-11-06 04:37:30 +0000 | [diff] [blame] | 414 | UninterpretedOption_NamePart_offsets_, |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 415 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption_NamePart, _has_bits_[0]), |
| 416 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption_NamePart, _unknown_fields_), |
| 417 | -1, |
kenton@google.com | 26bd9ee | 2008-11-21 00:06:27 +0000 | [diff] [blame] | 418 | ::google::protobuf::DescriptorPool::generated_pool(), |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 419 | ::google::protobuf::MessageFactory::generated_factory(), |
kenton@google.com | 26bd9ee | 2008-11-21 00:06:27 +0000 | [diff] [blame] | 420 | sizeof(UninterpretedOption_NamePart)); |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 421 | SourceCodeInfo_descriptor_ = file->message_type(16); |
| 422 | static const int SourceCodeInfo_offsets_[1] = { |
| 423 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SourceCodeInfo, location_), |
| 424 | }; |
| 425 | SourceCodeInfo_reflection_ = |
| 426 | new ::google::protobuf::internal::GeneratedMessageReflection( |
| 427 | SourceCodeInfo_descriptor_, |
| 428 | SourceCodeInfo::default_instance_, |
| 429 | SourceCodeInfo_offsets_, |
| 430 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SourceCodeInfo, _has_bits_[0]), |
| 431 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SourceCodeInfo, _unknown_fields_), |
| 432 | -1, |
| 433 | ::google::protobuf::DescriptorPool::generated_pool(), |
| 434 | ::google::protobuf::MessageFactory::generated_factory(), |
| 435 | sizeof(SourceCodeInfo)); |
| 436 | SourceCodeInfo_Location_descriptor_ = SourceCodeInfo_descriptor_->nested_type(0); |
| 437 | static const int SourceCodeInfo_Location_offsets_[2] = { |
| 438 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SourceCodeInfo_Location, path_), |
| 439 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SourceCodeInfo_Location, span_), |
| 440 | }; |
| 441 | SourceCodeInfo_Location_reflection_ = |
| 442 | new ::google::protobuf::internal::GeneratedMessageReflection( |
| 443 | SourceCodeInfo_Location_descriptor_, |
| 444 | SourceCodeInfo_Location::default_instance_, |
| 445 | SourceCodeInfo_Location_offsets_, |
| 446 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SourceCodeInfo_Location, _has_bits_[0]), |
| 447 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SourceCodeInfo_Location, _unknown_fields_), |
| 448 | -1, |
| 449 | ::google::protobuf::DescriptorPool::generated_pool(), |
| 450 | ::google::protobuf::MessageFactory::generated_factory(), |
| 451 | sizeof(SourceCodeInfo_Location)); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 452 | } |
| 453 | |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 454 | namespace { |
| 455 | |
| 456 | GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_); |
| 457 | inline void protobuf_AssignDescriptorsOnce() { |
| 458 | ::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_, |
| 459 | &protobuf_AssignDesc_google_2fprotobuf_2fdescriptor_2eproto); |
| 460 | } |
| 461 | |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 462 | void protobuf_RegisterTypes(const ::std::string&) { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 463 | protobuf_AssignDescriptorsOnce(); |
| 464 | ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( |
| 465 | FileDescriptorSet_descriptor_, &FileDescriptorSet::default_instance()); |
| 466 | ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( |
| 467 | FileDescriptorProto_descriptor_, &FileDescriptorProto::default_instance()); |
| 468 | ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( |
| 469 | DescriptorProto_descriptor_, &DescriptorProto::default_instance()); |
| 470 | ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( |
| 471 | DescriptorProto_ExtensionRange_descriptor_, &DescriptorProto_ExtensionRange::default_instance()); |
| 472 | ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( |
| 473 | FieldDescriptorProto_descriptor_, &FieldDescriptorProto::default_instance()); |
| 474 | ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( |
| 475 | EnumDescriptorProto_descriptor_, &EnumDescriptorProto::default_instance()); |
| 476 | ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( |
| 477 | EnumValueDescriptorProto_descriptor_, &EnumValueDescriptorProto::default_instance()); |
| 478 | ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( |
| 479 | ServiceDescriptorProto_descriptor_, &ServiceDescriptorProto::default_instance()); |
| 480 | ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( |
| 481 | MethodDescriptorProto_descriptor_, &MethodDescriptorProto::default_instance()); |
| 482 | ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( |
| 483 | FileOptions_descriptor_, &FileOptions::default_instance()); |
| 484 | ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( |
| 485 | MessageOptions_descriptor_, &MessageOptions::default_instance()); |
| 486 | ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( |
| 487 | FieldOptions_descriptor_, &FieldOptions::default_instance()); |
| 488 | ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( |
| 489 | EnumOptions_descriptor_, &EnumOptions::default_instance()); |
| 490 | ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( |
| 491 | EnumValueOptions_descriptor_, &EnumValueOptions::default_instance()); |
| 492 | ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( |
| 493 | ServiceOptions_descriptor_, &ServiceOptions::default_instance()); |
| 494 | ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( |
| 495 | MethodOptions_descriptor_, &MethodOptions::default_instance()); |
| 496 | ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( |
| 497 | UninterpretedOption_descriptor_, &UninterpretedOption::default_instance()); |
| 498 | ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( |
| 499 | UninterpretedOption_NamePart_descriptor_, &UninterpretedOption_NamePart::default_instance()); |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 500 | ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( |
| 501 | SourceCodeInfo_descriptor_, &SourceCodeInfo::default_instance()); |
| 502 | ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( |
| 503 | SourceCodeInfo_Location_descriptor_, &SourceCodeInfo_Location::default_instance()); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 504 | } |
| 505 | |
| 506 | } // namespace |
| 507 | |
kenton@google.com | 63e646b | 2009-05-06 19:27:03 +0000 | [diff] [blame] | 508 | void protobuf_ShutdownFile_google_2fprotobuf_2fdescriptor_2eproto() { |
| 509 | delete FileDescriptorSet::default_instance_; |
| 510 | delete FileDescriptorSet_reflection_; |
| 511 | delete FileDescriptorProto::default_instance_; |
| 512 | delete FileDescriptorProto_reflection_; |
| 513 | delete DescriptorProto::default_instance_; |
| 514 | delete DescriptorProto_reflection_; |
| 515 | delete DescriptorProto_ExtensionRange::default_instance_; |
| 516 | delete DescriptorProto_ExtensionRange_reflection_; |
| 517 | delete FieldDescriptorProto::default_instance_; |
| 518 | delete FieldDescriptorProto_reflection_; |
| 519 | delete EnumDescriptorProto::default_instance_; |
| 520 | delete EnumDescriptorProto_reflection_; |
| 521 | delete EnumValueDescriptorProto::default_instance_; |
| 522 | delete EnumValueDescriptorProto_reflection_; |
| 523 | delete ServiceDescriptorProto::default_instance_; |
| 524 | delete ServiceDescriptorProto_reflection_; |
| 525 | delete MethodDescriptorProto::default_instance_; |
| 526 | delete MethodDescriptorProto_reflection_; |
| 527 | delete FileOptions::default_instance_; |
| 528 | delete FileOptions_reflection_; |
| 529 | delete MessageOptions::default_instance_; |
| 530 | delete MessageOptions_reflection_; |
| 531 | delete FieldOptions::default_instance_; |
| 532 | delete FieldOptions_reflection_; |
| 533 | delete EnumOptions::default_instance_; |
| 534 | delete EnumOptions_reflection_; |
| 535 | delete EnumValueOptions::default_instance_; |
| 536 | delete EnumValueOptions_reflection_; |
| 537 | delete ServiceOptions::default_instance_; |
| 538 | delete ServiceOptions_reflection_; |
| 539 | delete MethodOptions::default_instance_; |
| 540 | delete MethodOptions_reflection_; |
| 541 | delete UninterpretedOption::default_instance_; |
| 542 | delete UninterpretedOption_reflection_; |
| 543 | delete UninterpretedOption_NamePart::default_instance_; |
| 544 | delete UninterpretedOption_NamePart_reflection_; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 545 | delete SourceCodeInfo::default_instance_; |
| 546 | delete SourceCodeInfo_reflection_; |
| 547 | delete SourceCodeInfo_Location::default_instance_; |
| 548 | delete SourceCodeInfo_Location_reflection_; |
kenton@google.com | 63e646b | 2009-05-06 19:27:03 +0000 | [diff] [blame] | 549 | } |
| 550 | |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 551 | void protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto() { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 552 | static bool already_here = false; |
| 553 | if (already_here) return; |
| 554 | already_here = true; |
| 555 | GOOGLE_PROTOBUF_VERIFY_VERSION; |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 556 | |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 557 | ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 558 | "\n google/protobuf/descriptor.proto\022\017goog" |
temporal | 779f61c | 2008-08-13 03:15:00 +0000 | [diff] [blame] | 559 | "le.protobuf\"G\n\021FileDescriptorSet\0222\n\004file" |
| 560 | "\030\001 \003(\0132$.google.protobuf.FileDescriptorP" |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 561 | "roto\"\227\003\n\023FileDescriptorProto\022\014\n\004name\030\001 \001" |
temporal | 779f61c | 2008-08-13 03:15:00 +0000 | [diff] [blame] | 562 | "(\t\022\017\n\007package\030\002 \001(\t\022\022\n\ndependency\030\003 \003(\t\022" |
| 563 | "6\n\014message_type\030\004 \003(\0132 .google.protobuf." |
| 564 | "DescriptorProto\0227\n\tenum_type\030\005 \003(\0132$.goo" |
| 565 | "gle.protobuf.EnumDescriptorProto\0228\n\007serv" |
| 566 | "ice\030\006 \003(\0132\'.google.protobuf.ServiceDescr" |
| 567 | "iptorProto\0228\n\textension\030\007 \003(\0132%.google.p" |
| 568 | "rotobuf.FieldDescriptorProto\022-\n\007options\030" |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 569 | "\010 \001(\0132\034.google.protobuf.FileOptions\0229\n\020s" |
| 570 | "ource_code_info\030\t \001(\0132\037.google.protobuf." |
| 571 | "SourceCodeInfo\"\251\003\n\017DescriptorProto\022\014\n\004na" |
| 572 | "me\030\001 \001(\t\0224\n\005field\030\002 \003(\0132%.google.protobu" |
| 573 | "f.FieldDescriptorProto\0228\n\textension\030\006 \003(" |
| 574 | "\0132%.google.protobuf.FieldDescriptorProto" |
| 575 | "\0225\n\013nested_type\030\003 \003(\0132 .google.protobuf." |
| 576 | "DescriptorProto\0227\n\tenum_type\030\004 \003(\0132$.goo" |
| 577 | "gle.protobuf.EnumDescriptorProto\022H\n\017exte" |
| 578 | "nsion_range\030\005 \003(\0132/.google.protobuf.Desc" |
| 579 | "riptorProto.ExtensionRange\0220\n\007options\030\007 " |
| 580 | "\001(\0132\037.google.protobuf.MessageOptions\032,\n\016" |
| 581 | "ExtensionRange\022\r\n\005start\030\001 \001(\005\022\013\n\003end\030\002 \001" |
| 582 | "(\005\"\224\005\n\024FieldDescriptorProto\022\014\n\004name\030\001 \001(" |
| 583 | "\t\022\016\n\006number\030\003 \001(\005\022:\n\005label\030\004 \001(\0162+.googl" |
| 584 | "e.protobuf.FieldDescriptorProto.Label\0228\n" |
| 585 | "\004type\030\005 \001(\0162*.google.protobuf.FieldDescr" |
| 586 | "iptorProto.Type\022\021\n\ttype_name\030\006 \001(\t\022\020\n\010ex" |
| 587 | "tendee\030\002 \001(\t\022\025\n\rdefault_value\030\007 \001(\t\022.\n\007o" |
| 588 | "ptions\030\010 \001(\0132\035.google.protobuf.FieldOpti" |
| 589 | "ons\"\266\002\n\004Type\022\017\n\013TYPE_DOUBLE\020\001\022\016\n\nTYPE_FL" |
| 590 | "OAT\020\002\022\016\n\nTYPE_INT64\020\003\022\017\n\013TYPE_UINT64\020\004\022\016" |
| 591 | "\n\nTYPE_INT32\020\005\022\020\n\014TYPE_FIXED64\020\006\022\020\n\014TYPE" |
| 592 | "_FIXED32\020\007\022\r\n\tTYPE_BOOL\020\010\022\017\n\013TYPE_STRING" |
| 593 | "\020\t\022\016\n\nTYPE_GROUP\020\n\022\020\n\014TYPE_MESSAGE\020\013\022\016\n\n" |
| 594 | "TYPE_BYTES\020\014\022\017\n\013TYPE_UINT32\020\r\022\r\n\tTYPE_EN" |
| 595 | "UM\020\016\022\021\n\rTYPE_SFIXED32\020\017\022\021\n\rTYPE_SFIXED64" |
| 596 | "\020\020\022\017\n\013TYPE_SINT32\020\021\022\017\n\013TYPE_SINT64\020\022\"C\n\005" |
| 597 | "Label\022\022\n\016LABEL_OPTIONAL\020\001\022\022\n\016LABEL_REQUI" |
| 598 | "RED\020\002\022\022\n\016LABEL_REPEATED\020\003\"\214\001\n\023EnumDescri" |
| 599 | "ptorProto\022\014\n\004name\030\001 \001(\t\0228\n\005value\030\002 \003(\0132)" |
| 600 | ".google.protobuf.EnumValueDescriptorProt" |
| 601 | "o\022-\n\007options\030\003 \001(\0132\034.google.protobuf.Enu" |
| 602 | "mOptions\"l\n\030EnumValueDescriptorProto\022\014\n\004" |
| 603 | "name\030\001 \001(\t\022\016\n\006number\030\002 \001(\005\0222\n\007options\030\003 " |
| 604 | "\001(\0132!.google.protobuf.EnumValueOptions\"\220" |
| 605 | "\001\n\026ServiceDescriptorProto\022\014\n\004name\030\001 \001(\t\022" |
| 606 | "6\n\006method\030\002 \003(\0132&.google.protobuf.Method" |
| 607 | "DescriptorProto\0220\n\007options\030\003 \001(\0132\037.googl" |
| 608 | "e.protobuf.ServiceOptions\"\177\n\025MethodDescr" |
| 609 | "iptorProto\022\014\n\004name\030\001 \001(\t\022\022\n\ninput_type\030\002" |
| 610 | " \001(\t\022\023\n\013output_type\030\003 \001(\t\022/\n\007options\030\004 \001" |
| 611 | "(\0132\036.google.protobuf.MethodOptions\"\325\003\n\013F" |
| 612 | "ileOptions\022\024\n\014java_package\030\001 \001(\t\022\034\n\024java" |
| 613 | "_outer_classname\030\010 \001(\t\022\"\n\023java_multiple_" |
| 614 | "files\030\n \001(\010:\005false\022,\n\035java_generate_equa" |
| 615 | "ls_and_hash\030\024 \001(\010:\005false\022F\n\014optimize_for" |
| 616 | "\030\t \001(\0162).google.protobuf.FileOptions.Opt" |
| 617 | "imizeMode:\005SPEED\022\"\n\023cc_generic_services\030" |
| 618 | "\020 \001(\010:\005false\022$\n\025java_generic_services\030\021 " |
| 619 | "\001(\010:\005false\022\"\n\023py_generic_services\030\022 \001(\010:" |
| 620 | "\005false\022C\n\024uninterpreted_option\030\347\007 \003(\0132$." |
| 621 | "google.protobuf.UninterpretedOption\":\n\014O" |
| 622 | "ptimizeMode\022\t\n\005SPEED\020\001\022\r\n\tCODE_SIZE\020\002\022\020\n" |
| 623 | "\014LITE_RUNTIME\020\003*\t\010\350\007\020\200\200\200\200\002\"\270\001\n\016MessageOp" |
| 624 | "tions\022&\n\027message_set_wire_format\030\001 \001(\010:\005" |
| 625 | "false\022.\n\037no_standard_descriptor_accessor" |
| 626 | "\030\002 \001(\010:\005false\022C\n\024uninterpreted_option\030\347\007" |
| 627 | " \003(\0132$.google.protobuf.UninterpretedOpti" |
| 628 | "on*\t\010\350\007\020\200\200\200\200\002\"\224\002\n\014FieldOptions\022:\n\005ctype\030" |
| 629 | "\001 \001(\0162#.google.protobuf.FieldOptions.CTy" |
| 630 | "pe:\006STRING\022\016\n\006packed\030\002 \001(\010\022\031\n\ndeprecated" |
| 631 | "\030\003 \001(\010:\005false\022\034\n\024experimental_map_key\030\t " |
| 632 | "\001(\t\022C\n\024uninterpreted_option\030\347\007 \003(\0132$.goo" |
| 633 | "gle.protobuf.UninterpretedOption\"/\n\005CTyp" |
| 634 | "e\022\n\n\006STRING\020\000\022\010\n\004CORD\020\001\022\020\n\014STRING_PIECE\020" |
| 635 | "\002*\t\010\350\007\020\200\200\200\200\002\"]\n\013EnumOptions\022C\n\024uninterpr" |
| 636 | "eted_option\030\347\007 \003(\0132$.google.protobuf.Uni" |
| 637 | "nterpretedOption*\t\010\350\007\020\200\200\200\200\002\"b\n\020EnumValue" |
| 638 | "Options\022C\n\024uninterpreted_option\030\347\007 \003(\0132$" |
| 639 | ".google.protobuf.UninterpretedOption*\t\010\350" |
| 640 | "\007\020\200\200\200\200\002\"`\n\016ServiceOptions\022C\n\024uninterpret" |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 641 | "ed_option\030\347\007 \003(\0132$.google.protobuf.Unint" |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 642 | "erpretedOption*\t\010\350\007\020\200\200\200\200\002\"_\n\rMethodOptio" |
| 643 | "ns\022C\n\024uninterpreted_option\030\347\007 \003(\0132$.goog" |
| 644 | "le.protobuf.UninterpretedOption*\t\010\350\007\020\200\200\200" |
| 645 | "\200\002\"\236\002\n\023UninterpretedOption\022;\n\004name\030\002 \003(\013" |
| 646 | "2-.google.protobuf.UninterpretedOption.N" |
| 647 | "amePart\022\030\n\020identifier_value\030\003 \001(\t\022\032\n\022pos" |
| 648 | "itive_int_value\030\004 \001(\004\022\032\n\022negative_int_va" |
| 649 | "lue\030\005 \001(\003\022\024\n\014double_value\030\006 \001(\001\022\024\n\014strin" |
| 650 | "g_value\030\007 \001(\014\022\027\n\017aggregate_value\030\010 \001(\t\0323" |
| 651 | "\n\010NamePart\022\021\n\tname_part\030\001 \002(\t\022\024\n\014is_exte" |
| 652 | "nsion\030\002 \002(\010\"|\n\016SourceCodeInfo\022:\n\010locatio" |
| 653 | "n\030\001 \003(\0132(.google.protobuf.SourceCodeInfo" |
| 654 | ".Location\032.\n\010Location\022\020\n\004path\030\001 \003(\005B\002\020\001\022" |
| 655 | "\020\n\004span\030\002 \003(\005B\002\020\001B)\n\023com.google.protobuf" |
| 656 | "B\020DescriptorProtosH\001", 3940); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 657 | ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( |
| 658 | "google/protobuf/descriptor.proto", &protobuf_RegisterTypes); |
| 659 | FileDescriptorSet::default_instance_ = new FileDescriptorSet(); |
| 660 | FileDescriptorProto::default_instance_ = new FileDescriptorProto(); |
| 661 | DescriptorProto::default_instance_ = new DescriptorProto(); |
| 662 | DescriptorProto_ExtensionRange::default_instance_ = new DescriptorProto_ExtensionRange(); |
| 663 | FieldDescriptorProto::default_instance_ = new FieldDescriptorProto(); |
| 664 | EnumDescriptorProto::default_instance_ = new EnumDescriptorProto(); |
| 665 | EnumValueDescriptorProto::default_instance_ = new EnumValueDescriptorProto(); |
| 666 | ServiceDescriptorProto::default_instance_ = new ServiceDescriptorProto(); |
| 667 | MethodDescriptorProto::default_instance_ = new MethodDescriptorProto(); |
| 668 | FileOptions::default_instance_ = new FileOptions(); |
| 669 | MessageOptions::default_instance_ = new MessageOptions(); |
| 670 | FieldOptions::default_instance_ = new FieldOptions(); |
| 671 | EnumOptions::default_instance_ = new EnumOptions(); |
| 672 | EnumValueOptions::default_instance_ = new EnumValueOptions(); |
| 673 | ServiceOptions::default_instance_ = new ServiceOptions(); |
| 674 | MethodOptions::default_instance_ = new MethodOptions(); |
| 675 | UninterpretedOption::default_instance_ = new UninterpretedOption(); |
| 676 | UninterpretedOption_NamePart::default_instance_ = new UninterpretedOption_NamePart(); |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 677 | SourceCodeInfo::default_instance_ = new SourceCodeInfo(); |
| 678 | SourceCodeInfo_Location::default_instance_ = new SourceCodeInfo_Location(); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 679 | FileDescriptorSet::default_instance_->InitAsDefaultInstance(); |
| 680 | FileDescriptorProto::default_instance_->InitAsDefaultInstance(); |
| 681 | DescriptorProto::default_instance_->InitAsDefaultInstance(); |
| 682 | DescriptorProto_ExtensionRange::default_instance_->InitAsDefaultInstance(); |
| 683 | FieldDescriptorProto::default_instance_->InitAsDefaultInstance(); |
| 684 | EnumDescriptorProto::default_instance_->InitAsDefaultInstance(); |
| 685 | EnumValueDescriptorProto::default_instance_->InitAsDefaultInstance(); |
| 686 | ServiceDescriptorProto::default_instance_->InitAsDefaultInstance(); |
| 687 | MethodDescriptorProto::default_instance_->InitAsDefaultInstance(); |
| 688 | FileOptions::default_instance_->InitAsDefaultInstance(); |
| 689 | MessageOptions::default_instance_->InitAsDefaultInstance(); |
| 690 | FieldOptions::default_instance_->InitAsDefaultInstance(); |
| 691 | EnumOptions::default_instance_->InitAsDefaultInstance(); |
| 692 | EnumValueOptions::default_instance_->InitAsDefaultInstance(); |
| 693 | ServiceOptions::default_instance_->InitAsDefaultInstance(); |
| 694 | MethodOptions::default_instance_->InitAsDefaultInstance(); |
| 695 | UninterpretedOption::default_instance_->InitAsDefaultInstance(); |
| 696 | UninterpretedOption_NamePart::default_instance_->InitAsDefaultInstance(); |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 697 | SourceCodeInfo::default_instance_->InitAsDefaultInstance(); |
| 698 | SourceCodeInfo_Location::default_instance_->InitAsDefaultInstance(); |
kenton@google.com | 63e646b | 2009-05-06 19:27:03 +0000 | [diff] [blame] | 699 | ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_google_2fprotobuf_2fdescriptor_2eproto); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 700 | } |
| 701 | |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 702 | // Force AddDescriptors() to be called at static initialization time. |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 703 | struct StaticDescriptorInitializer_google_2fprotobuf_2fdescriptor_2eproto { |
| 704 | StaticDescriptorInitializer_google_2fprotobuf_2fdescriptor_2eproto() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 705 | protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 706 | } |
| 707 | } static_descriptor_initializer_google_2fprotobuf_2fdescriptor_2eproto_; |
| 708 | |
| 709 | |
| 710 | // =================================================================== |
| 711 | |
kenton@google.com | cfa2d8a | 2009-04-18 00:02:12 +0000 | [diff] [blame] | 712 | #ifndef _MSC_VER |
| 713 | const int FileDescriptorSet::kFileFieldNumber; |
| 714 | #endif // !_MSC_VER |
temporal | 779f61c | 2008-08-13 03:15:00 +0000 | [diff] [blame] | 715 | |
kenton@google.com | 573989f | 2009-10-30 22:02:17 +0000 | [diff] [blame] | 716 | FileDescriptorSet::FileDescriptorSet() |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 717 | : ::google::protobuf::Message() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 718 | SharedCtor(); |
temporal | 779f61c | 2008-08-13 03:15:00 +0000 | [diff] [blame] | 719 | } |
| 720 | |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 721 | void FileDescriptorSet::InitAsDefaultInstance() { |
| 722 | } |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 723 | |
kenton@google.com | 573989f | 2009-10-30 22:02:17 +0000 | [diff] [blame] | 724 | FileDescriptorSet::FileDescriptorSet(const FileDescriptorSet& from) |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 725 | : ::google::protobuf::Message() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 726 | SharedCtor(); |
temporal | 779f61c | 2008-08-13 03:15:00 +0000 | [diff] [blame] | 727 | MergeFrom(from); |
| 728 | } |
| 729 | |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 730 | void FileDescriptorSet::SharedCtor() { |
| 731 | _cached_size_ = 0; |
| 732 | ::memset(_has_bits_, 0, sizeof(_has_bits_)); |
| 733 | } |
| 734 | |
temporal | 779f61c | 2008-08-13 03:15:00 +0000 | [diff] [blame] | 735 | FileDescriptorSet::~FileDescriptorSet() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 736 | SharedDtor(); |
| 737 | } |
| 738 | |
| 739 | void FileDescriptorSet::SharedDtor() { |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 740 | if (this != default_instance_) { |
temporal | 779f61c | 2008-08-13 03:15:00 +0000 | [diff] [blame] | 741 | } |
| 742 | } |
| 743 | |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 744 | void FileDescriptorSet::SetCachedSize(int size) const { |
| 745 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
| 746 | _cached_size_ = size; |
| 747 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); |
| 748 | } |
temporal | 779f61c | 2008-08-13 03:15:00 +0000 | [diff] [blame] | 749 | const ::google::protobuf::Descriptor* FileDescriptorSet::descriptor() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 750 | protobuf_AssignDescriptorsOnce(); |
temporal | 779f61c | 2008-08-13 03:15:00 +0000 | [diff] [blame] | 751 | return FileDescriptorSet_descriptor_; |
| 752 | } |
| 753 | |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 754 | const FileDescriptorSet& FileDescriptorSet::default_instance() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 755 | if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); return *default_instance_; |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 756 | } |
| 757 | |
| 758 | FileDescriptorSet* FileDescriptorSet::default_instance_ = NULL; |
| 759 | |
temporal | 779f61c | 2008-08-13 03:15:00 +0000 | [diff] [blame] | 760 | FileDescriptorSet* FileDescriptorSet::New() const { |
| 761 | return new FileDescriptorSet; |
| 762 | } |
| 763 | |
| 764 | void FileDescriptorSet::Clear() { |
| 765 | file_.Clear(); |
| 766 | ::memset(_has_bits_, 0, sizeof(_has_bits_)); |
| 767 | mutable_unknown_fields()->Clear(); |
| 768 | } |
| 769 | |
| 770 | bool FileDescriptorSet::MergePartialFromCodedStream( |
| 771 | ::google::protobuf::io::CodedInputStream* input) { |
| 772 | #define DO_(EXPRESSION) if (!(EXPRESSION)) return false |
| 773 | ::google::protobuf::uint32 tag; |
| 774 | while ((tag = input->ReadTag()) != 0) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 775 | switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { |
temporal | 779f61c | 2008-08-13 03:15:00 +0000 | [diff] [blame] | 776 | // repeated .google.protobuf.FileDescriptorProto file = 1; |
| 777 | case 1: { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 778 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 779 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 780 | parse_file: |
| 781 | DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( |
| 782 | input, add_file())); |
| 783 | } else { |
temporal | 779f61c | 2008-08-13 03:15:00 +0000 | [diff] [blame] | 784 | goto handle_uninterpreted; |
| 785 | } |
temporal | 779f61c | 2008-08-13 03:15:00 +0000 | [diff] [blame] | 786 | if (input->ExpectTag(10)) goto parse_file; |
| 787 | if (input->ExpectAtEnd()) return true; |
| 788 | break; |
| 789 | } |
| 790 | |
| 791 | default: { |
| 792 | handle_uninterpreted: |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 793 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
| 794 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { |
temporal | 779f61c | 2008-08-13 03:15:00 +0000 | [diff] [blame] | 795 | return true; |
| 796 | } |
| 797 | DO_(::google::protobuf::internal::WireFormat::SkipField( |
| 798 | input, tag, mutable_unknown_fields())); |
| 799 | break; |
| 800 | } |
| 801 | } |
| 802 | } |
| 803 | return true; |
| 804 | #undef DO_ |
| 805 | } |
| 806 | |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 807 | void FileDescriptorSet::SerializeWithCachedSizes( |
temporal | 779f61c | 2008-08-13 03:15:00 +0000 | [diff] [blame] | 808 | ::google::protobuf::io::CodedOutputStream* output) const { |
temporal | 779f61c | 2008-08-13 03:15:00 +0000 | [diff] [blame] | 809 | // repeated .google.protobuf.FileDescriptorProto file = 1; |
kenton@google.com | 2d6daa7 | 2009-01-22 01:27:00 +0000 | [diff] [blame] | 810 | for (int i = 0; i < this->file_size(); i++) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 811 | ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 812 | 1, this->file(i), output); |
temporal | 779f61c | 2008-08-13 03:15:00 +0000 | [diff] [blame] | 813 | } |
| 814 | |
| 815 | if (!unknown_fields().empty()) { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 816 | ::google::protobuf::internal::WireFormat::SerializeUnknownFields( |
| 817 | unknown_fields(), output); |
temporal | 779f61c | 2008-08-13 03:15:00 +0000 | [diff] [blame] | 818 | } |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 819 | } |
| 820 | |
| 821 | ::google::protobuf::uint8* FileDescriptorSet::SerializeWithCachedSizesToArray( |
| 822 | ::google::protobuf::uint8* target) const { |
| 823 | // repeated .google.protobuf.FileDescriptorProto file = 1; |
| 824 | for (int i = 0; i < this->file_size(); i++) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 825 | target = ::google::protobuf::internal::WireFormatLite:: |
| 826 | WriteMessageNoVirtualToArray( |
| 827 | 1, this->file(i), target); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 828 | } |
| 829 | |
| 830 | if (!unknown_fields().empty()) { |
| 831 | target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( |
| 832 | unknown_fields(), target); |
| 833 | } |
| 834 | return target; |
temporal | 779f61c | 2008-08-13 03:15:00 +0000 | [diff] [blame] | 835 | } |
| 836 | |
| 837 | int FileDescriptorSet::ByteSize() const { |
| 838 | int total_size = 0; |
| 839 | |
| 840 | // repeated .google.protobuf.FileDescriptorProto file = 1; |
kenton@google.com | 2d6daa7 | 2009-01-22 01:27:00 +0000 | [diff] [blame] | 841 | total_size += 1 * this->file_size(); |
| 842 | for (int i = 0; i < this->file_size(); i++) { |
temporal | 779f61c | 2008-08-13 03:15:00 +0000 | [diff] [blame] | 843 | total_size += |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 844 | ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( |
temporal | 779f61c | 2008-08-13 03:15:00 +0000 | [diff] [blame] | 845 | this->file(i)); |
| 846 | } |
| 847 | |
| 848 | if (!unknown_fields().empty()) { |
| 849 | total_size += |
| 850 | ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( |
| 851 | unknown_fields()); |
| 852 | } |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 853 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
temporal | 779f61c | 2008-08-13 03:15:00 +0000 | [diff] [blame] | 854 | _cached_size_ = total_size; |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 855 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); |
temporal | 779f61c | 2008-08-13 03:15:00 +0000 | [diff] [blame] | 856 | return total_size; |
| 857 | } |
| 858 | |
| 859 | void FileDescriptorSet::MergeFrom(const ::google::protobuf::Message& from) { |
| 860 | GOOGLE_CHECK_NE(&from, this); |
| 861 | const FileDescriptorSet* source = |
| 862 | ::google::protobuf::internal::dynamic_cast_if_available<const FileDescriptorSet*>( |
| 863 | &from); |
| 864 | if (source == NULL) { |
| 865 | ::google::protobuf::internal::ReflectionOps::Merge(from, this); |
| 866 | } else { |
| 867 | MergeFrom(*source); |
| 868 | } |
| 869 | } |
| 870 | |
| 871 | void FileDescriptorSet::MergeFrom(const FileDescriptorSet& from) { |
| 872 | GOOGLE_CHECK_NE(&from, this); |
| 873 | file_.MergeFrom(from.file_); |
| 874 | mutable_unknown_fields()->MergeFrom(from.unknown_fields()); |
| 875 | } |
| 876 | |
| 877 | void FileDescriptorSet::CopyFrom(const ::google::protobuf::Message& from) { |
| 878 | if (&from == this) return; |
| 879 | Clear(); |
| 880 | MergeFrom(from); |
| 881 | } |
| 882 | |
| 883 | void FileDescriptorSet::CopyFrom(const FileDescriptorSet& from) { |
| 884 | if (&from == this) return; |
| 885 | Clear(); |
| 886 | MergeFrom(from); |
| 887 | } |
| 888 | |
kenton@google.com | ceb561d | 2009-06-25 19:05:36 +0000 | [diff] [blame] | 889 | bool FileDescriptorSet::IsInitialized() const { |
| 890 | |
| 891 | for (int i = 0; i < file_size(); i++) { |
| 892 | if (!this->file(i).IsInitialized()) return false; |
| 893 | } |
| 894 | return true; |
| 895 | } |
| 896 | |
kenton@google.com | 26bd9ee | 2008-11-21 00:06:27 +0000 | [diff] [blame] | 897 | void FileDescriptorSet::Swap(FileDescriptorSet* other) { |
| 898 | if (other != this) { |
| 899 | file_.Swap(&other->file_); |
| 900 | std::swap(_has_bits_[0], other->_has_bits_[0]); |
| 901 | _unknown_fields_.Swap(&other->_unknown_fields_); |
| 902 | std::swap(_cached_size_, other->_cached_size_); |
| 903 | } |
| 904 | } |
| 905 | |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 906 | ::google::protobuf::Metadata FileDescriptorSet::GetMetadata() const { |
| 907 | protobuf_AssignDescriptorsOnce(); |
| 908 | ::google::protobuf::Metadata metadata; |
| 909 | metadata.descriptor = FileDescriptorSet_descriptor_; |
| 910 | metadata.reflection = FileDescriptorSet_reflection_; |
| 911 | return metadata; |
temporal | 779f61c | 2008-08-13 03:15:00 +0000 | [diff] [blame] | 912 | } |
| 913 | |
temporal | 779f61c | 2008-08-13 03:15:00 +0000 | [diff] [blame] | 914 | |
| 915 | // =================================================================== |
| 916 | |
kenton@google.com | cfa2d8a | 2009-04-18 00:02:12 +0000 | [diff] [blame] | 917 | #ifndef _MSC_VER |
| 918 | const int FileDescriptorProto::kNameFieldNumber; |
| 919 | const int FileDescriptorProto::kPackageFieldNumber; |
| 920 | const int FileDescriptorProto::kDependencyFieldNumber; |
| 921 | const int FileDescriptorProto::kMessageTypeFieldNumber; |
| 922 | const int FileDescriptorProto::kEnumTypeFieldNumber; |
| 923 | const int FileDescriptorProto::kServiceFieldNumber; |
| 924 | const int FileDescriptorProto::kExtensionFieldNumber; |
| 925 | const int FileDescriptorProto::kOptionsFieldNumber; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 926 | const int FileDescriptorProto::kSourceCodeInfoFieldNumber; |
kenton@google.com | cfa2d8a | 2009-04-18 00:02:12 +0000 | [diff] [blame] | 927 | #endif // !_MSC_VER |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 928 | |
kenton@google.com | 573989f | 2009-10-30 22:02:17 +0000 | [diff] [blame] | 929 | FileDescriptorProto::FileDescriptorProto() |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 930 | : ::google::protobuf::Message() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 931 | SharedCtor(); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 932 | } |
| 933 | |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 934 | void FileDescriptorProto::InitAsDefaultInstance() { |
| 935 | options_ = const_cast< ::google::protobuf::FileOptions*>(&::google::protobuf::FileOptions::default_instance()); |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 936 | source_code_info_ = const_cast< ::google::protobuf::SourceCodeInfo*>(&::google::protobuf::SourceCodeInfo::default_instance()); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 937 | } |
| 938 | |
kenton@google.com | 573989f | 2009-10-30 22:02:17 +0000 | [diff] [blame] | 939 | FileDescriptorProto::FileDescriptorProto(const FileDescriptorProto& from) |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 940 | : ::google::protobuf::Message() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 941 | SharedCtor(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 942 | MergeFrom(from); |
| 943 | } |
| 944 | |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 945 | void FileDescriptorProto::SharedCtor() { |
| 946 | _cached_size_ = 0; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 947 | name_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); |
| 948 | package_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 949 | options_ = NULL; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 950 | source_code_info_ = NULL; |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 951 | ::memset(_has_bits_, 0, sizeof(_has_bits_)); |
| 952 | } |
| 953 | |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 954 | FileDescriptorProto::~FileDescriptorProto() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 955 | SharedDtor(); |
| 956 | } |
| 957 | |
| 958 | void FileDescriptorProto::SharedDtor() { |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 959 | if (name_ != &::google::protobuf::internal::kEmptyString) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 960 | delete name_; |
| 961 | } |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 962 | if (package_ != &::google::protobuf::internal::kEmptyString) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 963 | delete package_; |
| 964 | } |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 965 | if (this != default_instance_) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 966 | delete options_; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 967 | delete source_code_info_; |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 968 | } |
| 969 | } |
| 970 | |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 971 | void FileDescriptorProto::SetCachedSize(int size) const { |
| 972 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
| 973 | _cached_size_ = size; |
| 974 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); |
| 975 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 976 | const ::google::protobuf::Descriptor* FileDescriptorProto::descriptor() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 977 | protobuf_AssignDescriptorsOnce(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 978 | return FileDescriptorProto_descriptor_; |
| 979 | } |
| 980 | |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 981 | const FileDescriptorProto& FileDescriptorProto::default_instance() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 982 | if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); return *default_instance_; |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 983 | } |
| 984 | |
| 985 | FileDescriptorProto* FileDescriptorProto::default_instance_ = NULL; |
| 986 | |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 987 | FileDescriptorProto* FileDescriptorProto::New() const { |
| 988 | return new FileDescriptorProto; |
| 989 | } |
| 990 | |
| 991 | void FileDescriptorProto::Clear() { |
| 992 | if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 993 | if (has_name()) { |
| 994 | if (name_ != &::google::protobuf::internal::kEmptyString) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 995 | name_->clear(); |
| 996 | } |
| 997 | } |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 998 | if (has_package()) { |
| 999 | if (package_ != &::google::protobuf::internal::kEmptyString) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1000 | package_->clear(); |
| 1001 | } |
| 1002 | } |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 1003 | if (has_options()) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1004 | if (options_ != NULL) options_->::google::protobuf::FileOptions::Clear(); |
| 1005 | } |
| 1006 | } |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 1007 | if (_has_bits_[8 / 32] & (0xffu << (8 % 32))) { |
| 1008 | if (has_source_code_info()) { |
| 1009 | if (source_code_info_ != NULL) source_code_info_->::google::protobuf::SourceCodeInfo::Clear(); |
| 1010 | } |
| 1011 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1012 | dependency_.Clear(); |
| 1013 | message_type_.Clear(); |
| 1014 | enum_type_.Clear(); |
| 1015 | service_.Clear(); |
| 1016 | extension_.Clear(); |
| 1017 | ::memset(_has_bits_, 0, sizeof(_has_bits_)); |
| 1018 | mutable_unknown_fields()->Clear(); |
| 1019 | } |
| 1020 | |
| 1021 | bool FileDescriptorProto::MergePartialFromCodedStream( |
| 1022 | ::google::protobuf::io::CodedInputStream* input) { |
| 1023 | #define DO_(EXPRESSION) if (!(EXPRESSION)) return false |
| 1024 | ::google::protobuf::uint32 tag; |
| 1025 | while ((tag = input->ReadTag()) != 0) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 1026 | switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1027 | // optional string name = 1; |
| 1028 | case 1: { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 1029 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 1030 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 1031 | DO_(::google::protobuf::internal::WireFormatLite::ReadString( |
| 1032 | input, this->mutable_name())); |
| 1033 | ::google::protobuf::internal::WireFormat::VerifyUTF8String( |
| 1034 | this->name().data(), this->name().length(), |
| 1035 | ::google::protobuf::internal::WireFormat::PARSE); |
| 1036 | } else { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1037 | goto handle_uninterpreted; |
| 1038 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1039 | if (input->ExpectTag(18)) goto parse_package; |
| 1040 | break; |
| 1041 | } |
| 1042 | |
| 1043 | // optional string package = 2; |
| 1044 | case 2: { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 1045 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 1046 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 1047 | parse_package: |
| 1048 | DO_(::google::protobuf::internal::WireFormatLite::ReadString( |
| 1049 | input, this->mutable_package())); |
| 1050 | ::google::protobuf::internal::WireFormat::VerifyUTF8String( |
| 1051 | this->package().data(), this->package().length(), |
| 1052 | ::google::protobuf::internal::WireFormat::PARSE); |
| 1053 | } else { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1054 | goto handle_uninterpreted; |
| 1055 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1056 | if (input->ExpectTag(26)) goto parse_dependency; |
| 1057 | break; |
| 1058 | } |
| 1059 | |
| 1060 | // repeated string dependency = 3; |
| 1061 | case 3: { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 1062 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 1063 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 1064 | parse_dependency: |
| 1065 | DO_(::google::protobuf::internal::WireFormatLite::ReadString( |
| 1066 | input, this->add_dependency())); |
| 1067 | ::google::protobuf::internal::WireFormat::VerifyUTF8String( |
| 1068 | this->dependency(0).data(), this->dependency(0).length(), |
| 1069 | ::google::protobuf::internal::WireFormat::PARSE); |
| 1070 | } else { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1071 | goto handle_uninterpreted; |
| 1072 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1073 | if (input->ExpectTag(26)) goto parse_dependency; |
| 1074 | if (input->ExpectTag(34)) goto parse_message_type; |
| 1075 | break; |
| 1076 | } |
| 1077 | |
| 1078 | // repeated .google.protobuf.DescriptorProto message_type = 4; |
| 1079 | case 4: { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 1080 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 1081 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 1082 | parse_message_type: |
| 1083 | DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( |
| 1084 | input, add_message_type())); |
| 1085 | } else { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1086 | goto handle_uninterpreted; |
| 1087 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1088 | if (input->ExpectTag(34)) goto parse_message_type; |
| 1089 | if (input->ExpectTag(42)) goto parse_enum_type; |
| 1090 | break; |
| 1091 | } |
| 1092 | |
| 1093 | // repeated .google.protobuf.EnumDescriptorProto enum_type = 5; |
| 1094 | case 5: { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 1095 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 1096 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 1097 | parse_enum_type: |
| 1098 | DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( |
| 1099 | input, add_enum_type())); |
| 1100 | } else { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1101 | goto handle_uninterpreted; |
| 1102 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1103 | if (input->ExpectTag(42)) goto parse_enum_type; |
| 1104 | if (input->ExpectTag(50)) goto parse_service; |
| 1105 | break; |
| 1106 | } |
| 1107 | |
| 1108 | // repeated .google.protobuf.ServiceDescriptorProto service = 6; |
| 1109 | case 6: { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 1110 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 1111 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 1112 | parse_service: |
| 1113 | DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( |
| 1114 | input, add_service())); |
| 1115 | } else { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1116 | goto handle_uninterpreted; |
| 1117 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1118 | if (input->ExpectTag(50)) goto parse_service; |
| 1119 | if (input->ExpectTag(58)) goto parse_extension; |
| 1120 | break; |
| 1121 | } |
| 1122 | |
| 1123 | // repeated .google.protobuf.FieldDescriptorProto extension = 7; |
| 1124 | case 7: { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 1125 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 1126 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 1127 | parse_extension: |
| 1128 | DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( |
| 1129 | input, add_extension())); |
| 1130 | } else { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1131 | goto handle_uninterpreted; |
| 1132 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1133 | if (input->ExpectTag(58)) goto parse_extension; |
| 1134 | if (input->ExpectTag(66)) goto parse_options; |
| 1135 | break; |
| 1136 | } |
| 1137 | |
| 1138 | // optional .google.protobuf.FileOptions options = 8; |
| 1139 | case 8: { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 1140 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 1141 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 1142 | parse_options: |
| 1143 | DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( |
| 1144 | input, mutable_options())); |
| 1145 | } else { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1146 | goto handle_uninterpreted; |
| 1147 | } |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 1148 | if (input->ExpectTag(74)) goto parse_source_code_info; |
| 1149 | break; |
| 1150 | } |
| 1151 | |
| 1152 | // optional .google.protobuf.SourceCodeInfo source_code_info = 9; |
| 1153 | case 9: { |
| 1154 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
| 1155 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { |
| 1156 | parse_source_code_info: |
| 1157 | DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( |
| 1158 | input, mutable_source_code_info())); |
| 1159 | } else { |
| 1160 | goto handle_uninterpreted; |
| 1161 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1162 | if (input->ExpectAtEnd()) return true; |
| 1163 | break; |
| 1164 | } |
| 1165 | |
| 1166 | default: { |
| 1167 | handle_uninterpreted: |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 1168 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
| 1169 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1170 | return true; |
| 1171 | } |
| 1172 | DO_(::google::protobuf::internal::WireFormat::SkipField( |
| 1173 | input, tag, mutable_unknown_fields())); |
| 1174 | break; |
| 1175 | } |
| 1176 | } |
| 1177 | } |
| 1178 | return true; |
| 1179 | #undef DO_ |
| 1180 | } |
| 1181 | |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 1182 | void FileDescriptorProto::SerializeWithCachedSizes( |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1183 | ::google::protobuf::io::CodedOutputStream* output) const { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1184 | // optional string name = 1; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 1185 | if (has_name()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 1186 | ::google::protobuf::internal::WireFormat::VerifyUTF8String( |
| 1187 | this->name().data(), this->name().length(), |
| 1188 | ::google::protobuf::internal::WireFormat::SERIALIZE); |
| 1189 | ::google::protobuf::internal::WireFormatLite::WriteString( |
| 1190 | 1, this->name(), output); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1191 | } |
| 1192 | |
| 1193 | // optional string package = 2; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 1194 | if (has_package()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 1195 | ::google::protobuf::internal::WireFormat::VerifyUTF8String( |
| 1196 | this->package().data(), this->package().length(), |
| 1197 | ::google::protobuf::internal::WireFormat::SERIALIZE); |
| 1198 | ::google::protobuf::internal::WireFormatLite::WriteString( |
| 1199 | 2, this->package(), output); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1200 | } |
| 1201 | |
| 1202 | // repeated string dependency = 3; |
kenton@google.com | 2d6daa7 | 2009-01-22 01:27:00 +0000 | [diff] [blame] | 1203 | for (int i = 0; i < this->dependency_size(); i++) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 1204 | ::google::protobuf::internal::WireFormat::VerifyUTF8String( |
| 1205 | this->dependency(i).data(), this->dependency(i).length(), |
| 1206 | ::google::protobuf::internal::WireFormat::SERIALIZE); |
| 1207 | ::google::protobuf::internal::WireFormatLite::WriteString( |
| 1208 | 3, this->dependency(i), output); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1209 | } |
| 1210 | |
| 1211 | // repeated .google.protobuf.DescriptorProto message_type = 4; |
kenton@google.com | 2d6daa7 | 2009-01-22 01:27:00 +0000 | [diff] [blame] | 1212 | for (int i = 0; i < this->message_type_size(); i++) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 1213 | ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 1214 | 4, this->message_type(i), output); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1215 | } |
| 1216 | |
| 1217 | // repeated .google.protobuf.EnumDescriptorProto enum_type = 5; |
kenton@google.com | 2d6daa7 | 2009-01-22 01:27:00 +0000 | [diff] [blame] | 1218 | for (int i = 0; i < this->enum_type_size(); i++) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 1219 | ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 1220 | 5, this->enum_type(i), output); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1221 | } |
| 1222 | |
| 1223 | // repeated .google.protobuf.ServiceDescriptorProto service = 6; |
kenton@google.com | 2d6daa7 | 2009-01-22 01:27:00 +0000 | [diff] [blame] | 1224 | for (int i = 0; i < this->service_size(); i++) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 1225 | ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 1226 | 6, this->service(i), output); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1227 | } |
| 1228 | |
| 1229 | // repeated .google.protobuf.FieldDescriptorProto extension = 7; |
kenton@google.com | 2d6daa7 | 2009-01-22 01:27:00 +0000 | [diff] [blame] | 1230 | for (int i = 0; i < this->extension_size(); i++) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 1231 | ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 1232 | 7, this->extension(i), output); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1233 | } |
| 1234 | |
| 1235 | // optional .google.protobuf.FileOptions options = 8; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 1236 | if (has_options()) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 1237 | ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 1238 | 8, this->options(), output); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1239 | } |
| 1240 | |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 1241 | // optional .google.protobuf.SourceCodeInfo source_code_info = 9; |
| 1242 | if (has_source_code_info()) { |
| 1243 | ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( |
| 1244 | 9, this->source_code_info(), output); |
| 1245 | } |
| 1246 | |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1247 | if (!unknown_fields().empty()) { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 1248 | ::google::protobuf::internal::WireFormat::SerializeUnknownFields( |
| 1249 | unknown_fields(), output); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1250 | } |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 1251 | } |
| 1252 | |
| 1253 | ::google::protobuf::uint8* FileDescriptorProto::SerializeWithCachedSizesToArray( |
| 1254 | ::google::protobuf::uint8* target) const { |
| 1255 | // optional string name = 1; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 1256 | if (has_name()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 1257 | ::google::protobuf::internal::WireFormat::VerifyUTF8String( |
| 1258 | this->name().data(), this->name().length(), |
| 1259 | ::google::protobuf::internal::WireFormat::SERIALIZE); |
| 1260 | target = |
| 1261 | ::google::protobuf::internal::WireFormatLite::WriteStringToArray( |
| 1262 | 1, this->name(), target); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 1263 | } |
| 1264 | |
| 1265 | // optional string package = 2; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 1266 | if (has_package()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 1267 | ::google::protobuf::internal::WireFormat::VerifyUTF8String( |
| 1268 | this->package().data(), this->package().length(), |
| 1269 | ::google::protobuf::internal::WireFormat::SERIALIZE); |
| 1270 | target = |
| 1271 | ::google::protobuf::internal::WireFormatLite::WriteStringToArray( |
| 1272 | 2, this->package(), target); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 1273 | } |
| 1274 | |
| 1275 | // repeated string dependency = 3; |
| 1276 | for (int i = 0; i < this->dependency_size(); i++) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 1277 | ::google::protobuf::internal::WireFormat::VerifyUTF8String( |
| 1278 | this->dependency(i).data(), this->dependency(i).length(), |
| 1279 | ::google::protobuf::internal::WireFormat::SERIALIZE); |
| 1280 | target = ::google::protobuf::internal::WireFormatLite:: |
| 1281 | WriteStringToArray(3, this->dependency(i), target); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 1282 | } |
| 1283 | |
| 1284 | // repeated .google.protobuf.DescriptorProto message_type = 4; |
| 1285 | for (int i = 0; i < this->message_type_size(); i++) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 1286 | target = ::google::protobuf::internal::WireFormatLite:: |
| 1287 | WriteMessageNoVirtualToArray( |
| 1288 | 4, this->message_type(i), target); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 1289 | } |
| 1290 | |
| 1291 | // repeated .google.protobuf.EnumDescriptorProto enum_type = 5; |
| 1292 | for (int i = 0; i < this->enum_type_size(); i++) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 1293 | target = ::google::protobuf::internal::WireFormatLite:: |
| 1294 | WriteMessageNoVirtualToArray( |
| 1295 | 5, this->enum_type(i), target); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 1296 | } |
| 1297 | |
| 1298 | // repeated .google.protobuf.ServiceDescriptorProto service = 6; |
| 1299 | for (int i = 0; i < this->service_size(); i++) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 1300 | target = ::google::protobuf::internal::WireFormatLite:: |
| 1301 | WriteMessageNoVirtualToArray( |
| 1302 | 6, this->service(i), target); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 1303 | } |
| 1304 | |
| 1305 | // repeated .google.protobuf.FieldDescriptorProto extension = 7; |
| 1306 | for (int i = 0; i < this->extension_size(); i++) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 1307 | target = ::google::protobuf::internal::WireFormatLite:: |
| 1308 | WriteMessageNoVirtualToArray( |
| 1309 | 7, this->extension(i), target); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 1310 | } |
| 1311 | |
| 1312 | // optional .google.protobuf.FileOptions options = 8; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 1313 | if (has_options()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 1314 | target = ::google::protobuf::internal::WireFormatLite:: |
| 1315 | WriteMessageNoVirtualToArray( |
| 1316 | 8, this->options(), target); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 1317 | } |
| 1318 | |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 1319 | // optional .google.protobuf.SourceCodeInfo source_code_info = 9; |
| 1320 | if (has_source_code_info()) { |
| 1321 | target = ::google::protobuf::internal::WireFormatLite:: |
| 1322 | WriteMessageNoVirtualToArray( |
| 1323 | 9, this->source_code_info(), target); |
| 1324 | } |
| 1325 | |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 1326 | if (!unknown_fields().empty()) { |
| 1327 | target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( |
| 1328 | unknown_fields(), target); |
| 1329 | } |
| 1330 | return target; |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1331 | } |
| 1332 | |
| 1333 | int FileDescriptorProto::ByteSize() const { |
| 1334 | int total_size = 0; |
| 1335 | |
| 1336 | if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { |
| 1337 | // optional string name = 1; |
| 1338 | if (has_name()) { |
| 1339 | total_size += 1 + |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 1340 | ::google::protobuf::internal::WireFormatLite::StringSize( |
| 1341 | this->name()); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1342 | } |
| 1343 | |
| 1344 | // optional string package = 2; |
| 1345 | if (has_package()) { |
| 1346 | total_size += 1 + |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 1347 | ::google::protobuf::internal::WireFormatLite::StringSize( |
| 1348 | this->package()); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1349 | } |
| 1350 | |
| 1351 | // optional .google.protobuf.FileOptions options = 8; |
| 1352 | if (has_options()) { |
| 1353 | total_size += 1 + |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 1354 | ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1355 | this->options()); |
| 1356 | } |
| 1357 | |
| 1358 | } |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 1359 | if (_has_bits_[8 / 32] & (0xffu << (8 % 32))) { |
| 1360 | // optional .google.protobuf.SourceCodeInfo source_code_info = 9; |
| 1361 | if (has_source_code_info()) { |
| 1362 | total_size += 1 + |
| 1363 | ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( |
| 1364 | this->source_code_info()); |
| 1365 | } |
| 1366 | |
| 1367 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1368 | // repeated string dependency = 3; |
kenton@google.com | 2d6daa7 | 2009-01-22 01:27:00 +0000 | [diff] [blame] | 1369 | total_size += 1 * this->dependency_size(); |
| 1370 | for (int i = 0; i < this->dependency_size(); i++) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 1371 | total_size += ::google::protobuf::internal::WireFormatLite::StringSize( |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1372 | this->dependency(i)); |
| 1373 | } |
| 1374 | |
| 1375 | // repeated .google.protobuf.DescriptorProto message_type = 4; |
kenton@google.com | 2d6daa7 | 2009-01-22 01:27:00 +0000 | [diff] [blame] | 1376 | total_size += 1 * this->message_type_size(); |
| 1377 | for (int i = 0; i < this->message_type_size(); i++) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1378 | total_size += |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 1379 | ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1380 | this->message_type(i)); |
| 1381 | } |
| 1382 | |
| 1383 | // repeated .google.protobuf.EnumDescriptorProto enum_type = 5; |
kenton@google.com | 2d6daa7 | 2009-01-22 01:27:00 +0000 | [diff] [blame] | 1384 | total_size += 1 * this->enum_type_size(); |
| 1385 | for (int i = 0; i < this->enum_type_size(); i++) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1386 | total_size += |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 1387 | ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1388 | this->enum_type(i)); |
| 1389 | } |
| 1390 | |
| 1391 | // repeated .google.protobuf.ServiceDescriptorProto service = 6; |
kenton@google.com | 2d6daa7 | 2009-01-22 01:27:00 +0000 | [diff] [blame] | 1392 | total_size += 1 * this->service_size(); |
| 1393 | for (int i = 0; i < this->service_size(); i++) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1394 | total_size += |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 1395 | ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1396 | this->service(i)); |
| 1397 | } |
| 1398 | |
| 1399 | // repeated .google.protobuf.FieldDescriptorProto extension = 7; |
kenton@google.com | 2d6daa7 | 2009-01-22 01:27:00 +0000 | [diff] [blame] | 1400 | total_size += 1 * this->extension_size(); |
| 1401 | for (int i = 0; i < this->extension_size(); i++) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1402 | total_size += |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 1403 | ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1404 | this->extension(i)); |
| 1405 | } |
| 1406 | |
| 1407 | if (!unknown_fields().empty()) { |
| 1408 | total_size += |
| 1409 | ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( |
| 1410 | unknown_fields()); |
| 1411 | } |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 1412 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1413 | _cached_size_ = total_size; |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 1414 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1415 | return total_size; |
| 1416 | } |
| 1417 | |
| 1418 | void FileDescriptorProto::MergeFrom(const ::google::protobuf::Message& from) { |
| 1419 | GOOGLE_CHECK_NE(&from, this); |
| 1420 | const FileDescriptorProto* source = |
| 1421 | ::google::protobuf::internal::dynamic_cast_if_available<const FileDescriptorProto*>( |
| 1422 | &from); |
| 1423 | if (source == NULL) { |
temporal | 779f61c | 2008-08-13 03:15:00 +0000 | [diff] [blame] | 1424 | ::google::protobuf::internal::ReflectionOps::Merge(from, this); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1425 | } else { |
| 1426 | MergeFrom(*source); |
| 1427 | } |
| 1428 | } |
| 1429 | |
| 1430 | void FileDescriptorProto::MergeFrom(const FileDescriptorProto& from) { |
| 1431 | GOOGLE_CHECK_NE(&from, this); |
| 1432 | dependency_.MergeFrom(from.dependency_); |
| 1433 | message_type_.MergeFrom(from.message_type_); |
| 1434 | enum_type_.MergeFrom(from.enum_type_); |
| 1435 | service_.MergeFrom(from.service_); |
| 1436 | extension_.MergeFrom(from.extension_); |
| 1437 | if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 1438 | if (from.has_name()) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1439 | set_name(from.name()); |
| 1440 | } |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 1441 | if (from.has_package()) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1442 | set_package(from.package()); |
| 1443 | } |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 1444 | if (from.has_options()) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1445 | mutable_options()->::google::protobuf::FileOptions::MergeFrom(from.options()); |
| 1446 | } |
| 1447 | } |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 1448 | if (from._has_bits_[8 / 32] & (0xffu << (8 % 32))) { |
| 1449 | if (from.has_source_code_info()) { |
| 1450 | mutable_source_code_info()->::google::protobuf::SourceCodeInfo::MergeFrom(from.source_code_info()); |
| 1451 | } |
| 1452 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1453 | mutable_unknown_fields()->MergeFrom(from.unknown_fields()); |
| 1454 | } |
| 1455 | |
| 1456 | void FileDescriptorProto::CopyFrom(const ::google::protobuf::Message& from) { |
| 1457 | if (&from == this) return; |
| 1458 | Clear(); |
| 1459 | MergeFrom(from); |
| 1460 | } |
| 1461 | |
| 1462 | void FileDescriptorProto::CopyFrom(const FileDescriptorProto& from) { |
| 1463 | if (&from == this) return; |
| 1464 | Clear(); |
| 1465 | MergeFrom(from); |
| 1466 | } |
| 1467 | |
| 1468 | bool FileDescriptorProto::IsInitialized() const { |
| 1469 | |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 1470 | for (int i = 0; i < message_type_size(); i++) { |
| 1471 | if (!this->message_type(i).IsInitialized()) return false; |
| 1472 | } |
| 1473 | for (int i = 0; i < enum_type_size(); i++) { |
| 1474 | if (!this->enum_type(i).IsInitialized()) return false; |
| 1475 | } |
| 1476 | for (int i = 0; i < service_size(); i++) { |
| 1477 | if (!this->service(i).IsInitialized()) return false; |
| 1478 | } |
| 1479 | for (int i = 0; i < extension_size(); i++) { |
| 1480 | if (!this->extension(i).IsInitialized()) return false; |
| 1481 | } |
| 1482 | if (has_options()) { |
| 1483 | if (!this->options().IsInitialized()) return false; |
| 1484 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1485 | return true; |
| 1486 | } |
| 1487 | |
kenton@google.com | ceb561d | 2009-06-25 19:05:36 +0000 | [diff] [blame] | 1488 | void FileDescriptorProto::Swap(FileDescriptorProto* other) { |
| 1489 | if (other != this) { |
| 1490 | std::swap(name_, other->name_); |
| 1491 | std::swap(package_, other->package_); |
| 1492 | dependency_.Swap(&other->dependency_); |
| 1493 | message_type_.Swap(&other->message_type_); |
| 1494 | enum_type_.Swap(&other->enum_type_); |
| 1495 | service_.Swap(&other->service_); |
| 1496 | extension_.Swap(&other->extension_); |
| 1497 | std::swap(options_, other->options_); |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 1498 | std::swap(source_code_info_, other->source_code_info_); |
kenton@google.com | ceb561d | 2009-06-25 19:05:36 +0000 | [diff] [blame] | 1499 | std::swap(_has_bits_[0], other->_has_bits_[0]); |
| 1500 | _unknown_fields_.Swap(&other->_unknown_fields_); |
| 1501 | std::swap(_cached_size_, other->_cached_size_); |
| 1502 | } |
| 1503 | } |
| 1504 | |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 1505 | ::google::protobuf::Metadata FileDescriptorProto::GetMetadata() const { |
| 1506 | protobuf_AssignDescriptorsOnce(); |
| 1507 | ::google::protobuf::Metadata metadata; |
| 1508 | metadata.descriptor = FileDescriptorProto_descriptor_; |
| 1509 | metadata.reflection = FileDescriptorProto_reflection_; |
| 1510 | return metadata; |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1511 | } |
| 1512 | |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1513 | |
| 1514 | // =================================================================== |
| 1515 | |
kenton@google.com | cfa2d8a | 2009-04-18 00:02:12 +0000 | [diff] [blame] | 1516 | #ifndef _MSC_VER |
| 1517 | const int DescriptorProto_ExtensionRange::kStartFieldNumber; |
| 1518 | const int DescriptorProto_ExtensionRange::kEndFieldNumber; |
| 1519 | #endif // !_MSC_VER |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1520 | |
kenton@google.com | 573989f | 2009-10-30 22:02:17 +0000 | [diff] [blame] | 1521 | DescriptorProto_ExtensionRange::DescriptorProto_ExtensionRange() |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 1522 | : ::google::protobuf::Message() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 1523 | SharedCtor(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1524 | } |
| 1525 | |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 1526 | void DescriptorProto_ExtensionRange::InitAsDefaultInstance() { |
| 1527 | } |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 1528 | |
kenton@google.com | 573989f | 2009-10-30 22:02:17 +0000 | [diff] [blame] | 1529 | DescriptorProto_ExtensionRange::DescriptorProto_ExtensionRange(const DescriptorProto_ExtensionRange& from) |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 1530 | : ::google::protobuf::Message() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 1531 | SharedCtor(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1532 | MergeFrom(from); |
| 1533 | } |
| 1534 | |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 1535 | void DescriptorProto_ExtensionRange::SharedCtor() { |
| 1536 | _cached_size_ = 0; |
| 1537 | start_ = 0; |
| 1538 | end_ = 0; |
| 1539 | ::memset(_has_bits_, 0, sizeof(_has_bits_)); |
| 1540 | } |
| 1541 | |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1542 | DescriptorProto_ExtensionRange::~DescriptorProto_ExtensionRange() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 1543 | SharedDtor(); |
| 1544 | } |
| 1545 | |
| 1546 | void DescriptorProto_ExtensionRange::SharedDtor() { |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 1547 | if (this != default_instance_) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1548 | } |
| 1549 | } |
| 1550 | |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 1551 | void DescriptorProto_ExtensionRange::SetCachedSize(int size) const { |
| 1552 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
| 1553 | _cached_size_ = size; |
| 1554 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); |
| 1555 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1556 | const ::google::protobuf::Descriptor* DescriptorProto_ExtensionRange::descriptor() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 1557 | protobuf_AssignDescriptorsOnce(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1558 | return DescriptorProto_ExtensionRange_descriptor_; |
| 1559 | } |
| 1560 | |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 1561 | const DescriptorProto_ExtensionRange& DescriptorProto_ExtensionRange::default_instance() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 1562 | if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); return *default_instance_; |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 1563 | } |
| 1564 | |
| 1565 | DescriptorProto_ExtensionRange* DescriptorProto_ExtensionRange::default_instance_ = NULL; |
| 1566 | |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1567 | DescriptorProto_ExtensionRange* DescriptorProto_ExtensionRange::New() const { |
| 1568 | return new DescriptorProto_ExtensionRange; |
| 1569 | } |
| 1570 | |
| 1571 | void DescriptorProto_ExtensionRange::Clear() { |
| 1572 | if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { |
| 1573 | start_ = 0; |
| 1574 | end_ = 0; |
| 1575 | } |
| 1576 | ::memset(_has_bits_, 0, sizeof(_has_bits_)); |
| 1577 | mutable_unknown_fields()->Clear(); |
| 1578 | } |
| 1579 | |
| 1580 | bool DescriptorProto_ExtensionRange::MergePartialFromCodedStream( |
| 1581 | ::google::protobuf::io::CodedInputStream* input) { |
| 1582 | #define DO_(EXPRESSION) if (!(EXPRESSION)) return false |
| 1583 | ::google::protobuf::uint32 tag; |
| 1584 | while ((tag = input->ReadTag()) != 0) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 1585 | switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1586 | // optional int32 start = 1; |
| 1587 | case 1: { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 1588 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 1589 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 1590 | DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< |
| 1591 | ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( |
| 1592 | input, &start_))); |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 1593 | set_has_start(); |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 1594 | } else { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1595 | goto handle_uninterpreted; |
| 1596 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1597 | if (input->ExpectTag(16)) goto parse_end; |
| 1598 | break; |
| 1599 | } |
| 1600 | |
| 1601 | // optional int32 end = 2; |
| 1602 | case 2: { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 1603 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 1604 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 1605 | parse_end: |
| 1606 | DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< |
| 1607 | ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( |
| 1608 | input, &end_))); |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 1609 | set_has_end(); |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 1610 | } else { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1611 | goto handle_uninterpreted; |
| 1612 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1613 | if (input->ExpectAtEnd()) return true; |
| 1614 | break; |
| 1615 | } |
| 1616 | |
| 1617 | default: { |
| 1618 | handle_uninterpreted: |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 1619 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
| 1620 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1621 | return true; |
| 1622 | } |
| 1623 | DO_(::google::protobuf::internal::WireFormat::SkipField( |
| 1624 | input, tag, mutable_unknown_fields())); |
| 1625 | break; |
| 1626 | } |
| 1627 | } |
| 1628 | } |
| 1629 | return true; |
| 1630 | #undef DO_ |
| 1631 | } |
| 1632 | |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 1633 | void DescriptorProto_ExtensionRange::SerializeWithCachedSizes( |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1634 | ::google::protobuf::io::CodedOutputStream* output) const { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1635 | // optional int32 start = 1; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 1636 | if (has_start()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 1637 | ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->start(), output); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1638 | } |
| 1639 | |
| 1640 | // optional int32 end = 2; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 1641 | if (has_end()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 1642 | ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->end(), output); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1643 | } |
| 1644 | |
| 1645 | if (!unknown_fields().empty()) { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 1646 | ::google::protobuf::internal::WireFormat::SerializeUnknownFields( |
| 1647 | unknown_fields(), output); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1648 | } |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 1649 | } |
| 1650 | |
| 1651 | ::google::protobuf::uint8* DescriptorProto_ExtensionRange::SerializeWithCachedSizesToArray( |
| 1652 | ::google::protobuf::uint8* target) const { |
| 1653 | // optional int32 start = 1; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 1654 | if (has_start()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 1655 | target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->start(), target); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 1656 | } |
| 1657 | |
| 1658 | // optional int32 end = 2; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 1659 | if (has_end()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 1660 | target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->end(), target); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 1661 | } |
| 1662 | |
| 1663 | if (!unknown_fields().empty()) { |
| 1664 | target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( |
| 1665 | unknown_fields(), target); |
| 1666 | } |
| 1667 | return target; |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1668 | } |
| 1669 | |
| 1670 | int DescriptorProto_ExtensionRange::ByteSize() const { |
| 1671 | int total_size = 0; |
| 1672 | |
| 1673 | if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { |
| 1674 | // optional int32 start = 1; |
| 1675 | if (has_start()) { |
| 1676 | total_size += 1 + |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 1677 | ::google::protobuf::internal::WireFormatLite::Int32Size( |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1678 | this->start()); |
| 1679 | } |
| 1680 | |
| 1681 | // optional int32 end = 2; |
| 1682 | if (has_end()) { |
| 1683 | total_size += 1 + |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 1684 | ::google::protobuf::internal::WireFormatLite::Int32Size( |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1685 | this->end()); |
| 1686 | } |
| 1687 | |
| 1688 | } |
| 1689 | if (!unknown_fields().empty()) { |
| 1690 | total_size += |
| 1691 | ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( |
| 1692 | unknown_fields()); |
| 1693 | } |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 1694 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1695 | _cached_size_ = total_size; |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 1696 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1697 | return total_size; |
| 1698 | } |
| 1699 | |
| 1700 | void DescriptorProto_ExtensionRange::MergeFrom(const ::google::protobuf::Message& from) { |
| 1701 | GOOGLE_CHECK_NE(&from, this); |
| 1702 | const DescriptorProto_ExtensionRange* source = |
| 1703 | ::google::protobuf::internal::dynamic_cast_if_available<const DescriptorProto_ExtensionRange*>( |
| 1704 | &from); |
| 1705 | if (source == NULL) { |
temporal | 779f61c | 2008-08-13 03:15:00 +0000 | [diff] [blame] | 1706 | ::google::protobuf::internal::ReflectionOps::Merge(from, this); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1707 | } else { |
| 1708 | MergeFrom(*source); |
| 1709 | } |
| 1710 | } |
| 1711 | |
| 1712 | void DescriptorProto_ExtensionRange::MergeFrom(const DescriptorProto_ExtensionRange& from) { |
| 1713 | GOOGLE_CHECK_NE(&from, this); |
| 1714 | if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 1715 | if (from.has_start()) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1716 | set_start(from.start()); |
| 1717 | } |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 1718 | if (from.has_end()) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1719 | set_end(from.end()); |
| 1720 | } |
| 1721 | } |
| 1722 | mutable_unknown_fields()->MergeFrom(from.unknown_fields()); |
| 1723 | } |
| 1724 | |
| 1725 | void DescriptorProto_ExtensionRange::CopyFrom(const ::google::protobuf::Message& from) { |
| 1726 | if (&from == this) return; |
| 1727 | Clear(); |
| 1728 | MergeFrom(from); |
| 1729 | } |
| 1730 | |
| 1731 | void DescriptorProto_ExtensionRange::CopyFrom(const DescriptorProto_ExtensionRange& from) { |
| 1732 | if (&from == this) return; |
| 1733 | Clear(); |
| 1734 | MergeFrom(from); |
| 1735 | } |
| 1736 | |
kenton@google.com | ceb561d | 2009-06-25 19:05:36 +0000 | [diff] [blame] | 1737 | bool DescriptorProto_ExtensionRange::IsInitialized() const { |
| 1738 | |
| 1739 | return true; |
| 1740 | } |
| 1741 | |
kenton@google.com | 26bd9ee | 2008-11-21 00:06:27 +0000 | [diff] [blame] | 1742 | void DescriptorProto_ExtensionRange::Swap(DescriptorProto_ExtensionRange* other) { |
| 1743 | if (other != this) { |
| 1744 | std::swap(start_, other->start_); |
| 1745 | std::swap(end_, other->end_); |
| 1746 | std::swap(_has_bits_[0], other->_has_bits_[0]); |
| 1747 | _unknown_fields_.Swap(&other->_unknown_fields_); |
| 1748 | std::swap(_cached_size_, other->_cached_size_); |
| 1749 | } |
| 1750 | } |
| 1751 | |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 1752 | ::google::protobuf::Metadata DescriptorProto_ExtensionRange::GetMetadata() const { |
| 1753 | protobuf_AssignDescriptorsOnce(); |
| 1754 | ::google::protobuf::Metadata metadata; |
| 1755 | metadata.descriptor = DescriptorProto_ExtensionRange_descriptor_; |
| 1756 | metadata.reflection = DescriptorProto_ExtensionRange_reflection_; |
| 1757 | return metadata; |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1758 | } |
| 1759 | |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1760 | |
| 1761 | // ------------------------------------------------------------------- |
| 1762 | |
kenton@google.com | cfa2d8a | 2009-04-18 00:02:12 +0000 | [diff] [blame] | 1763 | #ifndef _MSC_VER |
| 1764 | const int DescriptorProto::kNameFieldNumber; |
| 1765 | const int DescriptorProto::kFieldFieldNumber; |
| 1766 | const int DescriptorProto::kExtensionFieldNumber; |
| 1767 | const int DescriptorProto::kNestedTypeFieldNumber; |
| 1768 | const int DescriptorProto::kEnumTypeFieldNumber; |
| 1769 | const int DescriptorProto::kExtensionRangeFieldNumber; |
| 1770 | const int DescriptorProto::kOptionsFieldNumber; |
| 1771 | #endif // !_MSC_VER |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1772 | |
kenton@google.com | 573989f | 2009-10-30 22:02:17 +0000 | [diff] [blame] | 1773 | DescriptorProto::DescriptorProto() |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 1774 | : ::google::protobuf::Message() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 1775 | SharedCtor(); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 1776 | } |
| 1777 | |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 1778 | void DescriptorProto::InitAsDefaultInstance() { |
| 1779 | options_ = const_cast< ::google::protobuf::MessageOptions*>(&::google::protobuf::MessageOptions::default_instance()); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1780 | } |
| 1781 | |
kenton@google.com | 573989f | 2009-10-30 22:02:17 +0000 | [diff] [blame] | 1782 | DescriptorProto::DescriptorProto(const DescriptorProto& from) |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 1783 | : ::google::protobuf::Message() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 1784 | SharedCtor(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1785 | MergeFrom(from); |
| 1786 | } |
| 1787 | |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 1788 | void DescriptorProto::SharedCtor() { |
| 1789 | _cached_size_ = 0; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 1790 | name_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 1791 | options_ = NULL; |
| 1792 | ::memset(_has_bits_, 0, sizeof(_has_bits_)); |
| 1793 | } |
| 1794 | |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1795 | DescriptorProto::~DescriptorProto() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 1796 | SharedDtor(); |
| 1797 | } |
| 1798 | |
| 1799 | void DescriptorProto::SharedDtor() { |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 1800 | if (name_ != &::google::protobuf::internal::kEmptyString) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1801 | delete name_; |
| 1802 | } |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 1803 | if (this != default_instance_) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1804 | delete options_; |
| 1805 | } |
| 1806 | } |
| 1807 | |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 1808 | void DescriptorProto::SetCachedSize(int size) const { |
| 1809 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
| 1810 | _cached_size_ = size; |
| 1811 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); |
| 1812 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1813 | const ::google::protobuf::Descriptor* DescriptorProto::descriptor() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 1814 | protobuf_AssignDescriptorsOnce(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1815 | return DescriptorProto_descriptor_; |
| 1816 | } |
| 1817 | |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 1818 | const DescriptorProto& DescriptorProto::default_instance() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 1819 | if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); return *default_instance_; |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 1820 | } |
| 1821 | |
| 1822 | DescriptorProto* DescriptorProto::default_instance_ = NULL; |
| 1823 | |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1824 | DescriptorProto* DescriptorProto::New() const { |
| 1825 | return new DescriptorProto; |
| 1826 | } |
| 1827 | |
| 1828 | void DescriptorProto::Clear() { |
| 1829 | if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 1830 | if (has_name()) { |
| 1831 | if (name_ != &::google::protobuf::internal::kEmptyString) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1832 | name_->clear(); |
| 1833 | } |
| 1834 | } |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 1835 | if (has_options()) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1836 | if (options_ != NULL) options_->::google::protobuf::MessageOptions::Clear(); |
| 1837 | } |
| 1838 | } |
| 1839 | field_.Clear(); |
| 1840 | extension_.Clear(); |
| 1841 | nested_type_.Clear(); |
| 1842 | enum_type_.Clear(); |
| 1843 | extension_range_.Clear(); |
| 1844 | ::memset(_has_bits_, 0, sizeof(_has_bits_)); |
| 1845 | mutable_unknown_fields()->Clear(); |
| 1846 | } |
| 1847 | |
| 1848 | bool DescriptorProto::MergePartialFromCodedStream( |
| 1849 | ::google::protobuf::io::CodedInputStream* input) { |
| 1850 | #define DO_(EXPRESSION) if (!(EXPRESSION)) return false |
| 1851 | ::google::protobuf::uint32 tag; |
| 1852 | while ((tag = input->ReadTag()) != 0) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 1853 | switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1854 | // optional string name = 1; |
| 1855 | case 1: { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 1856 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 1857 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 1858 | DO_(::google::protobuf::internal::WireFormatLite::ReadString( |
| 1859 | input, this->mutable_name())); |
| 1860 | ::google::protobuf::internal::WireFormat::VerifyUTF8String( |
| 1861 | this->name().data(), this->name().length(), |
| 1862 | ::google::protobuf::internal::WireFormat::PARSE); |
| 1863 | } else { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1864 | goto handle_uninterpreted; |
| 1865 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1866 | if (input->ExpectTag(18)) goto parse_field; |
| 1867 | break; |
| 1868 | } |
| 1869 | |
| 1870 | // repeated .google.protobuf.FieldDescriptorProto field = 2; |
| 1871 | case 2: { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 1872 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 1873 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 1874 | parse_field: |
| 1875 | DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( |
| 1876 | input, add_field())); |
| 1877 | } else { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1878 | goto handle_uninterpreted; |
| 1879 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1880 | if (input->ExpectTag(18)) goto parse_field; |
| 1881 | if (input->ExpectTag(26)) goto parse_nested_type; |
| 1882 | break; |
| 1883 | } |
| 1884 | |
| 1885 | // repeated .google.protobuf.DescriptorProto nested_type = 3; |
| 1886 | case 3: { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 1887 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 1888 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 1889 | parse_nested_type: |
| 1890 | DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( |
| 1891 | input, add_nested_type())); |
| 1892 | } else { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1893 | goto handle_uninterpreted; |
| 1894 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1895 | if (input->ExpectTag(26)) goto parse_nested_type; |
| 1896 | if (input->ExpectTag(34)) goto parse_enum_type; |
| 1897 | break; |
| 1898 | } |
| 1899 | |
| 1900 | // repeated .google.protobuf.EnumDescriptorProto enum_type = 4; |
| 1901 | case 4: { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 1902 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 1903 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 1904 | parse_enum_type: |
| 1905 | DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( |
| 1906 | input, add_enum_type())); |
| 1907 | } else { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1908 | goto handle_uninterpreted; |
| 1909 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1910 | if (input->ExpectTag(34)) goto parse_enum_type; |
| 1911 | if (input->ExpectTag(42)) goto parse_extension_range; |
| 1912 | break; |
| 1913 | } |
| 1914 | |
| 1915 | // repeated .google.protobuf.DescriptorProto.ExtensionRange extension_range = 5; |
| 1916 | case 5: { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 1917 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 1918 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 1919 | parse_extension_range: |
| 1920 | DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( |
| 1921 | input, add_extension_range())); |
| 1922 | } else { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1923 | goto handle_uninterpreted; |
| 1924 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1925 | if (input->ExpectTag(42)) goto parse_extension_range; |
| 1926 | if (input->ExpectTag(50)) goto parse_extension; |
| 1927 | break; |
| 1928 | } |
| 1929 | |
| 1930 | // repeated .google.protobuf.FieldDescriptorProto extension = 6; |
| 1931 | case 6: { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 1932 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 1933 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 1934 | parse_extension: |
| 1935 | DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( |
| 1936 | input, add_extension())); |
| 1937 | } else { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1938 | goto handle_uninterpreted; |
| 1939 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1940 | if (input->ExpectTag(50)) goto parse_extension; |
| 1941 | if (input->ExpectTag(58)) goto parse_options; |
| 1942 | break; |
| 1943 | } |
| 1944 | |
| 1945 | // optional .google.protobuf.MessageOptions options = 7; |
| 1946 | case 7: { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 1947 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 1948 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 1949 | parse_options: |
| 1950 | DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( |
| 1951 | input, mutable_options())); |
| 1952 | } else { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1953 | goto handle_uninterpreted; |
| 1954 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1955 | if (input->ExpectAtEnd()) return true; |
| 1956 | break; |
| 1957 | } |
| 1958 | |
| 1959 | default: { |
| 1960 | handle_uninterpreted: |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 1961 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
| 1962 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1963 | return true; |
| 1964 | } |
| 1965 | DO_(::google::protobuf::internal::WireFormat::SkipField( |
| 1966 | input, tag, mutable_unknown_fields())); |
| 1967 | break; |
| 1968 | } |
| 1969 | } |
| 1970 | } |
| 1971 | return true; |
| 1972 | #undef DO_ |
| 1973 | } |
| 1974 | |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 1975 | void DescriptorProto::SerializeWithCachedSizes( |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1976 | ::google::protobuf::io::CodedOutputStream* output) const { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1977 | // optional string name = 1; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 1978 | if (has_name()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 1979 | ::google::protobuf::internal::WireFormat::VerifyUTF8String( |
| 1980 | this->name().data(), this->name().length(), |
| 1981 | ::google::protobuf::internal::WireFormat::SERIALIZE); |
| 1982 | ::google::protobuf::internal::WireFormatLite::WriteString( |
| 1983 | 1, this->name(), output); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1984 | } |
| 1985 | |
| 1986 | // repeated .google.protobuf.FieldDescriptorProto field = 2; |
kenton@google.com | 2d6daa7 | 2009-01-22 01:27:00 +0000 | [diff] [blame] | 1987 | for (int i = 0; i < this->field_size(); i++) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 1988 | ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 1989 | 2, this->field(i), output); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1990 | } |
| 1991 | |
| 1992 | // repeated .google.protobuf.DescriptorProto nested_type = 3; |
kenton@google.com | 2d6daa7 | 2009-01-22 01:27:00 +0000 | [diff] [blame] | 1993 | for (int i = 0; i < this->nested_type_size(); i++) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 1994 | ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 1995 | 3, this->nested_type(i), output); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 1996 | } |
| 1997 | |
| 1998 | // repeated .google.protobuf.EnumDescriptorProto enum_type = 4; |
kenton@google.com | 2d6daa7 | 2009-01-22 01:27:00 +0000 | [diff] [blame] | 1999 | for (int i = 0; i < this->enum_type_size(); i++) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 2000 | ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 2001 | 4, this->enum_type(i), output); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2002 | } |
| 2003 | |
| 2004 | // repeated .google.protobuf.DescriptorProto.ExtensionRange extension_range = 5; |
kenton@google.com | 2d6daa7 | 2009-01-22 01:27:00 +0000 | [diff] [blame] | 2005 | for (int i = 0; i < this->extension_range_size(); i++) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 2006 | ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 2007 | 5, this->extension_range(i), output); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2008 | } |
| 2009 | |
| 2010 | // repeated .google.protobuf.FieldDescriptorProto extension = 6; |
kenton@google.com | 2d6daa7 | 2009-01-22 01:27:00 +0000 | [diff] [blame] | 2011 | for (int i = 0; i < this->extension_size(); i++) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 2012 | ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 2013 | 6, this->extension(i), output); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2014 | } |
| 2015 | |
| 2016 | // optional .google.protobuf.MessageOptions options = 7; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 2017 | if (has_options()) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 2018 | ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 2019 | 7, this->options(), output); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2020 | } |
| 2021 | |
| 2022 | if (!unknown_fields().empty()) { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 2023 | ::google::protobuf::internal::WireFormat::SerializeUnknownFields( |
| 2024 | unknown_fields(), output); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2025 | } |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 2026 | } |
| 2027 | |
| 2028 | ::google::protobuf::uint8* DescriptorProto::SerializeWithCachedSizesToArray( |
| 2029 | ::google::protobuf::uint8* target) const { |
| 2030 | // optional string name = 1; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 2031 | if (has_name()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 2032 | ::google::protobuf::internal::WireFormat::VerifyUTF8String( |
| 2033 | this->name().data(), this->name().length(), |
| 2034 | ::google::protobuf::internal::WireFormat::SERIALIZE); |
| 2035 | target = |
| 2036 | ::google::protobuf::internal::WireFormatLite::WriteStringToArray( |
| 2037 | 1, this->name(), target); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 2038 | } |
| 2039 | |
| 2040 | // repeated .google.protobuf.FieldDescriptorProto field = 2; |
| 2041 | for (int i = 0; i < this->field_size(); i++) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 2042 | target = ::google::protobuf::internal::WireFormatLite:: |
| 2043 | WriteMessageNoVirtualToArray( |
| 2044 | 2, this->field(i), target); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 2045 | } |
| 2046 | |
| 2047 | // repeated .google.protobuf.DescriptorProto nested_type = 3; |
| 2048 | for (int i = 0; i < this->nested_type_size(); i++) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 2049 | target = ::google::protobuf::internal::WireFormatLite:: |
| 2050 | WriteMessageNoVirtualToArray( |
| 2051 | 3, this->nested_type(i), target); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 2052 | } |
| 2053 | |
| 2054 | // repeated .google.protobuf.EnumDescriptorProto enum_type = 4; |
| 2055 | for (int i = 0; i < this->enum_type_size(); i++) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 2056 | target = ::google::protobuf::internal::WireFormatLite:: |
| 2057 | WriteMessageNoVirtualToArray( |
| 2058 | 4, this->enum_type(i), target); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 2059 | } |
| 2060 | |
| 2061 | // repeated .google.protobuf.DescriptorProto.ExtensionRange extension_range = 5; |
| 2062 | for (int i = 0; i < this->extension_range_size(); i++) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 2063 | target = ::google::protobuf::internal::WireFormatLite:: |
| 2064 | WriteMessageNoVirtualToArray( |
| 2065 | 5, this->extension_range(i), target); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 2066 | } |
| 2067 | |
| 2068 | // repeated .google.protobuf.FieldDescriptorProto extension = 6; |
| 2069 | for (int i = 0; i < this->extension_size(); i++) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 2070 | target = ::google::protobuf::internal::WireFormatLite:: |
| 2071 | WriteMessageNoVirtualToArray( |
| 2072 | 6, this->extension(i), target); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 2073 | } |
| 2074 | |
| 2075 | // optional .google.protobuf.MessageOptions options = 7; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 2076 | if (has_options()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 2077 | target = ::google::protobuf::internal::WireFormatLite:: |
| 2078 | WriteMessageNoVirtualToArray( |
| 2079 | 7, this->options(), target); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 2080 | } |
| 2081 | |
| 2082 | if (!unknown_fields().empty()) { |
| 2083 | target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( |
| 2084 | unknown_fields(), target); |
| 2085 | } |
| 2086 | return target; |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2087 | } |
| 2088 | |
| 2089 | int DescriptorProto::ByteSize() const { |
| 2090 | int total_size = 0; |
| 2091 | |
| 2092 | if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { |
| 2093 | // optional string name = 1; |
| 2094 | if (has_name()) { |
| 2095 | total_size += 1 + |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 2096 | ::google::protobuf::internal::WireFormatLite::StringSize( |
| 2097 | this->name()); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2098 | } |
| 2099 | |
| 2100 | // optional .google.protobuf.MessageOptions options = 7; |
| 2101 | if (has_options()) { |
| 2102 | total_size += 1 + |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 2103 | ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2104 | this->options()); |
| 2105 | } |
| 2106 | |
| 2107 | } |
| 2108 | // repeated .google.protobuf.FieldDescriptorProto field = 2; |
kenton@google.com | 2d6daa7 | 2009-01-22 01:27:00 +0000 | [diff] [blame] | 2109 | total_size += 1 * this->field_size(); |
| 2110 | for (int i = 0; i < this->field_size(); i++) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2111 | total_size += |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 2112 | ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2113 | this->field(i)); |
| 2114 | } |
| 2115 | |
| 2116 | // repeated .google.protobuf.FieldDescriptorProto extension = 6; |
kenton@google.com | 2d6daa7 | 2009-01-22 01:27:00 +0000 | [diff] [blame] | 2117 | total_size += 1 * this->extension_size(); |
| 2118 | for (int i = 0; i < this->extension_size(); i++) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2119 | total_size += |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 2120 | ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2121 | this->extension(i)); |
| 2122 | } |
| 2123 | |
| 2124 | // repeated .google.protobuf.DescriptorProto nested_type = 3; |
kenton@google.com | 2d6daa7 | 2009-01-22 01:27:00 +0000 | [diff] [blame] | 2125 | total_size += 1 * this->nested_type_size(); |
| 2126 | for (int i = 0; i < this->nested_type_size(); i++) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2127 | total_size += |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 2128 | ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2129 | this->nested_type(i)); |
| 2130 | } |
| 2131 | |
| 2132 | // repeated .google.protobuf.EnumDescriptorProto enum_type = 4; |
kenton@google.com | 2d6daa7 | 2009-01-22 01:27:00 +0000 | [diff] [blame] | 2133 | total_size += 1 * this->enum_type_size(); |
| 2134 | for (int i = 0; i < this->enum_type_size(); i++) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2135 | total_size += |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 2136 | ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2137 | this->enum_type(i)); |
| 2138 | } |
| 2139 | |
| 2140 | // repeated .google.protobuf.DescriptorProto.ExtensionRange extension_range = 5; |
kenton@google.com | 2d6daa7 | 2009-01-22 01:27:00 +0000 | [diff] [blame] | 2141 | total_size += 1 * this->extension_range_size(); |
| 2142 | for (int i = 0; i < this->extension_range_size(); i++) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2143 | total_size += |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 2144 | ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2145 | this->extension_range(i)); |
| 2146 | } |
| 2147 | |
| 2148 | if (!unknown_fields().empty()) { |
| 2149 | total_size += |
| 2150 | ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( |
| 2151 | unknown_fields()); |
| 2152 | } |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 2153 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2154 | _cached_size_ = total_size; |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 2155 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2156 | return total_size; |
| 2157 | } |
| 2158 | |
| 2159 | void DescriptorProto::MergeFrom(const ::google::protobuf::Message& from) { |
| 2160 | GOOGLE_CHECK_NE(&from, this); |
| 2161 | const DescriptorProto* source = |
| 2162 | ::google::protobuf::internal::dynamic_cast_if_available<const DescriptorProto*>( |
| 2163 | &from); |
| 2164 | if (source == NULL) { |
temporal | 779f61c | 2008-08-13 03:15:00 +0000 | [diff] [blame] | 2165 | ::google::protobuf::internal::ReflectionOps::Merge(from, this); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2166 | } else { |
| 2167 | MergeFrom(*source); |
| 2168 | } |
| 2169 | } |
| 2170 | |
| 2171 | void DescriptorProto::MergeFrom(const DescriptorProto& from) { |
| 2172 | GOOGLE_CHECK_NE(&from, this); |
| 2173 | field_.MergeFrom(from.field_); |
| 2174 | extension_.MergeFrom(from.extension_); |
| 2175 | nested_type_.MergeFrom(from.nested_type_); |
| 2176 | enum_type_.MergeFrom(from.enum_type_); |
| 2177 | extension_range_.MergeFrom(from.extension_range_); |
| 2178 | if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 2179 | if (from.has_name()) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2180 | set_name(from.name()); |
| 2181 | } |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 2182 | if (from.has_options()) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2183 | mutable_options()->::google::protobuf::MessageOptions::MergeFrom(from.options()); |
| 2184 | } |
| 2185 | } |
| 2186 | mutable_unknown_fields()->MergeFrom(from.unknown_fields()); |
| 2187 | } |
| 2188 | |
| 2189 | void DescriptorProto::CopyFrom(const ::google::protobuf::Message& from) { |
| 2190 | if (&from == this) return; |
| 2191 | Clear(); |
| 2192 | MergeFrom(from); |
| 2193 | } |
| 2194 | |
| 2195 | void DescriptorProto::CopyFrom(const DescriptorProto& from) { |
| 2196 | if (&from == this) return; |
| 2197 | Clear(); |
| 2198 | MergeFrom(from); |
| 2199 | } |
| 2200 | |
| 2201 | bool DescriptorProto::IsInitialized() const { |
| 2202 | |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 2203 | for (int i = 0; i < field_size(); i++) { |
| 2204 | if (!this->field(i).IsInitialized()) return false; |
| 2205 | } |
| 2206 | for (int i = 0; i < extension_size(); i++) { |
| 2207 | if (!this->extension(i).IsInitialized()) return false; |
| 2208 | } |
| 2209 | for (int i = 0; i < nested_type_size(); i++) { |
| 2210 | if (!this->nested_type(i).IsInitialized()) return false; |
| 2211 | } |
| 2212 | for (int i = 0; i < enum_type_size(); i++) { |
| 2213 | if (!this->enum_type(i).IsInitialized()) return false; |
| 2214 | } |
| 2215 | if (has_options()) { |
| 2216 | if (!this->options().IsInitialized()) return false; |
| 2217 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2218 | return true; |
| 2219 | } |
| 2220 | |
kenton@google.com | ceb561d | 2009-06-25 19:05:36 +0000 | [diff] [blame] | 2221 | void DescriptorProto::Swap(DescriptorProto* other) { |
| 2222 | if (other != this) { |
| 2223 | std::swap(name_, other->name_); |
| 2224 | field_.Swap(&other->field_); |
| 2225 | extension_.Swap(&other->extension_); |
| 2226 | nested_type_.Swap(&other->nested_type_); |
| 2227 | enum_type_.Swap(&other->enum_type_); |
| 2228 | extension_range_.Swap(&other->extension_range_); |
| 2229 | std::swap(options_, other->options_); |
| 2230 | std::swap(_has_bits_[0], other->_has_bits_[0]); |
| 2231 | _unknown_fields_.Swap(&other->_unknown_fields_); |
| 2232 | std::swap(_cached_size_, other->_cached_size_); |
| 2233 | } |
| 2234 | } |
| 2235 | |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 2236 | ::google::protobuf::Metadata DescriptorProto::GetMetadata() const { |
| 2237 | protobuf_AssignDescriptorsOnce(); |
| 2238 | ::google::protobuf::Metadata metadata; |
| 2239 | metadata.descriptor = DescriptorProto_descriptor_; |
| 2240 | metadata.reflection = DescriptorProto_reflection_; |
| 2241 | return metadata; |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2242 | } |
| 2243 | |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2244 | |
| 2245 | // =================================================================== |
| 2246 | |
| 2247 | const ::google::protobuf::EnumDescriptor* FieldDescriptorProto_Type_descriptor() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 2248 | protobuf_AssignDescriptorsOnce(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2249 | return FieldDescriptorProto_Type_descriptor_; |
| 2250 | } |
| 2251 | bool FieldDescriptorProto_Type_IsValid(int value) { |
| 2252 | switch(value) { |
| 2253 | case 1: |
| 2254 | case 2: |
| 2255 | case 3: |
| 2256 | case 4: |
| 2257 | case 5: |
| 2258 | case 6: |
| 2259 | case 7: |
| 2260 | case 8: |
| 2261 | case 9: |
| 2262 | case 10: |
| 2263 | case 11: |
| 2264 | case 12: |
| 2265 | case 13: |
| 2266 | case 14: |
| 2267 | case 15: |
| 2268 | case 16: |
| 2269 | case 17: |
| 2270 | case 18: |
| 2271 | return true; |
| 2272 | default: |
| 2273 | return false; |
| 2274 | } |
| 2275 | } |
| 2276 | |
| 2277 | #ifndef _MSC_VER |
| 2278 | const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_DOUBLE; |
| 2279 | const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_FLOAT; |
| 2280 | const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_INT64; |
| 2281 | const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_UINT64; |
| 2282 | const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_INT32; |
| 2283 | const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_FIXED64; |
| 2284 | const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_FIXED32; |
| 2285 | const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_BOOL; |
| 2286 | const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_STRING; |
| 2287 | const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_GROUP; |
| 2288 | const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_MESSAGE; |
| 2289 | const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_BYTES; |
| 2290 | const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_UINT32; |
| 2291 | const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_ENUM; |
| 2292 | const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_SFIXED32; |
| 2293 | const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_SFIXED64; |
| 2294 | const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_SINT32; |
| 2295 | const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_SINT64; |
| 2296 | const FieldDescriptorProto_Type FieldDescriptorProto::Type_MIN; |
| 2297 | const FieldDescriptorProto_Type FieldDescriptorProto::Type_MAX; |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 2298 | const int FieldDescriptorProto::Type_ARRAYSIZE; |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2299 | #endif // _MSC_VER |
| 2300 | const ::google::protobuf::EnumDescriptor* FieldDescriptorProto_Label_descriptor() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 2301 | protobuf_AssignDescriptorsOnce(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2302 | return FieldDescriptorProto_Label_descriptor_; |
| 2303 | } |
| 2304 | bool FieldDescriptorProto_Label_IsValid(int value) { |
| 2305 | switch(value) { |
| 2306 | case 1: |
| 2307 | case 2: |
| 2308 | case 3: |
| 2309 | return true; |
| 2310 | default: |
| 2311 | return false; |
| 2312 | } |
| 2313 | } |
| 2314 | |
| 2315 | #ifndef _MSC_VER |
| 2316 | const FieldDescriptorProto_Label FieldDescriptorProto::LABEL_OPTIONAL; |
| 2317 | const FieldDescriptorProto_Label FieldDescriptorProto::LABEL_REQUIRED; |
| 2318 | const FieldDescriptorProto_Label FieldDescriptorProto::LABEL_REPEATED; |
| 2319 | const FieldDescriptorProto_Label FieldDescriptorProto::Label_MIN; |
| 2320 | const FieldDescriptorProto_Label FieldDescriptorProto::Label_MAX; |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 2321 | const int FieldDescriptorProto::Label_ARRAYSIZE; |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2322 | #endif // _MSC_VER |
kenton@google.com | cfa2d8a | 2009-04-18 00:02:12 +0000 | [diff] [blame] | 2323 | #ifndef _MSC_VER |
| 2324 | const int FieldDescriptorProto::kNameFieldNumber; |
| 2325 | const int FieldDescriptorProto::kNumberFieldNumber; |
| 2326 | const int FieldDescriptorProto::kLabelFieldNumber; |
| 2327 | const int FieldDescriptorProto::kTypeFieldNumber; |
| 2328 | const int FieldDescriptorProto::kTypeNameFieldNumber; |
| 2329 | const int FieldDescriptorProto::kExtendeeFieldNumber; |
| 2330 | const int FieldDescriptorProto::kDefaultValueFieldNumber; |
| 2331 | const int FieldDescriptorProto::kOptionsFieldNumber; |
| 2332 | #endif // !_MSC_VER |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2333 | |
kenton@google.com | 573989f | 2009-10-30 22:02:17 +0000 | [diff] [blame] | 2334 | FieldDescriptorProto::FieldDescriptorProto() |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 2335 | : ::google::protobuf::Message() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 2336 | SharedCtor(); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 2337 | } |
| 2338 | |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 2339 | void FieldDescriptorProto::InitAsDefaultInstance() { |
| 2340 | options_ = const_cast< ::google::protobuf::FieldOptions*>(&::google::protobuf::FieldOptions::default_instance()); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2341 | } |
| 2342 | |
kenton@google.com | 573989f | 2009-10-30 22:02:17 +0000 | [diff] [blame] | 2343 | FieldDescriptorProto::FieldDescriptorProto(const FieldDescriptorProto& from) |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 2344 | : ::google::protobuf::Message() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 2345 | SharedCtor(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2346 | MergeFrom(from); |
| 2347 | } |
| 2348 | |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 2349 | void FieldDescriptorProto::SharedCtor() { |
| 2350 | _cached_size_ = 0; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 2351 | name_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 2352 | number_ = 0; |
| 2353 | label_ = 1; |
| 2354 | type_ = 1; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 2355 | type_name_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); |
| 2356 | extendee_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); |
| 2357 | default_value_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 2358 | options_ = NULL; |
| 2359 | ::memset(_has_bits_, 0, sizeof(_has_bits_)); |
| 2360 | } |
| 2361 | |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2362 | FieldDescriptorProto::~FieldDescriptorProto() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 2363 | SharedDtor(); |
| 2364 | } |
| 2365 | |
| 2366 | void FieldDescriptorProto::SharedDtor() { |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 2367 | if (name_ != &::google::protobuf::internal::kEmptyString) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2368 | delete name_; |
| 2369 | } |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 2370 | if (type_name_ != &::google::protobuf::internal::kEmptyString) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2371 | delete type_name_; |
| 2372 | } |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 2373 | if (extendee_ != &::google::protobuf::internal::kEmptyString) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2374 | delete extendee_; |
| 2375 | } |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 2376 | if (default_value_ != &::google::protobuf::internal::kEmptyString) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2377 | delete default_value_; |
| 2378 | } |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 2379 | if (this != default_instance_) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2380 | delete options_; |
| 2381 | } |
| 2382 | } |
| 2383 | |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 2384 | void FieldDescriptorProto::SetCachedSize(int size) const { |
| 2385 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
| 2386 | _cached_size_ = size; |
| 2387 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); |
| 2388 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2389 | const ::google::protobuf::Descriptor* FieldDescriptorProto::descriptor() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 2390 | protobuf_AssignDescriptorsOnce(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2391 | return FieldDescriptorProto_descriptor_; |
| 2392 | } |
| 2393 | |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 2394 | const FieldDescriptorProto& FieldDescriptorProto::default_instance() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 2395 | if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); return *default_instance_; |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 2396 | } |
| 2397 | |
| 2398 | FieldDescriptorProto* FieldDescriptorProto::default_instance_ = NULL; |
| 2399 | |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2400 | FieldDescriptorProto* FieldDescriptorProto::New() const { |
| 2401 | return new FieldDescriptorProto; |
| 2402 | } |
| 2403 | |
| 2404 | void FieldDescriptorProto::Clear() { |
| 2405 | if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 2406 | if (has_name()) { |
| 2407 | if (name_ != &::google::protobuf::internal::kEmptyString) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2408 | name_->clear(); |
| 2409 | } |
| 2410 | } |
| 2411 | number_ = 0; |
| 2412 | label_ = 1; |
| 2413 | type_ = 1; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 2414 | if (has_type_name()) { |
| 2415 | if (type_name_ != &::google::protobuf::internal::kEmptyString) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2416 | type_name_->clear(); |
| 2417 | } |
| 2418 | } |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 2419 | if (has_extendee()) { |
| 2420 | if (extendee_ != &::google::protobuf::internal::kEmptyString) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2421 | extendee_->clear(); |
| 2422 | } |
| 2423 | } |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 2424 | if (has_default_value()) { |
| 2425 | if (default_value_ != &::google::protobuf::internal::kEmptyString) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2426 | default_value_->clear(); |
| 2427 | } |
| 2428 | } |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 2429 | if (has_options()) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2430 | if (options_ != NULL) options_->::google::protobuf::FieldOptions::Clear(); |
| 2431 | } |
| 2432 | } |
| 2433 | ::memset(_has_bits_, 0, sizeof(_has_bits_)); |
| 2434 | mutable_unknown_fields()->Clear(); |
| 2435 | } |
| 2436 | |
| 2437 | bool FieldDescriptorProto::MergePartialFromCodedStream( |
| 2438 | ::google::protobuf::io::CodedInputStream* input) { |
| 2439 | #define DO_(EXPRESSION) if (!(EXPRESSION)) return false |
| 2440 | ::google::protobuf::uint32 tag; |
| 2441 | while ((tag = input->ReadTag()) != 0) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 2442 | switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2443 | // optional string name = 1; |
| 2444 | case 1: { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 2445 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 2446 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 2447 | DO_(::google::protobuf::internal::WireFormatLite::ReadString( |
| 2448 | input, this->mutable_name())); |
| 2449 | ::google::protobuf::internal::WireFormat::VerifyUTF8String( |
| 2450 | this->name().data(), this->name().length(), |
| 2451 | ::google::protobuf::internal::WireFormat::PARSE); |
| 2452 | } else { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2453 | goto handle_uninterpreted; |
| 2454 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2455 | if (input->ExpectTag(18)) goto parse_extendee; |
| 2456 | break; |
| 2457 | } |
| 2458 | |
| 2459 | // optional string extendee = 2; |
| 2460 | case 2: { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 2461 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 2462 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 2463 | parse_extendee: |
| 2464 | DO_(::google::protobuf::internal::WireFormatLite::ReadString( |
| 2465 | input, this->mutable_extendee())); |
| 2466 | ::google::protobuf::internal::WireFormat::VerifyUTF8String( |
| 2467 | this->extendee().data(), this->extendee().length(), |
| 2468 | ::google::protobuf::internal::WireFormat::PARSE); |
| 2469 | } else { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2470 | goto handle_uninterpreted; |
| 2471 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2472 | if (input->ExpectTag(24)) goto parse_number; |
| 2473 | break; |
| 2474 | } |
| 2475 | |
| 2476 | // optional int32 number = 3; |
| 2477 | case 3: { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 2478 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 2479 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 2480 | parse_number: |
| 2481 | DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< |
| 2482 | ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( |
| 2483 | input, &number_))); |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 2484 | set_has_number(); |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 2485 | } else { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2486 | goto handle_uninterpreted; |
| 2487 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2488 | if (input->ExpectTag(32)) goto parse_label; |
| 2489 | break; |
| 2490 | } |
| 2491 | |
| 2492 | // optional .google.protobuf.FieldDescriptorProto.Label label = 4; |
| 2493 | case 4: { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 2494 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 2495 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 2496 | parse_label: |
| 2497 | int value; |
| 2498 | DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< |
| 2499 | int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( |
| 2500 | input, &value))); |
| 2501 | if (::google::protobuf::FieldDescriptorProto_Label_IsValid(value)) { |
| 2502 | set_label(static_cast< ::google::protobuf::FieldDescriptorProto_Label >(value)); |
| 2503 | } else { |
| 2504 | mutable_unknown_fields()->AddVarint(4, value); |
| 2505 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2506 | } else { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 2507 | goto handle_uninterpreted; |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2508 | } |
| 2509 | if (input->ExpectTag(40)) goto parse_type; |
| 2510 | break; |
| 2511 | } |
| 2512 | |
| 2513 | // optional .google.protobuf.FieldDescriptorProto.Type type = 5; |
| 2514 | case 5: { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 2515 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 2516 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 2517 | parse_type: |
| 2518 | int value; |
| 2519 | DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< |
| 2520 | int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( |
| 2521 | input, &value))); |
| 2522 | if (::google::protobuf::FieldDescriptorProto_Type_IsValid(value)) { |
| 2523 | set_type(static_cast< ::google::protobuf::FieldDescriptorProto_Type >(value)); |
| 2524 | } else { |
| 2525 | mutable_unknown_fields()->AddVarint(5, value); |
| 2526 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2527 | } else { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 2528 | goto handle_uninterpreted; |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2529 | } |
| 2530 | if (input->ExpectTag(50)) goto parse_type_name; |
| 2531 | break; |
| 2532 | } |
| 2533 | |
| 2534 | // optional string type_name = 6; |
| 2535 | case 6: { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 2536 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 2537 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 2538 | parse_type_name: |
| 2539 | DO_(::google::protobuf::internal::WireFormatLite::ReadString( |
| 2540 | input, this->mutable_type_name())); |
| 2541 | ::google::protobuf::internal::WireFormat::VerifyUTF8String( |
| 2542 | this->type_name().data(), this->type_name().length(), |
| 2543 | ::google::protobuf::internal::WireFormat::PARSE); |
| 2544 | } else { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2545 | goto handle_uninterpreted; |
| 2546 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2547 | if (input->ExpectTag(58)) goto parse_default_value; |
| 2548 | break; |
| 2549 | } |
| 2550 | |
| 2551 | // optional string default_value = 7; |
| 2552 | case 7: { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 2553 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 2554 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 2555 | parse_default_value: |
| 2556 | DO_(::google::protobuf::internal::WireFormatLite::ReadString( |
| 2557 | input, this->mutable_default_value())); |
| 2558 | ::google::protobuf::internal::WireFormat::VerifyUTF8String( |
| 2559 | this->default_value().data(), this->default_value().length(), |
| 2560 | ::google::protobuf::internal::WireFormat::PARSE); |
| 2561 | } else { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2562 | goto handle_uninterpreted; |
| 2563 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2564 | if (input->ExpectTag(66)) goto parse_options; |
| 2565 | break; |
| 2566 | } |
| 2567 | |
| 2568 | // optional .google.protobuf.FieldOptions options = 8; |
| 2569 | case 8: { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 2570 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 2571 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 2572 | parse_options: |
| 2573 | DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( |
| 2574 | input, mutable_options())); |
| 2575 | } else { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2576 | goto handle_uninterpreted; |
| 2577 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2578 | if (input->ExpectAtEnd()) return true; |
| 2579 | break; |
| 2580 | } |
| 2581 | |
| 2582 | default: { |
| 2583 | handle_uninterpreted: |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 2584 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
| 2585 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2586 | return true; |
| 2587 | } |
| 2588 | DO_(::google::protobuf::internal::WireFormat::SkipField( |
| 2589 | input, tag, mutable_unknown_fields())); |
| 2590 | break; |
| 2591 | } |
| 2592 | } |
| 2593 | } |
| 2594 | return true; |
| 2595 | #undef DO_ |
| 2596 | } |
| 2597 | |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 2598 | void FieldDescriptorProto::SerializeWithCachedSizes( |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2599 | ::google::protobuf::io::CodedOutputStream* output) const { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2600 | // optional string name = 1; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 2601 | if (has_name()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 2602 | ::google::protobuf::internal::WireFormat::VerifyUTF8String( |
| 2603 | this->name().data(), this->name().length(), |
| 2604 | ::google::protobuf::internal::WireFormat::SERIALIZE); |
| 2605 | ::google::protobuf::internal::WireFormatLite::WriteString( |
| 2606 | 1, this->name(), output); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2607 | } |
| 2608 | |
| 2609 | // optional string extendee = 2; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 2610 | if (has_extendee()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 2611 | ::google::protobuf::internal::WireFormat::VerifyUTF8String( |
| 2612 | this->extendee().data(), this->extendee().length(), |
| 2613 | ::google::protobuf::internal::WireFormat::SERIALIZE); |
| 2614 | ::google::protobuf::internal::WireFormatLite::WriteString( |
| 2615 | 2, this->extendee(), output); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2616 | } |
| 2617 | |
| 2618 | // optional int32 number = 3; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 2619 | if (has_number()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 2620 | ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->number(), output); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2621 | } |
| 2622 | |
| 2623 | // optional .google.protobuf.FieldDescriptorProto.Label label = 4; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 2624 | if (has_label()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 2625 | ::google::protobuf::internal::WireFormatLite::WriteEnum( |
| 2626 | 4, this->label(), output); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2627 | } |
| 2628 | |
| 2629 | // optional .google.protobuf.FieldDescriptorProto.Type type = 5; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 2630 | if (has_type()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 2631 | ::google::protobuf::internal::WireFormatLite::WriteEnum( |
| 2632 | 5, this->type(), output); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2633 | } |
| 2634 | |
| 2635 | // optional string type_name = 6; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 2636 | if (has_type_name()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 2637 | ::google::protobuf::internal::WireFormat::VerifyUTF8String( |
| 2638 | this->type_name().data(), this->type_name().length(), |
| 2639 | ::google::protobuf::internal::WireFormat::SERIALIZE); |
| 2640 | ::google::protobuf::internal::WireFormatLite::WriteString( |
| 2641 | 6, this->type_name(), output); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2642 | } |
| 2643 | |
| 2644 | // optional string default_value = 7; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 2645 | if (has_default_value()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 2646 | ::google::protobuf::internal::WireFormat::VerifyUTF8String( |
| 2647 | this->default_value().data(), this->default_value().length(), |
| 2648 | ::google::protobuf::internal::WireFormat::SERIALIZE); |
| 2649 | ::google::protobuf::internal::WireFormatLite::WriteString( |
| 2650 | 7, this->default_value(), output); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2651 | } |
| 2652 | |
| 2653 | // optional .google.protobuf.FieldOptions options = 8; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 2654 | if (has_options()) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 2655 | ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 2656 | 8, this->options(), output); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2657 | } |
| 2658 | |
| 2659 | if (!unknown_fields().empty()) { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 2660 | ::google::protobuf::internal::WireFormat::SerializeUnknownFields( |
| 2661 | unknown_fields(), output); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2662 | } |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 2663 | } |
| 2664 | |
| 2665 | ::google::protobuf::uint8* FieldDescriptorProto::SerializeWithCachedSizesToArray( |
| 2666 | ::google::protobuf::uint8* target) const { |
| 2667 | // optional string name = 1; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 2668 | if (has_name()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 2669 | ::google::protobuf::internal::WireFormat::VerifyUTF8String( |
| 2670 | this->name().data(), this->name().length(), |
| 2671 | ::google::protobuf::internal::WireFormat::SERIALIZE); |
| 2672 | target = |
| 2673 | ::google::protobuf::internal::WireFormatLite::WriteStringToArray( |
| 2674 | 1, this->name(), target); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 2675 | } |
| 2676 | |
| 2677 | // optional string extendee = 2; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 2678 | if (has_extendee()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 2679 | ::google::protobuf::internal::WireFormat::VerifyUTF8String( |
| 2680 | this->extendee().data(), this->extendee().length(), |
| 2681 | ::google::protobuf::internal::WireFormat::SERIALIZE); |
| 2682 | target = |
| 2683 | ::google::protobuf::internal::WireFormatLite::WriteStringToArray( |
| 2684 | 2, this->extendee(), target); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 2685 | } |
| 2686 | |
| 2687 | // optional int32 number = 3; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 2688 | if (has_number()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 2689 | target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->number(), target); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 2690 | } |
| 2691 | |
| 2692 | // optional .google.protobuf.FieldDescriptorProto.Label label = 4; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 2693 | if (has_label()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 2694 | target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( |
| 2695 | 4, this->label(), target); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 2696 | } |
| 2697 | |
| 2698 | // optional .google.protobuf.FieldDescriptorProto.Type type = 5; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 2699 | if (has_type()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 2700 | target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( |
| 2701 | 5, this->type(), target); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 2702 | } |
| 2703 | |
| 2704 | // optional string type_name = 6; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 2705 | if (has_type_name()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 2706 | ::google::protobuf::internal::WireFormat::VerifyUTF8String( |
| 2707 | this->type_name().data(), this->type_name().length(), |
| 2708 | ::google::protobuf::internal::WireFormat::SERIALIZE); |
| 2709 | target = |
| 2710 | ::google::protobuf::internal::WireFormatLite::WriteStringToArray( |
| 2711 | 6, this->type_name(), target); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 2712 | } |
| 2713 | |
| 2714 | // optional string default_value = 7; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 2715 | if (has_default_value()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 2716 | ::google::protobuf::internal::WireFormat::VerifyUTF8String( |
| 2717 | this->default_value().data(), this->default_value().length(), |
| 2718 | ::google::protobuf::internal::WireFormat::SERIALIZE); |
| 2719 | target = |
| 2720 | ::google::protobuf::internal::WireFormatLite::WriteStringToArray( |
| 2721 | 7, this->default_value(), target); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 2722 | } |
| 2723 | |
| 2724 | // optional .google.protobuf.FieldOptions options = 8; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 2725 | if (has_options()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 2726 | target = ::google::protobuf::internal::WireFormatLite:: |
| 2727 | WriteMessageNoVirtualToArray( |
| 2728 | 8, this->options(), target); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 2729 | } |
| 2730 | |
| 2731 | if (!unknown_fields().empty()) { |
| 2732 | target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( |
| 2733 | unknown_fields(), target); |
| 2734 | } |
| 2735 | return target; |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2736 | } |
| 2737 | |
| 2738 | int FieldDescriptorProto::ByteSize() const { |
| 2739 | int total_size = 0; |
| 2740 | |
| 2741 | if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { |
| 2742 | // optional string name = 1; |
| 2743 | if (has_name()) { |
| 2744 | total_size += 1 + |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 2745 | ::google::protobuf::internal::WireFormatLite::StringSize( |
| 2746 | this->name()); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2747 | } |
| 2748 | |
| 2749 | // optional int32 number = 3; |
| 2750 | if (has_number()) { |
| 2751 | total_size += 1 + |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 2752 | ::google::protobuf::internal::WireFormatLite::Int32Size( |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2753 | this->number()); |
| 2754 | } |
| 2755 | |
| 2756 | // optional .google.protobuf.FieldDescriptorProto.Label label = 4; |
| 2757 | if (has_label()) { |
| 2758 | total_size += 1 + |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 2759 | ::google::protobuf::internal::WireFormatLite::EnumSize(this->label()); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2760 | } |
| 2761 | |
| 2762 | // optional .google.protobuf.FieldDescriptorProto.Type type = 5; |
| 2763 | if (has_type()) { |
| 2764 | total_size += 1 + |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 2765 | ::google::protobuf::internal::WireFormatLite::EnumSize(this->type()); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2766 | } |
| 2767 | |
| 2768 | // optional string type_name = 6; |
| 2769 | if (has_type_name()) { |
| 2770 | total_size += 1 + |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 2771 | ::google::protobuf::internal::WireFormatLite::StringSize( |
| 2772 | this->type_name()); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2773 | } |
| 2774 | |
| 2775 | // optional string extendee = 2; |
| 2776 | if (has_extendee()) { |
| 2777 | total_size += 1 + |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 2778 | ::google::protobuf::internal::WireFormatLite::StringSize( |
| 2779 | this->extendee()); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2780 | } |
| 2781 | |
| 2782 | // optional string default_value = 7; |
| 2783 | if (has_default_value()) { |
| 2784 | total_size += 1 + |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 2785 | ::google::protobuf::internal::WireFormatLite::StringSize( |
| 2786 | this->default_value()); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2787 | } |
| 2788 | |
| 2789 | // optional .google.protobuf.FieldOptions options = 8; |
| 2790 | if (has_options()) { |
| 2791 | total_size += 1 + |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 2792 | ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2793 | this->options()); |
| 2794 | } |
| 2795 | |
| 2796 | } |
| 2797 | if (!unknown_fields().empty()) { |
| 2798 | total_size += |
| 2799 | ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( |
| 2800 | unknown_fields()); |
| 2801 | } |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 2802 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2803 | _cached_size_ = total_size; |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 2804 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2805 | return total_size; |
| 2806 | } |
| 2807 | |
| 2808 | void FieldDescriptorProto::MergeFrom(const ::google::protobuf::Message& from) { |
| 2809 | GOOGLE_CHECK_NE(&from, this); |
| 2810 | const FieldDescriptorProto* source = |
| 2811 | ::google::protobuf::internal::dynamic_cast_if_available<const FieldDescriptorProto*>( |
| 2812 | &from); |
| 2813 | if (source == NULL) { |
temporal | 779f61c | 2008-08-13 03:15:00 +0000 | [diff] [blame] | 2814 | ::google::protobuf::internal::ReflectionOps::Merge(from, this); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2815 | } else { |
| 2816 | MergeFrom(*source); |
| 2817 | } |
| 2818 | } |
| 2819 | |
| 2820 | void FieldDescriptorProto::MergeFrom(const FieldDescriptorProto& from) { |
| 2821 | GOOGLE_CHECK_NE(&from, this); |
| 2822 | if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 2823 | if (from.has_name()) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2824 | set_name(from.name()); |
| 2825 | } |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 2826 | if (from.has_number()) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2827 | set_number(from.number()); |
| 2828 | } |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 2829 | if (from.has_label()) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2830 | set_label(from.label()); |
| 2831 | } |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 2832 | if (from.has_type()) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2833 | set_type(from.type()); |
| 2834 | } |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 2835 | if (from.has_type_name()) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2836 | set_type_name(from.type_name()); |
| 2837 | } |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 2838 | if (from.has_extendee()) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2839 | set_extendee(from.extendee()); |
| 2840 | } |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 2841 | if (from.has_default_value()) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2842 | set_default_value(from.default_value()); |
| 2843 | } |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 2844 | if (from.has_options()) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2845 | mutable_options()->::google::protobuf::FieldOptions::MergeFrom(from.options()); |
| 2846 | } |
| 2847 | } |
| 2848 | mutable_unknown_fields()->MergeFrom(from.unknown_fields()); |
| 2849 | } |
| 2850 | |
| 2851 | void FieldDescriptorProto::CopyFrom(const ::google::protobuf::Message& from) { |
| 2852 | if (&from == this) return; |
| 2853 | Clear(); |
| 2854 | MergeFrom(from); |
| 2855 | } |
| 2856 | |
| 2857 | void FieldDescriptorProto::CopyFrom(const FieldDescriptorProto& from) { |
| 2858 | if (&from == this) return; |
| 2859 | Clear(); |
| 2860 | MergeFrom(from); |
| 2861 | } |
| 2862 | |
kenton@google.com | ceb561d | 2009-06-25 19:05:36 +0000 | [diff] [blame] | 2863 | bool FieldDescriptorProto::IsInitialized() const { |
| 2864 | |
| 2865 | if (has_options()) { |
| 2866 | if (!this->options().IsInitialized()) return false; |
| 2867 | } |
| 2868 | return true; |
| 2869 | } |
| 2870 | |
kenton@google.com | 26bd9ee | 2008-11-21 00:06:27 +0000 | [diff] [blame] | 2871 | void FieldDescriptorProto::Swap(FieldDescriptorProto* other) { |
| 2872 | if (other != this) { |
| 2873 | std::swap(name_, other->name_); |
| 2874 | std::swap(number_, other->number_); |
| 2875 | std::swap(label_, other->label_); |
| 2876 | std::swap(type_, other->type_); |
| 2877 | std::swap(type_name_, other->type_name_); |
| 2878 | std::swap(extendee_, other->extendee_); |
| 2879 | std::swap(default_value_, other->default_value_); |
| 2880 | std::swap(options_, other->options_); |
| 2881 | std::swap(_has_bits_[0], other->_has_bits_[0]); |
| 2882 | _unknown_fields_.Swap(&other->_unknown_fields_); |
| 2883 | std::swap(_cached_size_, other->_cached_size_); |
| 2884 | } |
| 2885 | } |
| 2886 | |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 2887 | ::google::protobuf::Metadata FieldDescriptorProto::GetMetadata() const { |
| 2888 | protobuf_AssignDescriptorsOnce(); |
| 2889 | ::google::protobuf::Metadata metadata; |
| 2890 | metadata.descriptor = FieldDescriptorProto_descriptor_; |
| 2891 | metadata.reflection = FieldDescriptorProto_reflection_; |
| 2892 | return metadata; |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2893 | } |
| 2894 | |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2895 | |
| 2896 | // =================================================================== |
| 2897 | |
kenton@google.com | cfa2d8a | 2009-04-18 00:02:12 +0000 | [diff] [blame] | 2898 | #ifndef _MSC_VER |
| 2899 | const int EnumDescriptorProto::kNameFieldNumber; |
| 2900 | const int EnumDescriptorProto::kValueFieldNumber; |
| 2901 | const int EnumDescriptorProto::kOptionsFieldNumber; |
| 2902 | #endif // !_MSC_VER |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2903 | |
kenton@google.com | 573989f | 2009-10-30 22:02:17 +0000 | [diff] [blame] | 2904 | EnumDescriptorProto::EnumDescriptorProto() |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 2905 | : ::google::protobuf::Message() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 2906 | SharedCtor(); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 2907 | } |
| 2908 | |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 2909 | void EnumDescriptorProto::InitAsDefaultInstance() { |
| 2910 | options_ = const_cast< ::google::protobuf::EnumOptions*>(&::google::protobuf::EnumOptions::default_instance()); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2911 | } |
| 2912 | |
kenton@google.com | 573989f | 2009-10-30 22:02:17 +0000 | [diff] [blame] | 2913 | EnumDescriptorProto::EnumDescriptorProto(const EnumDescriptorProto& from) |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 2914 | : ::google::protobuf::Message() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 2915 | SharedCtor(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2916 | MergeFrom(from); |
| 2917 | } |
| 2918 | |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 2919 | void EnumDescriptorProto::SharedCtor() { |
| 2920 | _cached_size_ = 0; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 2921 | name_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 2922 | options_ = NULL; |
| 2923 | ::memset(_has_bits_, 0, sizeof(_has_bits_)); |
| 2924 | } |
| 2925 | |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2926 | EnumDescriptorProto::~EnumDescriptorProto() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 2927 | SharedDtor(); |
| 2928 | } |
| 2929 | |
| 2930 | void EnumDescriptorProto::SharedDtor() { |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 2931 | if (name_ != &::google::protobuf::internal::kEmptyString) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2932 | delete name_; |
| 2933 | } |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 2934 | if (this != default_instance_) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2935 | delete options_; |
| 2936 | } |
| 2937 | } |
| 2938 | |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 2939 | void EnumDescriptorProto::SetCachedSize(int size) const { |
| 2940 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
| 2941 | _cached_size_ = size; |
| 2942 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); |
| 2943 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2944 | const ::google::protobuf::Descriptor* EnumDescriptorProto::descriptor() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 2945 | protobuf_AssignDescriptorsOnce(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2946 | return EnumDescriptorProto_descriptor_; |
| 2947 | } |
| 2948 | |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 2949 | const EnumDescriptorProto& EnumDescriptorProto::default_instance() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 2950 | if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); return *default_instance_; |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 2951 | } |
| 2952 | |
| 2953 | EnumDescriptorProto* EnumDescriptorProto::default_instance_ = NULL; |
| 2954 | |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2955 | EnumDescriptorProto* EnumDescriptorProto::New() const { |
| 2956 | return new EnumDescriptorProto; |
| 2957 | } |
| 2958 | |
| 2959 | void EnumDescriptorProto::Clear() { |
| 2960 | if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 2961 | if (has_name()) { |
| 2962 | if (name_ != &::google::protobuf::internal::kEmptyString) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2963 | name_->clear(); |
| 2964 | } |
| 2965 | } |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 2966 | if (has_options()) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2967 | if (options_ != NULL) options_->::google::protobuf::EnumOptions::Clear(); |
| 2968 | } |
| 2969 | } |
| 2970 | value_.Clear(); |
| 2971 | ::memset(_has_bits_, 0, sizeof(_has_bits_)); |
| 2972 | mutable_unknown_fields()->Clear(); |
| 2973 | } |
| 2974 | |
| 2975 | bool EnumDescriptorProto::MergePartialFromCodedStream( |
| 2976 | ::google::protobuf::io::CodedInputStream* input) { |
| 2977 | #define DO_(EXPRESSION) if (!(EXPRESSION)) return false |
| 2978 | ::google::protobuf::uint32 tag; |
| 2979 | while ((tag = input->ReadTag()) != 0) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 2980 | switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2981 | // optional string name = 1; |
| 2982 | case 1: { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 2983 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 2984 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 2985 | DO_(::google::protobuf::internal::WireFormatLite::ReadString( |
| 2986 | input, this->mutable_name())); |
| 2987 | ::google::protobuf::internal::WireFormat::VerifyUTF8String( |
| 2988 | this->name().data(), this->name().length(), |
| 2989 | ::google::protobuf::internal::WireFormat::PARSE); |
| 2990 | } else { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2991 | goto handle_uninterpreted; |
| 2992 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 2993 | if (input->ExpectTag(18)) goto parse_value; |
| 2994 | break; |
| 2995 | } |
| 2996 | |
| 2997 | // repeated .google.protobuf.EnumValueDescriptorProto value = 2; |
| 2998 | case 2: { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 2999 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 3000 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 3001 | parse_value: |
| 3002 | DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( |
| 3003 | input, add_value())); |
| 3004 | } else { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3005 | goto handle_uninterpreted; |
| 3006 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3007 | if (input->ExpectTag(18)) goto parse_value; |
| 3008 | if (input->ExpectTag(26)) goto parse_options; |
| 3009 | break; |
| 3010 | } |
| 3011 | |
| 3012 | // optional .google.protobuf.EnumOptions options = 3; |
| 3013 | case 3: { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 3014 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 3015 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 3016 | parse_options: |
| 3017 | DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( |
| 3018 | input, mutable_options())); |
| 3019 | } else { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3020 | goto handle_uninterpreted; |
| 3021 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3022 | if (input->ExpectAtEnd()) return true; |
| 3023 | break; |
| 3024 | } |
| 3025 | |
| 3026 | default: { |
| 3027 | handle_uninterpreted: |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 3028 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
| 3029 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3030 | return true; |
| 3031 | } |
| 3032 | DO_(::google::protobuf::internal::WireFormat::SkipField( |
| 3033 | input, tag, mutable_unknown_fields())); |
| 3034 | break; |
| 3035 | } |
| 3036 | } |
| 3037 | } |
| 3038 | return true; |
| 3039 | #undef DO_ |
| 3040 | } |
| 3041 | |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 3042 | void EnumDescriptorProto::SerializeWithCachedSizes( |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3043 | ::google::protobuf::io::CodedOutputStream* output) const { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3044 | // optional string name = 1; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 3045 | if (has_name()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 3046 | ::google::protobuf::internal::WireFormat::VerifyUTF8String( |
| 3047 | this->name().data(), this->name().length(), |
| 3048 | ::google::protobuf::internal::WireFormat::SERIALIZE); |
| 3049 | ::google::protobuf::internal::WireFormatLite::WriteString( |
| 3050 | 1, this->name(), output); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3051 | } |
| 3052 | |
| 3053 | // repeated .google.protobuf.EnumValueDescriptorProto value = 2; |
kenton@google.com | 2d6daa7 | 2009-01-22 01:27:00 +0000 | [diff] [blame] | 3054 | for (int i = 0; i < this->value_size(); i++) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 3055 | ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 3056 | 2, this->value(i), output); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3057 | } |
| 3058 | |
| 3059 | // optional .google.protobuf.EnumOptions options = 3; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 3060 | if (has_options()) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 3061 | ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 3062 | 3, this->options(), output); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3063 | } |
| 3064 | |
| 3065 | if (!unknown_fields().empty()) { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 3066 | ::google::protobuf::internal::WireFormat::SerializeUnknownFields( |
| 3067 | unknown_fields(), output); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3068 | } |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 3069 | } |
| 3070 | |
| 3071 | ::google::protobuf::uint8* EnumDescriptorProto::SerializeWithCachedSizesToArray( |
| 3072 | ::google::protobuf::uint8* target) const { |
| 3073 | // optional string name = 1; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 3074 | if (has_name()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 3075 | ::google::protobuf::internal::WireFormat::VerifyUTF8String( |
| 3076 | this->name().data(), this->name().length(), |
| 3077 | ::google::protobuf::internal::WireFormat::SERIALIZE); |
| 3078 | target = |
| 3079 | ::google::protobuf::internal::WireFormatLite::WriteStringToArray( |
| 3080 | 1, this->name(), target); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 3081 | } |
| 3082 | |
| 3083 | // repeated .google.protobuf.EnumValueDescriptorProto value = 2; |
| 3084 | for (int i = 0; i < this->value_size(); i++) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 3085 | target = ::google::protobuf::internal::WireFormatLite:: |
| 3086 | WriteMessageNoVirtualToArray( |
| 3087 | 2, this->value(i), target); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 3088 | } |
| 3089 | |
| 3090 | // optional .google.protobuf.EnumOptions options = 3; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 3091 | if (has_options()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 3092 | target = ::google::protobuf::internal::WireFormatLite:: |
| 3093 | WriteMessageNoVirtualToArray( |
| 3094 | 3, this->options(), target); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 3095 | } |
| 3096 | |
| 3097 | if (!unknown_fields().empty()) { |
| 3098 | target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( |
| 3099 | unknown_fields(), target); |
| 3100 | } |
| 3101 | return target; |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3102 | } |
| 3103 | |
| 3104 | int EnumDescriptorProto::ByteSize() const { |
| 3105 | int total_size = 0; |
| 3106 | |
| 3107 | if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { |
| 3108 | // optional string name = 1; |
| 3109 | if (has_name()) { |
| 3110 | total_size += 1 + |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 3111 | ::google::protobuf::internal::WireFormatLite::StringSize( |
| 3112 | this->name()); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3113 | } |
| 3114 | |
| 3115 | // optional .google.protobuf.EnumOptions options = 3; |
| 3116 | if (has_options()) { |
| 3117 | total_size += 1 + |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 3118 | ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3119 | this->options()); |
| 3120 | } |
| 3121 | |
| 3122 | } |
| 3123 | // repeated .google.protobuf.EnumValueDescriptorProto value = 2; |
kenton@google.com | 2d6daa7 | 2009-01-22 01:27:00 +0000 | [diff] [blame] | 3124 | total_size += 1 * this->value_size(); |
| 3125 | for (int i = 0; i < this->value_size(); i++) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3126 | total_size += |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 3127 | ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3128 | this->value(i)); |
| 3129 | } |
| 3130 | |
| 3131 | if (!unknown_fields().empty()) { |
| 3132 | total_size += |
| 3133 | ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( |
| 3134 | unknown_fields()); |
| 3135 | } |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 3136 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3137 | _cached_size_ = total_size; |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 3138 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3139 | return total_size; |
| 3140 | } |
| 3141 | |
| 3142 | void EnumDescriptorProto::MergeFrom(const ::google::protobuf::Message& from) { |
| 3143 | GOOGLE_CHECK_NE(&from, this); |
| 3144 | const EnumDescriptorProto* source = |
| 3145 | ::google::protobuf::internal::dynamic_cast_if_available<const EnumDescriptorProto*>( |
| 3146 | &from); |
| 3147 | if (source == NULL) { |
temporal | 779f61c | 2008-08-13 03:15:00 +0000 | [diff] [blame] | 3148 | ::google::protobuf::internal::ReflectionOps::Merge(from, this); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3149 | } else { |
| 3150 | MergeFrom(*source); |
| 3151 | } |
| 3152 | } |
| 3153 | |
| 3154 | void EnumDescriptorProto::MergeFrom(const EnumDescriptorProto& from) { |
| 3155 | GOOGLE_CHECK_NE(&from, this); |
| 3156 | value_.MergeFrom(from.value_); |
| 3157 | if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 3158 | if (from.has_name()) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3159 | set_name(from.name()); |
| 3160 | } |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 3161 | if (from.has_options()) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3162 | mutable_options()->::google::protobuf::EnumOptions::MergeFrom(from.options()); |
| 3163 | } |
| 3164 | } |
| 3165 | mutable_unknown_fields()->MergeFrom(from.unknown_fields()); |
| 3166 | } |
| 3167 | |
| 3168 | void EnumDescriptorProto::CopyFrom(const ::google::protobuf::Message& from) { |
| 3169 | if (&from == this) return; |
| 3170 | Clear(); |
| 3171 | MergeFrom(from); |
| 3172 | } |
| 3173 | |
| 3174 | void EnumDescriptorProto::CopyFrom(const EnumDescriptorProto& from) { |
| 3175 | if (&from == this) return; |
| 3176 | Clear(); |
| 3177 | MergeFrom(from); |
| 3178 | } |
| 3179 | |
| 3180 | bool EnumDescriptorProto::IsInitialized() const { |
| 3181 | |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 3182 | for (int i = 0; i < value_size(); i++) { |
| 3183 | if (!this->value(i).IsInitialized()) return false; |
| 3184 | } |
| 3185 | if (has_options()) { |
| 3186 | if (!this->options().IsInitialized()) return false; |
| 3187 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3188 | return true; |
| 3189 | } |
| 3190 | |
kenton@google.com | ceb561d | 2009-06-25 19:05:36 +0000 | [diff] [blame] | 3191 | void EnumDescriptorProto::Swap(EnumDescriptorProto* other) { |
| 3192 | if (other != this) { |
| 3193 | std::swap(name_, other->name_); |
| 3194 | value_.Swap(&other->value_); |
| 3195 | std::swap(options_, other->options_); |
| 3196 | std::swap(_has_bits_[0], other->_has_bits_[0]); |
| 3197 | _unknown_fields_.Swap(&other->_unknown_fields_); |
| 3198 | std::swap(_cached_size_, other->_cached_size_); |
| 3199 | } |
| 3200 | } |
| 3201 | |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 3202 | ::google::protobuf::Metadata EnumDescriptorProto::GetMetadata() const { |
| 3203 | protobuf_AssignDescriptorsOnce(); |
| 3204 | ::google::protobuf::Metadata metadata; |
| 3205 | metadata.descriptor = EnumDescriptorProto_descriptor_; |
| 3206 | metadata.reflection = EnumDescriptorProto_reflection_; |
| 3207 | return metadata; |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3208 | } |
| 3209 | |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3210 | |
| 3211 | // =================================================================== |
| 3212 | |
kenton@google.com | cfa2d8a | 2009-04-18 00:02:12 +0000 | [diff] [blame] | 3213 | #ifndef _MSC_VER |
| 3214 | const int EnumValueDescriptorProto::kNameFieldNumber; |
| 3215 | const int EnumValueDescriptorProto::kNumberFieldNumber; |
| 3216 | const int EnumValueDescriptorProto::kOptionsFieldNumber; |
| 3217 | #endif // !_MSC_VER |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3218 | |
kenton@google.com | 573989f | 2009-10-30 22:02:17 +0000 | [diff] [blame] | 3219 | EnumValueDescriptorProto::EnumValueDescriptorProto() |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 3220 | : ::google::protobuf::Message() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 3221 | SharedCtor(); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 3222 | } |
| 3223 | |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 3224 | void EnumValueDescriptorProto::InitAsDefaultInstance() { |
| 3225 | options_ = const_cast< ::google::protobuf::EnumValueOptions*>(&::google::protobuf::EnumValueOptions::default_instance()); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3226 | } |
| 3227 | |
kenton@google.com | 573989f | 2009-10-30 22:02:17 +0000 | [diff] [blame] | 3228 | EnumValueDescriptorProto::EnumValueDescriptorProto(const EnumValueDescriptorProto& from) |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 3229 | : ::google::protobuf::Message() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 3230 | SharedCtor(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3231 | MergeFrom(from); |
| 3232 | } |
| 3233 | |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 3234 | void EnumValueDescriptorProto::SharedCtor() { |
| 3235 | _cached_size_ = 0; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 3236 | name_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 3237 | number_ = 0; |
| 3238 | options_ = NULL; |
| 3239 | ::memset(_has_bits_, 0, sizeof(_has_bits_)); |
| 3240 | } |
| 3241 | |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3242 | EnumValueDescriptorProto::~EnumValueDescriptorProto() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 3243 | SharedDtor(); |
| 3244 | } |
| 3245 | |
| 3246 | void EnumValueDescriptorProto::SharedDtor() { |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 3247 | if (name_ != &::google::protobuf::internal::kEmptyString) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3248 | delete name_; |
| 3249 | } |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 3250 | if (this != default_instance_) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3251 | delete options_; |
| 3252 | } |
| 3253 | } |
| 3254 | |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 3255 | void EnumValueDescriptorProto::SetCachedSize(int size) const { |
| 3256 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
| 3257 | _cached_size_ = size; |
| 3258 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); |
| 3259 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3260 | const ::google::protobuf::Descriptor* EnumValueDescriptorProto::descriptor() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 3261 | protobuf_AssignDescriptorsOnce(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3262 | return EnumValueDescriptorProto_descriptor_; |
| 3263 | } |
| 3264 | |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 3265 | const EnumValueDescriptorProto& EnumValueDescriptorProto::default_instance() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 3266 | if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); return *default_instance_; |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 3267 | } |
| 3268 | |
| 3269 | EnumValueDescriptorProto* EnumValueDescriptorProto::default_instance_ = NULL; |
| 3270 | |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3271 | EnumValueDescriptorProto* EnumValueDescriptorProto::New() const { |
| 3272 | return new EnumValueDescriptorProto; |
| 3273 | } |
| 3274 | |
| 3275 | void EnumValueDescriptorProto::Clear() { |
| 3276 | if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 3277 | if (has_name()) { |
| 3278 | if (name_ != &::google::protobuf::internal::kEmptyString) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3279 | name_->clear(); |
| 3280 | } |
| 3281 | } |
| 3282 | number_ = 0; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 3283 | if (has_options()) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3284 | if (options_ != NULL) options_->::google::protobuf::EnumValueOptions::Clear(); |
| 3285 | } |
| 3286 | } |
| 3287 | ::memset(_has_bits_, 0, sizeof(_has_bits_)); |
| 3288 | mutable_unknown_fields()->Clear(); |
| 3289 | } |
| 3290 | |
| 3291 | bool EnumValueDescriptorProto::MergePartialFromCodedStream( |
| 3292 | ::google::protobuf::io::CodedInputStream* input) { |
| 3293 | #define DO_(EXPRESSION) if (!(EXPRESSION)) return false |
| 3294 | ::google::protobuf::uint32 tag; |
| 3295 | while ((tag = input->ReadTag()) != 0) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 3296 | switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3297 | // optional string name = 1; |
| 3298 | case 1: { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 3299 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 3300 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 3301 | DO_(::google::protobuf::internal::WireFormatLite::ReadString( |
| 3302 | input, this->mutable_name())); |
| 3303 | ::google::protobuf::internal::WireFormat::VerifyUTF8String( |
| 3304 | this->name().data(), this->name().length(), |
| 3305 | ::google::protobuf::internal::WireFormat::PARSE); |
| 3306 | } else { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3307 | goto handle_uninterpreted; |
| 3308 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3309 | if (input->ExpectTag(16)) goto parse_number; |
| 3310 | break; |
| 3311 | } |
| 3312 | |
| 3313 | // optional int32 number = 2; |
| 3314 | case 2: { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 3315 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 3316 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 3317 | parse_number: |
| 3318 | DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< |
| 3319 | ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( |
| 3320 | input, &number_))); |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 3321 | set_has_number(); |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 3322 | } else { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3323 | goto handle_uninterpreted; |
| 3324 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3325 | if (input->ExpectTag(26)) goto parse_options; |
| 3326 | break; |
| 3327 | } |
| 3328 | |
| 3329 | // optional .google.protobuf.EnumValueOptions options = 3; |
| 3330 | case 3: { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 3331 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 3332 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 3333 | parse_options: |
| 3334 | DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( |
| 3335 | input, mutable_options())); |
| 3336 | } else { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3337 | goto handle_uninterpreted; |
| 3338 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3339 | if (input->ExpectAtEnd()) return true; |
| 3340 | break; |
| 3341 | } |
| 3342 | |
| 3343 | default: { |
| 3344 | handle_uninterpreted: |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 3345 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
| 3346 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3347 | return true; |
| 3348 | } |
| 3349 | DO_(::google::protobuf::internal::WireFormat::SkipField( |
| 3350 | input, tag, mutable_unknown_fields())); |
| 3351 | break; |
| 3352 | } |
| 3353 | } |
| 3354 | } |
| 3355 | return true; |
| 3356 | #undef DO_ |
| 3357 | } |
| 3358 | |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 3359 | void EnumValueDescriptorProto::SerializeWithCachedSizes( |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3360 | ::google::protobuf::io::CodedOutputStream* output) const { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3361 | // optional string name = 1; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 3362 | if (has_name()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 3363 | ::google::protobuf::internal::WireFormat::VerifyUTF8String( |
| 3364 | this->name().data(), this->name().length(), |
| 3365 | ::google::protobuf::internal::WireFormat::SERIALIZE); |
| 3366 | ::google::protobuf::internal::WireFormatLite::WriteString( |
| 3367 | 1, this->name(), output); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3368 | } |
| 3369 | |
| 3370 | // optional int32 number = 2; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 3371 | if (has_number()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 3372 | ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->number(), output); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3373 | } |
| 3374 | |
| 3375 | // optional .google.protobuf.EnumValueOptions options = 3; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 3376 | if (has_options()) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 3377 | ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 3378 | 3, this->options(), output); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3379 | } |
| 3380 | |
| 3381 | if (!unknown_fields().empty()) { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 3382 | ::google::protobuf::internal::WireFormat::SerializeUnknownFields( |
| 3383 | unknown_fields(), output); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3384 | } |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 3385 | } |
| 3386 | |
| 3387 | ::google::protobuf::uint8* EnumValueDescriptorProto::SerializeWithCachedSizesToArray( |
| 3388 | ::google::protobuf::uint8* target) const { |
| 3389 | // optional string name = 1; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 3390 | if (has_name()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 3391 | ::google::protobuf::internal::WireFormat::VerifyUTF8String( |
| 3392 | this->name().data(), this->name().length(), |
| 3393 | ::google::protobuf::internal::WireFormat::SERIALIZE); |
| 3394 | target = |
| 3395 | ::google::protobuf::internal::WireFormatLite::WriteStringToArray( |
| 3396 | 1, this->name(), target); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 3397 | } |
| 3398 | |
| 3399 | // optional int32 number = 2; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 3400 | if (has_number()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 3401 | target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->number(), target); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 3402 | } |
| 3403 | |
| 3404 | // optional .google.protobuf.EnumValueOptions options = 3; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 3405 | if (has_options()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 3406 | target = ::google::protobuf::internal::WireFormatLite:: |
| 3407 | WriteMessageNoVirtualToArray( |
| 3408 | 3, this->options(), target); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 3409 | } |
| 3410 | |
| 3411 | if (!unknown_fields().empty()) { |
| 3412 | target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( |
| 3413 | unknown_fields(), target); |
| 3414 | } |
| 3415 | return target; |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3416 | } |
| 3417 | |
| 3418 | int EnumValueDescriptorProto::ByteSize() const { |
| 3419 | int total_size = 0; |
| 3420 | |
| 3421 | if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { |
| 3422 | // optional string name = 1; |
| 3423 | if (has_name()) { |
| 3424 | total_size += 1 + |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 3425 | ::google::protobuf::internal::WireFormatLite::StringSize( |
| 3426 | this->name()); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3427 | } |
| 3428 | |
| 3429 | // optional int32 number = 2; |
| 3430 | if (has_number()) { |
| 3431 | total_size += 1 + |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 3432 | ::google::protobuf::internal::WireFormatLite::Int32Size( |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3433 | this->number()); |
| 3434 | } |
| 3435 | |
| 3436 | // optional .google.protobuf.EnumValueOptions options = 3; |
| 3437 | if (has_options()) { |
| 3438 | total_size += 1 + |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 3439 | ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3440 | this->options()); |
| 3441 | } |
| 3442 | |
| 3443 | } |
| 3444 | if (!unknown_fields().empty()) { |
| 3445 | total_size += |
| 3446 | ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( |
| 3447 | unknown_fields()); |
| 3448 | } |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 3449 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3450 | _cached_size_ = total_size; |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 3451 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3452 | return total_size; |
| 3453 | } |
| 3454 | |
| 3455 | void EnumValueDescriptorProto::MergeFrom(const ::google::protobuf::Message& from) { |
| 3456 | GOOGLE_CHECK_NE(&from, this); |
| 3457 | const EnumValueDescriptorProto* source = |
| 3458 | ::google::protobuf::internal::dynamic_cast_if_available<const EnumValueDescriptorProto*>( |
| 3459 | &from); |
| 3460 | if (source == NULL) { |
temporal | 779f61c | 2008-08-13 03:15:00 +0000 | [diff] [blame] | 3461 | ::google::protobuf::internal::ReflectionOps::Merge(from, this); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3462 | } else { |
| 3463 | MergeFrom(*source); |
| 3464 | } |
| 3465 | } |
| 3466 | |
| 3467 | void EnumValueDescriptorProto::MergeFrom(const EnumValueDescriptorProto& from) { |
| 3468 | GOOGLE_CHECK_NE(&from, this); |
| 3469 | if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 3470 | if (from.has_name()) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3471 | set_name(from.name()); |
| 3472 | } |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 3473 | if (from.has_number()) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3474 | set_number(from.number()); |
| 3475 | } |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 3476 | if (from.has_options()) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3477 | mutable_options()->::google::protobuf::EnumValueOptions::MergeFrom(from.options()); |
| 3478 | } |
| 3479 | } |
| 3480 | mutable_unknown_fields()->MergeFrom(from.unknown_fields()); |
| 3481 | } |
| 3482 | |
| 3483 | void EnumValueDescriptorProto::CopyFrom(const ::google::protobuf::Message& from) { |
| 3484 | if (&from == this) return; |
| 3485 | Clear(); |
| 3486 | MergeFrom(from); |
| 3487 | } |
| 3488 | |
| 3489 | void EnumValueDescriptorProto::CopyFrom(const EnumValueDescriptorProto& from) { |
| 3490 | if (&from == this) return; |
| 3491 | Clear(); |
| 3492 | MergeFrom(from); |
| 3493 | } |
| 3494 | |
kenton@google.com | ceb561d | 2009-06-25 19:05:36 +0000 | [diff] [blame] | 3495 | bool EnumValueDescriptorProto::IsInitialized() const { |
| 3496 | |
| 3497 | if (has_options()) { |
| 3498 | if (!this->options().IsInitialized()) return false; |
| 3499 | } |
| 3500 | return true; |
| 3501 | } |
| 3502 | |
kenton@google.com | 26bd9ee | 2008-11-21 00:06:27 +0000 | [diff] [blame] | 3503 | void EnumValueDescriptorProto::Swap(EnumValueDescriptorProto* other) { |
| 3504 | if (other != this) { |
| 3505 | std::swap(name_, other->name_); |
| 3506 | std::swap(number_, other->number_); |
| 3507 | std::swap(options_, other->options_); |
| 3508 | std::swap(_has_bits_[0], other->_has_bits_[0]); |
| 3509 | _unknown_fields_.Swap(&other->_unknown_fields_); |
| 3510 | std::swap(_cached_size_, other->_cached_size_); |
| 3511 | } |
| 3512 | } |
| 3513 | |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 3514 | ::google::protobuf::Metadata EnumValueDescriptorProto::GetMetadata() const { |
| 3515 | protobuf_AssignDescriptorsOnce(); |
| 3516 | ::google::protobuf::Metadata metadata; |
| 3517 | metadata.descriptor = EnumValueDescriptorProto_descriptor_; |
| 3518 | metadata.reflection = EnumValueDescriptorProto_reflection_; |
| 3519 | return metadata; |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3520 | } |
| 3521 | |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3522 | |
| 3523 | // =================================================================== |
| 3524 | |
kenton@google.com | cfa2d8a | 2009-04-18 00:02:12 +0000 | [diff] [blame] | 3525 | #ifndef _MSC_VER |
| 3526 | const int ServiceDescriptorProto::kNameFieldNumber; |
| 3527 | const int ServiceDescriptorProto::kMethodFieldNumber; |
| 3528 | const int ServiceDescriptorProto::kOptionsFieldNumber; |
| 3529 | #endif // !_MSC_VER |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3530 | |
kenton@google.com | 573989f | 2009-10-30 22:02:17 +0000 | [diff] [blame] | 3531 | ServiceDescriptorProto::ServiceDescriptorProto() |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 3532 | : ::google::protobuf::Message() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 3533 | SharedCtor(); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 3534 | } |
| 3535 | |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 3536 | void ServiceDescriptorProto::InitAsDefaultInstance() { |
| 3537 | options_ = const_cast< ::google::protobuf::ServiceOptions*>(&::google::protobuf::ServiceOptions::default_instance()); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3538 | } |
| 3539 | |
kenton@google.com | 573989f | 2009-10-30 22:02:17 +0000 | [diff] [blame] | 3540 | ServiceDescriptorProto::ServiceDescriptorProto(const ServiceDescriptorProto& from) |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 3541 | : ::google::protobuf::Message() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 3542 | SharedCtor(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3543 | MergeFrom(from); |
| 3544 | } |
| 3545 | |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 3546 | void ServiceDescriptorProto::SharedCtor() { |
| 3547 | _cached_size_ = 0; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 3548 | name_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 3549 | options_ = NULL; |
| 3550 | ::memset(_has_bits_, 0, sizeof(_has_bits_)); |
| 3551 | } |
| 3552 | |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3553 | ServiceDescriptorProto::~ServiceDescriptorProto() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 3554 | SharedDtor(); |
| 3555 | } |
| 3556 | |
| 3557 | void ServiceDescriptorProto::SharedDtor() { |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 3558 | if (name_ != &::google::protobuf::internal::kEmptyString) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3559 | delete name_; |
| 3560 | } |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 3561 | if (this != default_instance_) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3562 | delete options_; |
| 3563 | } |
| 3564 | } |
| 3565 | |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 3566 | void ServiceDescriptorProto::SetCachedSize(int size) const { |
| 3567 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
| 3568 | _cached_size_ = size; |
| 3569 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); |
| 3570 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3571 | const ::google::protobuf::Descriptor* ServiceDescriptorProto::descriptor() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 3572 | protobuf_AssignDescriptorsOnce(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3573 | return ServiceDescriptorProto_descriptor_; |
| 3574 | } |
| 3575 | |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 3576 | const ServiceDescriptorProto& ServiceDescriptorProto::default_instance() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 3577 | if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); return *default_instance_; |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 3578 | } |
| 3579 | |
| 3580 | ServiceDescriptorProto* ServiceDescriptorProto::default_instance_ = NULL; |
| 3581 | |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3582 | ServiceDescriptorProto* ServiceDescriptorProto::New() const { |
| 3583 | return new ServiceDescriptorProto; |
| 3584 | } |
| 3585 | |
| 3586 | void ServiceDescriptorProto::Clear() { |
| 3587 | if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 3588 | if (has_name()) { |
| 3589 | if (name_ != &::google::protobuf::internal::kEmptyString) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3590 | name_->clear(); |
| 3591 | } |
| 3592 | } |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 3593 | if (has_options()) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3594 | if (options_ != NULL) options_->::google::protobuf::ServiceOptions::Clear(); |
| 3595 | } |
| 3596 | } |
| 3597 | method_.Clear(); |
| 3598 | ::memset(_has_bits_, 0, sizeof(_has_bits_)); |
| 3599 | mutable_unknown_fields()->Clear(); |
| 3600 | } |
| 3601 | |
| 3602 | bool ServiceDescriptorProto::MergePartialFromCodedStream( |
| 3603 | ::google::protobuf::io::CodedInputStream* input) { |
| 3604 | #define DO_(EXPRESSION) if (!(EXPRESSION)) return false |
| 3605 | ::google::protobuf::uint32 tag; |
| 3606 | while ((tag = input->ReadTag()) != 0) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 3607 | switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3608 | // optional string name = 1; |
| 3609 | case 1: { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 3610 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 3611 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 3612 | DO_(::google::protobuf::internal::WireFormatLite::ReadString( |
| 3613 | input, this->mutable_name())); |
| 3614 | ::google::protobuf::internal::WireFormat::VerifyUTF8String( |
| 3615 | this->name().data(), this->name().length(), |
| 3616 | ::google::protobuf::internal::WireFormat::PARSE); |
| 3617 | } else { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3618 | goto handle_uninterpreted; |
| 3619 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3620 | if (input->ExpectTag(18)) goto parse_method; |
| 3621 | break; |
| 3622 | } |
| 3623 | |
| 3624 | // repeated .google.protobuf.MethodDescriptorProto method = 2; |
| 3625 | case 2: { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 3626 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 3627 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 3628 | parse_method: |
| 3629 | DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( |
| 3630 | input, add_method())); |
| 3631 | } else { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3632 | goto handle_uninterpreted; |
| 3633 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3634 | if (input->ExpectTag(18)) goto parse_method; |
| 3635 | if (input->ExpectTag(26)) goto parse_options; |
| 3636 | break; |
| 3637 | } |
| 3638 | |
| 3639 | // optional .google.protobuf.ServiceOptions options = 3; |
| 3640 | case 3: { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 3641 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 3642 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 3643 | parse_options: |
| 3644 | DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( |
| 3645 | input, mutable_options())); |
| 3646 | } else { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3647 | goto handle_uninterpreted; |
| 3648 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3649 | if (input->ExpectAtEnd()) return true; |
| 3650 | break; |
| 3651 | } |
| 3652 | |
| 3653 | default: { |
| 3654 | handle_uninterpreted: |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 3655 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
| 3656 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3657 | return true; |
| 3658 | } |
| 3659 | DO_(::google::protobuf::internal::WireFormat::SkipField( |
| 3660 | input, tag, mutable_unknown_fields())); |
| 3661 | break; |
| 3662 | } |
| 3663 | } |
| 3664 | } |
| 3665 | return true; |
| 3666 | #undef DO_ |
| 3667 | } |
| 3668 | |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 3669 | void ServiceDescriptorProto::SerializeWithCachedSizes( |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3670 | ::google::protobuf::io::CodedOutputStream* output) const { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3671 | // optional string name = 1; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 3672 | if (has_name()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 3673 | ::google::protobuf::internal::WireFormat::VerifyUTF8String( |
| 3674 | this->name().data(), this->name().length(), |
| 3675 | ::google::protobuf::internal::WireFormat::SERIALIZE); |
| 3676 | ::google::protobuf::internal::WireFormatLite::WriteString( |
| 3677 | 1, this->name(), output); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3678 | } |
| 3679 | |
| 3680 | // repeated .google.protobuf.MethodDescriptorProto method = 2; |
kenton@google.com | 2d6daa7 | 2009-01-22 01:27:00 +0000 | [diff] [blame] | 3681 | for (int i = 0; i < this->method_size(); i++) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 3682 | ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 3683 | 2, this->method(i), output); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3684 | } |
| 3685 | |
| 3686 | // optional .google.protobuf.ServiceOptions options = 3; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 3687 | if (has_options()) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 3688 | ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 3689 | 3, this->options(), output); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3690 | } |
| 3691 | |
| 3692 | if (!unknown_fields().empty()) { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 3693 | ::google::protobuf::internal::WireFormat::SerializeUnknownFields( |
| 3694 | unknown_fields(), output); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3695 | } |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 3696 | } |
| 3697 | |
| 3698 | ::google::protobuf::uint8* ServiceDescriptorProto::SerializeWithCachedSizesToArray( |
| 3699 | ::google::protobuf::uint8* target) const { |
| 3700 | // optional string name = 1; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 3701 | if (has_name()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 3702 | ::google::protobuf::internal::WireFormat::VerifyUTF8String( |
| 3703 | this->name().data(), this->name().length(), |
| 3704 | ::google::protobuf::internal::WireFormat::SERIALIZE); |
| 3705 | target = |
| 3706 | ::google::protobuf::internal::WireFormatLite::WriteStringToArray( |
| 3707 | 1, this->name(), target); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 3708 | } |
| 3709 | |
| 3710 | // repeated .google.protobuf.MethodDescriptorProto method = 2; |
| 3711 | for (int i = 0; i < this->method_size(); i++) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 3712 | target = ::google::protobuf::internal::WireFormatLite:: |
| 3713 | WriteMessageNoVirtualToArray( |
| 3714 | 2, this->method(i), target); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 3715 | } |
| 3716 | |
| 3717 | // optional .google.protobuf.ServiceOptions options = 3; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 3718 | if (has_options()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 3719 | target = ::google::protobuf::internal::WireFormatLite:: |
| 3720 | WriteMessageNoVirtualToArray( |
| 3721 | 3, this->options(), target); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 3722 | } |
| 3723 | |
| 3724 | if (!unknown_fields().empty()) { |
| 3725 | target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( |
| 3726 | unknown_fields(), target); |
| 3727 | } |
| 3728 | return target; |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3729 | } |
| 3730 | |
| 3731 | int ServiceDescriptorProto::ByteSize() const { |
| 3732 | int total_size = 0; |
| 3733 | |
| 3734 | if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { |
| 3735 | // optional string name = 1; |
| 3736 | if (has_name()) { |
| 3737 | total_size += 1 + |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 3738 | ::google::protobuf::internal::WireFormatLite::StringSize( |
| 3739 | this->name()); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3740 | } |
| 3741 | |
| 3742 | // optional .google.protobuf.ServiceOptions options = 3; |
| 3743 | if (has_options()) { |
| 3744 | total_size += 1 + |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 3745 | ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3746 | this->options()); |
| 3747 | } |
| 3748 | |
| 3749 | } |
| 3750 | // repeated .google.protobuf.MethodDescriptorProto method = 2; |
kenton@google.com | 2d6daa7 | 2009-01-22 01:27:00 +0000 | [diff] [blame] | 3751 | total_size += 1 * this->method_size(); |
| 3752 | for (int i = 0; i < this->method_size(); i++) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3753 | total_size += |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 3754 | ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3755 | this->method(i)); |
| 3756 | } |
| 3757 | |
| 3758 | if (!unknown_fields().empty()) { |
| 3759 | total_size += |
| 3760 | ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( |
| 3761 | unknown_fields()); |
| 3762 | } |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 3763 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3764 | _cached_size_ = total_size; |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 3765 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3766 | return total_size; |
| 3767 | } |
| 3768 | |
| 3769 | void ServiceDescriptorProto::MergeFrom(const ::google::protobuf::Message& from) { |
| 3770 | GOOGLE_CHECK_NE(&from, this); |
| 3771 | const ServiceDescriptorProto* source = |
| 3772 | ::google::protobuf::internal::dynamic_cast_if_available<const ServiceDescriptorProto*>( |
| 3773 | &from); |
| 3774 | if (source == NULL) { |
temporal | 779f61c | 2008-08-13 03:15:00 +0000 | [diff] [blame] | 3775 | ::google::protobuf::internal::ReflectionOps::Merge(from, this); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3776 | } else { |
| 3777 | MergeFrom(*source); |
| 3778 | } |
| 3779 | } |
| 3780 | |
| 3781 | void ServiceDescriptorProto::MergeFrom(const ServiceDescriptorProto& from) { |
| 3782 | GOOGLE_CHECK_NE(&from, this); |
| 3783 | method_.MergeFrom(from.method_); |
| 3784 | if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 3785 | if (from.has_name()) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3786 | set_name(from.name()); |
| 3787 | } |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 3788 | if (from.has_options()) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3789 | mutable_options()->::google::protobuf::ServiceOptions::MergeFrom(from.options()); |
| 3790 | } |
| 3791 | } |
| 3792 | mutable_unknown_fields()->MergeFrom(from.unknown_fields()); |
| 3793 | } |
| 3794 | |
| 3795 | void ServiceDescriptorProto::CopyFrom(const ::google::protobuf::Message& from) { |
| 3796 | if (&from == this) return; |
| 3797 | Clear(); |
| 3798 | MergeFrom(from); |
| 3799 | } |
| 3800 | |
| 3801 | void ServiceDescriptorProto::CopyFrom(const ServiceDescriptorProto& from) { |
| 3802 | if (&from == this) return; |
| 3803 | Clear(); |
| 3804 | MergeFrom(from); |
| 3805 | } |
| 3806 | |
| 3807 | bool ServiceDescriptorProto::IsInitialized() const { |
| 3808 | |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 3809 | for (int i = 0; i < method_size(); i++) { |
| 3810 | if (!this->method(i).IsInitialized()) return false; |
| 3811 | } |
| 3812 | if (has_options()) { |
| 3813 | if (!this->options().IsInitialized()) return false; |
| 3814 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3815 | return true; |
| 3816 | } |
| 3817 | |
kenton@google.com | ceb561d | 2009-06-25 19:05:36 +0000 | [diff] [blame] | 3818 | void ServiceDescriptorProto::Swap(ServiceDescriptorProto* other) { |
| 3819 | if (other != this) { |
| 3820 | std::swap(name_, other->name_); |
| 3821 | method_.Swap(&other->method_); |
| 3822 | std::swap(options_, other->options_); |
| 3823 | std::swap(_has_bits_[0], other->_has_bits_[0]); |
| 3824 | _unknown_fields_.Swap(&other->_unknown_fields_); |
| 3825 | std::swap(_cached_size_, other->_cached_size_); |
| 3826 | } |
| 3827 | } |
| 3828 | |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 3829 | ::google::protobuf::Metadata ServiceDescriptorProto::GetMetadata() const { |
| 3830 | protobuf_AssignDescriptorsOnce(); |
| 3831 | ::google::protobuf::Metadata metadata; |
| 3832 | metadata.descriptor = ServiceDescriptorProto_descriptor_; |
| 3833 | metadata.reflection = ServiceDescriptorProto_reflection_; |
| 3834 | return metadata; |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3835 | } |
| 3836 | |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3837 | |
| 3838 | // =================================================================== |
| 3839 | |
kenton@google.com | cfa2d8a | 2009-04-18 00:02:12 +0000 | [diff] [blame] | 3840 | #ifndef _MSC_VER |
| 3841 | const int MethodDescriptorProto::kNameFieldNumber; |
| 3842 | const int MethodDescriptorProto::kInputTypeFieldNumber; |
| 3843 | const int MethodDescriptorProto::kOutputTypeFieldNumber; |
| 3844 | const int MethodDescriptorProto::kOptionsFieldNumber; |
| 3845 | #endif // !_MSC_VER |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3846 | |
kenton@google.com | 573989f | 2009-10-30 22:02:17 +0000 | [diff] [blame] | 3847 | MethodDescriptorProto::MethodDescriptorProto() |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 3848 | : ::google::protobuf::Message() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 3849 | SharedCtor(); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 3850 | } |
| 3851 | |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 3852 | void MethodDescriptorProto::InitAsDefaultInstance() { |
| 3853 | options_ = const_cast< ::google::protobuf::MethodOptions*>(&::google::protobuf::MethodOptions::default_instance()); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3854 | } |
| 3855 | |
kenton@google.com | 573989f | 2009-10-30 22:02:17 +0000 | [diff] [blame] | 3856 | MethodDescriptorProto::MethodDescriptorProto(const MethodDescriptorProto& from) |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 3857 | : ::google::protobuf::Message() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 3858 | SharedCtor(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3859 | MergeFrom(from); |
| 3860 | } |
| 3861 | |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 3862 | void MethodDescriptorProto::SharedCtor() { |
| 3863 | _cached_size_ = 0; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 3864 | name_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); |
| 3865 | input_type_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); |
| 3866 | output_type_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 3867 | options_ = NULL; |
| 3868 | ::memset(_has_bits_, 0, sizeof(_has_bits_)); |
| 3869 | } |
| 3870 | |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3871 | MethodDescriptorProto::~MethodDescriptorProto() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 3872 | SharedDtor(); |
| 3873 | } |
| 3874 | |
| 3875 | void MethodDescriptorProto::SharedDtor() { |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 3876 | if (name_ != &::google::protobuf::internal::kEmptyString) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3877 | delete name_; |
| 3878 | } |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 3879 | if (input_type_ != &::google::protobuf::internal::kEmptyString) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3880 | delete input_type_; |
| 3881 | } |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 3882 | if (output_type_ != &::google::protobuf::internal::kEmptyString) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3883 | delete output_type_; |
| 3884 | } |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 3885 | if (this != default_instance_) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3886 | delete options_; |
| 3887 | } |
| 3888 | } |
| 3889 | |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 3890 | void MethodDescriptorProto::SetCachedSize(int size) const { |
| 3891 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
| 3892 | _cached_size_ = size; |
| 3893 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); |
| 3894 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3895 | const ::google::protobuf::Descriptor* MethodDescriptorProto::descriptor() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 3896 | protobuf_AssignDescriptorsOnce(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3897 | return MethodDescriptorProto_descriptor_; |
| 3898 | } |
| 3899 | |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 3900 | const MethodDescriptorProto& MethodDescriptorProto::default_instance() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 3901 | if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); return *default_instance_; |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 3902 | } |
| 3903 | |
| 3904 | MethodDescriptorProto* MethodDescriptorProto::default_instance_ = NULL; |
| 3905 | |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3906 | MethodDescriptorProto* MethodDescriptorProto::New() const { |
| 3907 | return new MethodDescriptorProto; |
| 3908 | } |
| 3909 | |
| 3910 | void MethodDescriptorProto::Clear() { |
| 3911 | if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 3912 | if (has_name()) { |
| 3913 | if (name_ != &::google::protobuf::internal::kEmptyString) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3914 | name_->clear(); |
| 3915 | } |
| 3916 | } |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 3917 | if (has_input_type()) { |
| 3918 | if (input_type_ != &::google::protobuf::internal::kEmptyString) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3919 | input_type_->clear(); |
| 3920 | } |
| 3921 | } |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 3922 | if (has_output_type()) { |
| 3923 | if (output_type_ != &::google::protobuf::internal::kEmptyString) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3924 | output_type_->clear(); |
| 3925 | } |
| 3926 | } |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 3927 | if (has_options()) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3928 | if (options_ != NULL) options_->::google::protobuf::MethodOptions::Clear(); |
| 3929 | } |
| 3930 | } |
| 3931 | ::memset(_has_bits_, 0, sizeof(_has_bits_)); |
| 3932 | mutable_unknown_fields()->Clear(); |
| 3933 | } |
| 3934 | |
| 3935 | bool MethodDescriptorProto::MergePartialFromCodedStream( |
| 3936 | ::google::protobuf::io::CodedInputStream* input) { |
| 3937 | #define DO_(EXPRESSION) if (!(EXPRESSION)) return false |
| 3938 | ::google::protobuf::uint32 tag; |
| 3939 | while ((tag = input->ReadTag()) != 0) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 3940 | switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3941 | // optional string name = 1; |
| 3942 | case 1: { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 3943 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 3944 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 3945 | DO_(::google::protobuf::internal::WireFormatLite::ReadString( |
| 3946 | input, this->mutable_name())); |
| 3947 | ::google::protobuf::internal::WireFormat::VerifyUTF8String( |
| 3948 | this->name().data(), this->name().length(), |
| 3949 | ::google::protobuf::internal::WireFormat::PARSE); |
| 3950 | } else { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3951 | goto handle_uninterpreted; |
| 3952 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3953 | if (input->ExpectTag(18)) goto parse_input_type; |
| 3954 | break; |
| 3955 | } |
| 3956 | |
| 3957 | // optional string input_type = 2; |
| 3958 | case 2: { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 3959 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 3960 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 3961 | parse_input_type: |
| 3962 | DO_(::google::protobuf::internal::WireFormatLite::ReadString( |
| 3963 | input, this->mutable_input_type())); |
| 3964 | ::google::protobuf::internal::WireFormat::VerifyUTF8String( |
| 3965 | this->input_type().data(), this->input_type().length(), |
| 3966 | ::google::protobuf::internal::WireFormat::PARSE); |
| 3967 | } else { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3968 | goto handle_uninterpreted; |
| 3969 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3970 | if (input->ExpectTag(26)) goto parse_output_type; |
| 3971 | break; |
| 3972 | } |
| 3973 | |
| 3974 | // optional string output_type = 3; |
| 3975 | case 3: { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 3976 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 3977 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 3978 | parse_output_type: |
| 3979 | DO_(::google::protobuf::internal::WireFormatLite::ReadString( |
| 3980 | input, this->mutable_output_type())); |
| 3981 | ::google::protobuf::internal::WireFormat::VerifyUTF8String( |
| 3982 | this->output_type().data(), this->output_type().length(), |
| 3983 | ::google::protobuf::internal::WireFormat::PARSE); |
| 3984 | } else { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3985 | goto handle_uninterpreted; |
| 3986 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3987 | if (input->ExpectTag(34)) goto parse_options; |
| 3988 | break; |
| 3989 | } |
| 3990 | |
| 3991 | // optional .google.protobuf.MethodOptions options = 4; |
| 3992 | case 4: { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 3993 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 3994 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 3995 | parse_options: |
| 3996 | DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( |
| 3997 | input, mutable_options())); |
| 3998 | } else { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 3999 | goto handle_uninterpreted; |
| 4000 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4001 | if (input->ExpectAtEnd()) return true; |
| 4002 | break; |
| 4003 | } |
| 4004 | |
| 4005 | default: { |
| 4006 | handle_uninterpreted: |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 4007 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
| 4008 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4009 | return true; |
| 4010 | } |
| 4011 | DO_(::google::protobuf::internal::WireFormat::SkipField( |
| 4012 | input, tag, mutable_unknown_fields())); |
| 4013 | break; |
| 4014 | } |
| 4015 | } |
| 4016 | } |
| 4017 | return true; |
| 4018 | #undef DO_ |
| 4019 | } |
| 4020 | |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 4021 | void MethodDescriptorProto::SerializeWithCachedSizes( |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4022 | ::google::protobuf::io::CodedOutputStream* output) const { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4023 | // optional string name = 1; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 4024 | if (has_name()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 4025 | ::google::protobuf::internal::WireFormat::VerifyUTF8String( |
| 4026 | this->name().data(), this->name().length(), |
| 4027 | ::google::protobuf::internal::WireFormat::SERIALIZE); |
| 4028 | ::google::protobuf::internal::WireFormatLite::WriteString( |
| 4029 | 1, this->name(), output); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4030 | } |
| 4031 | |
| 4032 | // optional string input_type = 2; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 4033 | if (has_input_type()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 4034 | ::google::protobuf::internal::WireFormat::VerifyUTF8String( |
| 4035 | this->input_type().data(), this->input_type().length(), |
| 4036 | ::google::protobuf::internal::WireFormat::SERIALIZE); |
| 4037 | ::google::protobuf::internal::WireFormatLite::WriteString( |
| 4038 | 2, this->input_type(), output); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4039 | } |
| 4040 | |
| 4041 | // optional string output_type = 3; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 4042 | if (has_output_type()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 4043 | ::google::protobuf::internal::WireFormat::VerifyUTF8String( |
| 4044 | this->output_type().data(), this->output_type().length(), |
| 4045 | ::google::protobuf::internal::WireFormat::SERIALIZE); |
| 4046 | ::google::protobuf::internal::WireFormatLite::WriteString( |
| 4047 | 3, this->output_type(), output); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4048 | } |
| 4049 | |
| 4050 | // optional .google.protobuf.MethodOptions options = 4; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 4051 | if (has_options()) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 4052 | ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 4053 | 4, this->options(), output); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4054 | } |
| 4055 | |
| 4056 | if (!unknown_fields().empty()) { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 4057 | ::google::protobuf::internal::WireFormat::SerializeUnknownFields( |
| 4058 | unknown_fields(), output); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4059 | } |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 4060 | } |
| 4061 | |
| 4062 | ::google::protobuf::uint8* MethodDescriptorProto::SerializeWithCachedSizesToArray( |
| 4063 | ::google::protobuf::uint8* target) const { |
| 4064 | // optional string name = 1; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 4065 | if (has_name()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 4066 | ::google::protobuf::internal::WireFormat::VerifyUTF8String( |
| 4067 | this->name().data(), this->name().length(), |
| 4068 | ::google::protobuf::internal::WireFormat::SERIALIZE); |
| 4069 | target = |
| 4070 | ::google::protobuf::internal::WireFormatLite::WriteStringToArray( |
| 4071 | 1, this->name(), target); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 4072 | } |
| 4073 | |
| 4074 | // optional string input_type = 2; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 4075 | if (has_input_type()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 4076 | ::google::protobuf::internal::WireFormat::VerifyUTF8String( |
| 4077 | this->input_type().data(), this->input_type().length(), |
| 4078 | ::google::protobuf::internal::WireFormat::SERIALIZE); |
| 4079 | target = |
| 4080 | ::google::protobuf::internal::WireFormatLite::WriteStringToArray( |
| 4081 | 2, this->input_type(), target); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 4082 | } |
| 4083 | |
| 4084 | // optional string output_type = 3; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 4085 | if (has_output_type()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 4086 | ::google::protobuf::internal::WireFormat::VerifyUTF8String( |
| 4087 | this->output_type().data(), this->output_type().length(), |
| 4088 | ::google::protobuf::internal::WireFormat::SERIALIZE); |
| 4089 | target = |
| 4090 | ::google::protobuf::internal::WireFormatLite::WriteStringToArray( |
| 4091 | 3, this->output_type(), target); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 4092 | } |
| 4093 | |
| 4094 | // optional .google.protobuf.MethodOptions options = 4; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 4095 | if (has_options()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 4096 | target = ::google::protobuf::internal::WireFormatLite:: |
| 4097 | WriteMessageNoVirtualToArray( |
| 4098 | 4, this->options(), target); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 4099 | } |
| 4100 | |
| 4101 | if (!unknown_fields().empty()) { |
| 4102 | target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( |
| 4103 | unknown_fields(), target); |
| 4104 | } |
| 4105 | return target; |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4106 | } |
| 4107 | |
| 4108 | int MethodDescriptorProto::ByteSize() const { |
| 4109 | int total_size = 0; |
| 4110 | |
| 4111 | if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { |
| 4112 | // optional string name = 1; |
| 4113 | if (has_name()) { |
| 4114 | total_size += 1 + |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 4115 | ::google::protobuf::internal::WireFormatLite::StringSize( |
| 4116 | this->name()); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4117 | } |
| 4118 | |
| 4119 | // optional string input_type = 2; |
| 4120 | if (has_input_type()) { |
| 4121 | total_size += 1 + |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 4122 | ::google::protobuf::internal::WireFormatLite::StringSize( |
| 4123 | this->input_type()); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4124 | } |
| 4125 | |
| 4126 | // optional string output_type = 3; |
| 4127 | if (has_output_type()) { |
| 4128 | total_size += 1 + |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 4129 | ::google::protobuf::internal::WireFormatLite::StringSize( |
| 4130 | this->output_type()); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4131 | } |
| 4132 | |
| 4133 | // optional .google.protobuf.MethodOptions options = 4; |
| 4134 | if (has_options()) { |
| 4135 | total_size += 1 + |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 4136 | ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4137 | this->options()); |
| 4138 | } |
| 4139 | |
| 4140 | } |
| 4141 | if (!unknown_fields().empty()) { |
| 4142 | total_size += |
| 4143 | ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( |
| 4144 | unknown_fields()); |
| 4145 | } |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 4146 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4147 | _cached_size_ = total_size; |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 4148 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4149 | return total_size; |
| 4150 | } |
| 4151 | |
| 4152 | void MethodDescriptorProto::MergeFrom(const ::google::protobuf::Message& from) { |
| 4153 | GOOGLE_CHECK_NE(&from, this); |
| 4154 | const MethodDescriptorProto* source = |
| 4155 | ::google::protobuf::internal::dynamic_cast_if_available<const MethodDescriptorProto*>( |
| 4156 | &from); |
| 4157 | if (source == NULL) { |
temporal | 779f61c | 2008-08-13 03:15:00 +0000 | [diff] [blame] | 4158 | ::google::protobuf::internal::ReflectionOps::Merge(from, this); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4159 | } else { |
| 4160 | MergeFrom(*source); |
| 4161 | } |
| 4162 | } |
| 4163 | |
| 4164 | void MethodDescriptorProto::MergeFrom(const MethodDescriptorProto& from) { |
| 4165 | GOOGLE_CHECK_NE(&from, this); |
| 4166 | if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 4167 | if (from.has_name()) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4168 | set_name(from.name()); |
| 4169 | } |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 4170 | if (from.has_input_type()) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4171 | set_input_type(from.input_type()); |
| 4172 | } |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 4173 | if (from.has_output_type()) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4174 | set_output_type(from.output_type()); |
| 4175 | } |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 4176 | if (from.has_options()) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4177 | mutable_options()->::google::protobuf::MethodOptions::MergeFrom(from.options()); |
| 4178 | } |
| 4179 | } |
| 4180 | mutable_unknown_fields()->MergeFrom(from.unknown_fields()); |
| 4181 | } |
| 4182 | |
| 4183 | void MethodDescriptorProto::CopyFrom(const ::google::protobuf::Message& from) { |
| 4184 | if (&from == this) return; |
| 4185 | Clear(); |
| 4186 | MergeFrom(from); |
| 4187 | } |
| 4188 | |
| 4189 | void MethodDescriptorProto::CopyFrom(const MethodDescriptorProto& from) { |
| 4190 | if (&from == this) return; |
| 4191 | Clear(); |
| 4192 | MergeFrom(from); |
| 4193 | } |
| 4194 | |
kenton@google.com | ceb561d | 2009-06-25 19:05:36 +0000 | [diff] [blame] | 4195 | bool MethodDescriptorProto::IsInitialized() const { |
| 4196 | |
| 4197 | if (has_options()) { |
| 4198 | if (!this->options().IsInitialized()) return false; |
| 4199 | } |
| 4200 | return true; |
| 4201 | } |
| 4202 | |
kenton@google.com | 26bd9ee | 2008-11-21 00:06:27 +0000 | [diff] [blame] | 4203 | void MethodDescriptorProto::Swap(MethodDescriptorProto* other) { |
| 4204 | if (other != this) { |
| 4205 | std::swap(name_, other->name_); |
| 4206 | std::swap(input_type_, other->input_type_); |
| 4207 | std::swap(output_type_, other->output_type_); |
| 4208 | std::swap(options_, other->options_); |
| 4209 | std::swap(_has_bits_[0], other->_has_bits_[0]); |
| 4210 | _unknown_fields_.Swap(&other->_unknown_fields_); |
| 4211 | std::swap(_cached_size_, other->_cached_size_); |
| 4212 | } |
| 4213 | } |
| 4214 | |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 4215 | ::google::protobuf::Metadata MethodDescriptorProto::GetMetadata() const { |
| 4216 | protobuf_AssignDescriptorsOnce(); |
| 4217 | ::google::protobuf::Metadata metadata; |
| 4218 | metadata.descriptor = MethodDescriptorProto_descriptor_; |
| 4219 | metadata.reflection = MethodDescriptorProto_reflection_; |
| 4220 | return metadata; |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4221 | } |
| 4222 | |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4223 | |
| 4224 | // =================================================================== |
| 4225 | |
| 4226 | const ::google::protobuf::EnumDescriptor* FileOptions_OptimizeMode_descriptor() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 4227 | protobuf_AssignDescriptorsOnce(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4228 | return FileOptions_OptimizeMode_descriptor_; |
| 4229 | } |
| 4230 | bool FileOptions_OptimizeMode_IsValid(int value) { |
| 4231 | switch(value) { |
| 4232 | case 1: |
| 4233 | case 2: |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 4234 | case 3: |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4235 | return true; |
| 4236 | default: |
| 4237 | return false; |
| 4238 | } |
| 4239 | } |
| 4240 | |
| 4241 | #ifndef _MSC_VER |
| 4242 | const FileOptions_OptimizeMode FileOptions::SPEED; |
| 4243 | const FileOptions_OptimizeMode FileOptions::CODE_SIZE; |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 4244 | const FileOptions_OptimizeMode FileOptions::LITE_RUNTIME; |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4245 | const FileOptions_OptimizeMode FileOptions::OptimizeMode_MIN; |
| 4246 | const FileOptions_OptimizeMode FileOptions::OptimizeMode_MAX; |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 4247 | const int FileOptions::OptimizeMode_ARRAYSIZE; |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4248 | #endif // _MSC_VER |
kenton@google.com | cfa2d8a | 2009-04-18 00:02:12 +0000 | [diff] [blame] | 4249 | #ifndef _MSC_VER |
| 4250 | const int FileOptions::kJavaPackageFieldNumber; |
| 4251 | const int FileOptions::kJavaOuterClassnameFieldNumber; |
| 4252 | const int FileOptions::kJavaMultipleFilesFieldNumber; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 4253 | const int FileOptions::kJavaGenerateEqualsAndHashFieldNumber; |
kenton@google.com | cfa2d8a | 2009-04-18 00:02:12 +0000 | [diff] [blame] | 4254 | const int FileOptions::kOptimizeForFieldNumber; |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 4255 | const int FileOptions::kCcGenericServicesFieldNumber; |
| 4256 | const int FileOptions::kJavaGenericServicesFieldNumber; |
| 4257 | const int FileOptions::kPyGenericServicesFieldNumber; |
kenton@google.com | cfa2d8a | 2009-04-18 00:02:12 +0000 | [diff] [blame] | 4258 | const int FileOptions::kUninterpretedOptionFieldNumber; |
| 4259 | #endif // !_MSC_VER |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 4260 | |
kenton@google.com | 573989f | 2009-10-30 22:02:17 +0000 | [diff] [blame] | 4261 | FileOptions::FileOptions() |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 4262 | : ::google::protobuf::Message() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 4263 | SharedCtor(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4264 | } |
| 4265 | |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 4266 | void FileOptions::InitAsDefaultInstance() { |
| 4267 | } |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 4268 | |
kenton@google.com | 573989f | 2009-10-30 22:02:17 +0000 | [diff] [blame] | 4269 | FileOptions::FileOptions(const FileOptions& from) |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 4270 | : ::google::protobuf::Message() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 4271 | SharedCtor(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4272 | MergeFrom(from); |
| 4273 | } |
| 4274 | |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 4275 | void FileOptions::SharedCtor() { |
| 4276 | _cached_size_ = 0; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 4277 | java_package_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); |
| 4278 | java_outer_classname_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 4279 | java_multiple_files_ = false; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 4280 | java_generate_equals_and_hash_ = false; |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 4281 | optimize_for_ = 1; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 4282 | cc_generic_services_ = false; |
| 4283 | java_generic_services_ = false; |
| 4284 | py_generic_services_ = false; |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 4285 | ::memset(_has_bits_, 0, sizeof(_has_bits_)); |
| 4286 | } |
| 4287 | |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4288 | FileOptions::~FileOptions() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 4289 | SharedDtor(); |
| 4290 | } |
| 4291 | |
| 4292 | void FileOptions::SharedDtor() { |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 4293 | if (java_package_ != &::google::protobuf::internal::kEmptyString) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4294 | delete java_package_; |
| 4295 | } |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 4296 | if (java_outer_classname_ != &::google::protobuf::internal::kEmptyString) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4297 | delete java_outer_classname_; |
| 4298 | } |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 4299 | if (this != default_instance_) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4300 | } |
| 4301 | } |
| 4302 | |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 4303 | void FileOptions::SetCachedSize(int size) const { |
| 4304 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
| 4305 | _cached_size_ = size; |
| 4306 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); |
| 4307 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4308 | const ::google::protobuf::Descriptor* FileOptions::descriptor() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 4309 | protobuf_AssignDescriptorsOnce(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4310 | return FileOptions_descriptor_; |
| 4311 | } |
| 4312 | |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 4313 | const FileOptions& FileOptions::default_instance() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 4314 | if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); return *default_instance_; |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 4315 | } |
| 4316 | |
| 4317 | FileOptions* FileOptions::default_instance_ = NULL; |
| 4318 | |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4319 | FileOptions* FileOptions::New() const { |
| 4320 | return new FileOptions; |
| 4321 | } |
| 4322 | |
| 4323 | void FileOptions::Clear() { |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 4324 | _extensions_.Clear(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4325 | if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 4326 | if (has_java_package()) { |
| 4327 | if (java_package_ != &::google::protobuf::internal::kEmptyString) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4328 | java_package_->clear(); |
| 4329 | } |
| 4330 | } |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 4331 | if (has_java_outer_classname()) { |
| 4332 | if (java_outer_classname_ != &::google::protobuf::internal::kEmptyString) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4333 | java_outer_classname_->clear(); |
| 4334 | } |
| 4335 | } |
| 4336 | java_multiple_files_ = false; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 4337 | java_generate_equals_and_hash_ = false; |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 4338 | optimize_for_ = 1; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 4339 | cc_generic_services_ = false; |
| 4340 | java_generic_services_ = false; |
| 4341 | py_generic_services_ = false; |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4342 | } |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 4343 | uninterpreted_option_.Clear(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4344 | ::memset(_has_bits_, 0, sizeof(_has_bits_)); |
| 4345 | mutable_unknown_fields()->Clear(); |
| 4346 | } |
| 4347 | |
| 4348 | bool FileOptions::MergePartialFromCodedStream( |
| 4349 | ::google::protobuf::io::CodedInputStream* input) { |
| 4350 | #define DO_(EXPRESSION) if (!(EXPRESSION)) return false |
| 4351 | ::google::protobuf::uint32 tag; |
| 4352 | while ((tag = input->ReadTag()) != 0) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 4353 | switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4354 | // optional string java_package = 1; |
| 4355 | case 1: { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 4356 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 4357 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 4358 | DO_(::google::protobuf::internal::WireFormatLite::ReadString( |
| 4359 | input, this->mutable_java_package())); |
| 4360 | ::google::protobuf::internal::WireFormat::VerifyUTF8String( |
| 4361 | this->java_package().data(), this->java_package().length(), |
| 4362 | ::google::protobuf::internal::WireFormat::PARSE); |
| 4363 | } else { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4364 | goto handle_uninterpreted; |
| 4365 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4366 | if (input->ExpectTag(66)) goto parse_java_outer_classname; |
| 4367 | break; |
| 4368 | } |
| 4369 | |
| 4370 | // optional string java_outer_classname = 8; |
| 4371 | case 8: { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 4372 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 4373 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 4374 | parse_java_outer_classname: |
| 4375 | DO_(::google::protobuf::internal::WireFormatLite::ReadString( |
| 4376 | input, this->mutable_java_outer_classname())); |
| 4377 | ::google::protobuf::internal::WireFormat::VerifyUTF8String( |
| 4378 | this->java_outer_classname().data(), this->java_outer_classname().length(), |
| 4379 | ::google::protobuf::internal::WireFormat::PARSE); |
| 4380 | } else { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4381 | goto handle_uninterpreted; |
| 4382 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4383 | if (input->ExpectTag(72)) goto parse_optimize_for; |
| 4384 | break; |
| 4385 | } |
| 4386 | |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 4387 | // optional .google.protobuf.FileOptions.OptimizeMode optimize_for = 9 [default = SPEED]; |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4388 | case 9: { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 4389 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 4390 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 4391 | parse_optimize_for: |
| 4392 | int value; |
| 4393 | DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< |
| 4394 | int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( |
| 4395 | input, &value))); |
| 4396 | if (::google::protobuf::FileOptions_OptimizeMode_IsValid(value)) { |
| 4397 | set_optimize_for(static_cast< ::google::protobuf::FileOptions_OptimizeMode >(value)); |
| 4398 | } else { |
| 4399 | mutable_unknown_fields()->AddVarint(9, value); |
| 4400 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4401 | } else { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 4402 | goto handle_uninterpreted; |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4403 | } |
| 4404 | if (input->ExpectTag(80)) goto parse_java_multiple_files; |
| 4405 | break; |
| 4406 | } |
| 4407 | |
| 4408 | // optional bool java_multiple_files = 10 [default = false]; |
| 4409 | case 10: { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 4410 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 4411 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 4412 | parse_java_multiple_files: |
| 4413 | DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< |
| 4414 | bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( |
| 4415 | input, &java_multiple_files_))); |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 4416 | set_has_java_multiple_files(); |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 4417 | } else { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4418 | goto handle_uninterpreted; |
| 4419 | } |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 4420 | if (input->ExpectTag(128)) goto parse_cc_generic_services; |
| 4421 | break; |
| 4422 | } |
| 4423 | |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 4424 | // optional bool cc_generic_services = 16 [default = false]; |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 4425 | case 16: { |
| 4426 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
| 4427 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { |
| 4428 | parse_cc_generic_services: |
| 4429 | DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< |
| 4430 | bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( |
| 4431 | input, &cc_generic_services_))); |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 4432 | set_has_cc_generic_services(); |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 4433 | } else { |
| 4434 | goto handle_uninterpreted; |
| 4435 | } |
| 4436 | if (input->ExpectTag(136)) goto parse_java_generic_services; |
| 4437 | break; |
| 4438 | } |
| 4439 | |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 4440 | // optional bool java_generic_services = 17 [default = false]; |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 4441 | case 17: { |
| 4442 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
| 4443 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { |
| 4444 | parse_java_generic_services: |
| 4445 | DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< |
| 4446 | bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( |
| 4447 | input, &java_generic_services_))); |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 4448 | set_has_java_generic_services(); |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 4449 | } else { |
| 4450 | goto handle_uninterpreted; |
| 4451 | } |
| 4452 | if (input->ExpectTag(144)) goto parse_py_generic_services; |
| 4453 | break; |
| 4454 | } |
| 4455 | |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 4456 | // optional bool py_generic_services = 18 [default = false]; |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 4457 | case 18: { |
| 4458 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
| 4459 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { |
| 4460 | parse_py_generic_services: |
| 4461 | DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< |
| 4462 | bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( |
| 4463 | input, &py_generic_services_))); |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 4464 | set_has_py_generic_services(); |
| 4465 | } else { |
| 4466 | goto handle_uninterpreted; |
| 4467 | } |
| 4468 | if (input->ExpectTag(160)) goto parse_java_generate_equals_and_hash; |
| 4469 | break; |
| 4470 | } |
| 4471 | |
| 4472 | // optional bool java_generate_equals_and_hash = 20 [default = false]; |
| 4473 | case 20: { |
| 4474 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
| 4475 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { |
| 4476 | parse_java_generate_equals_and_hash: |
| 4477 | DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< |
| 4478 | bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( |
| 4479 | input, &java_generate_equals_and_hash_))); |
| 4480 | set_has_java_generate_equals_and_hash(); |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 4481 | } else { |
| 4482 | goto handle_uninterpreted; |
| 4483 | } |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 4484 | if (input->ExpectTag(7994)) goto parse_uninterpreted_option; |
| 4485 | break; |
| 4486 | } |
| 4487 | |
| 4488 | // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; |
| 4489 | case 999: { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 4490 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 4491 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 4492 | parse_uninterpreted_option: |
| 4493 | DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( |
| 4494 | input, add_uninterpreted_option())); |
| 4495 | } else { |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 4496 | goto handle_uninterpreted; |
| 4497 | } |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 4498 | if (input->ExpectTag(7994)) goto parse_uninterpreted_option; |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4499 | if (input->ExpectAtEnd()) return true; |
| 4500 | break; |
| 4501 | } |
| 4502 | |
| 4503 | default: { |
| 4504 | handle_uninterpreted: |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 4505 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
| 4506 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4507 | return true; |
| 4508 | } |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 4509 | if ((8000u <= tag)) { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 4510 | DO_(_extensions_.ParseField(tag, input, default_instance_, |
| 4511 | mutable_unknown_fields())); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 4512 | continue; |
| 4513 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4514 | DO_(::google::protobuf::internal::WireFormat::SkipField( |
| 4515 | input, tag, mutable_unknown_fields())); |
| 4516 | break; |
| 4517 | } |
| 4518 | } |
| 4519 | } |
| 4520 | return true; |
| 4521 | #undef DO_ |
| 4522 | } |
| 4523 | |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 4524 | void FileOptions::SerializeWithCachedSizes( |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4525 | ::google::protobuf::io::CodedOutputStream* output) const { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4526 | // optional string java_package = 1; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 4527 | if (has_java_package()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 4528 | ::google::protobuf::internal::WireFormat::VerifyUTF8String( |
| 4529 | this->java_package().data(), this->java_package().length(), |
| 4530 | ::google::protobuf::internal::WireFormat::SERIALIZE); |
| 4531 | ::google::protobuf::internal::WireFormatLite::WriteString( |
| 4532 | 1, this->java_package(), output); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4533 | } |
| 4534 | |
| 4535 | // optional string java_outer_classname = 8; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 4536 | if (has_java_outer_classname()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 4537 | ::google::protobuf::internal::WireFormat::VerifyUTF8String( |
| 4538 | this->java_outer_classname().data(), this->java_outer_classname().length(), |
| 4539 | ::google::protobuf::internal::WireFormat::SERIALIZE); |
| 4540 | ::google::protobuf::internal::WireFormatLite::WriteString( |
| 4541 | 8, this->java_outer_classname(), output); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4542 | } |
| 4543 | |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 4544 | // optional .google.protobuf.FileOptions.OptimizeMode optimize_for = 9 [default = SPEED]; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 4545 | if (has_optimize_for()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 4546 | ::google::protobuf::internal::WireFormatLite::WriteEnum( |
| 4547 | 9, this->optimize_for(), output); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4548 | } |
| 4549 | |
| 4550 | // optional bool java_multiple_files = 10 [default = false]; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 4551 | if (has_java_multiple_files()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 4552 | ::google::protobuf::internal::WireFormatLite::WriteBool(10, this->java_multiple_files(), output); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4553 | } |
| 4554 | |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 4555 | // optional bool cc_generic_services = 16 [default = false]; |
| 4556 | if (has_cc_generic_services()) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 4557 | ::google::protobuf::internal::WireFormatLite::WriteBool(16, this->cc_generic_services(), output); |
| 4558 | } |
| 4559 | |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 4560 | // optional bool java_generic_services = 17 [default = false]; |
| 4561 | if (has_java_generic_services()) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 4562 | ::google::protobuf::internal::WireFormatLite::WriteBool(17, this->java_generic_services(), output); |
| 4563 | } |
| 4564 | |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 4565 | // optional bool py_generic_services = 18 [default = false]; |
| 4566 | if (has_py_generic_services()) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 4567 | ::google::protobuf::internal::WireFormatLite::WriteBool(18, this->py_generic_services(), output); |
| 4568 | } |
| 4569 | |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 4570 | // optional bool java_generate_equals_and_hash = 20 [default = false]; |
| 4571 | if (has_java_generate_equals_and_hash()) { |
| 4572 | ::google::protobuf::internal::WireFormatLite::WriteBool(20, this->java_generate_equals_and_hash(), output); |
| 4573 | } |
| 4574 | |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 4575 | // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; |
kenton@google.com | 2d6daa7 | 2009-01-22 01:27:00 +0000 | [diff] [blame] | 4576 | for (int i = 0; i < this->uninterpreted_option_size(); i++) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 4577 | ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 4578 | 999, this->uninterpreted_option(i), output); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 4579 | } |
| 4580 | |
| 4581 | // Extension range [1000, 536870912) |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 4582 | _extensions_.SerializeWithCachedSizes( |
| 4583 | 1000, 536870912, output); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 4584 | |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4585 | if (!unknown_fields().empty()) { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 4586 | ::google::protobuf::internal::WireFormat::SerializeUnknownFields( |
| 4587 | unknown_fields(), output); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4588 | } |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 4589 | } |
| 4590 | |
| 4591 | ::google::protobuf::uint8* FileOptions::SerializeWithCachedSizesToArray( |
| 4592 | ::google::protobuf::uint8* target) const { |
| 4593 | // optional string java_package = 1; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 4594 | if (has_java_package()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 4595 | ::google::protobuf::internal::WireFormat::VerifyUTF8String( |
| 4596 | this->java_package().data(), this->java_package().length(), |
| 4597 | ::google::protobuf::internal::WireFormat::SERIALIZE); |
| 4598 | target = |
| 4599 | ::google::protobuf::internal::WireFormatLite::WriteStringToArray( |
| 4600 | 1, this->java_package(), target); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 4601 | } |
| 4602 | |
| 4603 | // optional string java_outer_classname = 8; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 4604 | if (has_java_outer_classname()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 4605 | ::google::protobuf::internal::WireFormat::VerifyUTF8String( |
| 4606 | this->java_outer_classname().data(), this->java_outer_classname().length(), |
| 4607 | ::google::protobuf::internal::WireFormat::SERIALIZE); |
| 4608 | target = |
| 4609 | ::google::protobuf::internal::WireFormatLite::WriteStringToArray( |
| 4610 | 8, this->java_outer_classname(), target); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 4611 | } |
| 4612 | |
| 4613 | // optional .google.protobuf.FileOptions.OptimizeMode optimize_for = 9 [default = SPEED]; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 4614 | if (has_optimize_for()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 4615 | target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( |
| 4616 | 9, this->optimize_for(), target); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 4617 | } |
| 4618 | |
| 4619 | // optional bool java_multiple_files = 10 [default = false]; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 4620 | if (has_java_multiple_files()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 4621 | target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(10, this->java_multiple_files(), target); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 4622 | } |
| 4623 | |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 4624 | // optional bool cc_generic_services = 16 [default = false]; |
| 4625 | if (has_cc_generic_services()) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 4626 | target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(16, this->cc_generic_services(), target); |
| 4627 | } |
| 4628 | |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 4629 | // optional bool java_generic_services = 17 [default = false]; |
| 4630 | if (has_java_generic_services()) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 4631 | target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(17, this->java_generic_services(), target); |
| 4632 | } |
| 4633 | |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 4634 | // optional bool py_generic_services = 18 [default = false]; |
| 4635 | if (has_py_generic_services()) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 4636 | target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(18, this->py_generic_services(), target); |
| 4637 | } |
| 4638 | |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 4639 | // optional bool java_generate_equals_and_hash = 20 [default = false]; |
| 4640 | if (has_java_generate_equals_and_hash()) { |
| 4641 | target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(20, this->java_generate_equals_and_hash(), target); |
| 4642 | } |
| 4643 | |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 4644 | // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; |
| 4645 | for (int i = 0; i < this->uninterpreted_option_size(); i++) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 4646 | target = ::google::protobuf::internal::WireFormatLite:: |
| 4647 | WriteMessageNoVirtualToArray( |
| 4648 | 999, this->uninterpreted_option(i), target); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 4649 | } |
| 4650 | |
| 4651 | // Extension range [1000, 536870912) |
| 4652 | target = _extensions_.SerializeWithCachedSizesToArray( |
| 4653 | 1000, 536870912, target); |
| 4654 | |
| 4655 | if (!unknown_fields().empty()) { |
| 4656 | target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( |
| 4657 | unknown_fields(), target); |
| 4658 | } |
| 4659 | return target; |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4660 | } |
| 4661 | |
| 4662 | int FileOptions::ByteSize() const { |
| 4663 | int total_size = 0; |
| 4664 | |
| 4665 | if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { |
| 4666 | // optional string java_package = 1; |
| 4667 | if (has_java_package()) { |
| 4668 | total_size += 1 + |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 4669 | ::google::protobuf::internal::WireFormatLite::StringSize( |
| 4670 | this->java_package()); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4671 | } |
| 4672 | |
| 4673 | // optional string java_outer_classname = 8; |
| 4674 | if (has_java_outer_classname()) { |
| 4675 | total_size += 1 + |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 4676 | ::google::protobuf::internal::WireFormatLite::StringSize( |
| 4677 | this->java_outer_classname()); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4678 | } |
| 4679 | |
| 4680 | // optional bool java_multiple_files = 10 [default = false]; |
| 4681 | if (has_java_multiple_files()) { |
| 4682 | total_size += 1 + 1; |
| 4683 | } |
| 4684 | |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 4685 | // optional bool java_generate_equals_and_hash = 20 [default = false]; |
| 4686 | if (has_java_generate_equals_and_hash()) { |
| 4687 | total_size += 2 + 1; |
| 4688 | } |
| 4689 | |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 4690 | // optional .google.protobuf.FileOptions.OptimizeMode optimize_for = 9 [default = SPEED]; |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4691 | if (has_optimize_for()) { |
| 4692 | total_size += 1 + |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 4693 | ::google::protobuf::internal::WireFormatLite::EnumSize(this->optimize_for()); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4694 | } |
| 4695 | |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 4696 | // optional bool cc_generic_services = 16 [default = false]; |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 4697 | if (has_cc_generic_services()) { |
| 4698 | total_size += 2 + 1; |
| 4699 | } |
| 4700 | |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 4701 | // optional bool java_generic_services = 17 [default = false]; |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 4702 | if (has_java_generic_services()) { |
| 4703 | total_size += 2 + 1; |
| 4704 | } |
| 4705 | |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 4706 | // optional bool py_generic_services = 18 [default = false]; |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 4707 | if (has_py_generic_services()) { |
| 4708 | total_size += 2 + 1; |
| 4709 | } |
| 4710 | |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4711 | } |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 4712 | // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; |
kenton@google.com | 2d6daa7 | 2009-01-22 01:27:00 +0000 | [diff] [blame] | 4713 | total_size += 2 * this->uninterpreted_option_size(); |
| 4714 | for (int i = 0; i < this->uninterpreted_option_size(); i++) { |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 4715 | total_size += |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 4716 | ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 4717 | this->uninterpreted_option(i)); |
| 4718 | } |
| 4719 | |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 4720 | total_size += _extensions_.ByteSize(); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 4721 | |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4722 | if (!unknown_fields().empty()) { |
| 4723 | total_size += |
| 4724 | ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( |
| 4725 | unknown_fields()); |
| 4726 | } |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 4727 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4728 | _cached_size_ = total_size; |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 4729 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4730 | return total_size; |
| 4731 | } |
| 4732 | |
| 4733 | void FileOptions::MergeFrom(const ::google::protobuf::Message& from) { |
| 4734 | GOOGLE_CHECK_NE(&from, this); |
| 4735 | const FileOptions* source = |
| 4736 | ::google::protobuf::internal::dynamic_cast_if_available<const FileOptions*>( |
| 4737 | &from); |
| 4738 | if (source == NULL) { |
temporal | 779f61c | 2008-08-13 03:15:00 +0000 | [diff] [blame] | 4739 | ::google::protobuf::internal::ReflectionOps::Merge(from, this); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4740 | } else { |
| 4741 | MergeFrom(*source); |
| 4742 | } |
| 4743 | } |
| 4744 | |
| 4745 | void FileOptions::MergeFrom(const FileOptions& from) { |
| 4746 | GOOGLE_CHECK_NE(&from, this); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 4747 | uninterpreted_option_.MergeFrom(from.uninterpreted_option_); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4748 | if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 4749 | if (from.has_java_package()) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4750 | set_java_package(from.java_package()); |
| 4751 | } |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 4752 | if (from.has_java_outer_classname()) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4753 | set_java_outer_classname(from.java_outer_classname()); |
| 4754 | } |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 4755 | if (from.has_java_multiple_files()) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4756 | set_java_multiple_files(from.java_multiple_files()); |
| 4757 | } |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 4758 | if (from.has_java_generate_equals_and_hash()) { |
| 4759 | set_java_generate_equals_and_hash(from.java_generate_equals_and_hash()); |
| 4760 | } |
| 4761 | if (from.has_optimize_for()) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4762 | set_optimize_for(from.optimize_for()); |
| 4763 | } |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 4764 | if (from.has_cc_generic_services()) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 4765 | set_cc_generic_services(from.cc_generic_services()); |
| 4766 | } |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 4767 | if (from.has_java_generic_services()) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 4768 | set_java_generic_services(from.java_generic_services()); |
| 4769 | } |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 4770 | if (from.has_py_generic_services()) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 4771 | set_py_generic_services(from.py_generic_services()); |
| 4772 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4773 | } |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 4774 | _extensions_.MergeFrom(from._extensions_); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4775 | mutable_unknown_fields()->MergeFrom(from.unknown_fields()); |
| 4776 | } |
| 4777 | |
| 4778 | void FileOptions::CopyFrom(const ::google::protobuf::Message& from) { |
| 4779 | if (&from == this) return; |
| 4780 | Clear(); |
| 4781 | MergeFrom(from); |
| 4782 | } |
| 4783 | |
| 4784 | void FileOptions::CopyFrom(const FileOptions& from) { |
| 4785 | if (&from == this) return; |
| 4786 | Clear(); |
| 4787 | MergeFrom(from); |
| 4788 | } |
| 4789 | |
kenton@google.com | ceb561d | 2009-06-25 19:05:36 +0000 | [diff] [blame] | 4790 | bool FileOptions::IsInitialized() const { |
| 4791 | |
| 4792 | for (int i = 0; i < uninterpreted_option_size(); i++) { |
| 4793 | if (!this->uninterpreted_option(i).IsInitialized()) return false; |
| 4794 | } |
| 4795 | |
| 4796 | if (!_extensions_.IsInitialized()) return false; return true; |
| 4797 | } |
| 4798 | |
kenton@google.com | 26bd9ee | 2008-11-21 00:06:27 +0000 | [diff] [blame] | 4799 | void FileOptions::Swap(FileOptions* other) { |
| 4800 | if (other != this) { |
| 4801 | std::swap(java_package_, other->java_package_); |
| 4802 | std::swap(java_outer_classname_, other->java_outer_classname_); |
| 4803 | std::swap(java_multiple_files_, other->java_multiple_files_); |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 4804 | std::swap(java_generate_equals_and_hash_, other->java_generate_equals_and_hash_); |
kenton@google.com | 26bd9ee | 2008-11-21 00:06:27 +0000 | [diff] [blame] | 4805 | std::swap(optimize_for_, other->optimize_for_); |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 4806 | std::swap(cc_generic_services_, other->cc_generic_services_); |
| 4807 | std::swap(java_generic_services_, other->java_generic_services_); |
| 4808 | std::swap(py_generic_services_, other->py_generic_services_); |
kenton@google.com | 26bd9ee | 2008-11-21 00:06:27 +0000 | [diff] [blame] | 4809 | uninterpreted_option_.Swap(&other->uninterpreted_option_); |
| 4810 | std::swap(_has_bits_[0], other->_has_bits_[0]); |
| 4811 | _unknown_fields_.Swap(&other->_unknown_fields_); |
| 4812 | std::swap(_cached_size_, other->_cached_size_); |
| 4813 | _extensions_.Swap(&other->_extensions_); |
| 4814 | } |
| 4815 | } |
| 4816 | |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 4817 | ::google::protobuf::Metadata FileOptions::GetMetadata() const { |
| 4818 | protobuf_AssignDescriptorsOnce(); |
| 4819 | ::google::protobuf::Metadata metadata; |
| 4820 | metadata.descriptor = FileOptions_descriptor_; |
| 4821 | metadata.reflection = FileOptions_reflection_; |
| 4822 | return metadata; |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4823 | } |
| 4824 | |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4825 | |
| 4826 | // =================================================================== |
| 4827 | |
kenton@google.com | cfa2d8a | 2009-04-18 00:02:12 +0000 | [diff] [blame] | 4828 | #ifndef _MSC_VER |
| 4829 | const int MessageOptions::kMessageSetWireFormatFieldNumber; |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 4830 | const int MessageOptions::kNoStandardDescriptorAccessorFieldNumber; |
kenton@google.com | cfa2d8a | 2009-04-18 00:02:12 +0000 | [diff] [blame] | 4831 | const int MessageOptions::kUninterpretedOptionFieldNumber; |
| 4832 | #endif // !_MSC_VER |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4833 | |
kenton@google.com | 573989f | 2009-10-30 22:02:17 +0000 | [diff] [blame] | 4834 | MessageOptions::MessageOptions() |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 4835 | : ::google::protobuf::Message() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 4836 | SharedCtor(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4837 | } |
| 4838 | |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 4839 | void MessageOptions::InitAsDefaultInstance() { |
| 4840 | } |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 4841 | |
kenton@google.com | 573989f | 2009-10-30 22:02:17 +0000 | [diff] [blame] | 4842 | MessageOptions::MessageOptions(const MessageOptions& from) |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 4843 | : ::google::protobuf::Message() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 4844 | SharedCtor(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4845 | MergeFrom(from); |
| 4846 | } |
| 4847 | |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 4848 | void MessageOptions::SharedCtor() { |
| 4849 | _cached_size_ = 0; |
| 4850 | message_set_wire_format_ = false; |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 4851 | no_standard_descriptor_accessor_ = false; |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 4852 | ::memset(_has_bits_, 0, sizeof(_has_bits_)); |
| 4853 | } |
| 4854 | |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4855 | MessageOptions::~MessageOptions() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 4856 | SharedDtor(); |
| 4857 | } |
| 4858 | |
| 4859 | void MessageOptions::SharedDtor() { |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 4860 | if (this != default_instance_) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4861 | } |
| 4862 | } |
| 4863 | |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 4864 | void MessageOptions::SetCachedSize(int size) const { |
| 4865 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
| 4866 | _cached_size_ = size; |
| 4867 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); |
| 4868 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4869 | const ::google::protobuf::Descriptor* MessageOptions::descriptor() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 4870 | protobuf_AssignDescriptorsOnce(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4871 | return MessageOptions_descriptor_; |
| 4872 | } |
| 4873 | |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 4874 | const MessageOptions& MessageOptions::default_instance() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 4875 | if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); return *default_instance_; |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 4876 | } |
| 4877 | |
| 4878 | MessageOptions* MessageOptions::default_instance_ = NULL; |
| 4879 | |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4880 | MessageOptions* MessageOptions::New() const { |
| 4881 | return new MessageOptions; |
| 4882 | } |
| 4883 | |
| 4884 | void MessageOptions::Clear() { |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 4885 | _extensions_.Clear(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4886 | if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { |
| 4887 | message_set_wire_format_ = false; |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 4888 | no_standard_descriptor_accessor_ = false; |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4889 | } |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 4890 | uninterpreted_option_.Clear(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4891 | ::memset(_has_bits_, 0, sizeof(_has_bits_)); |
| 4892 | mutable_unknown_fields()->Clear(); |
| 4893 | } |
| 4894 | |
| 4895 | bool MessageOptions::MergePartialFromCodedStream( |
| 4896 | ::google::protobuf::io::CodedInputStream* input) { |
| 4897 | #define DO_(EXPRESSION) if (!(EXPRESSION)) return false |
| 4898 | ::google::protobuf::uint32 tag; |
| 4899 | while ((tag = input->ReadTag()) != 0) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 4900 | switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4901 | // optional bool message_set_wire_format = 1 [default = false]; |
| 4902 | case 1: { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 4903 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 4904 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 4905 | DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< |
| 4906 | bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( |
| 4907 | input, &message_set_wire_format_))); |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 4908 | set_has_message_set_wire_format(); |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 4909 | } else { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4910 | goto handle_uninterpreted; |
| 4911 | } |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 4912 | if (input->ExpectTag(16)) goto parse_no_standard_descriptor_accessor; |
| 4913 | break; |
| 4914 | } |
| 4915 | |
| 4916 | // optional bool no_standard_descriptor_accessor = 2 [default = false]; |
| 4917 | case 2: { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 4918 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 4919 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 4920 | parse_no_standard_descriptor_accessor: |
| 4921 | DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< |
| 4922 | bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( |
| 4923 | input, &no_standard_descriptor_accessor_))); |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 4924 | set_has_no_standard_descriptor_accessor(); |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 4925 | } else { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 4926 | goto handle_uninterpreted; |
| 4927 | } |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 4928 | if (input->ExpectTag(7994)) goto parse_uninterpreted_option; |
| 4929 | break; |
| 4930 | } |
| 4931 | |
| 4932 | // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; |
| 4933 | case 999: { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 4934 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 4935 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 4936 | parse_uninterpreted_option: |
| 4937 | DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( |
| 4938 | input, add_uninterpreted_option())); |
| 4939 | } else { |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 4940 | goto handle_uninterpreted; |
| 4941 | } |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 4942 | if (input->ExpectTag(7994)) goto parse_uninterpreted_option; |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4943 | if (input->ExpectAtEnd()) return true; |
| 4944 | break; |
| 4945 | } |
| 4946 | |
| 4947 | default: { |
| 4948 | handle_uninterpreted: |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 4949 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
| 4950 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4951 | return true; |
| 4952 | } |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 4953 | if ((8000u <= tag)) { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 4954 | DO_(_extensions_.ParseField(tag, input, default_instance_, |
| 4955 | mutable_unknown_fields())); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 4956 | continue; |
| 4957 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4958 | DO_(::google::protobuf::internal::WireFormat::SkipField( |
| 4959 | input, tag, mutable_unknown_fields())); |
| 4960 | break; |
| 4961 | } |
| 4962 | } |
| 4963 | } |
| 4964 | return true; |
| 4965 | #undef DO_ |
| 4966 | } |
| 4967 | |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 4968 | void MessageOptions::SerializeWithCachedSizes( |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4969 | ::google::protobuf::io::CodedOutputStream* output) const { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4970 | // optional bool message_set_wire_format = 1 [default = false]; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 4971 | if (has_message_set_wire_format()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 4972 | ::google::protobuf::internal::WireFormatLite::WriteBool(1, this->message_set_wire_format(), output); |
| 4973 | } |
| 4974 | |
| 4975 | // optional bool no_standard_descriptor_accessor = 2 [default = false]; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 4976 | if (has_no_standard_descriptor_accessor()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 4977 | ::google::protobuf::internal::WireFormatLite::WriteBool(2, this->no_standard_descriptor_accessor(), output); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4978 | } |
| 4979 | |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 4980 | // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; |
kenton@google.com | 2d6daa7 | 2009-01-22 01:27:00 +0000 | [diff] [blame] | 4981 | for (int i = 0; i < this->uninterpreted_option_size(); i++) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 4982 | ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 4983 | 999, this->uninterpreted_option(i), output); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 4984 | } |
| 4985 | |
| 4986 | // Extension range [1000, 536870912) |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 4987 | _extensions_.SerializeWithCachedSizes( |
| 4988 | 1000, 536870912, output); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 4989 | |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4990 | if (!unknown_fields().empty()) { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 4991 | ::google::protobuf::internal::WireFormat::SerializeUnknownFields( |
| 4992 | unknown_fields(), output); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 4993 | } |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 4994 | } |
| 4995 | |
| 4996 | ::google::protobuf::uint8* MessageOptions::SerializeWithCachedSizesToArray( |
| 4997 | ::google::protobuf::uint8* target) const { |
| 4998 | // optional bool message_set_wire_format = 1 [default = false]; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 4999 | if (has_message_set_wire_format()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 5000 | target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(1, this->message_set_wire_format(), target); |
| 5001 | } |
| 5002 | |
| 5003 | // optional bool no_standard_descriptor_accessor = 2 [default = false]; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 5004 | if (has_no_standard_descriptor_accessor()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 5005 | target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(2, this->no_standard_descriptor_accessor(), target); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 5006 | } |
| 5007 | |
| 5008 | // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; |
| 5009 | for (int i = 0; i < this->uninterpreted_option_size(); i++) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 5010 | target = ::google::protobuf::internal::WireFormatLite:: |
| 5011 | WriteMessageNoVirtualToArray( |
| 5012 | 999, this->uninterpreted_option(i), target); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 5013 | } |
| 5014 | |
| 5015 | // Extension range [1000, 536870912) |
| 5016 | target = _extensions_.SerializeWithCachedSizesToArray( |
| 5017 | 1000, 536870912, target); |
| 5018 | |
| 5019 | if (!unknown_fields().empty()) { |
| 5020 | target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( |
| 5021 | unknown_fields(), target); |
| 5022 | } |
| 5023 | return target; |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5024 | } |
| 5025 | |
| 5026 | int MessageOptions::ByteSize() const { |
| 5027 | int total_size = 0; |
| 5028 | |
| 5029 | if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { |
| 5030 | // optional bool message_set_wire_format = 1 [default = false]; |
| 5031 | if (has_message_set_wire_format()) { |
| 5032 | total_size += 1 + 1; |
| 5033 | } |
| 5034 | |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 5035 | // optional bool no_standard_descriptor_accessor = 2 [default = false]; |
| 5036 | if (has_no_standard_descriptor_accessor()) { |
| 5037 | total_size += 1 + 1; |
| 5038 | } |
| 5039 | |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5040 | } |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 5041 | // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; |
kenton@google.com | 2d6daa7 | 2009-01-22 01:27:00 +0000 | [diff] [blame] | 5042 | total_size += 2 * this->uninterpreted_option_size(); |
| 5043 | for (int i = 0; i < this->uninterpreted_option_size(); i++) { |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 5044 | total_size += |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 5045 | ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 5046 | this->uninterpreted_option(i)); |
| 5047 | } |
| 5048 | |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 5049 | total_size += _extensions_.ByteSize(); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 5050 | |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5051 | if (!unknown_fields().empty()) { |
| 5052 | total_size += |
| 5053 | ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( |
| 5054 | unknown_fields()); |
| 5055 | } |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 5056 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5057 | _cached_size_ = total_size; |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 5058 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5059 | return total_size; |
| 5060 | } |
| 5061 | |
| 5062 | void MessageOptions::MergeFrom(const ::google::protobuf::Message& from) { |
| 5063 | GOOGLE_CHECK_NE(&from, this); |
| 5064 | const MessageOptions* source = |
| 5065 | ::google::protobuf::internal::dynamic_cast_if_available<const MessageOptions*>( |
| 5066 | &from); |
| 5067 | if (source == NULL) { |
temporal | 779f61c | 2008-08-13 03:15:00 +0000 | [diff] [blame] | 5068 | ::google::protobuf::internal::ReflectionOps::Merge(from, this); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5069 | } else { |
| 5070 | MergeFrom(*source); |
| 5071 | } |
| 5072 | } |
| 5073 | |
| 5074 | void MessageOptions::MergeFrom(const MessageOptions& from) { |
| 5075 | GOOGLE_CHECK_NE(&from, this); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 5076 | uninterpreted_option_.MergeFrom(from.uninterpreted_option_); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5077 | if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 5078 | if (from.has_message_set_wire_format()) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5079 | set_message_set_wire_format(from.message_set_wire_format()); |
| 5080 | } |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 5081 | if (from.has_no_standard_descriptor_accessor()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 5082 | set_no_standard_descriptor_accessor(from.no_standard_descriptor_accessor()); |
| 5083 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5084 | } |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 5085 | _extensions_.MergeFrom(from._extensions_); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5086 | mutable_unknown_fields()->MergeFrom(from.unknown_fields()); |
| 5087 | } |
| 5088 | |
| 5089 | void MessageOptions::CopyFrom(const ::google::protobuf::Message& from) { |
| 5090 | if (&from == this) return; |
| 5091 | Clear(); |
| 5092 | MergeFrom(from); |
| 5093 | } |
| 5094 | |
| 5095 | void MessageOptions::CopyFrom(const MessageOptions& from) { |
| 5096 | if (&from == this) return; |
| 5097 | Clear(); |
| 5098 | MergeFrom(from); |
| 5099 | } |
| 5100 | |
kenton@google.com | ceb561d | 2009-06-25 19:05:36 +0000 | [diff] [blame] | 5101 | bool MessageOptions::IsInitialized() const { |
| 5102 | |
| 5103 | for (int i = 0; i < uninterpreted_option_size(); i++) { |
| 5104 | if (!this->uninterpreted_option(i).IsInitialized()) return false; |
| 5105 | } |
| 5106 | |
| 5107 | if (!_extensions_.IsInitialized()) return false; return true; |
| 5108 | } |
| 5109 | |
kenton@google.com | 26bd9ee | 2008-11-21 00:06:27 +0000 | [diff] [blame] | 5110 | void MessageOptions::Swap(MessageOptions* other) { |
| 5111 | if (other != this) { |
| 5112 | std::swap(message_set_wire_format_, other->message_set_wire_format_); |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 5113 | std::swap(no_standard_descriptor_accessor_, other->no_standard_descriptor_accessor_); |
kenton@google.com | 26bd9ee | 2008-11-21 00:06:27 +0000 | [diff] [blame] | 5114 | uninterpreted_option_.Swap(&other->uninterpreted_option_); |
| 5115 | std::swap(_has_bits_[0], other->_has_bits_[0]); |
| 5116 | _unknown_fields_.Swap(&other->_unknown_fields_); |
| 5117 | std::swap(_cached_size_, other->_cached_size_); |
| 5118 | _extensions_.Swap(&other->_extensions_); |
| 5119 | } |
| 5120 | } |
| 5121 | |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 5122 | ::google::protobuf::Metadata MessageOptions::GetMetadata() const { |
| 5123 | protobuf_AssignDescriptorsOnce(); |
| 5124 | ::google::protobuf::Metadata metadata; |
| 5125 | metadata.descriptor = MessageOptions_descriptor_; |
| 5126 | metadata.reflection = MessageOptions_reflection_; |
| 5127 | return metadata; |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5128 | } |
| 5129 | |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5130 | |
| 5131 | // =================================================================== |
| 5132 | |
| 5133 | const ::google::protobuf::EnumDescriptor* FieldOptions_CType_descriptor() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 5134 | protobuf_AssignDescriptorsOnce(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5135 | return FieldOptions_CType_descriptor_; |
| 5136 | } |
| 5137 | bool FieldOptions_CType_IsValid(int value) { |
| 5138 | switch(value) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 5139 | case 0: |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5140 | case 1: |
| 5141 | case 2: |
| 5142 | return true; |
| 5143 | default: |
| 5144 | return false; |
| 5145 | } |
| 5146 | } |
| 5147 | |
| 5148 | #ifndef _MSC_VER |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 5149 | const FieldOptions_CType FieldOptions::STRING; |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5150 | const FieldOptions_CType FieldOptions::CORD; |
| 5151 | const FieldOptions_CType FieldOptions::STRING_PIECE; |
| 5152 | const FieldOptions_CType FieldOptions::CType_MIN; |
| 5153 | const FieldOptions_CType FieldOptions::CType_MAX; |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 5154 | const int FieldOptions::CType_ARRAYSIZE; |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5155 | #endif // _MSC_VER |
kenton@google.com | cfa2d8a | 2009-04-18 00:02:12 +0000 | [diff] [blame] | 5156 | #ifndef _MSC_VER |
| 5157 | const int FieldOptions::kCtypeFieldNumber; |
| 5158 | const int FieldOptions::kPackedFieldNumber; |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 5159 | const int FieldOptions::kDeprecatedFieldNumber; |
kenton@google.com | cfa2d8a | 2009-04-18 00:02:12 +0000 | [diff] [blame] | 5160 | const int FieldOptions::kExperimentalMapKeyFieldNumber; |
| 5161 | const int FieldOptions::kUninterpretedOptionFieldNumber; |
| 5162 | #endif // !_MSC_VER |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 5163 | |
kenton@google.com | 573989f | 2009-10-30 22:02:17 +0000 | [diff] [blame] | 5164 | FieldOptions::FieldOptions() |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 5165 | : ::google::protobuf::Message() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 5166 | SharedCtor(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5167 | } |
| 5168 | |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 5169 | void FieldOptions::InitAsDefaultInstance() { |
| 5170 | } |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 5171 | |
kenton@google.com | 573989f | 2009-10-30 22:02:17 +0000 | [diff] [blame] | 5172 | FieldOptions::FieldOptions(const FieldOptions& from) |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 5173 | : ::google::protobuf::Message() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 5174 | SharedCtor(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5175 | MergeFrom(from); |
| 5176 | } |
| 5177 | |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 5178 | void FieldOptions::SharedCtor() { |
| 5179 | _cached_size_ = 0; |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 5180 | ctype_ = 0; |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 5181 | packed_ = false; |
| 5182 | deprecated_ = false; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 5183 | experimental_map_key_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 5184 | ::memset(_has_bits_, 0, sizeof(_has_bits_)); |
| 5185 | } |
| 5186 | |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5187 | FieldOptions::~FieldOptions() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 5188 | SharedDtor(); |
| 5189 | } |
| 5190 | |
| 5191 | void FieldOptions::SharedDtor() { |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 5192 | if (experimental_map_key_ != &::google::protobuf::internal::kEmptyString) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5193 | delete experimental_map_key_; |
| 5194 | } |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 5195 | if (this != default_instance_) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5196 | } |
| 5197 | } |
| 5198 | |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 5199 | void FieldOptions::SetCachedSize(int size) const { |
| 5200 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
| 5201 | _cached_size_ = size; |
| 5202 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); |
| 5203 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5204 | const ::google::protobuf::Descriptor* FieldOptions::descriptor() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 5205 | protobuf_AssignDescriptorsOnce(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5206 | return FieldOptions_descriptor_; |
| 5207 | } |
| 5208 | |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 5209 | const FieldOptions& FieldOptions::default_instance() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 5210 | if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); return *default_instance_; |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 5211 | } |
| 5212 | |
| 5213 | FieldOptions* FieldOptions::default_instance_ = NULL; |
| 5214 | |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5215 | FieldOptions* FieldOptions::New() const { |
| 5216 | return new FieldOptions; |
| 5217 | } |
| 5218 | |
| 5219 | void FieldOptions::Clear() { |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 5220 | _extensions_.Clear(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5221 | if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 5222 | ctype_ = 0; |
kenton@google.com | 2d6daa7 | 2009-01-22 01:27:00 +0000 | [diff] [blame] | 5223 | packed_ = false; |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 5224 | deprecated_ = false; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 5225 | if (has_experimental_map_key()) { |
| 5226 | if (experimental_map_key_ != &::google::protobuf::internal::kEmptyString) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5227 | experimental_map_key_->clear(); |
| 5228 | } |
| 5229 | } |
| 5230 | } |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 5231 | uninterpreted_option_.Clear(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5232 | ::memset(_has_bits_, 0, sizeof(_has_bits_)); |
| 5233 | mutable_unknown_fields()->Clear(); |
| 5234 | } |
| 5235 | |
| 5236 | bool FieldOptions::MergePartialFromCodedStream( |
| 5237 | ::google::protobuf::io::CodedInputStream* input) { |
| 5238 | #define DO_(EXPRESSION) if (!(EXPRESSION)) return false |
| 5239 | ::google::protobuf::uint32 tag; |
| 5240 | while ((tag = input->ReadTag()) != 0) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 5241 | switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 5242 | // optional .google.protobuf.FieldOptions.CType ctype = 1 [default = STRING]; |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5243 | case 1: { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 5244 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 5245 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 5246 | int value; |
| 5247 | DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< |
| 5248 | int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( |
| 5249 | input, &value))); |
| 5250 | if (::google::protobuf::FieldOptions_CType_IsValid(value)) { |
| 5251 | set_ctype(static_cast< ::google::protobuf::FieldOptions_CType >(value)); |
| 5252 | } else { |
| 5253 | mutable_unknown_fields()->AddVarint(1, value); |
| 5254 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5255 | } else { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 5256 | goto handle_uninterpreted; |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5257 | } |
kenton@google.com | 2d6daa7 | 2009-01-22 01:27:00 +0000 | [diff] [blame] | 5258 | if (input->ExpectTag(16)) goto parse_packed; |
| 5259 | break; |
| 5260 | } |
| 5261 | |
| 5262 | // optional bool packed = 2; |
| 5263 | case 2: { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 5264 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 5265 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 5266 | parse_packed: |
| 5267 | DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< |
| 5268 | bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( |
| 5269 | input, &packed_))); |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 5270 | set_has_packed(); |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 5271 | } else { |
kenton@google.com | 2d6daa7 | 2009-01-22 01:27:00 +0000 | [diff] [blame] | 5272 | goto handle_uninterpreted; |
| 5273 | } |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 5274 | if (input->ExpectTag(24)) goto parse_deprecated; |
| 5275 | break; |
| 5276 | } |
| 5277 | |
| 5278 | // optional bool deprecated = 3 [default = false]; |
| 5279 | case 3: { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 5280 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 5281 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 5282 | parse_deprecated: |
| 5283 | DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< |
| 5284 | bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( |
| 5285 | input, &deprecated_))); |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 5286 | set_has_deprecated(); |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 5287 | } else { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 5288 | goto handle_uninterpreted; |
| 5289 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5290 | if (input->ExpectTag(74)) goto parse_experimental_map_key; |
| 5291 | break; |
| 5292 | } |
| 5293 | |
| 5294 | // optional string experimental_map_key = 9; |
| 5295 | case 9: { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 5296 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 5297 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 5298 | parse_experimental_map_key: |
| 5299 | DO_(::google::protobuf::internal::WireFormatLite::ReadString( |
| 5300 | input, this->mutable_experimental_map_key())); |
| 5301 | ::google::protobuf::internal::WireFormat::VerifyUTF8String( |
| 5302 | this->experimental_map_key().data(), this->experimental_map_key().length(), |
| 5303 | ::google::protobuf::internal::WireFormat::PARSE); |
| 5304 | } else { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5305 | goto handle_uninterpreted; |
| 5306 | } |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 5307 | if (input->ExpectTag(7994)) goto parse_uninterpreted_option; |
| 5308 | break; |
| 5309 | } |
| 5310 | |
| 5311 | // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; |
| 5312 | case 999: { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 5313 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 5314 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 5315 | parse_uninterpreted_option: |
| 5316 | DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( |
| 5317 | input, add_uninterpreted_option())); |
| 5318 | } else { |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 5319 | goto handle_uninterpreted; |
| 5320 | } |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 5321 | if (input->ExpectTag(7994)) goto parse_uninterpreted_option; |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5322 | if (input->ExpectAtEnd()) return true; |
| 5323 | break; |
| 5324 | } |
| 5325 | |
| 5326 | default: { |
| 5327 | handle_uninterpreted: |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 5328 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
| 5329 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5330 | return true; |
| 5331 | } |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 5332 | if ((8000u <= tag)) { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 5333 | DO_(_extensions_.ParseField(tag, input, default_instance_, |
| 5334 | mutable_unknown_fields())); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 5335 | continue; |
| 5336 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5337 | DO_(::google::protobuf::internal::WireFormat::SkipField( |
| 5338 | input, tag, mutable_unknown_fields())); |
| 5339 | break; |
| 5340 | } |
| 5341 | } |
| 5342 | } |
| 5343 | return true; |
| 5344 | #undef DO_ |
| 5345 | } |
| 5346 | |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 5347 | void FieldOptions::SerializeWithCachedSizes( |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5348 | ::google::protobuf::io::CodedOutputStream* output) const { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 5349 | // optional .google.protobuf.FieldOptions.CType ctype = 1 [default = STRING]; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 5350 | if (has_ctype()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 5351 | ::google::protobuf::internal::WireFormatLite::WriteEnum( |
| 5352 | 1, this->ctype(), output); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5353 | } |
| 5354 | |
kenton@google.com | 2d6daa7 | 2009-01-22 01:27:00 +0000 | [diff] [blame] | 5355 | // optional bool packed = 2; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 5356 | if (has_packed()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 5357 | ::google::protobuf::internal::WireFormatLite::WriteBool(2, this->packed(), output); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 5358 | } |
| 5359 | |
| 5360 | // optional bool deprecated = 3 [default = false]; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 5361 | if (has_deprecated()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 5362 | ::google::protobuf::internal::WireFormatLite::WriteBool(3, this->deprecated(), output); |
kenton@google.com | 2d6daa7 | 2009-01-22 01:27:00 +0000 | [diff] [blame] | 5363 | } |
| 5364 | |
| 5365 | // optional string experimental_map_key = 9; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 5366 | if (has_experimental_map_key()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 5367 | ::google::protobuf::internal::WireFormat::VerifyUTF8String( |
| 5368 | this->experimental_map_key().data(), this->experimental_map_key().length(), |
| 5369 | ::google::protobuf::internal::WireFormat::SERIALIZE); |
| 5370 | ::google::protobuf::internal::WireFormatLite::WriteString( |
| 5371 | 9, this->experimental_map_key(), output); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5372 | } |
| 5373 | |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 5374 | // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; |
kenton@google.com | 2d6daa7 | 2009-01-22 01:27:00 +0000 | [diff] [blame] | 5375 | for (int i = 0; i < this->uninterpreted_option_size(); i++) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 5376 | ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 5377 | 999, this->uninterpreted_option(i), output); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 5378 | } |
| 5379 | |
| 5380 | // Extension range [1000, 536870912) |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 5381 | _extensions_.SerializeWithCachedSizes( |
| 5382 | 1000, 536870912, output); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 5383 | |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5384 | if (!unknown_fields().empty()) { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 5385 | ::google::protobuf::internal::WireFormat::SerializeUnknownFields( |
| 5386 | unknown_fields(), output); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5387 | } |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 5388 | } |
| 5389 | |
| 5390 | ::google::protobuf::uint8* FieldOptions::SerializeWithCachedSizesToArray( |
| 5391 | ::google::protobuf::uint8* target) const { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 5392 | // optional .google.protobuf.FieldOptions.CType ctype = 1 [default = STRING]; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 5393 | if (has_ctype()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 5394 | target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( |
| 5395 | 1, this->ctype(), target); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 5396 | } |
| 5397 | |
| 5398 | // optional bool packed = 2; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 5399 | if (has_packed()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 5400 | target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(2, this->packed(), target); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 5401 | } |
| 5402 | |
| 5403 | // optional bool deprecated = 3 [default = false]; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 5404 | if (has_deprecated()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 5405 | target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(3, this->deprecated(), target); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 5406 | } |
| 5407 | |
| 5408 | // optional string experimental_map_key = 9; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 5409 | if (has_experimental_map_key()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 5410 | ::google::protobuf::internal::WireFormat::VerifyUTF8String( |
| 5411 | this->experimental_map_key().data(), this->experimental_map_key().length(), |
| 5412 | ::google::protobuf::internal::WireFormat::SERIALIZE); |
| 5413 | target = |
| 5414 | ::google::protobuf::internal::WireFormatLite::WriteStringToArray( |
| 5415 | 9, this->experimental_map_key(), target); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 5416 | } |
| 5417 | |
| 5418 | // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; |
| 5419 | for (int i = 0; i < this->uninterpreted_option_size(); i++) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 5420 | target = ::google::protobuf::internal::WireFormatLite:: |
| 5421 | WriteMessageNoVirtualToArray( |
| 5422 | 999, this->uninterpreted_option(i), target); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 5423 | } |
| 5424 | |
| 5425 | // Extension range [1000, 536870912) |
| 5426 | target = _extensions_.SerializeWithCachedSizesToArray( |
| 5427 | 1000, 536870912, target); |
| 5428 | |
| 5429 | if (!unknown_fields().empty()) { |
| 5430 | target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( |
| 5431 | unknown_fields(), target); |
| 5432 | } |
| 5433 | return target; |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5434 | } |
| 5435 | |
| 5436 | int FieldOptions::ByteSize() const { |
| 5437 | int total_size = 0; |
| 5438 | |
| 5439 | if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 5440 | // optional .google.protobuf.FieldOptions.CType ctype = 1 [default = STRING]; |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5441 | if (has_ctype()) { |
| 5442 | total_size += 1 + |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 5443 | ::google::protobuf::internal::WireFormatLite::EnumSize(this->ctype()); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5444 | } |
| 5445 | |
kenton@google.com | 2d6daa7 | 2009-01-22 01:27:00 +0000 | [diff] [blame] | 5446 | // optional bool packed = 2; |
| 5447 | if (has_packed()) { |
| 5448 | total_size += 1 + 1; |
| 5449 | } |
| 5450 | |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 5451 | // optional bool deprecated = 3 [default = false]; |
| 5452 | if (has_deprecated()) { |
| 5453 | total_size += 1 + 1; |
| 5454 | } |
| 5455 | |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5456 | // optional string experimental_map_key = 9; |
| 5457 | if (has_experimental_map_key()) { |
| 5458 | total_size += 1 + |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 5459 | ::google::protobuf::internal::WireFormatLite::StringSize( |
| 5460 | this->experimental_map_key()); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5461 | } |
| 5462 | |
| 5463 | } |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 5464 | // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; |
kenton@google.com | 2d6daa7 | 2009-01-22 01:27:00 +0000 | [diff] [blame] | 5465 | total_size += 2 * this->uninterpreted_option_size(); |
| 5466 | for (int i = 0; i < this->uninterpreted_option_size(); i++) { |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 5467 | total_size += |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 5468 | ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 5469 | this->uninterpreted_option(i)); |
| 5470 | } |
| 5471 | |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 5472 | total_size += _extensions_.ByteSize(); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 5473 | |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5474 | if (!unknown_fields().empty()) { |
| 5475 | total_size += |
| 5476 | ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( |
| 5477 | unknown_fields()); |
| 5478 | } |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 5479 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5480 | _cached_size_ = total_size; |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 5481 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5482 | return total_size; |
| 5483 | } |
| 5484 | |
| 5485 | void FieldOptions::MergeFrom(const ::google::protobuf::Message& from) { |
| 5486 | GOOGLE_CHECK_NE(&from, this); |
| 5487 | const FieldOptions* source = |
| 5488 | ::google::protobuf::internal::dynamic_cast_if_available<const FieldOptions*>( |
| 5489 | &from); |
| 5490 | if (source == NULL) { |
temporal | 779f61c | 2008-08-13 03:15:00 +0000 | [diff] [blame] | 5491 | ::google::protobuf::internal::ReflectionOps::Merge(from, this); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5492 | } else { |
| 5493 | MergeFrom(*source); |
| 5494 | } |
| 5495 | } |
| 5496 | |
| 5497 | void FieldOptions::MergeFrom(const FieldOptions& from) { |
| 5498 | GOOGLE_CHECK_NE(&from, this); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 5499 | uninterpreted_option_.MergeFrom(from.uninterpreted_option_); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5500 | if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 5501 | if (from.has_ctype()) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5502 | set_ctype(from.ctype()); |
| 5503 | } |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 5504 | if (from.has_packed()) { |
kenton@google.com | 2d6daa7 | 2009-01-22 01:27:00 +0000 | [diff] [blame] | 5505 | set_packed(from.packed()); |
| 5506 | } |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 5507 | if (from.has_deprecated()) { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 5508 | set_deprecated(from.deprecated()); |
| 5509 | } |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 5510 | if (from.has_experimental_map_key()) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5511 | set_experimental_map_key(from.experimental_map_key()); |
| 5512 | } |
| 5513 | } |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 5514 | _extensions_.MergeFrom(from._extensions_); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5515 | mutable_unknown_fields()->MergeFrom(from.unknown_fields()); |
| 5516 | } |
| 5517 | |
| 5518 | void FieldOptions::CopyFrom(const ::google::protobuf::Message& from) { |
| 5519 | if (&from == this) return; |
| 5520 | Clear(); |
| 5521 | MergeFrom(from); |
| 5522 | } |
| 5523 | |
| 5524 | void FieldOptions::CopyFrom(const FieldOptions& from) { |
| 5525 | if (&from == this) return; |
| 5526 | Clear(); |
| 5527 | MergeFrom(from); |
| 5528 | } |
| 5529 | |
kenton@google.com | ceb561d | 2009-06-25 19:05:36 +0000 | [diff] [blame] | 5530 | bool FieldOptions::IsInitialized() const { |
| 5531 | |
| 5532 | for (int i = 0; i < uninterpreted_option_size(); i++) { |
| 5533 | if (!this->uninterpreted_option(i).IsInitialized()) return false; |
| 5534 | } |
| 5535 | |
| 5536 | if (!_extensions_.IsInitialized()) return false; return true; |
| 5537 | } |
| 5538 | |
kenton@google.com | 26bd9ee | 2008-11-21 00:06:27 +0000 | [diff] [blame] | 5539 | void FieldOptions::Swap(FieldOptions* other) { |
| 5540 | if (other != this) { |
| 5541 | std::swap(ctype_, other->ctype_); |
kenton@google.com | 2d6daa7 | 2009-01-22 01:27:00 +0000 | [diff] [blame] | 5542 | std::swap(packed_, other->packed_); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 5543 | std::swap(deprecated_, other->deprecated_); |
kenton@google.com | 26bd9ee | 2008-11-21 00:06:27 +0000 | [diff] [blame] | 5544 | std::swap(experimental_map_key_, other->experimental_map_key_); |
| 5545 | uninterpreted_option_.Swap(&other->uninterpreted_option_); |
| 5546 | std::swap(_has_bits_[0], other->_has_bits_[0]); |
| 5547 | _unknown_fields_.Swap(&other->_unknown_fields_); |
| 5548 | std::swap(_cached_size_, other->_cached_size_); |
| 5549 | _extensions_.Swap(&other->_extensions_); |
| 5550 | } |
| 5551 | } |
| 5552 | |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 5553 | ::google::protobuf::Metadata FieldOptions::GetMetadata() const { |
| 5554 | protobuf_AssignDescriptorsOnce(); |
| 5555 | ::google::protobuf::Metadata metadata; |
| 5556 | metadata.descriptor = FieldOptions_descriptor_; |
| 5557 | metadata.reflection = FieldOptions_reflection_; |
| 5558 | return metadata; |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5559 | } |
| 5560 | |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5561 | |
| 5562 | // =================================================================== |
| 5563 | |
kenton@google.com | cfa2d8a | 2009-04-18 00:02:12 +0000 | [diff] [blame] | 5564 | #ifndef _MSC_VER |
| 5565 | const int EnumOptions::kUninterpretedOptionFieldNumber; |
| 5566 | #endif // !_MSC_VER |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5567 | |
kenton@google.com | 573989f | 2009-10-30 22:02:17 +0000 | [diff] [blame] | 5568 | EnumOptions::EnumOptions() |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 5569 | : ::google::protobuf::Message() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 5570 | SharedCtor(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5571 | } |
| 5572 | |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 5573 | void EnumOptions::InitAsDefaultInstance() { |
| 5574 | } |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 5575 | |
kenton@google.com | 573989f | 2009-10-30 22:02:17 +0000 | [diff] [blame] | 5576 | EnumOptions::EnumOptions(const EnumOptions& from) |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 5577 | : ::google::protobuf::Message() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 5578 | SharedCtor(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5579 | MergeFrom(from); |
| 5580 | } |
| 5581 | |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 5582 | void EnumOptions::SharedCtor() { |
| 5583 | _cached_size_ = 0; |
| 5584 | ::memset(_has_bits_, 0, sizeof(_has_bits_)); |
| 5585 | } |
| 5586 | |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5587 | EnumOptions::~EnumOptions() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 5588 | SharedDtor(); |
| 5589 | } |
| 5590 | |
| 5591 | void EnumOptions::SharedDtor() { |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 5592 | if (this != default_instance_) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5593 | } |
| 5594 | } |
| 5595 | |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 5596 | void EnumOptions::SetCachedSize(int size) const { |
| 5597 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
| 5598 | _cached_size_ = size; |
| 5599 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); |
| 5600 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5601 | const ::google::protobuf::Descriptor* EnumOptions::descriptor() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 5602 | protobuf_AssignDescriptorsOnce(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5603 | return EnumOptions_descriptor_; |
| 5604 | } |
| 5605 | |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 5606 | const EnumOptions& EnumOptions::default_instance() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 5607 | if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); return *default_instance_; |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 5608 | } |
| 5609 | |
| 5610 | EnumOptions* EnumOptions::default_instance_ = NULL; |
| 5611 | |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5612 | EnumOptions* EnumOptions::New() const { |
| 5613 | return new EnumOptions; |
| 5614 | } |
| 5615 | |
| 5616 | void EnumOptions::Clear() { |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 5617 | _extensions_.Clear(); |
| 5618 | uninterpreted_option_.Clear(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5619 | ::memset(_has_bits_, 0, sizeof(_has_bits_)); |
| 5620 | mutable_unknown_fields()->Clear(); |
| 5621 | } |
| 5622 | |
| 5623 | bool EnumOptions::MergePartialFromCodedStream( |
| 5624 | ::google::protobuf::io::CodedInputStream* input) { |
| 5625 | #define DO_(EXPRESSION) if (!(EXPRESSION)) return false |
| 5626 | ::google::protobuf::uint32 tag; |
| 5627 | while ((tag = input->ReadTag()) != 0) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 5628 | switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 5629 | // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; |
| 5630 | case 999: { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 5631 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 5632 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 5633 | parse_uninterpreted_option: |
| 5634 | DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( |
| 5635 | input, add_uninterpreted_option())); |
| 5636 | } else { |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 5637 | goto handle_uninterpreted; |
| 5638 | } |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 5639 | if (input->ExpectTag(7994)) goto parse_uninterpreted_option; |
| 5640 | if (input->ExpectAtEnd()) return true; |
| 5641 | break; |
| 5642 | } |
| 5643 | |
| 5644 | default: { |
| 5645 | handle_uninterpreted: |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 5646 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
| 5647 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 5648 | return true; |
| 5649 | } |
| 5650 | if ((8000u <= tag)) { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 5651 | DO_(_extensions_.ParseField(tag, input, default_instance_, |
| 5652 | mutable_unknown_fields())); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 5653 | continue; |
| 5654 | } |
| 5655 | DO_(::google::protobuf::internal::WireFormat::SkipField( |
| 5656 | input, tag, mutable_unknown_fields())); |
| 5657 | break; |
| 5658 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5659 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5660 | } |
| 5661 | return true; |
| 5662 | #undef DO_ |
| 5663 | } |
| 5664 | |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 5665 | void EnumOptions::SerializeWithCachedSizes( |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5666 | ::google::protobuf::io::CodedOutputStream* output) const { |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 5667 | // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; |
kenton@google.com | 2d6daa7 | 2009-01-22 01:27:00 +0000 | [diff] [blame] | 5668 | for (int i = 0; i < this->uninterpreted_option_size(); i++) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 5669 | ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 5670 | 999, this->uninterpreted_option(i), output); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 5671 | } |
| 5672 | |
| 5673 | // Extension range [1000, 536870912) |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 5674 | _extensions_.SerializeWithCachedSizes( |
| 5675 | 1000, 536870912, output); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 5676 | |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5677 | if (!unknown_fields().empty()) { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 5678 | ::google::protobuf::internal::WireFormat::SerializeUnknownFields( |
| 5679 | unknown_fields(), output); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5680 | } |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 5681 | } |
| 5682 | |
| 5683 | ::google::protobuf::uint8* EnumOptions::SerializeWithCachedSizesToArray( |
| 5684 | ::google::protobuf::uint8* target) const { |
| 5685 | // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; |
| 5686 | for (int i = 0; i < this->uninterpreted_option_size(); i++) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 5687 | target = ::google::protobuf::internal::WireFormatLite:: |
| 5688 | WriteMessageNoVirtualToArray( |
| 5689 | 999, this->uninterpreted_option(i), target); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 5690 | } |
| 5691 | |
| 5692 | // Extension range [1000, 536870912) |
| 5693 | target = _extensions_.SerializeWithCachedSizesToArray( |
| 5694 | 1000, 536870912, target); |
| 5695 | |
| 5696 | if (!unknown_fields().empty()) { |
| 5697 | target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( |
| 5698 | unknown_fields(), target); |
| 5699 | } |
| 5700 | return target; |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5701 | } |
| 5702 | |
| 5703 | int EnumOptions::ByteSize() const { |
| 5704 | int total_size = 0; |
| 5705 | |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 5706 | // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; |
kenton@google.com | 2d6daa7 | 2009-01-22 01:27:00 +0000 | [diff] [blame] | 5707 | total_size += 2 * this->uninterpreted_option_size(); |
| 5708 | for (int i = 0; i < this->uninterpreted_option_size(); i++) { |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 5709 | total_size += |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 5710 | ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 5711 | this->uninterpreted_option(i)); |
| 5712 | } |
| 5713 | |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 5714 | total_size += _extensions_.ByteSize(); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 5715 | |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5716 | if (!unknown_fields().empty()) { |
| 5717 | total_size += |
| 5718 | ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( |
| 5719 | unknown_fields()); |
| 5720 | } |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 5721 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5722 | _cached_size_ = total_size; |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 5723 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5724 | return total_size; |
| 5725 | } |
| 5726 | |
| 5727 | void EnumOptions::MergeFrom(const ::google::protobuf::Message& from) { |
| 5728 | GOOGLE_CHECK_NE(&from, this); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 5729 | const EnumOptions* source = |
| 5730 | ::google::protobuf::internal::dynamic_cast_if_available<const EnumOptions*>( |
| 5731 | &from); |
| 5732 | if (source == NULL) { |
| 5733 | ::google::protobuf::internal::ReflectionOps::Merge(from, this); |
| 5734 | } else { |
| 5735 | MergeFrom(*source); |
| 5736 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5737 | } |
| 5738 | |
| 5739 | void EnumOptions::MergeFrom(const EnumOptions& from) { |
| 5740 | GOOGLE_CHECK_NE(&from, this); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 5741 | uninterpreted_option_.MergeFrom(from.uninterpreted_option_); |
| 5742 | _extensions_.MergeFrom(from._extensions_); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5743 | mutable_unknown_fields()->MergeFrom(from.unknown_fields()); |
| 5744 | } |
| 5745 | |
| 5746 | void EnumOptions::CopyFrom(const ::google::protobuf::Message& from) { |
| 5747 | if (&from == this) return; |
| 5748 | Clear(); |
| 5749 | MergeFrom(from); |
| 5750 | } |
| 5751 | |
| 5752 | void EnumOptions::CopyFrom(const EnumOptions& from) { |
| 5753 | if (&from == this) return; |
| 5754 | Clear(); |
| 5755 | MergeFrom(from); |
| 5756 | } |
| 5757 | |
kenton@google.com | ceb561d | 2009-06-25 19:05:36 +0000 | [diff] [blame] | 5758 | bool EnumOptions::IsInitialized() const { |
| 5759 | |
| 5760 | for (int i = 0; i < uninterpreted_option_size(); i++) { |
| 5761 | if (!this->uninterpreted_option(i).IsInitialized()) return false; |
| 5762 | } |
| 5763 | |
| 5764 | if (!_extensions_.IsInitialized()) return false; return true; |
| 5765 | } |
| 5766 | |
kenton@google.com | 26bd9ee | 2008-11-21 00:06:27 +0000 | [diff] [blame] | 5767 | void EnumOptions::Swap(EnumOptions* other) { |
| 5768 | if (other != this) { |
| 5769 | uninterpreted_option_.Swap(&other->uninterpreted_option_); |
| 5770 | std::swap(_has_bits_[0], other->_has_bits_[0]); |
| 5771 | _unknown_fields_.Swap(&other->_unknown_fields_); |
| 5772 | std::swap(_cached_size_, other->_cached_size_); |
| 5773 | _extensions_.Swap(&other->_extensions_); |
| 5774 | } |
| 5775 | } |
| 5776 | |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 5777 | ::google::protobuf::Metadata EnumOptions::GetMetadata() const { |
| 5778 | protobuf_AssignDescriptorsOnce(); |
| 5779 | ::google::protobuf::Metadata metadata; |
| 5780 | metadata.descriptor = EnumOptions_descriptor_; |
| 5781 | metadata.reflection = EnumOptions_reflection_; |
| 5782 | return metadata; |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5783 | } |
| 5784 | |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5785 | |
| 5786 | // =================================================================== |
| 5787 | |
kenton@google.com | cfa2d8a | 2009-04-18 00:02:12 +0000 | [diff] [blame] | 5788 | #ifndef _MSC_VER |
| 5789 | const int EnumValueOptions::kUninterpretedOptionFieldNumber; |
| 5790 | #endif // !_MSC_VER |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5791 | |
kenton@google.com | 573989f | 2009-10-30 22:02:17 +0000 | [diff] [blame] | 5792 | EnumValueOptions::EnumValueOptions() |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 5793 | : ::google::protobuf::Message() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 5794 | SharedCtor(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5795 | } |
| 5796 | |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 5797 | void EnumValueOptions::InitAsDefaultInstance() { |
| 5798 | } |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 5799 | |
kenton@google.com | 573989f | 2009-10-30 22:02:17 +0000 | [diff] [blame] | 5800 | EnumValueOptions::EnumValueOptions(const EnumValueOptions& from) |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 5801 | : ::google::protobuf::Message() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 5802 | SharedCtor(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5803 | MergeFrom(from); |
| 5804 | } |
| 5805 | |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 5806 | void EnumValueOptions::SharedCtor() { |
| 5807 | _cached_size_ = 0; |
| 5808 | ::memset(_has_bits_, 0, sizeof(_has_bits_)); |
| 5809 | } |
| 5810 | |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5811 | EnumValueOptions::~EnumValueOptions() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 5812 | SharedDtor(); |
| 5813 | } |
| 5814 | |
| 5815 | void EnumValueOptions::SharedDtor() { |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 5816 | if (this != default_instance_) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5817 | } |
| 5818 | } |
| 5819 | |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 5820 | void EnumValueOptions::SetCachedSize(int size) const { |
| 5821 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
| 5822 | _cached_size_ = size; |
| 5823 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); |
| 5824 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5825 | const ::google::protobuf::Descriptor* EnumValueOptions::descriptor() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 5826 | protobuf_AssignDescriptorsOnce(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5827 | return EnumValueOptions_descriptor_; |
| 5828 | } |
| 5829 | |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 5830 | const EnumValueOptions& EnumValueOptions::default_instance() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 5831 | if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); return *default_instance_; |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 5832 | } |
| 5833 | |
| 5834 | EnumValueOptions* EnumValueOptions::default_instance_ = NULL; |
| 5835 | |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5836 | EnumValueOptions* EnumValueOptions::New() const { |
| 5837 | return new EnumValueOptions; |
| 5838 | } |
| 5839 | |
| 5840 | void EnumValueOptions::Clear() { |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 5841 | _extensions_.Clear(); |
| 5842 | uninterpreted_option_.Clear(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5843 | ::memset(_has_bits_, 0, sizeof(_has_bits_)); |
| 5844 | mutable_unknown_fields()->Clear(); |
| 5845 | } |
| 5846 | |
| 5847 | bool EnumValueOptions::MergePartialFromCodedStream( |
| 5848 | ::google::protobuf::io::CodedInputStream* input) { |
| 5849 | #define DO_(EXPRESSION) if (!(EXPRESSION)) return false |
| 5850 | ::google::protobuf::uint32 tag; |
| 5851 | while ((tag = input->ReadTag()) != 0) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 5852 | switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 5853 | // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; |
| 5854 | case 999: { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 5855 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 5856 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 5857 | parse_uninterpreted_option: |
| 5858 | DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( |
| 5859 | input, add_uninterpreted_option())); |
| 5860 | } else { |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 5861 | goto handle_uninterpreted; |
| 5862 | } |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 5863 | if (input->ExpectTag(7994)) goto parse_uninterpreted_option; |
| 5864 | if (input->ExpectAtEnd()) return true; |
| 5865 | break; |
| 5866 | } |
| 5867 | |
| 5868 | default: { |
| 5869 | handle_uninterpreted: |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 5870 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
| 5871 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 5872 | return true; |
| 5873 | } |
| 5874 | if ((8000u <= tag)) { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 5875 | DO_(_extensions_.ParseField(tag, input, default_instance_, |
| 5876 | mutable_unknown_fields())); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 5877 | continue; |
| 5878 | } |
| 5879 | DO_(::google::protobuf::internal::WireFormat::SkipField( |
| 5880 | input, tag, mutable_unknown_fields())); |
| 5881 | break; |
| 5882 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5883 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5884 | } |
| 5885 | return true; |
| 5886 | #undef DO_ |
| 5887 | } |
| 5888 | |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 5889 | void EnumValueOptions::SerializeWithCachedSizes( |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5890 | ::google::protobuf::io::CodedOutputStream* output) const { |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 5891 | // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; |
kenton@google.com | 2d6daa7 | 2009-01-22 01:27:00 +0000 | [diff] [blame] | 5892 | for (int i = 0; i < this->uninterpreted_option_size(); i++) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 5893 | ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 5894 | 999, this->uninterpreted_option(i), output); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 5895 | } |
| 5896 | |
| 5897 | // Extension range [1000, 536870912) |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 5898 | _extensions_.SerializeWithCachedSizes( |
| 5899 | 1000, 536870912, output); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 5900 | |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5901 | if (!unknown_fields().empty()) { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 5902 | ::google::protobuf::internal::WireFormat::SerializeUnknownFields( |
| 5903 | unknown_fields(), output); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5904 | } |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 5905 | } |
| 5906 | |
| 5907 | ::google::protobuf::uint8* EnumValueOptions::SerializeWithCachedSizesToArray( |
| 5908 | ::google::protobuf::uint8* target) const { |
| 5909 | // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; |
| 5910 | for (int i = 0; i < this->uninterpreted_option_size(); i++) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 5911 | target = ::google::protobuf::internal::WireFormatLite:: |
| 5912 | WriteMessageNoVirtualToArray( |
| 5913 | 999, this->uninterpreted_option(i), target); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 5914 | } |
| 5915 | |
| 5916 | // Extension range [1000, 536870912) |
| 5917 | target = _extensions_.SerializeWithCachedSizesToArray( |
| 5918 | 1000, 536870912, target); |
| 5919 | |
| 5920 | if (!unknown_fields().empty()) { |
| 5921 | target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( |
| 5922 | unknown_fields(), target); |
| 5923 | } |
| 5924 | return target; |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5925 | } |
| 5926 | |
| 5927 | int EnumValueOptions::ByteSize() const { |
| 5928 | int total_size = 0; |
| 5929 | |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 5930 | // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; |
kenton@google.com | 2d6daa7 | 2009-01-22 01:27:00 +0000 | [diff] [blame] | 5931 | total_size += 2 * this->uninterpreted_option_size(); |
| 5932 | for (int i = 0; i < this->uninterpreted_option_size(); i++) { |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 5933 | total_size += |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 5934 | ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 5935 | this->uninterpreted_option(i)); |
| 5936 | } |
| 5937 | |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 5938 | total_size += _extensions_.ByteSize(); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 5939 | |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5940 | if (!unknown_fields().empty()) { |
| 5941 | total_size += |
| 5942 | ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( |
| 5943 | unknown_fields()); |
| 5944 | } |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 5945 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5946 | _cached_size_ = total_size; |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 5947 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5948 | return total_size; |
| 5949 | } |
| 5950 | |
| 5951 | void EnumValueOptions::MergeFrom(const ::google::protobuf::Message& from) { |
| 5952 | GOOGLE_CHECK_NE(&from, this); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 5953 | const EnumValueOptions* source = |
| 5954 | ::google::protobuf::internal::dynamic_cast_if_available<const EnumValueOptions*>( |
| 5955 | &from); |
| 5956 | if (source == NULL) { |
| 5957 | ::google::protobuf::internal::ReflectionOps::Merge(from, this); |
| 5958 | } else { |
| 5959 | MergeFrom(*source); |
| 5960 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5961 | } |
| 5962 | |
| 5963 | void EnumValueOptions::MergeFrom(const EnumValueOptions& from) { |
| 5964 | GOOGLE_CHECK_NE(&from, this); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 5965 | uninterpreted_option_.MergeFrom(from.uninterpreted_option_); |
| 5966 | _extensions_.MergeFrom(from._extensions_); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 5967 | mutable_unknown_fields()->MergeFrom(from.unknown_fields()); |
| 5968 | } |
| 5969 | |
| 5970 | void EnumValueOptions::CopyFrom(const ::google::protobuf::Message& from) { |
| 5971 | if (&from == this) return; |
| 5972 | Clear(); |
| 5973 | MergeFrom(from); |
| 5974 | } |
| 5975 | |
| 5976 | void EnumValueOptions::CopyFrom(const EnumValueOptions& from) { |
| 5977 | if (&from == this) return; |
| 5978 | Clear(); |
| 5979 | MergeFrom(from); |
| 5980 | } |
| 5981 | |
kenton@google.com | ceb561d | 2009-06-25 19:05:36 +0000 | [diff] [blame] | 5982 | bool EnumValueOptions::IsInitialized() const { |
| 5983 | |
| 5984 | for (int i = 0; i < uninterpreted_option_size(); i++) { |
| 5985 | if (!this->uninterpreted_option(i).IsInitialized()) return false; |
| 5986 | } |
| 5987 | |
| 5988 | if (!_extensions_.IsInitialized()) return false; return true; |
| 5989 | } |
| 5990 | |
kenton@google.com | 26bd9ee | 2008-11-21 00:06:27 +0000 | [diff] [blame] | 5991 | void EnumValueOptions::Swap(EnumValueOptions* other) { |
| 5992 | if (other != this) { |
| 5993 | uninterpreted_option_.Swap(&other->uninterpreted_option_); |
| 5994 | std::swap(_has_bits_[0], other->_has_bits_[0]); |
| 5995 | _unknown_fields_.Swap(&other->_unknown_fields_); |
| 5996 | std::swap(_cached_size_, other->_cached_size_); |
| 5997 | _extensions_.Swap(&other->_extensions_); |
| 5998 | } |
| 5999 | } |
| 6000 | |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 6001 | ::google::protobuf::Metadata EnumValueOptions::GetMetadata() const { |
| 6002 | protobuf_AssignDescriptorsOnce(); |
| 6003 | ::google::protobuf::Metadata metadata; |
| 6004 | metadata.descriptor = EnumValueOptions_descriptor_; |
| 6005 | metadata.reflection = EnumValueOptions_reflection_; |
| 6006 | return metadata; |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 6007 | } |
| 6008 | |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 6009 | |
| 6010 | // =================================================================== |
| 6011 | |
kenton@google.com | cfa2d8a | 2009-04-18 00:02:12 +0000 | [diff] [blame] | 6012 | #ifndef _MSC_VER |
| 6013 | const int ServiceOptions::kUninterpretedOptionFieldNumber; |
| 6014 | #endif // !_MSC_VER |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 6015 | |
kenton@google.com | 573989f | 2009-10-30 22:02:17 +0000 | [diff] [blame] | 6016 | ServiceOptions::ServiceOptions() |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 6017 | : ::google::protobuf::Message() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 6018 | SharedCtor(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 6019 | } |
| 6020 | |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 6021 | void ServiceOptions::InitAsDefaultInstance() { |
| 6022 | } |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6023 | |
kenton@google.com | 573989f | 2009-10-30 22:02:17 +0000 | [diff] [blame] | 6024 | ServiceOptions::ServiceOptions(const ServiceOptions& from) |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 6025 | : ::google::protobuf::Message() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 6026 | SharedCtor(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 6027 | MergeFrom(from); |
| 6028 | } |
| 6029 | |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 6030 | void ServiceOptions::SharedCtor() { |
| 6031 | _cached_size_ = 0; |
| 6032 | ::memset(_has_bits_, 0, sizeof(_has_bits_)); |
| 6033 | } |
| 6034 | |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 6035 | ServiceOptions::~ServiceOptions() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 6036 | SharedDtor(); |
| 6037 | } |
| 6038 | |
| 6039 | void ServiceOptions::SharedDtor() { |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6040 | if (this != default_instance_) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 6041 | } |
| 6042 | } |
| 6043 | |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 6044 | void ServiceOptions::SetCachedSize(int size) const { |
| 6045 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
| 6046 | _cached_size_ = size; |
| 6047 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); |
| 6048 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 6049 | const ::google::protobuf::Descriptor* ServiceOptions::descriptor() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 6050 | protobuf_AssignDescriptorsOnce(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 6051 | return ServiceOptions_descriptor_; |
| 6052 | } |
| 6053 | |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6054 | const ServiceOptions& ServiceOptions::default_instance() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 6055 | if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); return *default_instance_; |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6056 | } |
| 6057 | |
| 6058 | ServiceOptions* ServiceOptions::default_instance_ = NULL; |
| 6059 | |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 6060 | ServiceOptions* ServiceOptions::New() const { |
| 6061 | return new ServiceOptions; |
| 6062 | } |
| 6063 | |
| 6064 | void ServiceOptions::Clear() { |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6065 | _extensions_.Clear(); |
| 6066 | uninterpreted_option_.Clear(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 6067 | ::memset(_has_bits_, 0, sizeof(_has_bits_)); |
| 6068 | mutable_unknown_fields()->Clear(); |
| 6069 | } |
| 6070 | |
| 6071 | bool ServiceOptions::MergePartialFromCodedStream( |
| 6072 | ::google::protobuf::io::CodedInputStream* input) { |
| 6073 | #define DO_(EXPRESSION) if (!(EXPRESSION)) return false |
| 6074 | ::google::protobuf::uint32 tag; |
| 6075 | while ((tag = input->ReadTag()) != 0) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 6076 | switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6077 | // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; |
| 6078 | case 999: { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 6079 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 6080 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 6081 | parse_uninterpreted_option: |
| 6082 | DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( |
| 6083 | input, add_uninterpreted_option())); |
| 6084 | } else { |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6085 | goto handle_uninterpreted; |
| 6086 | } |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6087 | if (input->ExpectTag(7994)) goto parse_uninterpreted_option; |
| 6088 | if (input->ExpectAtEnd()) return true; |
| 6089 | break; |
| 6090 | } |
| 6091 | |
| 6092 | default: { |
| 6093 | handle_uninterpreted: |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 6094 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
| 6095 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6096 | return true; |
| 6097 | } |
| 6098 | if ((8000u <= tag)) { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 6099 | DO_(_extensions_.ParseField(tag, input, default_instance_, |
| 6100 | mutable_unknown_fields())); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6101 | continue; |
| 6102 | } |
| 6103 | DO_(::google::protobuf::internal::WireFormat::SkipField( |
| 6104 | input, tag, mutable_unknown_fields())); |
| 6105 | break; |
| 6106 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 6107 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 6108 | } |
| 6109 | return true; |
| 6110 | #undef DO_ |
| 6111 | } |
| 6112 | |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 6113 | void ServiceOptions::SerializeWithCachedSizes( |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 6114 | ::google::protobuf::io::CodedOutputStream* output) const { |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6115 | // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; |
kenton@google.com | 2d6daa7 | 2009-01-22 01:27:00 +0000 | [diff] [blame] | 6116 | for (int i = 0; i < this->uninterpreted_option_size(); i++) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 6117 | ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 6118 | 999, this->uninterpreted_option(i), output); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6119 | } |
| 6120 | |
| 6121 | // Extension range [1000, 536870912) |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 6122 | _extensions_.SerializeWithCachedSizes( |
| 6123 | 1000, 536870912, output); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6124 | |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 6125 | if (!unknown_fields().empty()) { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 6126 | ::google::protobuf::internal::WireFormat::SerializeUnknownFields( |
| 6127 | unknown_fields(), output); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 6128 | } |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 6129 | } |
| 6130 | |
| 6131 | ::google::protobuf::uint8* ServiceOptions::SerializeWithCachedSizesToArray( |
| 6132 | ::google::protobuf::uint8* target) const { |
| 6133 | // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; |
| 6134 | for (int i = 0; i < this->uninterpreted_option_size(); i++) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 6135 | target = ::google::protobuf::internal::WireFormatLite:: |
| 6136 | WriteMessageNoVirtualToArray( |
| 6137 | 999, this->uninterpreted_option(i), target); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 6138 | } |
| 6139 | |
| 6140 | // Extension range [1000, 536870912) |
| 6141 | target = _extensions_.SerializeWithCachedSizesToArray( |
| 6142 | 1000, 536870912, target); |
| 6143 | |
| 6144 | if (!unknown_fields().empty()) { |
| 6145 | target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( |
| 6146 | unknown_fields(), target); |
| 6147 | } |
| 6148 | return target; |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 6149 | } |
| 6150 | |
| 6151 | int ServiceOptions::ByteSize() const { |
| 6152 | int total_size = 0; |
| 6153 | |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6154 | // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; |
kenton@google.com | 2d6daa7 | 2009-01-22 01:27:00 +0000 | [diff] [blame] | 6155 | total_size += 2 * this->uninterpreted_option_size(); |
| 6156 | for (int i = 0; i < this->uninterpreted_option_size(); i++) { |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6157 | total_size += |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 6158 | ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6159 | this->uninterpreted_option(i)); |
| 6160 | } |
| 6161 | |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 6162 | total_size += _extensions_.ByteSize(); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6163 | |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 6164 | if (!unknown_fields().empty()) { |
| 6165 | total_size += |
| 6166 | ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( |
| 6167 | unknown_fields()); |
| 6168 | } |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 6169 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 6170 | _cached_size_ = total_size; |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 6171 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 6172 | return total_size; |
| 6173 | } |
| 6174 | |
| 6175 | void ServiceOptions::MergeFrom(const ::google::protobuf::Message& from) { |
| 6176 | GOOGLE_CHECK_NE(&from, this); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6177 | const ServiceOptions* source = |
| 6178 | ::google::protobuf::internal::dynamic_cast_if_available<const ServiceOptions*>( |
| 6179 | &from); |
| 6180 | if (source == NULL) { |
| 6181 | ::google::protobuf::internal::ReflectionOps::Merge(from, this); |
| 6182 | } else { |
| 6183 | MergeFrom(*source); |
| 6184 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 6185 | } |
| 6186 | |
| 6187 | void ServiceOptions::MergeFrom(const ServiceOptions& from) { |
| 6188 | GOOGLE_CHECK_NE(&from, this); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6189 | uninterpreted_option_.MergeFrom(from.uninterpreted_option_); |
| 6190 | _extensions_.MergeFrom(from._extensions_); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 6191 | mutable_unknown_fields()->MergeFrom(from.unknown_fields()); |
| 6192 | } |
| 6193 | |
| 6194 | void ServiceOptions::CopyFrom(const ::google::protobuf::Message& from) { |
| 6195 | if (&from == this) return; |
| 6196 | Clear(); |
| 6197 | MergeFrom(from); |
| 6198 | } |
| 6199 | |
| 6200 | void ServiceOptions::CopyFrom(const ServiceOptions& from) { |
| 6201 | if (&from == this) return; |
| 6202 | Clear(); |
| 6203 | MergeFrom(from); |
| 6204 | } |
| 6205 | |
kenton@google.com | ceb561d | 2009-06-25 19:05:36 +0000 | [diff] [blame] | 6206 | bool ServiceOptions::IsInitialized() const { |
| 6207 | |
| 6208 | for (int i = 0; i < uninterpreted_option_size(); i++) { |
| 6209 | if (!this->uninterpreted_option(i).IsInitialized()) return false; |
| 6210 | } |
| 6211 | |
| 6212 | if (!_extensions_.IsInitialized()) return false; return true; |
| 6213 | } |
| 6214 | |
kenton@google.com | 26bd9ee | 2008-11-21 00:06:27 +0000 | [diff] [blame] | 6215 | void ServiceOptions::Swap(ServiceOptions* other) { |
| 6216 | if (other != this) { |
| 6217 | uninterpreted_option_.Swap(&other->uninterpreted_option_); |
| 6218 | std::swap(_has_bits_[0], other->_has_bits_[0]); |
| 6219 | _unknown_fields_.Swap(&other->_unknown_fields_); |
| 6220 | std::swap(_cached_size_, other->_cached_size_); |
| 6221 | _extensions_.Swap(&other->_extensions_); |
| 6222 | } |
| 6223 | } |
| 6224 | |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 6225 | ::google::protobuf::Metadata ServiceOptions::GetMetadata() const { |
| 6226 | protobuf_AssignDescriptorsOnce(); |
| 6227 | ::google::protobuf::Metadata metadata; |
| 6228 | metadata.descriptor = ServiceOptions_descriptor_; |
| 6229 | metadata.reflection = ServiceOptions_reflection_; |
| 6230 | return metadata; |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 6231 | } |
| 6232 | |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 6233 | |
| 6234 | // =================================================================== |
| 6235 | |
kenton@google.com | cfa2d8a | 2009-04-18 00:02:12 +0000 | [diff] [blame] | 6236 | #ifndef _MSC_VER |
| 6237 | const int MethodOptions::kUninterpretedOptionFieldNumber; |
| 6238 | #endif // !_MSC_VER |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 6239 | |
kenton@google.com | 573989f | 2009-10-30 22:02:17 +0000 | [diff] [blame] | 6240 | MethodOptions::MethodOptions() |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 6241 | : ::google::protobuf::Message() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 6242 | SharedCtor(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 6243 | } |
| 6244 | |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 6245 | void MethodOptions::InitAsDefaultInstance() { |
| 6246 | } |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6247 | |
kenton@google.com | 573989f | 2009-10-30 22:02:17 +0000 | [diff] [blame] | 6248 | MethodOptions::MethodOptions(const MethodOptions& from) |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 6249 | : ::google::protobuf::Message() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 6250 | SharedCtor(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 6251 | MergeFrom(from); |
| 6252 | } |
| 6253 | |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 6254 | void MethodOptions::SharedCtor() { |
| 6255 | _cached_size_ = 0; |
| 6256 | ::memset(_has_bits_, 0, sizeof(_has_bits_)); |
| 6257 | } |
| 6258 | |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 6259 | MethodOptions::~MethodOptions() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 6260 | SharedDtor(); |
| 6261 | } |
| 6262 | |
| 6263 | void MethodOptions::SharedDtor() { |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6264 | if (this != default_instance_) { |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 6265 | } |
| 6266 | } |
| 6267 | |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 6268 | void MethodOptions::SetCachedSize(int size) const { |
| 6269 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
| 6270 | _cached_size_ = size; |
| 6271 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); |
| 6272 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 6273 | const ::google::protobuf::Descriptor* MethodOptions::descriptor() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 6274 | protobuf_AssignDescriptorsOnce(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 6275 | return MethodOptions_descriptor_; |
| 6276 | } |
| 6277 | |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6278 | const MethodOptions& MethodOptions::default_instance() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 6279 | if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); return *default_instance_; |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6280 | } |
| 6281 | |
| 6282 | MethodOptions* MethodOptions::default_instance_ = NULL; |
| 6283 | |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 6284 | MethodOptions* MethodOptions::New() const { |
| 6285 | return new MethodOptions; |
| 6286 | } |
| 6287 | |
| 6288 | void MethodOptions::Clear() { |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6289 | _extensions_.Clear(); |
| 6290 | uninterpreted_option_.Clear(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 6291 | ::memset(_has_bits_, 0, sizeof(_has_bits_)); |
| 6292 | mutable_unknown_fields()->Clear(); |
| 6293 | } |
| 6294 | |
| 6295 | bool MethodOptions::MergePartialFromCodedStream( |
| 6296 | ::google::protobuf::io::CodedInputStream* input) { |
| 6297 | #define DO_(EXPRESSION) if (!(EXPRESSION)) return false |
| 6298 | ::google::protobuf::uint32 tag; |
| 6299 | while ((tag = input->ReadTag()) != 0) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 6300 | switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6301 | // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; |
| 6302 | case 999: { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 6303 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 6304 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 6305 | parse_uninterpreted_option: |
| 6306 | DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( |
| 6307 | input, add_uninterpreted_option())); |
| 6308 | } else { |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6309 | goto handle_uninterpreted; |
| 6310 | } |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6311 | if (input->ExpectTag(7994)) goto parse_uninterpreted_option; |
| 6312 | if (input->ExpectAtEnd()) return true; |
| 6313 | break; |
| 6314 | } |
| 6315 | |
| 6316 | default: { |
| 6317 | handle_uninterpreted: |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 6318 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
| 6319 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6320 | return true; |
| 6321 | } |
| 6322 | if ((8000u <= tag)) { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 6323 | DO_(_extensions_.ParseField(tag, input, default_instance_, |
| 6324 | mutable_unknown_fields())); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6325 | continue; |
| 6326 | } |
| 6327 | DO_(::google::protobuf::internal::WireFormat::SkipField( |
| 6328 | input, tag, mutable_unknown_fields())); |
| 6329 | break; |
| 6330 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 6331 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 6332 | } |
| 6333 | return true; |
| 6334 | #undef DO_ |
| 6335 | } |
| 6336 | |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 6337 | void MethodOptions::SerializeWithCachedSizes( |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 6338 | ::google::protobuf::io::CodedOutputStream* output) const { |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6339 | // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; |
kenton@google.com | 2d6daa7 | 2009-01-22 01:27:00 +0000 | [diff] [blame] | 6340 | for (int i = 0; i < this->uninterpreted_option_size(); i++) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 6341 | ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 6342 | 999, this->uninterpreted_option(i), output); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6343 | } |
| 6344 | |
| 6345 | // Extension range [1000, 536870912) |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 6346 | _extensions_.SerializeWithCachedSizes( |
| 6347 | 1000, 536870912, output); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6348 | |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 6349 | if (!unknown_fields().empty()) { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 6350 | ::google::protobuf::internal::WireFormat::SerializeUnknownFields( |
| 6351 | unknown_fields(), output); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 6352 | } |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 6353 | } |
| 6354 | |
| 6355 | ::google::protobuf::uint8* MethodOptions::SerializeWithCachedSizesToArray( |
| 6356 | ::google::protobuf::uint8* target) const { |
| 6357 | // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; |
| 6358 | for (int i = 0; i < this->uninterpreted_option_size(); i++) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 6359 | target = ::google::protobuf::internal::WireFormatLite:: |
| 6360 | WriteMessageNoVirtualToArray( |
| 6361 | 999, this->uninterpreted_option(i), target); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 6362 | } |
| 6363 | |
| 6364 | // Extension range [1000, 536870912) |
| 6365 | target = _extensions_.SerializeWithCachedSizesToArray( |
| 6366 | 1000, 536870912, target); |
| 6367 | |
| 6368 | if (!unknown_fields().empty()) { |
| 6369 | target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( |
| 6370 | unknown_fields(), target); |
| 6371 | } |
| 6372 | return target; |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 6373 | } |
| 6374 | |
| 6375 | int MethodOptions::ByteSize() const { |
| 6376 | int total_size = 0; |
| 6377 | |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6378 | // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; |
kenton@google.com | 2d6daa7 | 2009-01-22 01:27:00 +0000 | [diff] [blame] | 6379 | total_size += 2 * this->uninterpreted_option_size(); |
| 6380 | for (int i = 0; i < this->uninterpreted_option_size(); i++) { |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6381 | total_size += |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 6382 | ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6383 | this->uninterpreted_option(i)); |
| 6384 | } |
| 6385 | |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 6386 | total_size += _extensions_.ByteSize(); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6387 | |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 6388 | if (!unknown_fields().empty()) { |
| 6389 | total_size += |
| 6390 | ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( |
| 6391 | unknown_fields()); |
| 6392 | } |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 6393 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 6394 | _cached_size_ = total_size; |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 6395 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 6396 | return total_size; |
| 6397 | } |
| 6398 | |
| 6399 | void MethodOptions::MergeFrom(const ::google::protobuf::Message& from) { |
| 6400 | GOOGLE_CHECK_NE(&from, this); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6401 | const MethodOptions* source = |
| 6402 | ::google::protobuf::internal::dynamic_cast_if_available<const MethodOptions*>( |
| 6403 | &from); |
| 6404 | if (source == NULL) { |
| 6405 | ::google::protobuf::internal::ReflectionOps::Merge(from, this); |
| 6406 | } else { |
| 6407 | MergeFrom(*source); |
| 6408 | } |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 6409 | } |
| 6410 | |
| 6411 | void MethodOptions::MergeFrom(const MethodOptions& from) { |
| 6412 | GOOGLE_CHECK_NE(&from, this); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6413 | uninterpreted_option_.MergeFrom(from.uninterpreted_option_); |
| 6414 | _extensions_.MergeFrom(from._extensions_); |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 6415 | mutable_unknown_fields()->MergeFrom(from.unknown_fields()); |
| 6416 | } |
| 6417 | |
| 6418 | void MethodOptions::CopyFrom(const ::google::protobuf::Message& from) { |
| 6419 | if (&from == this) return; |
| 6420 | Clear(); |
| 6421 | MergeFrom(from); |
| 6422 | } |
| 6423 | |
| 6424 | void MethodOptions::CopyFrom(const MethodOptions& from) { |
| 6425 | if (&from == this) return; |
| 6426 | Clear(); |
| 6427 | MergeFrom(from); |
| 6428 | } |
| 6429 | |
kenton@google.com | ceb561d | 2009-06-25 19:05:36 +0000 | [diff] [blame] | 6430 | bool MethodOptions::IsInitialized() const { |
| 6431 | |
| 6432 | for (int i = 0; i < uninterpreted_option_size(); i++) { |
| 6433 | if (!this->uninterpreted_option(i).IsInitialized()) return false; |
| 6434 | } |
| 6435 | |
| 6436 | if (!_extensions_.IsInitialized()) return false; return true; |
| 6437 | } |
| 6438 | |
kenton@google.com | 26bd9ee | 2008-11-21 00:06:27 +0000 | [diff] [blame] | 6439 | void MethodOptions::Swap(MethodOptions* other) { |
| 6440 | if (other != this) { |
| 6441 | uninterpreted_option_.Swap(&other->uninterpreted_option_); |
| 6442 | std::swap(_has_bits_[0], other->_has_bits_[0]); |
| 6443 | _unknown_fields_.Swap(&other->_unknown_fields_); |
| 6444 | std::swap(_cached_size_, other->_cached_size_); |
| 6445 | _extensions_.Swap(&other->_extensions_); |
| 6446 | } |
| 6447 | } |
| 6448 | |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 6449 | ::google::protobuf::Metadata MethodOptions::GetMetadata() const { |
| 6450 | protobuf_AssignDescriptorsOnce(); |
| 6451 | ::google::protobuf::Metadata metadata; |
| 6452 | metadata.descriptor = MethodOptions_descriptor_; |
| 6453 | metadata.reflection = MethodOptions_reflection_; |
| 6454 | return metadata; |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 6455 | } |
| 6456 | |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 6457 | |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6458 | // =================================================================== |
| 6459 | |
kenton@google.com | cfa2d8a | 2009-04-18 00:02:12 +0000 | [diff] [blame] | 6460 | #ifndef _MSC_VER |
| 6461 | const int UninterpretedOption_NamePart::kNamePartFieldNumber; |
| 6462 | const int UninterpretedOption_NamePart::kIsExtensionFieldNumber; |
| 6463 | #endif // !_MSC_VER |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6464 | |
kenton@google.com | 573989f | 2009-10-30 22:02:17 +0000 | [diff] [blame] | 6465 | UninterpretedOption_NamePart::UninterpretedOption_NamePart() |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 6466 | : ::google::protobuf::Message() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 6467 | SharedCtor(); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6468 | } |
| 6469 | |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 6470 | void UninterpretedOption_NamePart::InitAsDefaultInstance() { |
| 6471 | } |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6472 | |
kenton@google.com | 573989f | 2009-10-30 22:02:17 +0000 | [diff] [blame] | 6473 | UninterpretedOption_NamePart::UninterpretedOption_NamePart(const UninterpretedOption_NamePart& from) |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 6474 | : ::google::protobuf::Message() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 6475 | SharedCtor(); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6476 | MergeFrom(from); |
| 6477 | } |
| 6478 | |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 6479 | void UninterpretedOption_NamePart::SharedCtor() { |
| 6480 | _cached_size_ = 0; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 6481 | name_part_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 6482 | is_extension_ = false; |
| 6483 | ::memset(_has_bits_, 0, sizeof(_has_bits_)); |
| 6484 | } |
| 6485 | |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6486 | UninterpretedOption_NamePart::~UninterpretedOption_NamePart() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 6487 | SharedDtor(); |
| 6488 | } |
| 6489 | |
| 6490 | void UninterpretedOption_NamePart::SharedDtor() { |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 6491 | if (name_part_ != &::google::protobuf::internal::kEmptyString) { |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6492 | delete name_part_; |
| 6493 | } |
| 6494 | if (this != default_instance_) { |
| 6495 | } |
| 6496 | } |
| 6497 | |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 6498 | void UninterpretedOption_NamePart::SetCachedSize(int size) const { |
| 6499 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
| 6500 | _cached_size_ = size; |
| 6501 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); |
| 6502 | } |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6503 | const ::google::protobuf::Descriptor* UninterpretedOption_NamePart::descriptor() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 6504 | protobuf_AssignDescriptorsOnce(); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6505 | return UninterpretedOption_NamePart_descriptor_; |
| 6506 | } |
| 6507 | |
| 6508 | const UninterpretedOption_NamePart& UninterpretedOption_NamePart::default_instance() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 6509 | if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); return *default_instance_; |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6510 | } |
| 6511 | |
| 6512 | UninterpretedOption_NamePart* UninterpretedOption_NamePart::default_instance_ = NULL; |
| 6513 | |
| 6514 | UninterpretedOption_NamePart* UninterpretedOption_NamePart::New() const { |
| 6515 | return new UninterpretedOption_NamePart; |
| 6516 | } |
| 6517 | |
| 6518 | void UninterpretedOption_NamePart::Clear() { |
| 6519 | if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 6520 | if (has_name_part()) { |
| 6521 | if (name_part_ != &::google::protobuf::internal::kEmptyString) { |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6522 | name_part_->clear(); |
| 6523 | } |
| 6524 | } |
| 6525 | is_extension_ = false; |
| 6526 | } |
| 6527 | ::memset(_has_bits_, 0, sizeof(_has_bits_)); |
| 6528 | mutable_unknown_fields()->Clear(); |
| 6529 | } |
| 6530 | |
| 6531 | bool UninterpretedOption_NamePart::MergePartialFromCodedStream( |
| 6532 | ::google::protobuf::io::CodedInputStream* input) { |
| 6533 | #define DO_(EXPRESSION) if (!(EXPRESSION)) return false |
| 6534 | ::google::protobuf::uint32 tag; |
| 6535 | while ((tag = input->ReadTag()) != 0) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 6536 | switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6537 | // required string name_part = 1; |
| 6538 | case 1: { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 6539 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 6540 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 6541 | DO_(::google::protobuf::internal::WireFormatLite::ReadString( |
| 6542 | input, this->mutable_name_part())); |
| 6543 | ::google::protobuf::internal::WireFormat::VerifyUTF8String( |
| 6544 | this->name_part().data(), this->name_part().length(), |
| 6545 | ::google::protobuf::internal::WireFormat::PARSE); |
| 6546 | } else { |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6547 | goto handle_uninterpreted; |
| 6548 | } |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6549 | if (input->ExpectTag(16)) goto parse_is_extension; |
| 6550 | break; |
| 6551 | } |
| 6552 | |
| 6553 | // required bool is_extension = 2; |
| 6554 | case 2: { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 6555 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 6556 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 6557 | parse_is_extension: |
| 6558 | DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< |
| 6559 | bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( |
| 6560 | input, &is_extension_))); |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 6561 | set_has_is_extension(); |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 6562 | } else { |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6563 | goto handle_uninterpreted; |
| 6564 | } |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6565 | if (input->ExpectAtEnd()) return true; |
| 6566 | break; |
| 6567 | } |
| 6568 | |
| 6569 | default: { |
| 6570 | handle_uninterpreted: |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 6571 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
| 6572 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6573 | return true; |
| 6574 | } |
| 6575 | DO_(::google::protobuf::internal::WireFormat::SkipField( |
| 6576 | input, tag, mutable_unknown_fields())); |
| 6577 | break; |
| 6578 | } |
| 6579 | } |
| 6580 | } |
| 6581 | return true; |
| 6582 | #undef DO_ |
| 6583 | } |
| 6584 | |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 6585 | void UninterpretedOption_NamePart::SerializeWithCachedSizes( |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6586 | ::google::protobuf::io::CodedOutputStream* output) const { |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6587 | // required string name_part = 1; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 6588 | if (has_name_part()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 6589 | ::google::protobuf::internal::WireFormat::VerifyUTF8String( |
| 6590 | this->name_part().data(), this->name_part().length(), |
| 6591 | ::google::protobuf::internal::WireFormat::SERIALIZE); |
| 6592 | ::google::protobuf::internal::WireFormatLite::WriteString( |
| 6593 | 1, this->name_part(), output); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6594 | } |
| 6595 | |
| 6596 | // required bool is_extension = 2; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 6597 | if (has_is_extension()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 6598 | ::google::protobuf::internal::WireFormatLite::WriteBool(2, this->is_extension(), output); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6599 | } |
| 6600 | |
| 6601 | if (!unknown_fields().empty()) { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 6602 | ::google::protobuf::internal::WireFormat::SerializeUnknownFields( |
| 6603 | unknown_fields(), output); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6604 | } |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 6605 | } |
| 6606 | |
| 6607 | ::google::protobuf::uint8* UninterpretedOption_NamePart::SerializeWithCachedSizesToArray( |
| 6608 | ::google::protobuf::uint8* target) const { |
| 6609 | // required string name_part = 1; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 6610 | if (has_name_part()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 6611 | ::google::protobuf::internal::WireFormat::VerifyUTF8String( |
| 6612 | this->name_part().data(), this->name_part().length(), |
| 6613 | ::google::protobuf::internal::WireFormat::SERIALIZE); |
| 6614 | target = |
| 6615 | ::google::protobuf::internal::WireFormatLite::WriteStringToArray( |
| 6616 | 1, this->name_part(), target); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 6617 | } |
| 6618 | |
| 6619 | // required bool is_extension = 2; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 6620 | if (has_is_extension()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 6621 | target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(2, this->is_extension(), target); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 6622 | } |
| 6623 | |
| 6624 | if (!unknown_fields().empty()) { |
| 6625 | target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( |
| 6626 | unknown_fields(), target); |
| 6627 | } |
| 6628 | return target; |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6629 | } |
| 6630 | |
| 6631 | int UninterpretedOption_NamePart::ByteSize() const { |
| 6632 | int total_size = 0; |
| 6633 | |
| 6634 | if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { |
| 6635 | // required string name_part = 1; |
| 6636 | if (has_name_part()) { |
| 6637 | total_size += 1 + |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 6638 | ::google::protobuf::internal::WireFormatLite::StringSize( |
| 6639 | this->name_part()); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6640 | } |
| 6641 | |
| 6642 | // required bool is_extension = 2; |
| 6643 | if (has_is_extension()) { |
| 6644 | total_size += 1 + 1; |
| 6645 | } |
| 6646 | |
| 6647 | } |
| 6648 | if (!unknown_fields().empty()) { |
| 6649 | total_size += |
| 6650 | ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( |
| 6651 | unknown_fields()); |
| 6652 | } |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 6653 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6654 | _cached_size_ = total_size; |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 6655 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6656 | return total_size; |
| 6657 | } |
| 6658 | |
| 6659 | void UninterpretedOption_NamePart::MergeFrom(const ::google::protobuf::Message& from) { |
| 6660 | GOOGLE_CHECK_NE(&from, this); |
| 6661 | const UninterpretedOption_NamePart* source = |
| 6662 | ::google::protobuf::internal::dynamic_cast_if_available<const UninterpretedOption_NamePart*>( |
| 6663 | &from); |
| 6664 | if (source == NULL) { |
| 6665 | ::google::protobuf::internal::ReflectionOps::Merge(from, this); |
| 6666 | } else { |
| 6667 | MergeFrom(*source); |
| 6668 | } |
| 6669 | } |
| 6670 | |
| 6671 | void UninterpretedOption_NamePart::MergeFrom(const UninterpretedOption_NamePart& from) { |
| 6672 | GOOGLE_CHECK_NE(&from, this); |
| 6673 | if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 6674 | if (from.has_name_part()) { |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6675 | set_name_part(from.name_part()); |
| 6676 | } |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 6677 | if (from.has_is_extension()) { |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6678 | set_is_extension(from.is_extension()); |
| 6679 | } |
| 6680 | } |
| 6681 | mutable_unknown_fields()->MergeFrom(from.unknown_fields()); |
| 6682 | } |
| 6683 | |
| 6684 | void UninterpretedOption_NamePart::CopyFrom(const ::google::protobuf::Message& from) { |
| 6685 | if (&from == this) return; |
| 6686 | Clear(); |
| 6687 | MergeFrom(from); |
| 6688 | } |
| 6689 | |
| 6690 | void UninterpretedOption_NamePart::CopyFrom(const UninterpretedOption_NamePart& from) { |
| 6691 | if (&from == this) return; |
| 6692 | Clear(); |
| 6693 | MergeFrom(from); |
| 6694 | } |
| 6695 | |
kenton@google.com | ceb561d | 2009-06-25 19:05:36 +0000 | [diff] [blame] | 6696 | bool UninterpretedOption_NamePart::IsInitialized() const { |
| 6697 | if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false; |
| 6698 | |
| 6699 | return true; |
| 6700 | } |
| 6701 | |
kenton@google.com | 26bd9ee | 2008-11-21 00:06:27 +0000 | [diff] [blame] | 6702 | void UninterpretedOption_NamePart::Swap(UninterpretedOption_NamePart* other) { |
| 6703 | if (other != this) { |
| 6704 | std::swap(name_part_, other->name_part_); |
| 6705 | std::swap(is_extension_, other->is_extension_); |
| 6706 | std::swap(_has_bits_[0], other->_has_bits_[0]); |
| 6707 | _unknown_fields_.Swap(&other->_unknown_fields_); |
| 6708 | std::swap(_cached_size_, other->_cached_size_); |
| 6709 | } |
| 6710 | } |
| 6711 | |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 6712 | ::google::protobuf::Metadata UninterpretedOption_NamePart::GetMetadata() const { |
| 6713 | protobuf_AssignDescriptorsOnce(); |
| 6714 | ::google::protobuf::Metadata metadata; |
| 6715 | metadata.descriptor = UninterpretedOption_NamePart_descriptor_; |
| 6716 | metadata.reflection = UninterpretedOption_NamePart_reflection_; |
| 6717 | return metadata; |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6718 | } |
| 6719 | |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6720 | |
| 6721 | // ------------------------------------------------------------------- |
| 6722 | |
kenton@google.com | cfa2d8a | 2009-04-18 00:02:12 +0000 | [diff] [blame] | 6723 | #ifndef _MSC_VER |
| 6724 | const int UninterpretedOption::kNameFieldNumber; |
| 6725 | const int UninterpretedOption::kIdentifierValueFieldNumber; |
| 6726 | const int UninterpretedOption::kPositiveIntValueFieldNumber; |
| 6727 | const int UninterpretedOption::kNegativeIntValueFieldNumber; |
| 6728 | const int UninterpretedOption::kDoubleValueFieldNumber; |
| 6729 | const int UninterpretedOption::kStringValueFieldNumber; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 6730 | const int UninterpretedOption::kAggregateValueFieldNumber; |
kenton@google.com | cfa2d8a | 2009-04-18 00:02:12 +0000 | [diff] [blame] | 6731 | #endif // !_MSC_VER |
| 6732 | |
kenton@google.com | 573989f | 2009-10-30 22:02:17 +0000 | [diff] [blame] | 6733 | UninterpretedOption::UninterpretedOption() |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 6734 | : ::google::protobuf::Message() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 6735 | SharedCtor(); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6736 | } |
| 6737 | |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 6738 | void UninterpretedOption::InitAsDefaultInstance() { |
| 6739 | } |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6740 | |
kenton@google.com | 573989f | 2009-10-30 22:02:17 +0000 | [diff] [blame] | 6741 | UninterpretedOption::UninterpretedOption(const UninterpretedOption& from) |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 6742 | : ::google::protobuf::Message() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 6743 | SharedCtor(); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6744 | MergeFrom(from); |
| 6745 | } |
| 6746 | |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 6747 | void UninterpretedOption::SharedCtor() { |
| 6748 | _cached_size_ = 0; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 6749 | identifier_value_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 6750 | positive_int_value_ = GOOGLE_ULONGLONG(0); |
| 6751 | negative_int_value_ = GOOGLE_LONGLONG(0); |
| 6752 | double_value_ = 0; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 6753 | string_value_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); |
| 6754 | aggregate_value_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 6755 | ::memset(_has_bits_, 0, sizeof(_has_bits_)); |
| 6756 | } |
| 6757 | |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6758 | UninterpretedOption::~UninterpretedOption() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 6759 | SharedDtor(); |
| 6760 | } |
| 6761 | |
| 6762 | void UninterpretedOption::SharedDtor() { |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 6763 | if (identifier_value_ != &::google::protobuf::internal::kEmptyString) { |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6764 | delete identifier_value_; |
| 6765 | } |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 6766 | if (string_value_ != &::google::protobuf::internal::kEmptyString) { |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6767 | delete string_value_; |
| 6768 | } |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 6769 | if (aggregate_value_ != &::google::protobuf::internal::kEmptyString) { |
| 6770 | delete aggregate_value_; |
| 6771 | } |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6772 | if (this != default_instance_) { |
| 6773 | } |
| 6774 | } |
| 6775 | |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 6776 | void UninterpretedOption::SetCachedSize(int size) const { |
| 6777 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
| 6778 | _cached_size_ = size; |
| 6779 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); |
| 6780 | } |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6781 | const ::google::protobuf::Descriptor* UninterpretedOption::descriptor() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 6782 | protobuf_AssignDescriptorsOnce(); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6783 | return UninterpretedOption_descriptor_; |
| 6784 | } |
| 6785 | |
| 6786 | const UninterpretedOption& UninterpretedOption::default_instance() { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 6787 | if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); return *default_instance_; |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6788 | } |
| 6789 | |
| 6790 | UninterpretedOption* UninterpretedOption::default_instance_ = NULL; |
| 6791 | |
| 6792 | UninterpretedOption* UninterpretedOption::New() const { |
| 6793 | return new UninterpretedOption; |
| 6794 | } |
| 6795 | |
| 6796 | void UninterpretedOption::Clear() { |
| 6797 | if (_has_bits_[1 / 32] & (0xffu << (1 % 32))) { |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 6798 | if (has_identifier_value()) { |
| 6799 | if (identifier_value_ != &::google::protobuf::internal::kEmptyString) { |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6800 | identifier_value_->clear(); |
| 6801 | } |
| 6802 | } |
| 6803 | positive_int_value_ = GOOGLE_ULONGLONG(0); |
| 6804 | negative_int_value_ = GOOGLE_LONGLONG(0); |
| 6805 | double_value_ = 0; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 6806 | if (has_string_value()) { |
| 6807 | if (string_value_ != &::google::protobuf::internal::kEmptyString) { |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6808 | string_value_->clear(); |
| 6809 | } |
| 6810 | } |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 6811 | if (has_aggregate_value()) { |
| 6812 | if (aggregate_value_ != &::google::protobuf::internal::kEmptyString) { |
| 6813 | aggregate_value_->clear(); |
| 6814 | } |
| 6815 | } |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6816 | } |
| 6817 | name_.Clear(); |
| 6818 | ::memset(_has_bits_, 0, sizeof(_has_bits_)); |
| 6819 | mutable_unknown_fields()->Clear(); |
| 6820 | } |
| 6821 | |
| 6822 | bool UninterpretedOption::MergePartialFromCodedStream( |
| 6823 | ::google::protobuf::io::CodedInputStream* input) { |
| 6824 | #define DO_(EXPRESSION) if (!(EXPRESSION)) return false |
| 6825 | ::google::protobuf::uint32 tag; |
| 6826 | while ((tag = input->ReadTag()) != 0) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 6827 | switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6828 | // repeated .google.protobuf.UninterpretedOption.NamePart name = 2; |
| 6829 | case 2: { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 6830 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 6831 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 6832 | parse_name: |
| 6833 | DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( |
| 6834 | input, add_name())); |
| 6835 | } else { |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6836 | goto handle_uninterpreted; |
| 6837 | } |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6838 | if (input->ExpectTag(18)) goto parse_name; |
| 6839 | if (input->ExpectTag(26)) goto parse_identifier_value; |
| 6840 | break; |
| 6841 | } |
| 6842 | |
| 6843 | // optional string identifier_value = 3; |
| 6844 | case 3: { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 6845 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 6846 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 6847 | parse_identifier_value: |
| 6848 | DO_(::google::protobuf::internal::WireFormatLite::ReadString( |
| 6849 | input, this->mutable_identifier_value())); |
| 6850 | ::google::protobuf::internal::WireFormat::VerifyUTF8String( |
| 6851 | this->identifier_value().data(), this->identifier_value().length(), |
| 6852 | ::google::protobuf::internal::WireFormat::PARSE); |
| 6853 | } else { |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6854 | goto handle_uninterpreted; |
| 6855 | } |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6856 | if (input->ExpectTag(32)) goto parse_positive_int_value; |
| 6857 | break; |
| 6858 | } |
| 6859 | |
| 6860 | // optional uint64 positive_int_value = 4; |
| 6861 | case 4: { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 6862 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 6863 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 6864 | parse_positive_int_value: |
| 6865 | DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< |
| 6866 | ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( |
| 6867 | input, &positive_int_value_))); |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 6868 | set_has_positive_int_value(); |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 6869 | } else { |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6870 | goto handle_uninterpreted; |
| 6871 | } |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6872 | if (input->ExpectTag(40)) goto parse_negative_int_value; |
| 6873 | break; |
| 6874 | } |
| 6875 | |
| 6876 | // optional int64 negative_int_value = 5; |
| 6877 | case 5: { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 6878 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 6879 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 6880 | parse_negative_int_value: |
| 6881 | DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< |
| 6882 | ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( |
| 6883 | input, &negative_int_value_))); |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 6884 | set_has_negative_int_value(); |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 6885 | } else { |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6886 | goto handle_uninterpreted; |
| 6887 | } |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6888 | if (input->ExpectTag(49)) goto parse_double_value; |
| 6889 | break; |
| 6890 | } |
| 6891 | |
| 6892 | // optional double double_value = 6; |
| 6893 | case 6: { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 6894 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 6895 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED64) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 6896 | parse_double_value: |
| 6897 | DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< |
| 6898 | double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>( |
| 6899 | input, &double_value_))); |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 6900 | set_has_double_value(); |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 6901 | } else { |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6902 | goto handle_uninterpreted; |
| 6903 | } |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6904 | if (input->ExpectTag(58)) goto parse_string_value; |
| 6905 | break; |
| 6906 | } |
| 6907 | |
| 6908 | // optional bytes string_value = 7; |
| 6909 | case 7: { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 6910 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 6911 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 6912 | parse_string_value: |
| 6913 | DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( |
| 6914 | input, this->mutable_string_value())); |
| 6915 | } else { |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6916 | goto handle_uninterpreted; |
| 6917 | } |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 6918 | if (input->ExpectTag(66)) goto parse_aggregate_value; |
| 6919 | break; |
| 6920 | } |
| 6921 | |
| 6922 | // optional string aggregate_value = 8; |
| 6923 | case 8: { |
| 6924 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
| 6925 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { |
| 6926 | parse_aggregate_value: |
| 6927 | DO_(::google::protobuf::internal::WireFormatLite::ReadString( |
| 6928 | input, this->mutable_aggregate_value())); |
| 6929 | ::google::protobuf::internal::WireFormat::VerifyUTF8String( |
| 6930 | this->aggregate_value().data(), this->aggregate_value().length(), |
| 6931 | ::google::protobuf::internal::WireFormat::PARSE); |
| 6932 | } else { |
| 6933 | goto handle_uninterpreted; |
| 6934 | } |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6935 | if (input->ExpectAtEnd()) return true; |
| 6936 | break; |
| 6937 | } |
| 6938 | |
| 6939 | default: { |
| 6940 | handle_uninterpreted: |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 6941 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
| 6942 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6943 | return true; |
| 6944 | } |
| 6945 | DO_(::google::protobuf::internal::WireFormat::SkipField( |
| 6946 | input, tag, mutable_unknown_fields())); |
| 6947 | break; |
| 6948 | } |
| 6949 | } |
| 6950 | } |
| 6951 | return true; |
| 6952 | #undef DO_ |
| 6953 | } |
| 6954 | |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 6955 | void UninterpretedOption::SerializeWithCachedSizes( |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6956 | ::google::protobuf::io::CodedOutputStream* output) const { |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6957 | // repeated .google.protobuf.UninterpretedOption.NamePart name = 2; |
kenton@google.com | 2d6daa7 | 2009-01-22 01:27:00 +0000 | [diff] [blame] | 6958 | for (int i = 0; i < this->name_size(); i++) { |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 6959 | ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 6960 | 2, this->name(i), output); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6961 | } |
| 6962 | |
| 6963 | // optional string identifier_value = 3; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 6964 | if (has_identifier_value()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 6965 | ::google::protobuf::internal::WireFormat::VerifyUTF8String( |
| 6966 | this->identifier_value().data(), this->identifier_value().length(), |
| 6967 | ::google::protobuf::internal::WireFormat::SERIALIZE); |
| 6968 | ::google::protobuf::internal::WireFormatLite::WriteString( |
| 6969 | 3, this->identifier_value(), output); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6970 | } |
| 6971 | |
| 6972 | // optional uint64 positive_int_value = 4; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 6973 | if (has_positive_int_value()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 6974 | ::google::protobuf::internal::WireFormatLite::WriteUInt64(4, this->positive_int_value(), output); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6975 | } |
| 6976 | |
| 6977 | // optional int64 negative_int_value = 5; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 6978 | if (has_negative_int_value()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 6979 | ::google::protobuf::internal::WireFormatLite::WriteInt64(5, this->negative_int_value(), output); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6980 | } |
| 6981 | |
| 6982 | // optional double double_value = 6; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 6983 | if (has_double_value()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 6984 | ::google::protobuf::internal::WireFormatLite::WriteDouble(6, this->double_value(), output); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6985 | } |
| 6986 | |
| 6987 | // optional bytes string_value = 7; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 6988 | if (has_string_value()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 6989 | ::google::protobuf::internal::WireFormatLite::WriteBytes( |
| 6990 | 7, this->string_value(), output); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 6991 | } |
| 6992 | |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 6993 | // optional string aggregate_value = 8; |
| 6994 | if (has_aggregate_value()) { |
| 6995 | ::google::protobuf::internal::WireFormat::VerifyUTF8String( |
| 6996 | this->aggregate_value().data(), this->aggregate_value().length(), |
| 6997 | ::google::protobuf::internal::WireFormat::SERIALIZE); |
| 6998 | ::google::protobuf::internal::WireFormatLite::WriteString( |
| 6999 | 8, this->aggregate_value(), output); |
| 7000 | } |
| 7001 | |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 7002 | if (!unknown_fields().empty()) { |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 7003 | ::google::protobuf::internal::WireFormat::SerializeUnknownFields( |
| 7004 | unknown_fields(), output); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 7005 | } |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 7006 | } |
| 7007 | |
| 7008 | ::google::protobuf::uint8* UninterpretedOption::SerializeWithCachedSizesToArray( |
| 7009 | ::google::protobuf::uint8* target) const { |
| 7010 | // repeated .google.protobuf.UninterpretedOption.NamePart name = 2; |
| 7011 | for (int i = 0; i < this->name_size(); i++) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 7012 | target = ::google::protobuf::internal::WireFormatLite:: |
| 7013 | WriteMessageNoVirtualToArray( |
| 7014 | 2, this->name(i), target); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 7015 | } |
| 7016 | |
| 7017 | // optional string identifier_value = 3; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 7018 | if (has_identifier_value()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 7019 | ::google::protobuf::internal::WireFormat::VerifyUTF8String( |
| 7020 | this->identifier_value().data(), this->identifier_value().length(), |
| 7021 | ::google::protobuf::internal::WireFormat::SERIALIZE); |
| 7022 | target = |
| 7023 | ::google::protobuf::internal::WireFormatLite::WriteStringToArray( |
| 7024 | 3, this->identifier_value(), target); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 7025 | } |
| 7026 | |
| 7027 | // optional uint64 positive_int_value = 4; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 7028 | if (has_positive_int_value()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 7029 | target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(4, this->positive_int_value(), target); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 7030 | } |
| 7031 | |
| 7032 | // optional int64 negative_int_value = 5; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 7033 | if (has_negative_int_value()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 7034 | target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(5, this->negative_int_value(), target); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 7035 | } |
| 7036 | |
| 7037 | // optional double double_value = 6; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 7038 | if (has_double_value()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 7039 | target = ::google::protobuf::internal::WireFormatLite::WriteDoubleToArray(6, this->double_value(), target); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 7040 | } |
| 7041 | |
| 7042 | // optional bytes string_value = 7; |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 7043 | if (has_string_value()) { |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 7044 | target = |
| 7045 | ::google::protobuf::internal::WireFormatLite::WriteBytesToArray( |
| 7046 | 7, this->string_value(), target); |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 7047 | } |
| 7048 | |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 7049 | // optional string aggregate_value = 8; |
| 7050 | if (has_aggregate_value()) { |
| 7051 | ::google::protobuf::internal::WireFormat::VerifyUTF8String( |
| 7052 | this->aggregate_value().data(), this->aggregate_value().length(), |
| 7053 | ::google::protobuf::internal::WireFormat::SERIALIZE); |
| 7054 | target = |
| 7055 | ::google::protobuf::internal::WireFormatLite::WriteStringToArray( |
| 7056 | 8, this->aggregate_value(), target); |
| 7057 | } |
| 7058 | |
kenton@google.com | d37d46d | 2009-04-25 02:53:47 +0000 | [diff] [blame] | 7059 | if (!unknown_fields().empty()) { |
| 7060 | target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( |
| 7061 | unknown_fields(), target); |
| 7062 | } |
| 7063 | return target; |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 7064 | } |
| 7065 | |
| 7066 | int UninterpretedOption::ByteSize() const { |
| 7067 | int total_size = 0; |
| 7068 | |
| 7069 | if (_has_bits_[1 / 32] & (0xffu << (1 % 32))) { |
| 7070 | // optional string identifier_value = 3; |
| 7071 | if (has_identifier_value()) { |
| 7072 | total_size += 1 + |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 7073 | ::google::protobuf::internal::WireFormatLite::StringSize( |
| 7074 | this->identifier_value()); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 7075 | } |
| 7076 | |
| 7077 | // optional uint64 positive_int_value = 4; |
| 7078 | if (has_positive_int_value()) { |
| 7079 | total_size += 1 + |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 7080 | ::google::protobuf::internal::WireFormatLite::UInt64Size( |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 7081 | this->positive_int_value()); |
| 7082 | } |
| 7083 | |
| 7084 | // optional int64 negative_int_value = 5; |
| 7085 | if (has_negative_int_value()) { |
| 7086 | total_size += 1 + |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 7087 | ::google::protobuf::internal::WireFormatLite::Int64Size( |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 7088 | this->negative_int_value()); |
| 7089 | } |
| 7090 | |
| 7091 | // optional double double_value = 6; |
| 7092 | if (has_double_value()) { |
| 7093 | total_size += 1 + 8; |
| 7094 | } |
| 7095 | |
| 7096 | // optional bytes string_value = 7; |
| 7097 | if (has_string_value()) { |
| 7098 | total_size += 1 + |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 7099 | ::google::protobuf::internal::WireFormatLite::BytesSize( |
| 7100 | this->string_value()); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 7101 | } |
| 7102 | |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 7103 | // optional string aggregate_value = 8; |
| 7104 | if (has_aggregate_value()) { |
| 7105 | total_size += 1 + |
| 7106 | ::google::protobuf::internal::WireFormatLite::StringSize( |
| 7107 | this->aggregate_value()); |
| 7108 | } |
| 7109 | |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 7110 | } |
| 7111 | // repeated .google.protobuf.UninterpretedOption.NamePart name = 2; |
kenton@google.com | 2d6daa7 | 2009-01-22 01:27:00 +0000 | [diff] [blame] | 7112 | total_size += 1 * this->name_size(); |
| 7113 | for (int i = 0; i < this->name_size(); i++) { |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 7114 | total_size += |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 7115 | ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 7116 | this->name(i)); |
| 7117 | } |
| 7118 | |
| 7119 | if (!unknown_fields().empty()) { |
| 7120 | total_size += |
| 7121 | ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( |
| 7122 | unknown_fields()); |
| 7123 | } |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 7124 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 7125 | _cached_size_ = total_size; |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 7126 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 7127 | return total_size; |
| 7128 | } |
| 7129 | |
| 7130 | void UninterpretedOption::MergeFrom(const ::google::protobuf::Message& from) { |
| 7131 | GOOGLE_CHECK_NE(&from, this); |
| 7132 | const UninterpretedOption* source = |
| 7133 | ::google::protobuf::internal::dynamic_cast_if_available<const UninterpretedOption*>( |
| 7134 | &from); |
| 7135 | if (source == NULL) { |
| 7136 | ::google::protobuf::internal::ReflectionOps::Merge(from, this); |
| 7137 | } else { |
| 7138 | MergeFrom(*source); |
| 7139 | } |
| 7140 | } |
| 7141 | |
| 7142 | void UninterpretedOption::MergeFrom(const UninterpretedOption& from) { |
| 7143 | GOOGLE_CHECK_NE(&from, this); |
| 7144 | name_.MergeFrom(from.name_); |
| 7145 | if (from._has_bits_[1 / 32] & (0xffu << (1 % 32))) { |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 7146 | if (from.has_identifier_value()) { |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 7147 | set_identifier_value(from.identifier_value()); |
| 7148 | } |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 7149 | if (from.has_positive_int_value()) { |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 7150 | set_positive_int_value(from.positive_int_value()); |
| 7151 | } |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 7152 | if (from.has_negative_int_value()) { |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 7153 | set_negative_int_value(from.negative_int_value()); |
| 7154 | } |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 7155 | if (from.has_double_value()) { |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 7156 | set_double_value(from.double_value()); |
| 7157 | } |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 7158 | if (from.has_string_value()) { |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 7159 | set_string_value(from.string_value()); |
| 7160 | } |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 7161 | if (from.has_aggregate_value()) { |
| 7162 | set_aggregate_value(from.aggregate_value()); |
| 7163 | } |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 7164 | } |
| 7165 | mutable_unknown_fields()->MergeFrom(from.unknown_fields()); |
| 7166 | } |
| 7167 | |
| 7168 | void UninterpretedOption::CopyFrom(const ::google::protobuf::Message& from) { |
| 7169 | if (&from == this) return; |
| 7170 | Clear(); |
| 7171 | MergeFrom(from); |
| 7172 | } |
| 7173 | |
| 7174 | void UninterpretedOption::CopyFrom(const UninterpretedOption& from) { |
| 7175 | if (&from == this) return; |
| 7176 | Clear(); |
| 7177 | MergeFrom(from); |
| 7178 | } |
| 7179 | |
kenton@google.com | ceb561d | 2009-06-25 19:05:36 +0000 | [diff] [blame] | 7180 | bool UninterpretedOption::IsInitialized() const { |
| 7181 | |
| 7182 | for (int i = 0; i < name_size(); i++) { |
| 7183 | if (!this->name(i).IsInitialized()) return false; |
| 7184 | } |
| 7185 | return true; |
| 7186 | } |
| 7187 | |
kenton@google.com | 26bd9ee | 2008-11-21 00:06:27 +0000 | [diff] [blame] | 7188 | void UninterpretedOption::Swap(UninterpretedOption* other) { |
| 7189 | if (other != this) { |
| 7190 | name_.Swap(&other->name_); |
| 7191 | std::swap(identifier_value_, other->identifier_value_); |
| 7192 | std::swap(positive_int_value_, other->positive_int_value_); |
| 7193 | std::swap(negative_int_value_, other->negative_int_value_); |
| 7194 | std::swap(double_value_, other->double_value_); |
| 7195 | std::swap(string_value_, other->string_value_); |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 7196 | std::swap(aggregate_value_, other->aggregate_value_); |
kenton@google.com | 26bd9ee | 2008-11-21 00:06:27 +0000 | [diff] [blame] | 7197 | std::swap(_has_bits_[0], other->_has_bits_[0]); |
| 7198 | _unknown_fields_.Swap(&other->_unknown_fields_); |
| 7199 | std::swap(_cached_size_, other->_cached_size_); |
| 7200 | } |
| 7201 | } |
| 7202 | |
kenton@google.com | 80b1d62 | 2009-07-29 01:13:20 +0000 | [diff] [blame] | 7203 | ::google::protobuf::Metadata UninterpretedOption::GetMetadata() const { |
| 7204 | protobuf_AssignDescriptorsOnce(); |
| 7205 | ::google::protobuf::Metadata metadata; |
| 7206 | metadata.descriptor = UninterpretedOption_descriptor_; |
| 7207 | metadata.reflection = UninterpretedOption_reflection_; |
| 7208 | return metadata; |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 7209 | } |
| 7210 | |
kenton@google.com | 24bf56f | 2008-09-24 20:31:01 +0000 | [diff] [blame] | 7211 | |
liujisi@google.com | 33165fe | 2010-11-02 13:14:58 +0000 | [diff] [blame^] | 7212 | // =================================================================== |
| 7213 | |
| 7214 | #ifndef _MSC_VER |
| 7215 | const int SourceCodeInfo_Location::kPathFieldNumber; |
| 7216 | const int SourceCodeInfo_Location::kSpanFieldNumber; |
| 7217 | #endif // !_MSC_VER |
| 7218 | |
| 7219 | SourceCodeInfo_Location::SourceCodeInfo_Location() |
| 7220 | : ::google::protobuf::Message() { |
| 7221 | SharedCtor(); |
| 7222 | } |
| 7223 | |
| 7224 | void SourceCodeInfo_Location::InitAsDefaultInstance() { |
| 7225 | } |
| 7226 | |
| 7227 | SourceCodeInfo_Location::SourceCodeInfo_Location(const SourceCodeInfo_Location& from) |
| 7228 | : ::google::protobuf::Message() { |
| 7229 | SharedCtor(); |
| 7230 | MergeFrom(from); |
| 7231 | } |
| 7232 | |
| 7233 | void SourceCodeInfo_Location::SharedCtor() { |
| 7234 | _cached_size_ = 0; |
| 7235 | ::memset(_has_bits_, 0, sizeof(_has_bits_)); |
| 7236 | } |
| 7237 | |
| 7238 | SourceCodeInfo_Location::~SourceCodeInfo_Location() { |
| 7239 | SharedDtor(); |
| 7240 | } |
| 7241 | |
| 7242 | void SourceCodeInfo_Location::SharedDtor() { |
| 7243 | if (this != default_instance_) { |
| 7244 | } |
| 7245 | } |
| 7246 | |
| 7247 | void SourceCodeInfo_Location::SetCachedSize(int size) const { |
| 7248 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
| 7249 | _cached_size_ = size; |
| 7250 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); |
| 7251 | } |
| 7252 | const ::google::protobuf::Descriptor* SourceCodeInfo_Location::descriptor() { |
| 7253 | protobuf_AssignDescriptorsOnce(); |
| 7254 | return SourceCodeInfo_Location_descriptor_; |
| 7255 | } |
| 7256 | |
| 7257 | const SourceCodeInfo_Location& SourceCodeInfo_Location::default_instance() { |
| 7258 | if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); return *default_instance_; |
| 7259 | } |
| 7260 | |
| 7261 | SourceCodeInfo_Location* SourceCodeInfo_Location::default_instance_ = NULL; |
| 7262 | |
| 7263 | SourceCodeInfo_Location* SourceCodeInfo_Location::New() const { |
| 7264 | return new SourceCodeInfo_Location; |
| 7265 | } |
| 7266 | |
| 7267 | void SourceCodeInfo_Location::Clear() { |
| 7268 | path_.Clear(); |
| 7269 | span_.Clear(); |
| 7270 | ::memset(_has_bits_, 0, sizeof(_has_bits_)); |
| 7271 | mutable_unknown_fields()->Clear(); |
| 7272 | } |
| 7273 | |
| 7274 | bool SourceCodeInfo_Location::MergePartialFromCodedStream( |
| 7275 | ::google::protobuf::io::CodedInputStream* input) { |
| 7276 | #define DO_(EXPRESSION) if (!(EXPRESSION)) return false |
| 7277 | ::google::protobuf::uint32 tag; |
| 7278 | while ((tag = input->ReadTag()) != 0) { |
| 7279 | switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { |
| 7280 | // repeated int32 path = 1 [packed = true]; |
| 7281 | case 1: { |
| 7282 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
| 7283 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { |
| 7284 | DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< |
| 7285 | ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( |
| 7286 | input, this->mutable_path()))); |
| 7287 | } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) |
| 7288 | == ::google::protobuf::internal::WireFormatLite:: |
| 7289 | WIRETYPE_VARINT) { |
| 7290 | DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< |
| 7291 | ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( |
| 7292 | 1, 10, input, this->mutable_path()))); |
| 7293 | } else { |
| 7294 | goto handle_uninterpreted; |
| 7295 | } |
| 7296 | if (input->ExpectTag(18)) goto parse_span; |
| 7297 | break; |
| 7298 | } |
| 7299 | |
| 7300 | // repeated int32 span = 2 [packed = true]; |
| 7301 | case 2: { |
| 7302 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
| 7303 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { |
| 7304 | parse_span: |
| 7305 | DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< |
| 7306 | ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( |
| 7307 | input, this->mutable_span()))); |
| 7308 | } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) |
| 7309 | == ::google::protobuf::internal::WireFormatLite:: |
| 7310 | WIRETYPE_VARINT) { |
| 7311 | DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< |
| 7312 | ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( |
| 7313 | 1, 18, input, this->mutable_span()))); |
| 7314 | } else { |
| 7315 | goto handle_uninterpreted; |
| 7316 | } |
| 7317 | if (input->ExpectAtEnd()) return true; |
| 7318 | break; |
| 7319 | } |
| 7320 | |
| 7321 | default: { |
| 7322 | handle_uninterpreted: |
| 7323 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
| 7324 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { |
| 7325 | return true; |
| 7326 | } |
| 7327 | DO_(::google::protobuf::internal::WireFormat::SkipField( |
| 7328 | input, tag, mutable_unknown_fields())); |
| 7329 | break; |
| 7330 | } |
| 7331 | } |
| 7332 | } |
| 7333 | return true; |
| 7334 | #undef DO_ |
| 7335 | } |
| 7336 | |
| 7337 | void SourceCodeInfo_Location::SerializeWithCachedSizes( |
| 7338 | ::google::protobuf::io::CodedOutputStream* output) const { |
| 7339 | // repeated int32 path = 1 [packed = true]; |
| 7340 | if (this->path_size() > 0) { |
| 7341 | ::google::protobuf::internal::WireFormatLite::WriteTag(1, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); |
| 7342 | output->WriteVarint32(_path_cached_byte_size_); |
| 7343 | } |
| 7344 | for (int i = 0; i < this->path_size(); i++) { |
| 7345 | ::google::protobuf::internal::WireFormatLite::WriteInt32NoTag( |
| 7346 | this->path(i), output); |
| 7347 | } |
| 7348 | |
| 7349 | // repeated int32 span = 2 [packed = true]; |
| 7350 | if (this->span_size() > 0) { |
| 7351 | ::google::protobuf::internal::WireFormatLite::WriteTag(2, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); |
| 7352 | output->WriteVarint32(_span_cached_byte_size_); |
| 7353 | } |
| 7354 | for (int i = 0; i < this->span_size(); i++) { |
| 7355 | ::google::protobuf::internal::WireFormatLite::WriteInt32NoTag( |
| 7356 | this->span(i), output); |
| 7357 | } |
| 7358 | |
| 7359 | if (!unknown_fields().empty()) { |
| 7360 | ::google::protobuf::internal::WireFormat::SerializeUnknownFields( |
| 7361 | unknown_fields(), output); |
| 7362 | } |
| 7363 | } |
| 7364 | |
| 7365 | ::google::protobuf::uint8* SourceCodeInfo_Location::SerializeWithCachedSizesToArray( |
| 7366 | ::google::protobuf::uint8* target) const { |
| 7367 | // repeated int32 path = 1 [packed = true]; |
| 7368 | if (this->path_size() > 0) { |
| 7369 | target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( |
| 7370 | 1, |
| 7371 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, |
| 7372 | target); |
| 7373 | target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( |
| 7374 | _path_cached_byte_size_, target); |
| 7375 | } |
| 7376 | for (int i = 0; i < this->path_size(); i++) { |
| 7377 | target = ::google::protobuf::internal::WireFormatLite:: |
| 7378 | WriteInt32NoTagToArray(this->path(i), target); |
| 7379 | } |
| 7380 | |
| 7381 | // repeated int32 span = 2 [packed = true]; |
| 7382 | if (this->span_size() > 0) { |
| 7383 | target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( |
| 7384 | 2, |
| 7385 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, |
| 7386 | target); |
| 7387 | target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( |
| 7388 | _span_cached_byte_size_, target); |
| 7389 | } |
| 7390 | for (int i = 0; i < this->span_size(); i++) { |
| 7391 | target = ::google::protobuf::internal::WireFormatLite:: |
| 7392 | WriteInt32NoTagToArray(this->span(i), target); |
| 7393 | } |
| 7394 | |
| 7395 | if (!unknown_fields().empty()) { |
| 7396 | target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( |
| 7397 | unknown_fields(), target); |
| 7398 | } |
| 7399 | return target; |
| 7400 | } |
| 7401 | |
| 7402 | int SourceCodeInfo_Location::ByteSize() const { |
| 7403 | int total_size = 0; |
| 7404 | |
| 7405 | // repeated int32 path = 1 [packed = true]; |
| 7406 | { |
| 7407 | int data_size = 0; |
| 7408 | for (int i = 0; i < this->path_size(); i++) { |
| 7409 | data_size += ::google::protobuf::internal::WireFormatLite:: |
| 7410 | Int32Size(this->path(i)); |
| 7411 | } |
| 7412 | if (data_size > 0) { |
| 7413 | total_size += 1 + |
| 7414 | ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); |
| 7415 | } |
| 7416 | _path_cached_byte_size_ = data_size; |
| 7417 | total_size += data_size; |
| 7418 | } |
| 7419 | |
| 7420 | // repeated int32 span = 2 [packed = true]; |
| 7421 | { |
| 7422 | int data_size = 0; |
| 7423 | for (int i = 0; i < this->span_size(); i++) { |
| 7424 | data_size += ::google::protobuf::internal::WireFormatLite:: |
| 7425 | Int32Size(this->span(i)); |
| 7426 | } |
| 7427 | if (data_size > 0) { |
| 7428 | total_size += 1 + |
| 7429 | ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); |
| 7430 | } |
| 7431 | _span_cached_byte_size_ = data_size; |
| 7432 | total_size += data_size; |
| 7433 | } |
| 7434 | |
| 7435 | if (!unknown_fields().empty()) { |
| 7436 | total_size += |
| 7437 | ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( |
| 7438 | unknown_fields()); |
| 7439 | } |
| 7440 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
| 7441 | _cached_size_ = total_size; |
| 7442 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); |
| 7443 | return total_size; |
| 7444 | } |
| 7445 | |
| 7446 | void SourceCodeInfo_Location::MergeFrom(const ::google::protobuf::Message& from) { |
| 7447 | GOOGLE_CHECK_NE(&from, this); |
| 7448 | const SourceCodeInfo_Location* source = |
| 7449 | ::google::protobuf::internal::dynamic_cast_if_available<const SourceCodeInfo_Location*>( |
| 7450 | &from); |
| 7451 | if (source == NULL) { |
| 7452 | ::google::protobuf::internal::ReflectionOps::Merge(from, this); |
| 7453 | } else { |
| 7454 | MergeFrom(*source); |
| 7455 | } |
| 7456 | } |
| 7457 | |
| 7458 | void SourceCodeInfo_Location::MergeFrom(const SourceCodeInfo_Location& from) { |
| 7459 | GOOGLE_CHECK_NE(&from, this); |
| 7460 | path_.MergeFrom(from.path_); |
| 7461 | span_.MergeFrom(from.span_); |
| 7462 | mutable_unknown_fields()->MergeFrom(from.unknown_fields()); |
| 7463 | } |
| 7464 | |
| 7465 | void SourceCodeInfo_Location::CopyFrom(const ::google::protobuf::Message& from) { |
| 7466 | if (&from == this) return; |
| 7467 | Clear(); |
| 7468 | MergeFrom(from); |
| 7469 | } |
| 7470 | |
| 7471 | void SourceCodeInfo_Location::CopyFrom(const SourceCodeInfo_Location& from) { |
| 7472 | if (&from == this) return; |
| 7473 | Clear(); |
| 7474 | MergeFrom(from); |
| 7475 | } |
| 7476 | |
| 7477 | bool SourceCodeInfo_Location::IsInitialized() const { |
| 7478 | |
| 7479 | return true; |
| 7480 | } |
| 7481 | |
| 7482 | void SourceCodeInfo_Location::Swap(SourceCodeInfo_Location* other) { |
| 7483 | if (other != this) { |
| 7484 | path_.Swap(&other->path_); |
| 7485 | span_.Swap(&other->span_); |
| 7486 | std::swap(_has_bits_[0], other->_has_bits_[0]); |
| 7487 | _unknown_fields_.Swap(&other->_unknown_fields_); |
| 7488 | std::swap(_cached_size_, other->_cached_size_); |
| 7489 | } |
| 7490 | } |
| 7491 | |
| 7492 | ::google::protobuf::Metadata SourceCodeInfo_Location::GetMetadata() const { |
| 7493 | protobuf_AssignDescriptorsOnce(); |
| 7494 | ::google::protobuf::Metadata metadata; |
| 7495 | metadata.descriptor = SourceCodeInfo_Location_descriptor_; |
| 7496 | metadata.reflection = SourceCodeInfo_Location_reflection_; |
| 7497 | return metadata; |
| 7498 | } |
| 7499 | |
| 7500 | |
| 7501 | // ------------------------------------------------------------------- |
| 7502 | |
| 7503 | #ifndef _MSC_VER |
| 7504 | const int SourceCodeInfo::kLocationFieldNumber; |
| 7505 | #endif // !_MSC_VER |
| 7506 | |
| 7507 | SourceCodeInfo::SourceCodeInfo() |
| 7508 | : ::google::protobuf::Message() { |
| 7509 | SharedCtor(); |
| 7510 | } |
| 7511 | |
| 7512 | void SourceCodeInfo::InitAsDefaultInstance() { |
| 7513 | } |
| 7514 | |
| 7515 | SourceCodeInfo::SourceCodeInfo(const SourceCodeInfo& from) |
| 7516 | : ::google::protobuf::Message() { |
| 7517 | SharedCtor(); |
| 7518 | MergeFrom(from); |
| 7519 | } |
| 7520 | |
| 7521 | void SourceCodeInfo::SharedCtor() { |
| 7522 | _cached_size_ = 0; |
| 7523 | ::memset(_has_bits_, 0, sizeof(_has_bits_)); |
| 7524 | } |
| 7525 | |
| 7526 | SourceCodeInfo::~SourceCodeInfo() { |
| 7527 | SharedDtor(); |
| 7528 | } |
| 7529 | |
| 7530 | void SourceCodeInfo::SharedDtor() { |
| 7531 | if (this != default_instance_) { |
| 7532 | } |
| 7533 | } |
| 7534 | |
| 7535 | void SourceCodeInfo::SetCachedSize(int size) const { |
| 7536 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
| 7537 | _cached_size_ = size; |
| 7538 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); |
| 7539 | } |
| 7540 | const ::google::protobuf::Descriptor* SourceCodeInfo::descriptor() { |
| 7541 | protobuf_AssignDescriptorsOnce(); |
| 7542 | return SourceCodeInfo_descriptor_; |
| 7543 | } |
| 7544 | |
| 7545 | const SourceCodeInfo& SourceCodeInfo::default_instance() { |
| 7546 | if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); return *default_instance_; |
| 7547 | } |
| 7548 | |
| 7549 | SourceCodeInfo* SourceCodeInfo::default_instance_ = NULL; |
| 7550 | |
| 7551 | SourceCodeInfo* SourceCodeInfo::New() const { |
| 7552 | return new SourceCodeInfo; |
| 7553 | } |
| 7554 | |
| 7555 | void SourceCodeInfo::Clear() { |
| 7556 | location_.Clear(); |
| 7557 | ::memset(_has_bits_, 0, sizeof(_has_bits_)); |
| 7558 | mutable_unknown_fields()->Clear(); |
| 7559 | } |
| 7560 | |
| 7561 | bool SourceCodeInfo::MergePartialFromCodedStream( |
| 7562 | ::google::protobuf::io::CodedInputStream* input) { |
| 7563 | #define DO_(EXPRESSION) if (!(EXPRESSION)) return false |
| 7564 | ::google::protobuf::uint32 tag; |
| 7565 | while ((tag = input->ReadTag()) != 0) { |
| 7566 | switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { |
| 7567 | // repeated .google.protobuf.SourceCodeInfo.Location location = 1; |
| 7568 | case 1: { |
| 7569 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
| 7570 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { |
| 7571 | parse_location: |
| 7572 | DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( |
| 7573 | input, add_location())); |
| 7574 | } else { |
| 7575 | goto handle_uninterpreted; |
| 7576 | } |
| 7577 | if (input->ExpectTag(10)) goto parse_location; |
| 7578 | if (input->ExpectAtEnd()) return true; |
| 7579 | break; |
| 7580 | } |
| 7581 | |
| 7582 | default: { |
| 7583 | handle_uninterpreted: |
| 7584 | if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
| 7585 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { |
| 7586 | return true; |
| 7587 | } |
| 7588 | DO_(::google::protobuf::internal::WireFormat::SkipField( |
| 7589 | input, tag, mutable_unknown_fields())); |
| 7590 | break; |
| 7591 | } |
| 7592 | } |
| 7593 | } |
| 7594 | return true; |
| 7595 | #undef DO_ |
| 7596 | } |
| 7597 | |
| 7598 | void SourceCodeInfo::SerializeWithCachedSizes( |
| 7599 | ::google::protobuf::io::CodedOutputStream* output) const { |
| 7600 | // repeated .google.protobuf.SourceCodeInfo.Location location = 1; |
| 7601 | for (int i = 0; i < this->location_size(); i++) { |
| 7602 | ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( |
| 7603 | 1, this->location(i), output); |
| 7604 | } |
| 7605 | |
| 7606 | if (!unknown_fields().empty()) { |
| 7607 | ::google::protobuf::internal::WireFormat::SerializeUnknownFields( |
| 7608 | unknown_fields(), output); |
| 7609 | } |
| 7610 | } |
| 7611 | |
| 7612 | ::google::protobuf::uint8* SourceCodeInfo::SerializeWithCachedSizesToArray( |
| 7613 | ::google::protobuf::uint8* target) const { |
| 7614 | // repeated .google.protobuf.SourceCodeInfo.Location location = 1; |
| 7615 | for (int i = 0; i < this->location_size(); i++) { |
| 7616 | target = ::google::protobuf::internal::WireFormatLite:: |
| 7617 | WriteMessageNoVirtualToArray( |
| 7618 | 1, this->location(i), target); |
| 7619 | } |
| 7620 | |
| 7621 | if (!unknown_fields().empty()) { |
| 7622 | target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( |
| 7623 | unknown_fields(), target); |
| 7624 | } |
| 7625 | return target; |
| 7626 | } |
| 7627 | |
| 7628 | int SourceCodeInfo::ByteSize() const { |
| 7629 | int total_size = 0; |
| 7630 | |
| 7631 | // repeated .google.protobuf.SourceCodeInfo.Location location = 1; |
| 7632 | total_size += 1 * this->location_size(); |
| 7633 | for (int i = 0; i < this->location_size(); i++) { |
| 7634 | total_size += |
| 7635 | ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( |
| 7636 | this->location(i)); |
| 7637 | } |
| 7638 | |
| 7639 | if (!unknown_fields().empty()) { |
| 7640 | total_size += |
| 7641 | ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( |
| 7642 | unknown_fields()); |
| 7643 | } |
| 7644 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
| 7645 | _cached_size_ = total_size; |
| 7646 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); |
| 7647 | return total_size; |
| 7648 | } |
| 7649 | |
| 7650 | void SourceCodeInfo::MergeFrom(const ::google::protobuf::Message& from) { |
| 7651 | GOOGLE_CHECK_NE(&from, this); |
| 7652 | const SourceCodeInfo* source = |
| 7653 | ::google::protobuf::internal::dynamic_cast_if_available<const SourceCodeInfo*>( |
| 7654 | &from); |
| 7655 | if (source == NULL) { |
| 7656 | ::google::protobuf::internal::ReflectionOps::Merge(from, this); |
| 7657 | } else { |
| 7658 | MergeFrom(*source); |
| 7659 | } |
| 7660 | } |
| 7661 | |
| 7662 | void SourceCodeInfo::MergeFrom(const SourceCodeInfo& from) { |
| 7663 | GOOGLE_CHECK_NE(&from, this); |
| 7664 | location_.MergeFrom(from.location_); |
| 7665 | mutable_unknown_fields()->MergeFrom(from.unknown_fields()); |
| 7666 | } |
| 7667 | |
| 7668 | void SourceCodeInfo::CopyFrom(const ::google::protobuf::Message& from) { |
| 7669 | if (&from == this) return; |
| 7670 | Clear(); |
| 7671 | MergeFrom(from); |
| 7672 | } |
| 7673 | |
| 7674 | void SourceCodeInfo::CopyFrom(const SourceCodeInfo& from) { |
| 7675 | if (&from == this) return; |
| 7676 | Clear(); |
| 7677 | MergeFrom(from); |
| 7678 | } |
| 7679 | |
| 7680 | bool SourceCodeInfo::IsInitialized() const { |
| 7681 | |
| 7682 | return true; |
| 7683 | } |
| 7684 | |
| 7685 | void SourceCodeInfo::Swap(SourceCodeInfo* other) { |
| 7686 | if (other != this) { |
| 7687 | location_.Swap(&other->location_); |
| 7688 | std::swap(_has_bits_[0], other->_has_bits_[0]); |
| 7689 | _unknown_fields_.Swap(&other->_unknown_fields_); |
| 7690 | std::swap(_cached_size_, other->_cached_size_); |
| 7691 | } |
| 7692 | } |
| 7693 | |
| 7694 | ::google::protobuf::Metadata SourceCodeInfo::GetMetadata() const { |
| 7695 | protobuf_AssignDescriptorsOnce(); |
| 7696 | ::google::protobuf::Metadata metadata; |
| 7697 | metadata.descriptor = SourceCodeInfo_descriptor_; |
| 7698 | metadata.reflection = SourceCodeInfo_reflection_; |
| 7699 | return metadata; |
| 7700 | } |
| 7701 | |
| 7702 | |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 7703 | // @@protoc_insertion_point(namespace_scope) |
| 7704 | |
temporal | 40ee551 | 2008-07-10 02:12:20 +0000 | [diff] [blame] | 7705 | } // namespace protobuf |
| 7706 | } // namespace google |
kenton@google.com | fccb146 | 2009-12-18 02:11:36 +0000 | [diff] [blame] | 7707 | |
| 7708 | // @@protoc_insertion_point(global_scope) |