Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame^] | 1 | // Generated by the protocol buffer compiler. DO NOT EDIT! |
| 2 | // source: google/protobuf/struct.proto |
| 3 | |
| 4 | #define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION |
| 5 | #include <google/protobuf/struct.pb.h> |
| 6 | |
| 7 | #include <algorithm> |
| 8 | |
| 9 | #include <google/protobuf/stubs/common.h> |
| 10 | #include <google/protobuf/stubs/port.h> |
| 11 | #include <google/protobuf/stubs/once.h> |
| 12 | #include <google/protobuf/io/coded_stream.h> |
| 13 | #include <google/protobuf/wire_format_lite_inl.h> |
| 14 | #include <google/protobuf/descriptor.h> |
| 15 | #include <google/protobuf/generated_message_reflection.h> |
| 16 | #include <google/protobuf/reflection_ops.h> |
| 17 | #include <google/protobuf/wire_format.h> |
| 18 | // @@protoc_insertion_point(includes) |
| 19 | |
| 20 | namespace google { |
| 21 | namespace protobuf { |
| 22 | |
| 23 | namespace { |
| 24 | |
| 25 | const ::google::protobuf::Descriptor* Struct_descriptor_ = NULL; |
| 26 | const ::google::protobuf::internal::GeneratedMessageReflection* |
| 27 | Struct_reflection_ = NULL; |
| 28 | const ::google::protobuf::Descriptor* Struct_FieldsEntry_descriptor_ = NULL; |
| 29 | const ::google::protobuf::Descriptor* Value_descriptor_ = NULL; |
| 30 | const ::google::protobuf::internal::GeneratedMessageReflection* |
| 31 | Value_reflection_ = NULL; |
| 32 | struct ValueOneofInstance { |
| 33 | int null_value_; |
| 34 | double number_value_; |
| 35 | ::google::protobuf::internal::ArenaStringPtr string_value_; |
| 36 | bool bool_value_; |
| 37 | const ::google::protobuf::Struct* struct_value_; |
| 38 | const ::google::protobuf::ListValue* list_value_; |
| 39 | }* Value_default_oneof_instance_ = NULL; |
| 40 | const ::google::protobuf::Descriptor* ListValue_descriptor_ = NULL; |
| 41 | const ::google::protobuf::internal::GeneratedMessageReflection* |
| 42 | ListValue_reflection_ = NULL; |
| 43 | const ::google::protobuf::EnumDescriptor* NullValue_descriptor_ = NULL; |
| 44 | |
| 45 | } // namespace |
| 46 | |
| 47 | |
| 48 | void protobuf_AssignDesc_google_2fprotobuf_2fstruct_2eproto() { |
| 49 | protobuf_AddDesc_google_2fprotobuf_2fstruct_2eproto(); |
| 50 | const ::google::protobuf::FileDescriptor* file = |
| 51 | ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName( |
| 52 | "google/protobuf/struct.proto"); |
| 53 | GOOGLE_CHECK(file != NULL); |
| 54 | Struct_descriptor_ = file->message_type(0); |
| 55 | static const int Struct_offsets_[1] = { |
| 56 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Struct, fields_), |
| 57 | }; |
| 58 | Struct_reflection_ = |
| 59 | ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( |
| 60 | Struct_descriptor_, |
| 61 | Struct::default_instance_, |
| 62 | Struct_offsets_, |
| 63 | -1, |
| 64 | -1, |
| 65 | -1, |
| 66 | sizeof(Struct), |
| 67 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Struct, _internal_metadata_), |
| 68 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Struct, _is_default_instance_)); |
| 69 | Struct_FieldsEntry_descriptor_ = Struct_descriptor_->nested_type(0); |
| 70 | Value_descriptor_ = file->message_type(1); |
| 71 | static const int Value_offsets_[7] = { |
| 72 | PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET(Value_default_oneof_instance_, null_value_), |
| 73 | PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET(Value_default_oneof_instance_, number_value_), |
| 74 | PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET(Value_default_oneof_instance_, string_value_), |
| 75 | PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET(Value_default_oneof_instance_, bool_value_), |
| 76 | PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET(Value_default_oneof_instance_, struct_value_), |
| 77 | PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET(Value_default_oneof_instance_, list_value_), |
| 78 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Value, kind_), |
| 79 | }; |
| 80 | Value_reflection_ = |
| 81 | ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( |
| 82 | Value_descriptor_, |
| 83 | Value::default_instance_, |
| 84 | Value_offsets_, |
| 85 | -1, |
| 86 | -1, |
| 87 | -1, |
| 88 | Value_default_oneof_instance_, |
| 89 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Value, _oneof_case_[0]), |
| 90 | sizeof(Value), |
| 91 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Value, _internal_metadata_), |
| 92 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Value, _is_default_instance_)); |
| 93 | ListValue_descriptor_ = file->message_type(2); |
| 94 | static const int ListValue_offsets_[1] = { |
| 95 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ListValue, values_), |
| 96 | }; |
| 97 | ListValue_reflection_ = |
| 98 | ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( |
| 99 | ListValue_descriptor_, |
| 100 | ListValue::default_instance_, |
| 101 | ListValue_offsets_, |
| 102 | -1, |
| 103 | -1, |
| 104 | -1, |
| 105 | sizeof(ListValue), |
| 106 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ListValue, _internal_metadata_), |
| 107 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ListValue, _is_default_instance_)); |
| 108 | NullValue_descriptor_ = file->enum_type(0); |
| 109 | } |
| 110 | |
| 111 | namespace { |
| 112 | |
| 113 | GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_); |
| 114 | inline void protobuf_AssignDescriptorsOnce() { |
| 115 | ::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_, |
| 116 | &protobuf_AssignDesc_google_2fprotobuf_2fstruct_2eproto); |
| 117 | } |
| 118 | |
| 119 | void protobuf_RegisterTypes(const ::std::string&) { |
| 120 | protobuf_AssignDescriptorsOnce(); |
| 121 | ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( |
| 122 | Struct_descriptor_, &Struct::default_instance()); |
| 123 | ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( |
| 124 | Struct_FieldsEntry_descriptor_, |
| 125 | ::google::protobuf::internal::MapEntry< |
| 126 | ::std::string, |
| 127 | ::google::protobuf::Value, |
| 128 | ::google::protobuf::internal::WireFormatLite::TYPE_STRING, |
| 129 | ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, |
| 130 | 0>::CreateDefaultInstance( |
| 131 | Struct_FieldsEntry_descriptor_)); |
| 132 | ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( |
| 133 | Value_descriptor_, &Value::default_instance()); |
| 134 | ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( |
| 135 | ListValue_descriptor_, &ListValue::default_instance()); |
| 136 | } |
| 137 | |
| 138 | } // namespace |
| 139 | |
| 140 | void protobuf_ShutdownFile_google_2fprotobuf_2fstruct_2eproto() { |
| 141 | delete Struct::default_instance_; |
| 142 | delete Struct_reflection_; |
| 143 | delete Value::default_instance_; |
| 144 | delete Value_default_oneof_instance_; |
| 145 | delete Value_reflection_; |
| 146 | delete ListValue::default_instance_; |
| 147 | delete ListValue_reflection_; |
| 148 | } |
| 149 | |
| 150 | void protobuf_AddDesc_google_2fprotobuf_2fstruct_2eproto() { |
| 151 | static bool already_here = false; |
| 152 | if (already_here) return; |
| 153 | already_here = true; |
| 154 | GOOGLE_PROTOBUF_VERIFY_VERSION; |
| 155 | |
| 156 | ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( |
| 157 | "\n\034google/protobuf/struct.proto\022\017google.p" |
| 158 | "rotobuf\"\204\001\n\006Struct\0223\n\006fields\030\001 \003(\0132#.goo" |
| 159 | "gle.protobuf.Struct.FieldsEntry\032E\n\013Field" |
| 160 | "sEntry\022\013\n\003key\030\001 \001(\t\022%\n\005value\030\002 \001(\0132\026.goo" |
| 161 | "gle.protobuf.Value:\0028\001\"\352\001\n\005Value\0220\n\nnull" |
| 162 | "_value\030\001 \001(\0162\032.google.protobuf.NullValue" |
| 163 | "H\000\022\026\n\014number_value\030\002 \001(\001H\000\022\026\n\014string_val" |
| 164 | "ue\030\003 \001(\tH\000\022\024\n\nbool_value\030\004 \001(\010H\000\022/\n\014stru" |
| 165 | "ct_value\030\005 \001(\0132\027.google.protobuf.StructH" |
| 166 | "\000\0220\n\nlist_value\030\006 \001(\0132\032.google.protobuf." |
| 167 | "ListValueH\000B\006\n\004kind\"3\n\tListValue\022&\n\006valu" |
| 168 | "es\030\001 \003(\0132\026.google.protobuf.Value*\033\n\tNull" |
| 169 | "Value\022\016\n\nNULL_VALUE\020\000BN\n\023com.google.prot" |
| 170 | "obufB\013StructProtoP\001\240\001\001\242\002\003GPB\252\002\036Google.Pr" |
| 171 | "otobuf.WellKnownTypesb\006proto3", 589); |
| 172 | ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( |
| 173 | "google/protobuf/struct.proto", &protobuf_RegisterTypes); |
| 174 | Struct::default_instance_ = new Struct(); |
| 175 | Value::default_instance_ = new Value(); |
| 176 | Value_default_oneof_instance_ = new ValueOneofInstance(); |
| 177 | ListValue::default_instance_ = new ListValue(); |
| 178 | Struct::default_instance_->InitAsDefaultInstance(); |
| 179 | Value::default_instance_->InitAsDefaultInstance(); |
| 180 | ListValue::default_instance_->InitAsDefaultInstance(); |
| 181 | ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_google_2fprotobuf_2fstruct_2eproto); |
| 182 | } |
| 183 | |
| 184 | // Force AddDescriptors() to be called at static initialization time. |
| 185 | struct StaticDescriptorInitializer_google_2fprotobuf_2fstruct_2eproto { |
| 186 | StaticDescriptorInitializer_google_2fprotobuf_2fstruct_2eproto() { |
| 187 | protobuf_AddDesc_google_2fprotobuf_2fstruct_2eproto(); |
| 188 | } |
| 189 | } static_descriptor_initializer_google_2fprotobuf_2fstruct_2eproto_; |
| 190 | const ::google::protobuf::EnumDescriptor* NullValue_descriptor() { |
| 191 | protobuf_AssignDescriptorsOnce(); |
| 192 | return NullValue_descriptor_; |
| 193 | } |
| 194 | bool NullValue_IsValid(int value) { |
| 195 | switch(value) { |
| 196 | case 0: |
| 197 | return true; |
| 198 | default: |
| 199 | return false; |
| 200 | } |
| 201 | } |
| 202 | |
| 203 | |
| 204 | namespace { |
| 205 | |
| 206 | static void MergeFromFail(int line) GOOGLE_ATTRIBUTE_COLD; |
| 207 | static void MergeFromFail(int line) { |
| 208 | GOOGLE_CHECK(false) << __FILE__ << ":" << line; |
| 209 | } |
| 210 | |
| 211 | } // namespace |
| 212 | |
| 213 | |
| 214 | // =================================================================== |
| 215 | |
| 216 | #if !defined(_MSC_VER) || _MSC_VER >= 1900 |
| 217 | const int Struct::kFieldsFieldNumber; |
| 218 | #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 |
| 219 | |
| 220 | Struct::Struct() |
| 221 | : ::google::protobuf::Message(), _internal_metadata_(NULL) { |
| 222 | SharedCtor(); |
| 223 | // @@protoc_insertion_point(constructor:google.protobuf.Struct) |
| 224 | } |
| 225 | |
| 226 | void Struct::InitAsDefaultInstance() { |
| 227 | _is_default_instance_ = true; |
| 228 | } |
| 229 | |
| 230 | Struct::Struct(const Struct& from) |
| 231 | : ::google::protobuf::Message(), |
| 232 | _internal_metadata_(NULL) { |
| 233 | SharedCtor(); |
| 234 | MergeFrom(from); |
| 235 | // @@protoc_insertion_point(copy_constructor:google.protobuf.Struct) |
| 236 | } |
| 237 | |
| 238 | void Struct::SharedCtor() { |
| 239 | _is_default_instance_ = false; |
| 240 | _cached_size_ = 0; |
| 241 | fields_.SetAssignDescriptorCallback( |
| 242 | protobuf_AssignDescriptorsOnce); |
| 243 | fields_.SetEntryDescriptor( |
| 244 | &::google::protobuf::Struct_FieldsEntry_descriptor_); |
| 245 | } |
| 246 | |
| 247 | Struct::~Struct() { |
| 248 | // @@protoc_insertion_point(destructor:google.protobuf.Struct) |
| 249 | SharedDtor(); |
| 250 | } |
| 251 | |
| 252 | void Struct::SharedDtor() { |
| 253 | if (this != default_instance_) { |
| 254 | } |
| 255 | } |
| 256 | |
| 257 | void Struct::SetCachedSize(int size) const { |
| 258 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
| 259 | _cached_size_ = size; |
| 260 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); |
| 261 | } |
| 262 | const ::google::protobuf::Descriptor* Struct::descriptor() { |
| 263 | protobuf_AssignDescriptorsOnce(); |
| 264 | return Struct_descriptor_; |
| 265 | } |
| 266 | |
| 267 | const Struct& Struct::default_instance() { |
| 268 | if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2fstruct_2eproto(); |
| 269 | return *default_instance_; |
| 270 | } |
| 271 | |
| 272 | Struct* Struct::default_instance_ = NULL; |
| 273 | |
| 274 | Struct* Struct::New(::google::protobuf::Arena* arena) const { |
| 275 | Struct* n = new Struct; |
| 276 | if (arena != NULL) { |
| 277 | arena->Own(n); |
| 278 | } |
| 279 | return n; |
| 280 | } |
| 281 | |
| 282 | void Struct::Clear() { |
| 283 | fields_.Clear(); |
| 284 | } |
| 285 | |
| 286 | bool Struct::MergePartialFromCodedStream( |
| 287 | ::google::protobuf::io::CodedInputStream* input) { |
| 288 | #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure |
| 289 | ::google::protobuf::uint32 tag; |
| 290 | // @@protoc_insertion_point(parse_start:google.protobuf.Struct) |
| 291 | for (;;) { |
| 292 | ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); |
| 293 | tag = p.first; |
| 294 | if (!p.second) goto handle_unusual; |
| 295 | switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { |
| 296 | // map<string, .google.protobuf.Value> fields = 1; |
| 297 | case 1: { |
| 298 | if (tag == 10) { |
| 299 | DO_(input->IncrementRecursionDepth()); |
| 300 | parse_loop_fields: |
| 301 | ::google::protobuf::scoped_ptr<Struct_FieldsEntry> entry(fields_.NewEntry()); |
| 302 | DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( |
| 303 | input, entry.get())); |
| 304 | (*mutable_fields())[entry->key()].Swap(entry->mutable_value()); |
| 305 | DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( |
| 306 | entry->key().data(), entry->key().length(), |
| 307 | ::google::protobuf::internal::WireFormatLite::PARSE, |
| 308 | "google.protobuf.Struct.FieldsEntry.key")); |
| 309 | } else { |
| 310 | goto handle_unusual; |
| 311 | } |
| 312 | if (input->ExpectTag(10)) goto parse_loop_fields; |
| 313 | input->UnsafeDecrementRecursionDepth(); |
| 314 | if (input->ExpectAtEnd()) goto success; |
| 315 | break; |
| 316 | } |
| 317 | |
| 318 | default: { |
| 319 | handle_unusual: |
| 320 | if (tag == 0 || |
| 321 | ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
| 322 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { |
| 323 | goto success; |
| 324 | } |
| 325 | DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag)); |
| 326 | break; |
| 327 | } |
| 328 | } |
| 329 | } |
| 330 | success: |
| 331 | // @@protoc_insertion_point(parse_success:google.protobuf.Struct) |
| 332 | return true; |
| 333 | failure: |
| 334 | // @@protoc_insertion_point(parse_failure:google.protobuf.Struct) |
| 335 | return false; |
| 336 | #undef DO_ |
| 337 | } |
| 338 | |
| 339 | void Struct::SerializeWithCachedSizes( |
| 340 | ::google::protobuf::io::CodedOutputStream* output) const { |
| 341 | // @@protoc_insertion_point(serialize_start:google.protobuf.Struct) |
| 342 | // map<string, .google.protobuf.Value> fields = 1; |
| 343 | { |
| 344 | ::google::protobuf::scoped_ptr<Struct_FieldsEntry> entry; |
| 345 | for (::google::protobuf::Map< ::std::string, ::google::protobuf::Value >::const_iterator |
| 346 | it = this->fields().begin(); |
| 347 | it != this->fields().end(); ++it) { |
| 348 | entry.reset(fields_.NewEntryWrapper(it->first, it->second)); |
| 349 | ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( |
| 350 | 1, *entry, output); |
| 351 | ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( |
| 352 | it->first.data(), it->first.length(), |
| 353 | ::google::protobuf::internal::WireFormatLite::SERIALIZE, |
| 354 | "google.protobuf.Struct.FieldsEntry.key"); |
| 355 | } |
| 356 | } |
| 357 | |
| 358 | // @@protoc_insertion_point(serialize_end:google.protobuf.Struct) |
| 359 | } |
| 360 | |
| 361 | ::google::protobuf::uint8* Struct::SerializeWithCachedSizesToArray( |
| 362 | ::google::protobuf::uint8* target) const { |
| 363 | // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Struct) |
| 364 | // map<string, .google.protobuf.Value> fields = 1; |
| 365 | { |
| 366 | ::google::protobuf::scoped_ptr<Struct_FieldsEntry> entry; |
| 367 | for (::google::protobuf::Map< ::std::string, ::google::protobuf::Value >::const_iterator |
| 368 | it = this->fields().begin(); |
| 369 | it != this->fields().end(); ++it) { |
| 370 | entry.reset(fields_.NewEntryWrapper(it->first, it->second)); |
| 371 | target = ::google::protobuf::internal::WireFormatLite:: |
| 372 | WriteMessageNoVirtualToArray( |
| 373 | 1, *entry, target); |
| 374 | ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( |
| 375 | it->first.data(), it->first.length(), |
| 376 | ::google::protobuf::internal::WireFormatLite::SERIALIZE, |
| 377 | "google.protobuf.Struct.FieldsEntry.key"); |
| 378 | } |
| 379 | } |
| 380 | |
| 381 | // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Struct) |
| 382 | return target; |
| 383 | } |
| 384 | |
| 385 | int Struct::ByteSize() const { |
| 386 | int total_size = 0; |
| 387 | |
| 388 | // map<string, .google.protobuf.Value> fields = 1; |
| 389 | total_size += 1 * this->fields_size(); |
| 390 | { |
| 391 | ::google::protobuf::scoped_ptr<Struct_FieldsEntry> entry; |
| 392 | for (::google::protobuf::Map< ::std::string, ::google::protobuf::Value >::const_iterator |
| 393 | it = this->fields().begin(); |
| 394 | it != this->fields().end(); ++it) { |
| 395 | entry.reset(fields_.NewEntryWrapper(it->first, it->second)); |
| 396 | total_size += ::google::protobuf::internal::WireFormatLite:: |
| 397 | MessageSizeNoVirtual(*entry); |
| 398 | } |
| 399 | } |
| 400 | |
| 401 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
| 402 | _cached_size_ = total_size; |
| 403 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); |
| 404 | return total_size; |
| 405 | } |
| 406 | |
| 407 | void Struct::MergeFrom(const ::google::protobuf::Message& from) { |
| 408 | if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); |
| 409 | const Struct* source = |
| 410 | ::google::protobuf::internal::DynamicCastToGenerated<const Struct>( |
| 411 | &from); |
| 412 | if (source == NULL) { |
| 413 | ::google::protobuf::internal::ReflectionOps::Merge(from, this); |
| 414 | } else { |
| 415 | MergeFrom(*source); |
| 416 | } |
| 417 | } |
| 418 | |
| 419 | void Struct::MergeFrom(const Struct& from) { |
| 420 | if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); |
| 421 | fields_.MergeFrom(from.fields_); |
| 422 | } |
| 423 | |
| 424 | void Struct::CopyFrom(const ::google::protobuf::Message& from) { |
| 425 | if (&from == this) return; |
| 426 | Clear(); |
| 427 | MergeFrom(from); |
| 428 | } |
| 429 | |
| 430 | void Struct::CopyFrom(const Struct& from) { |
| 431 | if (&from == this) return; |
| 432 | Clear(); |
| 433 | MergeFrom(from); |
| 434 | } |
| 435 | |
| 436 | bool Struct::IsInitialized() const { |
| 437 | |
| 438 | return true; |
| 439 | } |
| 440 | |
| 441 | void Struct::Swap(Struct* other) { |
| 442 | if (other == this) return; |
| 443 | InternalSwap(other); |
| 444 | } |
| 445 | void Struct::InternalSwap(Struct* other) { |
| 446 | fields_.Swap(&other->fields_); |
| 447 | _internal_metadata_.Swap(&other->_internal_metadata_); |
| 448 | std::swap(_cached_size_, other->_cached_size_); |
| 449 | } |
| 450 | |
| 451 | ::google::protobuf::Metadata Struct::GetMetadata() const { |
| 452 | protobuf_AssignDescriptorsOnce(); |
| 453 | ::google::protobuf::Metadata metadata; |
| 454 | metadata.descriptor = Struct_descriptor_; |
| 455 | metadata.reflection = Struct_reflection_; |
| 456 | return metadata; |
| 457 | } |
| 458 | |
| 459 | #if PROTOBUF_INLINE_NOT_IN_HEADERS |
| 460 | // Struct |
| 461 | |
| 462 | // map<string, .google.protobuf.Value> fields = 1; |
| 463 | int Struct::fields_size() const { |
| 464 | return fields_.size(); |
| 465 | } |
| 466 | void Struct::clear_fields() { |
| 467 | fields_.Clear(); |
| 468 | } |
| 469 | const ::google::protobuf::Map< ::std::string, ::google::protobuf::Value >& |
| 470 | Struct::fields() const { |
| 471 | // @@protoc_insertion_point(field_map:google.protobuf.Struct.fields) |
| 472 | return fields_.GetMap(); |
| 473 | } |
| 474 | ::google::protobuf::Map< ::std::string, ::google::protobuf::Value >* |
| 475 | Struct::mutable_fields() { |
| 476 | // @@protoc_insertion_point(field_mutable_map:google.protobuf.Struct.fields) |
| 477 | return fields_.MutableMap(); |
| 478 | } |
| 479 | |
| 480 | #endif // PROTOBUF_INLINE_NOT_IN_HEADERS |
| 481 | |
| 482 | // =================================================================== |
| 483 | |
| 484 | #if !defined(_MSC_VER) || _MSC_VER >= 1900 |
| 485 | const int Value::kNullValueFieldNumber; |
| 486 | const int Value::kNumberValueFieldNumber; |
| 487 | const int Value::kStringValueFieldNumber; |
| 488 | const int Value::kBoolValueFieldNumber; |
| 489 | const int Value::kStructValueFieldNumber; |
| 490 | const int Value::kListValueFieldNumber; |
| 491 | #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 |
| 492 | |
| 493 | Value::Value() |
| 494 | : ::google::protobuf::Message(), _internal_metadata_(NULL) { |
| 495 | SharedCtor(); |
| 496 | // @@protoc_insertion_point(constructor:google.protobuf.Value) |
| 497 | } |
| 498 | |
| 499 | void Value::InitAsDefaultInstance() { |
| 500 | _is_default_instance_ = true; |
| 501 | Value_default_oneof_instance_->null_value_ = 0; |
| 502 | Value_default_oneof_instance_->number_value_ = 0; |
| 503 | Value_default_oneof_instance_->string_value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); |
| 504 | Value_default_oneof_instance_->bool_value_ = false; |
| 505 | Value_default_oneof_instance_->struct_value_ = const_cast< ::google::protobuf::Struct*>(&::google::protobuf::Struct::default_instance()); |
| 506 | Value_default_oneof_instance_->list_value_ = const_cast< ::google::protobuf::ListValue*>(&::google::protobuf::ListValue::default_instance()); |
| 507 | } |
| 508 | |
| 509 | Value::Value(const Value& from) |
| 510 | : ::google::protobuf::Message(), |
| 511 | _internal_metadata_(NULL) { |
| 512 | SharedCtor(); |
| 513 | MergeFrom(from); |
| 514 | // @@protoc_insertion_point(copy_constructor:google.protobuf.Value) |
| 515 | } |
| 516 | |
| 517 | void Value::SharedCtor() { |
| 518 | _is_default_instance_ = false; |
| 519 | ::google::protobuf::internal::GetEmptyString(); |
| 520 | _cached_size_ = 0; |
| 521 | clear_has_kind(); |
| 522 | } |
| 523 | |
| 524 | Value::~Value() { |
| 525 | // @@protoc_insertion_point(destructor:google.protobuf.Value) |
| 526 | SharedDtor(); |
| 527 | } |
| 528 | |
| 529 | void Value::SharedDtor() { |
| 530 | if (has_kind()) { |
| 531 | clear_kind(); |
| 532 | } |
| 533 | if (this != default_instance_) { |
| 534 | } |
| 535 | } |
| 536 | |
| 537 | void Value::SetCachedSize(int size) const { |
| 538 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
| 539 | _cached_size_ = size; |
| 540 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); |
| 541 | } |
| 542 | const ::google::protobuf::Descriptor* Value::descriptor() { |
| 543 | protobuf_AssignDescriptorsOnce(); |
| 544 | return Value_descriptor_; |
| 545 | } |
| 546 | |
| 547 | const Value& Value::default_instance() { |
| 548 | if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2fstruct_2eproto(); |
| 549 | return *default_instance_; |
| 550 | } |
| 551 | |
| 552 | Value* Value::default_instance_ = NULL; |
| 553 | |
| 554 | Value* Value::New(::google::protobuf::Arena* arena) const { |
| 555 | Value* n = new Value; |
| 556 | if (arena != NULL) { |
| 557 | arena->Own(n); |
| 558 | } |
| 559 | return n; |
| 560 | } |
| 561 | |
| 562 | void Value::clear_kind() { |
| 563 | switch(kind_case()) { |
| 564 | case kNullValue: { |
| 565 | // No need to clear |
| 566 | break; |
| 567 | } |
| 568 | case kNumberValue: { |
| 569 | // No need to clear |
| 570 | break; |
| 571 | } |
| 572 | case kStringValue: { |
| 573 | kind_.string_value_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); |
| 574 | break; |
| 575 | } |
| 576 | case kBoolValue: { |
| 577 | // No need to clear |
| 578 | break; |
| 579 | } |
| 580 | case kStructValue: { |
| 581 | delete kind_.struct_value_; |
| 582 | break; |
| 583 | } |
| 584 | case kListValue: { |
| 585 | delete kind_.list_value_; |
| 586 | break; |
| 587 | } |
| 588 | case KIND_NOT_SET: { |
| 589 | break; |
| 590 | } |
| 591 | } |
| 592 | _oneof_case_[0] = KIND_NOT_SET; |
| 593 | } |
| 594 | |
| 595 | |
| 596 | void Value::Clear() { |
| 597 | clear_kind(); |
| 598 | } |
| 599 | |
| 600 | bool Value::MergePartialFromCodedStream( |
| 601 | ::google::protobuf::io::CodedInputStream* input) { |
| 602 | #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure |
| 603 | ::google::protobuf::uint32 tag; |
| 604 | // @@protoc_insertion_point(parse_start:google.protobuf.Value) |
| 605 | for (;;) { |
| 606 | ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); |
| 607 | tag = p.first; |
| 608 | if (!p.second) goto handle_unusual; |
| 609 | switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { |
| 610 | // optional .google.protobuf.NullValue null_value = 1; |
| 611 | case 1: { |
| 612 | if (tag == 8) { |
| 613 | int value; |
| 614 | DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< |
| 615 | int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( |
| 616 | input, &value))); |
| 617 | set_null_value(static_cast< ::google::protobuf::NullValue >(value)); |
| 618 | } else { |
| 619 | goto handle_unusual; |
| 620 | } |
| 621 | if (input->ExpectTag(17)) goto parse_number_value; |
| 622 | break; |
| 623 | } |
| 624 | |
| 625 | // optional double number_value = 2; |
| 626 | case 2: { |
| 627 | if (tag == 17) { |
| 628 | parse_number_value: |
| 629 | clear_kind(); |
| 630 | DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< |
| 631 | double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>( |
| 632 | input, &kind_.number_value_))); |
| 633 | set_has_number_value(); |
| 634 | } else { |
| 635 | goto handle_unusual; |
| 636 | } |
| 637 | if (input->ExpectTag(26)) goto parse_string_value; |
| 638 | break; |
| 639 | } |
| 640 | |
| 641 | // optional string string_value = 3; |
| 642 | case 3: { |
| 643 | if (tag == 26) { |
| 644 | parse_string_value: |
| 645 | DO_(::google::protobuf::internal::WireFormatLite::ReadString( |
| 646 | input, this->mutable_string_value())); |
| 647 | DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( |
| 648 | this->string_value().data(), this->string_value().length(), |
| 649 | ::google::protobuf::internal::WireFormatLite::PARSE, |
| 650 | "google.protobuf.Value.string_value")); |
| 651 | } else { |
| 652 | goto handle_unusual; |
| 653 | } |
| 654 | if (input->ExpectTag(32)) goto parse_bool_value; |
| 655 | break; |
| 656 | } |
| 657 | |
| 658 | // optional bool bool_value = 4; |
| 659 | case 4: { |
| 660 | if (tag == 32) { |
| 661 | parse_bool_value: |
| 662 | clear_kind(); |
| 663 | DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< |
| 664 | bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( |
| 665 | input, &kind_.bool_value_))); |
| 666 | set_has_bool_value(); |
| 667 | } else { |
| 668 | goto handle_unusual; |
| 669 | } |
| 670 | if (input->ExpectTag(42)) goto parse_struct_value; |
| 671 | break; |
| 672 | } |
| 673 | |
| 674 | // optional .google.protobuf.Struct struct_value = 5; |
| 675 | case 5: { |
| 676 | if (tag == 42) { |
| 677 | parse_struct_value: |
| 678 | DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( |
| 679 | input, mutable_struct_value())); |
| 680 | } else { |
| 681 | goto handle_unusual; |
| 682 | } |
| 683 | if (input->ExpectTag(50)) goto parse_list_value; |
| 684 | break; |
| 685 | } |
| 686 | |
| 687 | // optional .google.protobuf.ListValue list_value = 6; |
| 688 | case 6: { |
| 689 | if (tag == 50) { |
| 690 | parse_list_value: |
| 691 | DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( |
| 692 | input, mutable_list_value())); |
| 693 | } else { |
| 694 | goto handle_unusual; |
| 695 | } |
| 696 | if (input->ExpectAtEnd()) goto success; |
| 697 | break; |
| 698 | } |
| 699 | |
| 700 | default: { |
| 701 | handle_unusual: |
| 702 | if (tag == 0 || |
| 703 | ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
| 704 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { |
| 705 | goto success; |
| 706 | } |
| 707 | DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag)); |
| 708 | break; |
| 709 | } |
| 710 | } |
| 711 | } |
| 712 | success: |
| 713 | // @@protoc_insertion_point(parse_success:google.protobuf.Value) |
| 714 | return true; |
| 715 | failure: |
| 716 | // @@protoc_insertion_point(parse_failure:google.protobuf.Value) |
| 717 | return false; |
| 718 | #undef DO_ |
| 719 | } |
| 720 | |
| 721 | void Value::SerializeWithCachedSizes( |
| 722 | ::google::protobuf::io::CodedOutputStream* output) const { |
| 723 | // @@protoc_insertion_point(serialize_start:google.protobuf.Value) |
| 724 | // optional .google.protobuf.NullValue null_value = 1; |
| 725 | if (has_null_value()) { |
| 726 | ::google::protobuf::internal::WireFormatLite::WriteEnum( |
| 727 | 1, this->null_value(), output); |
| 728 | } |
| 729 | |
| 730 | // optional double number_value = 2; |
| 731 | if (has_number_value()) { |
| 732 | ::google::protobuf::internal::WireFormatLite::WriteDouble(2, this->number_value(), output); |
| 733 | } |
| 734 | |
| 735 | // optional string string_value = 3; |
| 736 | if (has_string_value()) { |
| 737 | ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( |
| 738 | this->string_value().data(), this->string_value().length(), |
| 739 | ::google::protobuf::internal::WireFormatLite::SERIALIZE, |
| 740 | "google.protobuf.Value.string_value"); |
| 741 | ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( |
| 742 | 3, this->string_value(), output); |
| 743 | } |
| 744 | |
| 745 | // optional bool bool_value = 4; |
| 746 | if (has_bool_value()) { |
| 747 | ::google::protobuf::internal::WireFormatLite::WriteBool(4, this->bool_value(), output); |
| 748 | } |
| 749 | |
| 750 | // optional .google.protobuf.Struct struct_value = 5; |
| 751 | if (has_struct_value()) { |
| 752 | ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( |
| 753 | 5, *kind_.struct_value_, output); |
| 754 | } |
| 755 | |
| 756 | // optional .google.protobuf.ListValue list_value = 6; |
| 757 | if (has_list_value()) { |
| 758 | ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( |
| 759 | 6, *kind_.list_value_, output); |
| 760 | } |
| 761 | |
| 762 | // @@protoc_insertion_point(serialize_end:google.protobuf.Value) |
| 763 | } |
| 764 | |
| 765 | ::google::protobuf::uint8* Value::SerializeWithCachedSizesToArray( |
| 766 | ::google::protobuf::uint8* target) const { |
| 767 | // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Value) |
| 768 | // optional .google.protobuf.NullValue null_value = 1; |
| 769 | if (has_null_value()) { |
| 770 | target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( |
| 771 | 1, this->null_value(), target); |
| 772 | } |
| 773 | |
| 774 | // optional double number_value = 2; |
| 775 | if (has_number_value()) { |
| 776 | target = ::google::protobuf::internal::WireFormatLite::WriteDoubleToArray(2, this->number_value(), target); |
| 777 | } |
| 778 | |
| 779 | // optional string string_value = 3; |
| 780 | if (has_string_value()) { |
| 781 | ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( |
| 782 | this->string_value().data(), this->string_value().length(), |
| 783 | ::google::protobuf::internal::WireFormatLite::SERIALIZE, |
| 784 | "google.protobuf.Value.string_value"); |
| 785 | target = |
| 786 | ::google::protobuf::internal::WireFormatLite::WriteStringToArray( |
| 787 | 3, this->string_value(), target); |
| 788 | } |
| 789 | |
| 790 | // optional bool bool_value = 4; |
| 791 | if (has_bool_value()) { |
| 792 | target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(4, this->bool_value(), target); |
| 793 | } |
| 794 | |
| 795 | // optional .google.protobuf.Struct struct_value = 5; |
| 796 | if (has_struct_value()) { |
| 797 | target = ::google::protobuf::internal::WireFormatLite:: |
| 798 | WriteMessageNoVirtualToArray( |
| 799 | 5, *kind_.struct_value_, target); |
| 800 | } |
| 801 | |
| 802 | // optional .google.protobuf.ListValue list_value = 6; |
| 803 | if (has_list_value()) { |
| 804 | target = ::google::protobuf::internal::WireFormatLite:: |
| 805 | WriteMessageNoVirtualToArray( |
| 806 | 6, *kind_.list_value_, target); |
| 807 | } |
| 808 | |
| 809 | // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Value) |
| 810 | return target; |
| 811 | } |
| 812 | |
| 813 | int Value::ByteSize() const { |
| 814 | int total_size = 0; |
| 815 | |
| 816 | switch (kind_case()) { |
| 817 | // optional .google.protobuf.NullValue null_value = 1; |
| 818 | case kNullValue: { |
| 819 | total_size += 1 + |
| 820 | ::google::protobuf::internal::WireFormatLite::EnumSize(this->null_value()); |
| 821 | break; |
| 822 | } |
| 823 | // optional double number_value = 2; |
| 824 | case kNumberValue: { |
| 825 | total_size += 1 + 8; |
| 826 | break; |
| 827 | } |
| 828 | // optional string string_value = 3; |
| 829 | case kStringValue: { |
| 830 | total_size += 1 + |
| 831 | ::google::protobuf::internal::WireFormatLite::StringSize( |
| 832 | this->string_value()); |
| 833 | break; |
| 834 | } |
| 835 | // optional bool bool_value = 4; |
| 836 | case kBoolValue: { |
| 837 | total_size += 1 + 1; |
| 838 | break; |
| 839 | } |
| 840 | // optional .google.protobuf.Struct struct_value = 5; |
| 841 | case kStructValue: { |
| 842 | total_size += 1 + |
| 843 | ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( |
| 844 | *kind_.struct_value_); |
| 845 | break; |
| 846 | } |
| 847 | // optional .google.protobuf.ListValue list_value = 6; |
| 848 | case kListValue: { |
| 849 | total_size += 1 + |
| 850 | ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( |
| 851 | *kind_.list_value_); |
| 852 | break; |
| 853 | } |
| 854 | case KIND_NOT_SET: { |
| 855 | break; |
| 856 | } |
| 857 | } |
| 858 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
| 859 | _cached_size_ = total_size; |
| 860 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); |
| 861 | return total_size; |
| 862 | } |
| 863 | |
| 864 | void Value::MergeFrom(const ::google::protobuf::Message& from) { |
| 865 | if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); |
| 866 | const Value* source = |
| 867 | ::google::protobuf::internal::DynamicCastToGenerated<const Value>( |
| 868 | &from); |
| 869 | if (source == NULL) { |
| 870 | ::google::protobuf::internal::ReflectionOps::Merge(from, this); |
| 871 | } else { |
| 872 | MergeFrom(*source); |
| 873 | } |
| 874 | } |
| 875 | |
| 876 | void Value::MergeFrom(const Value& from) { |
| 877 | if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); |
| 878 | switch (from.kind_case()) { |
| 879 | case kNullValue: { |
| 880 | set_null_value(from.null_value()); |
| 881 | break; |
| 882 | } |
| 883 | case kNumberValue: { |
| 884 | set_number_value(from.number_value()); |
| 885 | break; |
| 886 | } |
| 887 | case kStringValue: { |
| 888 | set_string_value(from.string_value()); |
| 889 | break; |
| 890 | } |
| 891 | case kBoolValue: { |
| 892 | set_bool_value(from.bool_value()); |
| 893 | break; |
| 894 | } |
| 895 | case kStructValue: { |
| 896 | mutable_struct_value()->::google::protobuf::Struct::MergeFrom(from.struct_value()); |
| 897 | break; |
| 898 | } |
| 899 | case kListValue: { |
| 900 | mutable_list_value()->::google::protobuf::ListValue::MergeFrom(from.list_value()); |
| 901 | break; |
| 902 | } |
| 903 | case KIND_NOT_SET: { |
| 904 | break; |
| 905 | } |
| 906 | } |
| 907 | } |
| 908 | |
| 909 | void Value::CopyFrom(const ::google::protobuf::Message& from) { |
| 910 | if (&from == this) return; |
| 911 | Clear(); |
| 912 | MergeFrom(from); |
| 913 | } |
| 914 | |
| 915 | void Value::CopyFrom(const Value& from) { |
| 916 | if (&from == this) return; |
| 917 | Clear(); |
| 918 | MergeFrom(from); |
| 919 | } |
| 920 | |
| 921 | bool Value::IsInitialized() const { |
| 922 | |
| 923 | return true; |
| 924 | } |
| 925 | |
| 926 | void Value::Swap(Value* other) { |
| 927 | if (other == this) return; |
| 928 | InternalSwap(other); |
| 929 | } |
| 930 | void Value::InternalSwap(Value* other) { |
| 931 | std::swap(kind_, other->kind_); |
| 932 | std::swap(_oneof_case_[0], other->_oneof_case_[0]); |
| 933 | _internal_metadata_.Swap(&other->_internal_metadata_); |
| 934 | std::swap(_cached_size_, other->_cached_size_); |
| 935 | } |
| 936 | |
| 937 | ::google::protobuf::Metadata Value::GetMetadata() const { |
| 938 | protobuf_AssignDescriptorsOnce(); |
| 939 | ::google::protobuf::Metadata metadata; |
| 940 | metadata.descriptor = Value_descriptor_; |
| 941 | metadata.reflection = Value_reflection_; |
| 942 | return metadata; |
| 943 | } |
| 944 | |
| 945 | #if PROTOBUF_INLINE_NOT_IN_HEADERS |
| 946 | // Value |
| 947 | |
| 948 | // optional .google.protobuf.NullValue null_value = 1; |
| 949 | bool Value::has_null_value() const { |
| 950 | return kind_case() == kNullValue; |
| 951 | } |
| 952 | void Value::set_has_null_value() { |
| 953 | _oneof_case_[0] = kNullValue; |
| 954 | } |
| 955 | void Value::clear_null_value() { |
| 956 | if (has_null_value()) { |
| 957 | kind_.null_value_ = 0; |
| 958 | clear_has_kind(); |
| 959 | } |
| 960 | } |
| 961 | ::google::protobuf::NullValue Value::null_value() const { |
| 962 | // @@protoc_insertion_point(field_get:google.protobuf.Value.null_value) |
| 963 | if (has_null_value()) { |
| 964 | return static_cast< ::google::protobuf::NullValue >(kind_.null_value_); |
| 965 | } |
| 966 | return static_cast< ::google::protobuf::NullValue >(0); |
| 967 | } |
| 968 | void Value::set_null_value(::google::protobuf::NullValue value) { |
| 969 | if (!has_null_value()) { |
| 970 | clear_kind(); |
| 971 | set_has_null_value(); |
| 972 | } |
| 973 | kind_.null_value_ = value; |
| 974 | // @@protoc_insertion_point(field_set:google.protobuf.Value.null_value) |
| 975 | } |
| 976 | |
| 977 | // optional double number_value = 2; |
| 978 | bool Value::has_number_value() const { |
| 979 | return kind_case() == kNumberValue; |
| 980 | } |
| 981 | void Value::set_has_number_value() { |
| 982 | _oneof_case_[0] = kNumberValue; |
| 983 | } |
| 984 | void Value::clear_number_value() { |
| 985 | if (has_number_value()) { |
| 986 | kind_.number_value_ = 0; |
| 987 | clear_has_kind(); |
| 988 | } |
| 989 | } |
| 990 | double Value::number_value() const { |
| 991 | // @@protoc_insertion_point(field_get:google.protobuf.Value.number_value) |
| 992 | if (has_number_value()) { |
| 993 | return kind_.number_value_; |
| 994 | } |
| 995 | return 0; |
| 996 | } |
| 997 | void Value::set_number_value(double value) { |
| 998 | if (!has_number_value()) { |
| 999 | clear_kind(); |
| 1000 | set_has_number_value(); |
| 1001 | } |
| 1002 | kind_.number_value_ = value; |
| 1003 | // @@protoc_insertion_point(field_set:google.protobuf.Value.number_value) |
| 1004 | } |
| 1005 | |
| 1006 | // optional string string_value = 3; |
| 1007 | bool Value::has_string_value() const { |
| 1008 | return kind_case() == kStringValue; |
| 1009 | } |
| 1010 | void Value::set_has_string_value() { |
| 1011 | _oneof_case_[0] = kStringValue; |
| 1012 | } |
| 1013 | void Value::clear_string_value() { |
| 1014 | if (has_string_value()) { |
| 1015 | kind_.string_value_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); |
| 1016 | clear_has_kind(); |
| 1017 | } |
| 1018 | } |
| 1019 | const ::std::string& Value::string_value() const { |
| 1020 | // @@protoc_insertion_point(field_get:google.protobuf.Value.string_value) |
| 1021 | if (has_string_value()) { |
| 1022 | return kind_.string_value_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); |
| 1023 | } |
| 1024 | return *&::google::protobuf::internal::GetEmptyStringAlreadyInited(); |
| 1025 | } |
| 1026 | void Value::set_string_value(const ::std::string& value) { |
| 1027 | // @@protoc_insertion_point(field_set:google.protobuf.Value.string_value) |
| 1028 | if (!has_string_value()) { |
| 1029 | clear_kind(); |
| 1030 | set_has_string_value(); |
| 1031 | kind_.string_value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); |
| 1032 | } |
| 1033 | kind_.string_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); |
| 1034 | // @@protoc_insertion_point(field_set:google.protobuf.Value.string_value) |
| 1035 | } |
| 1036 | void Value::set_string_value(const char* value) { |
| 1037 | if (!has_string_value()) { |
| 1038 | clear_kind(); |
| 1039 | set_has_string_value(); |
| 1040 | kind_.string_value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); |
| 1041 | } |
| 1042 | kind_.string_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), |
| 1043 | ::std::string(value)); |
| 1044 | // @@protoc_insertion_point(field_set_char:google.protobuf.Value.string_value) |
| 1045 | } |
| 1046 | void Value::set_string_value(const char* value, size_t size) { |
| 1047 | if (!has_string_value()) { |
| 1048 | clear_kind(); |
| 1049 | set_has_string_value(); |
| 1050 | kind_.string_value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); |
| 1051 | } |
| 1052 | kind_.string_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( |
| 1053 | reinterpret_cast<const char*>(value), size)); |
| 1054 | // @@protoc_insertion_point(field_set_pointer:google.protobuf.Value.string_value) |
| 1055 | } |
| 1056 | ::std::string* Value::mutable_string_value() { |
| 1057 | if (!has_string_value()) { |
| 1058 | clear_kind(); |
| 1059 | set_has_string_value(); |
| 1060 | kind_.string_value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); |
| 1061 | } |
| 1062 | // @@protoc_insertion_point(field_mutable:google.protobuf.Value.string_value) |
| 1063 | return kind_.string_value_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); |
| 1064 | } |
| 1065 | ::std::string* Value::release_string_value() { |
| 1066 | if (has_string_value()) { |
| 1067 | clear_has_kind(); |
| 1068 | return kind_.string_value_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); |
| 1069 | } else { |
| 1070 | return NULL; |
| 1071 | } |
| 1072 | } |
| 1073 | void Value::set_allocated_string_value(::std::string* string_value) { |
| 1074 | if (!has_string_value()) { |
| 1075 | kind_.string_value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); |
| 1076 | } |
| 1077 | clear_kind(); |
| 1078 | if (string_value != NULL) { |
| 1079 | set_has_string_value(); |
| 1080 | kind_.string_value_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), |
| 1081 | string_value); |
| 1082 | } |
| 1083 | // @@protoc_insertion_point(field_set_allocated:google.protobuf.Value.string_value) |
| 1084 | } |
| 1085 | |
| 1086 | // optional bool bool_value = 4; |
| 1087 | bool Value::has_bool_value() const { |
| 1088 | return kind_case() == kBoolValue; |
| 1089 | } |
| 1090 | void Value::set_has_bool_value() { |
| 1091 | _oneof_case_[0] = kBoolValue; |
| 1092 | } |
| 1093 | void Value::clear_bool_value() { |
| 1094 | if (has_bool_value()) { |
| 1095 | kind_.bool_value_ = false; |
| 1096 | clear_has_kind(); |
| 1097 | } |
| 1098 | } |
| 1099 | bool Value::bool_value() const { |
| 1100 | // @@protoc_insertion_point(field_get:google.protobuf.Value.bool_value) |
| 1101 | if (has_bool_value()) { |
| 1102 | return kind_.bool_value_; |
| 1103 | } |
| 1104 | return false; |
| 1105 | } |
| 1106 | void Value::set_bool_value(bool value) { |
| 1107 | if (!has_bool_value()) { |
| 1108 | clear_kind(); |
| 1109 | set_has_bool_value(); |
| 1110 | } |
| 1111 | kind_.bool_value_ = value; |
| 1112 | // @@protoc_insertion_point(field_set:google.protobuf.Value.bool_value) |
| 1113 | } |
| 1114 | |
| 1115 | // optional .google.protobuf.Struct struct_value = 5; |
| 1116 | bool Value::has_struct_value() const { |
| 1117 | return kind_case() == kStructValue; |
| 1118 | } |
| 1119 | void Value::set_has_struct_value() { |
| 1120 | _oneof_case_[0] = kStructValue; |
| 1121 | } |
| 1122 | void Value::clear_struct_value() { |
| 1123 | if (has_struct_value()) { |
| 1124 | delete kind_.struct_value_; |
| 1125 | clear_has_kind(); |
| 1126 | } |
| 1127 | } |
| 1128 | const ::google::protobuf::Struct& Value::struct_value() const { |
| 1129 | // @@protoc_insertion_point(field_get:google.protobuf.Value.struct_value) |
| 1130 | return has_struct_value() |
| 1131 | ? *kind_.struct_value_ |
| 1132 | : ::google::protobuf::Struct::default_instance(); |
| 1133 | } |
| 1134 | ::google::protobuf::Struct* Value::mutable_struct_value() { |
| 1135 | if (!has_struct_value()) { |
| 1136 | clear_kind(); |
| 1137 | set_has_struct_value(); |
| 1138 | kind_.struct_value_ = new ::google::protobuf::Struct; |
| 1139 | } |
| 1140 | // @@protoc_insertion_point(field_mutable:google.protobuf.Value.struct_value) |
| 1141 | return kind_.struct_value_; |
| 1142 | } |
| 1143 | ::google::protobuf::Struct* Value::release_struct_value() { |
| 1144 | if (has_struct_value()) { |
| 1145 | clear_has_kind(); |
| 1146 | ::google::protobuf::Struct* temp = kind_.struct_value_; |
| 1147 | kind_.struct_value_ = NULL; |
| 1148 | return temp; |
| 1149 | } else { |
| 1150 | return NULL; |
| 1151 | } |
| 1152 | } |
| 1153 | void Value::set_allocated_struct_value(::google::protobuf::Struct* struct_value) { |
| 1154 | clear_kind(); |
| 1155 | if (struct_value) { |
| 1156 | set_has_struct_value(); |
| 1157 | kind_.struct_value_ = struct_value; |
| 1158 | } |
| 1159 | // @@protoc_insertion_point(field_set_allocated:google.protobuf.Value.struct_value) |
| 1160 | } |
| 1161 | |
| 1162 | // optional .google.protobuf.ListValue list_value = 6; |
| 1163 | bool Value::has_list_value() const { |
| 1164 | return kind_case() == kListValue; |
| 1165 | } |
| 1166 | void Value::set_has_list_value() { |
| 1167 | _oneof_case_[0] = kListValue; |
| 1168 | } |
| 1169 | void Value::clear_list_value() { |
| 1170 | if (has_list_value()) { |
| 1171 | delete kind_.list_value_; |
| 1172 | clear_has_kind(); |
| 1173 | } |
| 1174 | } |
| 1175 | const ::google::protobuf::ListValue& Value::list_value() const { |
| 1176 | // @@protoc_insertion_point(field_get:google.protobuf.Value.list_value) |
| 1177 | return has_list_value() |
| 1178 | ? *kind_.list_value_ |
| 1179 | : ::google::protobuf::ListValue::default_instance(); |
| 1180 | } |
| 1181 | ::google::protobuf::ListValue* Value::mutable_list_value() { |
| 1182 | if (!has_list_value()) { |
| 1183 | clear_kind(); |
| 1184 | set_has_list_value(); |
| 1185 | kind_.list_value_ = new ::google::protobuf::ListValue; |
| 1186 | } |
| 1187 | // @@protoc_insertion_point(field_mutable:google.protobuf.Value.list_value) |
| 1188 | return kind_.list_value_; |
| 1189 | } |
| 1190 | ::google::protobuf::ListValue* Value::release_list_value() { |
| 1191 | if (has_list_value()) { |
| 1192 | clear_has_kind(); |
| 1193 | ::google::protobuf::ListValue* temp = kind_.list_value_; |
| 1194 | kind_.list_value_ = NULL; |
| 1195 | return temp; |
| 1196 | } else { |
| 1197 | return NULL; |
| 1198 | } |
| 1199 | } |
| 1200 | void Value::set_allocated_list_value(::google::protobuf::ListValue* list_value) { |
| 1201 | clear_kind(); |
| 1202 | if (list_value) { |
| 1203 | set_has_list_value(); |
| 1204 | kind_.list_value_ = list_value; |
| 1205 | } |
| 1206 | // @@protoc_insertion_point(field_set_allocated:google.protobuf.Value.list_value) |
| 1207 | } |
| 1208 | |
| 1209 | bool Value::has_kind() const { |
| 1210 | return kind_case() != KIND_NOT_SET; |
| 1211 | } |
| 1212 | void Value::clear_has_kind() { |
| 1213 | _oneof_case_[0] = KIND_NOT_SET; |
| 1214 | } |
| 1215 | Value::KindCase Value::kind_case() const { |
| 1216 | return Value::KindCase(_oneof_case_[0]); |
| 1217 | } |
| 1218 | #endif // PROTOBUF_INLINE_NOT_IN_HEADERS |
| 1219 | |
| 1220 | // =================================================================== |
| 1221 | |
| 1222 | #if !defined(_MSC_VER) || _MSC_VER >= 1900 |
| 1223 | const int ListValue::kValuesFieldNumber; |
| 1224 | #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 |
| 1225 | |
| 1226 | ListValue::ListValue() |
| 1227 | : ::google::protobuf::Message(), _internal_metadata_(NULL) { |
| 1228 | SharedCtor(); |
| 1229 | // @@protoc_insertion_point(constructor:google.protobuf.ListValue) |
| 1230 | } |
| 1231 | |
| 1232 | void ListValue::InitAsDefaultInstance() { |
| 1233 | _is_default_instance_ = true; |
| 1234 | } |
| 1235 | |
| 1236 | ListValue::ListValue(const ListValue& from) |
| 1237 | : ::google::protobuf::Message(), |
| 1238 | _internal_metadata_(NULL) { |
| 1239 | SharedCtor(); |
| 1240 | MergeFrom(from); |
| 1241 | // @@protoc_insertion_point(copy_constructor:google.protobuf.ListValue) |
| 1242 | } |
| 1243 | |
| 1244 | void ListValue::SharedCtor() { |
| 1245 | _is_default_instance_ = false; |
| 1246 | _cached_size_ = 0; |
| 1247 | } |
| 1248 | |
| 1249 | ListValue::~ListValue() { |
| 1250 | // @@protoc_insertion_point(destructor:google.protobuf.ListValue) |
| 1251 | SharedDtor(); |
| 1252 | } |
| 1253 | |
| 1254 | void ListValue::SharedDtor() { |
| 1255 | if (this != default_instance_) { |
| 1256 | } |
| 1257 | } |
| 1258 | |
| 1259 | void ListValue::SetCachedSize(int size) const { |
| 1260 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
| 1261 | _cached_size_ = size; |
| 1262 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); |
| 1263 | } |
| 1264 | const ::google::protobuf::Descriptor* ListValue::descriptor() { |
| 1265 | protobuf_AssignDescriptorsOnce(); |
| 1266 | return ListValue_descriptor_; |
| 1267 | } |
| 1268 | |
| 1269 | const ListValue& ListValue::default_instance() { |
| 1270 | if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2fstruct_2eproto(); |
| 1271 | return *default_instance_; |
| 1272 | } |
| 1273 | |
| 1274 | ListValue* ListValue::default_instance_ = NULL; |
| 1275 | |
| 1276 | ListValue* ListValue::New(::google::protobuf::Arena* arena) const { |
| 1277 | ListValue* n = new ListValue; |
| 1278 | if (arena != NULL) { |
| 1279 | arena->Own(n); |
| 1280 | } |
| 1281 | return n; |
| 1282 | } |
| 1283 | |
| 1284 | void ListValue::Clear() { |
| 1285 | values_.Clear(); |
| 1286 | } |
| 1287 | |
| 1288 | bool ListValue::MergePartialFromCodedStream( |
| 1289 | ::google::protobuf::io::CodedInputStream* input) { |
| 1290 | #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure |
| 1291 | ::google::protobuf::uint32 tag; |
| 1292 | // @@protoc_insertion_point(parse_start:google.protobuf.ListValue) |
| 1293 | for (;;) { |
| 1294 | ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); |
| 1295 | tag = p.first; |
| 1296 | if (!p.second) goto handle_unusual; |
| 1297 | switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { |
| 1298 | // repeated .google.protobuf.Value values = 1; |
| 1299 | case 1: { |
| 1300 | if (tag == 10) { |
| 1301 | DO_(input->IncrementRecursionDepth()); |
| 1302 | parse_loop_values: |
| 1303 | DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( |
| 1304 | input, add_values())); |
| 1305 | } else { |
| 1306 | goto handle_unusual; |
| 1307 | } |
| 1308 | if (input->ExpectTag(10)) goto parse_loop_values; |
| 1309 | input->UnsafeDecrementRecursionDepth(); |
| 1310 | if (input->ExpectAtEnd()) goto success; |
| 1311 | break; |
| 1312 | } |
| 1313 | |
| 1314 | default: { |
| 1315 | handle_unusual: |
| 1316 | if (tag == 0 || |
| 1317 | ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == |
| 1318 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { |
| 1319 | goto success; |
| 1320 | } |
| 1321 | DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag)); |
| 1322 | break; |
| 1323 | } |
| 1324 | } |
| 1325 | } |
| 1326 | success: |
| 1327 | // @@protoc_insertion_point(parse_success:google.protobuf.ListValue) |
| 1328 | return true; |
| 1329 | failure: |
| 1330 | // @@protoc_insertion_point(parse_failure:google.protobuf.ListValue) |
| 1331 | return false; |
| 1332 | #undef DO_ |
| 1333 | } |
| 1334 | |
| 1335 | void ListValue::SerializeWithCachedSizes( |
| 1336 | ::google::protobuf::io::CodedOutputStream* output) const { |
| 1337 | // @@protoc_insertion_point(serialize_start:google.protobuf.ListValue) |
| 1338 | // repeated .google.protobuf.Value values = 1; |
| 1339 | for (unsigned int i = 0, n = this->values_size(); i < n; i++) { |
| 1340 | ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( |
| 1341 | 1, this->values(i), output); |
| 1342 | } |
| 1343 | |
| 1344 | // @@protoc_insertion_point(serialize_end:google.protobuf.ListValue) |
| 1345 | } |
| 1346 | |
| 1347 | ::google::protobuf::uint8* ListValue::SerializeWithCachedSizesToArray( |
| 1348 | ::google::protobuf::uint8* target) const { |
| 1349 | // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.ListValue) |
| 1350 | // repeated .google.protobuf.Value values = 1; |
| 1351 | for (unsigned int i = 0, n = this->values_size(); i < n; i++) { |
| 1352 | target = ::google::protobuf::internal::WireFormatLite:: |
| 1353 | WriteMessageNoVirtualToArray( |
| 1354 | 1, this->values(i), target); |
| 1355 | } |
| 1356 | |
| 1357 | // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.ListValue) |
| 1358 | return target; |
| 1359 | } |
| 1360 | |
| 1361 | int ListValue::ByteSize() const { |
| 1362 | int total_size = 0; |
| 1363 | |
| 1364 | // repeated .google.protobuf.Value values = 1; |
| 1365 | total_size += 1 * this->values_size(); |
| 1366 | for (int i = 0; i < this->values_size(); i++) { |
| 1367 | total_size += |
| 1368 | ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( |
| 1369 | this->values(i)); |
| 1370 | } |
| 1371 | |
| 1372 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); |
| 1373 | _cached_size_ = total_size; |
| 1374 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); |
| 1375 | return total_size; |
| 1376 | } |
| 1377 | |
| 1378 | void ListValue::MergeFrom(const ::google::protobuf::Message& from) { |
| 1379 | if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); |
| 1380 | const ListValue* source = |
| 1381 | ::google::protobuf::internal::DynamicCastToGenerated<const ListValue>( |
| 1382 | &from); |
| 1383 | if (source == NULL) { |
| 1384 | ::google::protobuf::internal::ReflectionOps::Merge(from, this); |
| 1385 | } else { |
| 1386 | MergeFrom(*source); |
| 1387 | } |
| 1388 | } |
| 1389 | |
| 1390 | void ListValue::MergeFrom(const ListValue& from) { |
| 1391 | if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); |
| 1392 | values_.MergeFrom(from.values_); |
| 1393 | } |
| 1394 | |
| 1395 | void ListValue::CopyFrom(const ::google::protobuf::Message& from) { |
| 1396 | if (&from == this) return; |
| 1397 | Clear(); |
| 1398 | MergeFrom(from); |
| 1399 | } |
| 1400 | |
| 1401 | void ListValue::CopyFrom(const ListValue& from) { |
| 1402 | if (&from == this) return; |
| 1403 | Clear(); |
| 1404 | MergeFrom(from); |
| 1405 | } |
| 1406 | |
| 1407 | bool ListValue::IsInitialized() const { |
| 1408 | |
| 1409 | return true; |
| 1410 | } |
| 1411 | |
| 1412 | void ListValue::Swap(ListValue* other) { |
| 1413 | if (other == this) return; |
| 1414 | InternalSwap(other); |
| 1415 | } |
| 1416 | void ListValue::InternalSwap(ListValue* other) { |
| 1417 | values_.UnsafeArenaSwap(&other->values_); |
| 1418 | _internal_metadata_.Swap(&other->_internal_metadata_); |
| 1419 | std::swap(_cached_size_, other->_cached_size_); |
| 1420 | } |
| 1421 | |
| 1422 | ::google::protobuf::Metadata ListValue::GetMetadata() const { |
| 1423 | protobuf_AssignDescriptorsOnce(); |
| 1424 | ::google::protobuf::Metadata metadata; |
| 1425 | metadata.descriptor = ListValue_descriptor_; |
| 1426 | metadata.reflection = ListValue_reflection_; |
| 1427 | return metadata; |
| 1428 | } |
| 1429 | |
| 1430 | #if PROTOBUF_INLINE_NOT_IN_HEADERS |
| 1431 | // ListValue |
| 1432 | |
| 1433 | // repeated .google.protobuf.Value values = 1; |
| 1434 | int ListValue::values_size() const { |
| 1435 | return values_.size(); |
| 1436 | } |
| 1437 | void ListValue::clear_values() { |
| 1438 | values_.Clear(); |
| 1439 | } |
| 1440 | const ::google::protobuf::Value& ListValue::values(int index) const { |
| 1441 | // @@protoc_insertion_point(field_get:google.protobuf.ListValue.values) |
| 1442 | return values_.Get(index); |
| 1443 | } |
| 1444 | ::google::protobuf::Value* ListValue::mutable_values(int index) { |
| 1445 | // @@protoc_insertion_point(field_mutable:google.protobuf.ListValue.values) |
| 1446 | return values_.Mutable(index); |
| 1447 | } |
| 1448 | ::google::protobuf::Value* ListValue::add_values() { |
| 1449 | // @@protoc_insertion_point(field_add:google.protobuf.ListValue.values) |
| 1450 | return values_.Add(); |
| 1451 | } |
| 1452 | ::google::protobuf::RepeatedPtrField< ::google::protobuf::Value >* |
| 1453 | ListValue::mutable_values() { |
| 1454 | // @@protoc_insertion_point(field_mutable_list:google.protobuf.ListValue.values) |
| 1455 | return &values_; |
| 1456 | } |
| 1457 | const ::google::protobuf::RepeatedPtrField< ::google::protobuf::Value >& |
| 1458 | ListValue::values() const { |
| 1459 | // @@protoc_insertion_point(field_list:google.protobuf.ListValue.values) |
| 1460 | return values_; |
| 1461 | } |
| 1462 | |
| 1463 | #endif // PROTOBUF_INLINE_NOT_IN_HEADERS |
| 1464 | |
| 1465 | // @@protoc_insertion_point(namespace_scope) |
| 1466 | |
| 1467 | } // namespace protobuf |
| 1468 | } // namespace google |
| 1469 | |
| 1470 | // @@protoc_insertion_point(global_scope) |