blob: 8f2d484818da21c9a36bf31d9d0a631466596c7d [file] [log] [blame]
Brian Silverman9c614bc2016-02-15 20:20:02 -05001// Generated by the protocol buffer compiler. DO NOT EDIT!
2// source: google/protobuf/struct.proto
3
Brian Silverman9c614bc2016-02-15 20:20:02 -05004#include <google/protobuf/struct.pb.h>
5
6#include <algorithm>
7
8#include <google/protobuf/stubs/common.h>
9#include <google/protobuf/stubs/port.h>
Brian Silverman9c614bc2016-02-15 20:20:02 -050010#include <google/protobuf/io/coded_stream.h>
11#include <google/protobuf/wire_format_lite_inl.h>
12#include <google/protobuf/descriptor.h>
13#include <google/protobuf/generated_message_reflection.h>
14#include <google/protobuf/reflection_ops.h>
15#include <google/protobuf/wire_format.h>
Austin Schuh40c16522018-10-28 20:27:54 -070016// This is a temporary google only hack
17#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
18#include "third_party/protobuf/version.h"
19#endif
Brian Silverman9c614bc2016-02-15 20:20:02 -050020// @@protoc_insertion_point(includes)
21
Austin Schuh40c16522018-10-28 20:27:54 -070022namespace protobuf_google_2fprotobuf_2fstruct_2eproto {
23extern PROTOBUF_INTERNAL_EXPORT_protobuf_google_2fprotobuf_2fstruct_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_ListValue;
24} // namespace protobuf_google_2fprotobuf_2fstruct_2eproto
Brian Silverman9c614bc2016-02-15 20:20:02 -050025namespace google {
26namespace protobuf {
Austin Schuh40c16522018-10-28 20:27:54 -070027class Struct_FieldsEntry_DoNotUseDefaultTypeInternal {
28 public:
29 ::google::protobuf::internal::ExplicitlyConstructed<Struct_FieldsEntry_DoNotUse>
30 _instance;
31} _Struct_FieldsEntry_DoNotUse_default_instance_;
32class StructDefaultTypeInternal {
33 public:
34 ::google::protobuf::internal::ExplicitlyConstructed<Struct>
35 _instance;
36} _Struct_default_instance_;
37class ValueDefaultTypeInternal {
38 public:
39 ::google::protobuf::internal::ExplicitlyConstructed<Value>
40 _instance;
Brian Silverman9c614bc2016-02-15 20:20:02 -050041 int null_value_;
42 double number_value_;
43 ::google::protobuf::internal::ArenaStringPtr string_value_;
44 bool bool_value_;
45 const ::google::protobuf::Struct* struct_value_;
46 const ::google::protobuf::ListValue* list_value_;
Austin Schuh40c16522018-10-28 20:27:54 -070047} _Value_default_instance_;
48class ListValueDefaultTypeInternal {
49 public:
50 ::google::protobuf::internal::ExplicitlyConstructed<ListValue>
51 _instance;
52} _ListValue_default_instance_;
53} // namespace protobuf
54} // namespace google
55namespace protobuf_google_2fprotobuf_2fstruct_2eproto {
56static void InitDefaultsListValue() {
Brian Silverman9c614bc2016-02-15 20:20:02 -050057 GOOGLE_PROTOBUF_VERIFY_VERSION;
58
Austin Schuh40c16522018-10-28 20:27:54 -070059 {
60 void* ptr = &::google::protobuf::_Struct_FieldsEntry_DoNotUse_default_instance_;
61 new (ptr) ::google::protobuf::Struct_FieldsEntry_DoNotUse();
62 }
63 {
64 void* ptr = &::google::protobuf::_Struct_default_instance_;
65 new (ptr) ::google::protobuf::Struct();
66 ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
67 }
68 {
69 void* ptr = &::google::protobuf::_Value_default_instance_;
70 new (ptr) ::google::protobuf::Value();
71 ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
72 }
73 {
74 void* ptr = &::google::protobuf::_ListValue_default_instance_;
75 new (ptr) ::google::protobuf::ListValue();
76 ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
77 }
78 ::google::protobuf::Struct_FieldsEntry_DoNotUse::InitAsDefaultInstance();
79 ::google::protobuf::Struct::InitAsDefaultInstance();
80 ::google::protobuf::Value::InitAsDefaultInstance();
81 ::google::protobuf::ListValue::InitAsDefaultInstance();
Brian Silverman9c614bc2016-02-15 20:20:02 -050082}
83
Austin Schuh40c16522018-10-28 20:27:54 -070084LIBPROTOBUF_EXPORT ::google::protobuf::internal::SCCInfo<0> scc_info_ListValue =
85 {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsListValue}, {}};
86
87void InitDefaults() {
88 ::google::protobuf::internal::InitSCC(&scc_info_ListValue.base);
89}
90
91::google::protobuf::Metadata file_level_metadata[4];
92const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors[1];
93
94const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
95 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Struct_FieldsEntry_DoNotUse, _has_bits_),
96 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Struct_FieldsEntry_DoNotUse, _internal_metadata_),
97 ~0u, // no _extensions_
98 ~0u, // no _oneof_case_
99 ~0u, // no _weak_field_map_
100 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Struct_FieldsEntry_DoNotUse, key_),
101 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Struct_FieldsEntry_DoNotUse, value_),
102 0,
103 1,
104 ~0u, // no _has_bits_
105 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Struct, _internal_metadata_),
106 ~0u, // no _extensions_
107 ~0u, // no _oneof_case_
108 ~0u, // no _weak_field_map_
109 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Struct, fields_),
110 ~0u, // no _has_bits_
111 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Value, _internal_metadata_),
112 ~0u, // no _extensions_
113 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Value, _oneof_case_[0]),
114 ~0u, // no _weak_field_map_
115 offsetof(::google::protobuf::ValueDefaultTypeInternal, null_value_),
116 offsetof(::google::protobuf::ValueDefaultTypeInternal, number_value_),
117 offsetof(::google::protobuf::ValueDefaultTypeInternal, string_value_),
118 offsetof(::google::protobuf::ValueDefaultTypeInternal, bool_value_),
119 offsetof(::google::protobuf::ValueDefaultTypeInternal, struct_value_),
120 offsetof(::google::protobuf::ValueDefaultTypeInternal, list_value_),
121 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::Value, kind_),
122 ~0u, // no _has_bits_
123 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::ListValue, _internal_metadata_),
124 ~0u, // no _extensions_
125 ~0u, // no _oneof_case_
126 ~0u, // no _weak_field_map_
127 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::ListValue, values_),
128};
129static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
130 { 0, 7, sizeof(::google::protobuf::Struct_FieldsEntry_DoNotUse)},
131 { 9, -1, sizeof(::google::protobuf::Struct)},
132 { 15, -1, sizeof(::google::protobuf::Value)},
133 { 27, -1, sizeof(::google::protobuf::ListValue)},
134};
135
136static ::google::protobuf::Message const * const file_default_instances[] = {
137 reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::_Struct_FieldsEntry_DoNotUse_default_instance_),
138 reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::_Struct_default_instance_),
139 reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::_Value_default_instance_),
140 reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::_ListValue_default_instance_),
141};
142
143void protobuf_AssignDescriptors() {
144 AddDescriptors();
145 AssignDescriptors(
146 "google/protobuf/struct.proto", schemas, file_default_instances, TableStruct::offsets,
147 file_level_metadata, file_level_enum_descriptors, NULL);
148}
149
150void protobuf_AssignDescriptorsOnce() {
151 static ::google::protobuf::internal::once_flag once;
152 ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors);
153}
154
155void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD;
156void protobuf_RegisterTypes(const ::std::string&) {
Brian Silverman9c614bc2016-02-15 20:20:02 -0500157 protobuf_AssignDescriptorsOnce();
Austin Schuh40c16522018-10-28 20:27:54 -0700158 ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 4);
159}
160
161void AddDescriptorsImpl() {
162 InitDefaults();
163 static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
164 "\n\034google/protobuf/struct.proto\022\017google.p"
165 "rotobuf\"\204\001\n\006Struct\0223\n\006fields\030\001 \003(\0132#.goo"
166 "gle.protobuf.Struct.FieldsEntry\032E\n\013Field"
167 "sEntry\022\013\n\003key\030\001 \001(\t\022%\n\005value\030\002 \001(\0132\026.goo"
168 "gle.protobuf.Value:\0028\001\"\352\001\n\005Value\0220\n\nnull"
169 "_value\030\001 \001(\0162\032.google.protobuf.NullValue"
170 "H\000\022\026\n\014number_value\030\002 \001(\001H\000\022\026\n\014string_val"
171 "ue\030\003 \001(\tH\000\022\024\n\nbool_value\030\004 \001(\010H\000\022/\n\014stru"
172 "ct_value\030\005 \001(\0132\027.google.protobuf.StructH"
173 "\000\0220\n\nlist_value\030\006 \001(\0132\032.google.protobuf."
174 "ListValueH\000B\006\n\004kind\"3\n\tListValue\022&\n\006valu"
175 "es\030\001 \003(\0132\026.google.protobuf.Value*\033\n\tNull"
176 "Value\022\016\n\nNULL_VALUE\020\000B\201\001\n\023com.google.pro"
177 "tobufB\013StructProtoP\001Z1github.com/golang/"
178 "protobuf/ptypes/struct;structpb\370\001\001\242\002\003GPB"
179 "\252\002\036Google.Protobuf.WellKnownTypesb\006proto"
180 "3"
181 };
182 ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
183 descriptor, 641);
184 ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
185 "google/protobuf/struct.proto", &protobuf_RegisterTypes);
186}
187
188void AddDescriptors() {
189 static ::google::protobuf::internal::once_flag once;
190 ::google::protobuf::internal::call_once(once, AddDescriptorsImpl);
191}
192// Force AddDescriptors() to be called at dynamic initialization time.
193struct StaticDescriptorInitializer {
194 StaticDescriptorInitializer() {
195 AddDescriptors();
196 }
197} static_descriptor_initializer;
198} // namespace protobuf_google_2fprotobuf_2fstruct_2eproto
199namespace google {
200namespace protobuf {
201const ::google::protobuf::EnumDescriptor* NullValue_descriptor() {
202 protobuf_google_2fprotobuf_2fstruct_2eproto::protobuf_AssignDescriptorsOnce();
203 return protobuf_google_2fprotobuf_2fstruct_2eproto::file_level_enum_descriptors[0];
Brian Silverman9c614bc2016-02-15 20:20:02 -0500204}
205bool NullValue_IsValid(int value) {
Austin Schuh40c16522018-10-28 20:27:54 -0700206 switch (value) {
Brian Silverman9c614bc2016-02-15 20:20:02 -0500207 case 0:
208 return true;
209 default:
210 return false;
211 }
212}
213
214
Austin Schuh40c16522018-10-28 20:27:54 -0700215// ===================================================================
Brian Silverman9c614bc2016-02-15 20:20:02 -0500216
Austin Schuh40c16522018-10-28 20:27:54 -0700217Struct_FieldsEntry_DoNotUse::Struct_FieldsEntry_DoNotUse() {}
218Struct_FieldsEntry_DoNotUse::Struct_FieldsEntry_DoNotUse(::google::protobuf::Arena* arena) : SuperType(arena) {}
219void Struct_FieldsEntry_DoNotUse::MergeFrom(const Struct_FieldsEntry_DoNotUse& other) {
220 MergeFromInternal(other);
Brian Silverman9c614bc2016-02-15 20:20:02 -0500221}
Austin Schuh40c16522018-10-28 20:27:54 -0700222::google::protobuf::Metadata Struct_FieldsEntry_DoNotUse::GetMetadata() const {
223 ::protobuf_google_2fprotobuf_2fstruct_2eproto::protobuf_AssignDescriptorsOnce();
224 return ::protobuf_google_2fprotobuf_2fstruct_2eproto::file_level_metadata[0];
225}
226void Struct_FieldsEntry_DoNotUse::MergeFrom(
227 const ::google::protobuf::Message& other) {
228 ::google::protobuf::Message::MergeFrom(other);
229}
Brian Silverman9c614bc2016-02-15 20:20:02 -0500230
231
232// ===================================================================
233
Austin Schuh40c16522018-10-28 20:27:54 -0700234void Struct::InitAsDefaultInstance() {
235}
Brian Silverman9c614bc2016-02-15 20:20:02 -0500236#if !defined(_MSC_VER) || _MSC_VER >= 1900
237const int Struct::kFieldsFieldNumber;
238#endif // !defined(_MSC_VER) || _MSC_VER >= 1900
239
240Struct::Struct()
241 : ::google::protobuf::Message(), _internal_metadata_(NULL) {
Austin Schuh40c16522018-10-28 20:27:54 -0700242 ::google::protobuf::internal::InitSCC(
243 &protobuf_google_2fprotobuf_2fstruct_2eproto::scc_info_ListValue.base);
Brian Silverman9c614bc2016-02-15 20:20:02 -0500244 SharedCtor();
245 // @@protoc_insertion_point(constructor:google.protobuf.Struct)
246}
Austin Schuh40c16522018-10-28 20:27:54 -0700247Struct::Struct(::google::protobuf::Arena* arena)
248 : ::google::protobuf::Message(),
249 _internal_metadata_(arena),
250 fields_(arena) {
251 ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2fstruct_2eproto::scc_info_ListValue.base);
252 SharedCtor();
253 RegisterArenaDtor(arena);
254 // @@protoc_insertion_point(arena_constructor:google.protobuf.Struct)
Brian Silverman9c614bc2016-02-15 20:20:02 -0500255}
Brian Silverman9c614bc2016-02-15 20:20:02 -0500256Struct::Struct(const Struct& from)
257 : ::google::protobuf::Message(),
Austin Schuh40c16522018-10-28 20:27:54 -0700258 _internal_metadata_(NULL) {
259 _internal_metadata_.MergeFrom(from._internal_metadata_);
260 fields_.MergeFrom(from.fields_);
Brian Silverman9c614bc2016-02-15 20:20:02 -0500261 // @@protoc_insertion_point(copy_constructor:google.protobuf.Struct)
262}
263
264void Struct::SharedCtor() {
Brian Silverman9c614bc2016-02-15 20:20:02 -0500265}
266
267Struct::~Struct() {
268 // @@protoc_insertion_point(destructor:google.protobuf.Struct)
269 SharedDtor();
270}
271
272void Struct::SharedDtor() {
Austin Schuh40c16522018-10-28 20:27:54 -0700273 GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
Brian Silverman9c614bc2016-02-15 20:20:02 -0500274}
275
Austin Schuh40c16522018-10-28 20:27:54 -0700276void Struct::ArenaDtor(void* object) {
277 Struct* _this = reinterpret_cast< Struct* >(object);
278 (void)_this;
279}
280void Struct::RegisterArenaDtor(::google::protobuf::Arena* arena) {
281}
Brian Silverman9c614bc2016-02-15 20:20:02 -0500282void Struct::SetCachedSize(int size) const {
Austin Schuh40c16522018-10-28 20:27:54 -0700283 _cached_size_.Set(size);
Brian Silverman9c614bc2016-02-15 20:20:02 -0500284}
285const ::google::protobuf::Descriptor* Struct::descriptor() {
Austin Schuh40c16522018-10-28 20:27:54 -0700286 ::protobuf_google_2fprotobuf_2fstruct_2eproto::protobuf_AssignDescriptorsOnce();
287 return ::protobuf_google_2fprotobuf_2fstruct_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
Brian Silverman9c614bc2016-02-15 20:20:02 -0500288}
289
290const Struct& Struct::default_instance() {
Austin Schuh40c16522018-10-28 20:27:54 -0700291 ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2fstruct_2eproto::scc_info_ListValue.base);
292 return *internal_default_instance();
Brian Silverman9c614bc2016-02-15 20:20:02 -0500293}
294
Brian Silverman9c614bc2016-02-15 20:20:02 -0500295
296void Struct::Clear() {
Austin Schuh40c16522018-10-28 20:27:54 -0700297// @@protoc_insertion_point(message_clear_start:google.protobuf.Struct)
298 ::google::protobuf::uint32 cached_has_bits = 0;
299 // Prevent compiler warnings about cached_has_bits being unused
300 (void) cached_has_bits;
301
Brian Silverman9c614bc2016-02-15 20:20:02 -0500302 fields_.Clear();
Austin Schuh40c16522018-10-28 20:27:54 -0700303 _internal_metadata_.Clear();
Brian Silverman9c614bc2016-02-15 20:20:02 -0500304}
305
306bool Struct::MergePartialFromCodedStream(
307 ::google::protobuf::io::CodedInputStream* input) {
Austin Schuh40c16522018-10-28 20:27:54 -0700308#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
Brian Silverman9c614bc2016-02-15 20:20:02 -0500309 ::google::protobuf::uint32 tag;
310 // @@protoc_insertion_point(parse_start:google.protobuf.Struct)
311 for (;;) {
Austin Schuh40c16522018-10-28 20:27:54 -0700312 ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
Brian Silverman9c614bc2016-02-15 20:20:02 -0500313 tag = p.first;
314 if (!p.second) goto handle_unusual;
315 switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
316 // map<string, .google.protobuf.Value> fields = 1;
317 case 1: {
Austin Schuh40c16522018-10-28 20:27:54 -0700318 if (static_cast< ::google::protobuf::uint8>(tag) ==
319 static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
320 Struct_FieldsEntry_DoNotUse::Parser< ::google::protobuf::internal::MapField<
321 Struct_FieldsEntry_DoNotUse,
322 ::std::string, ::google::protobuf::Value,
323 ::google::protobuf::internal::WireFormatLite::TYPE_STRING,
324 ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE,
325 0 >,
326 ::google::protobuf::Map< ::std::string, ::google::protobuf::Value > > parser(&fields_);
Brian Silverman9c614bc2016-02-15 20:20:02 -0500327 DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
Austin Schuh40c16522018-10-28 20:27:54 -0700328 input, &parser));
Brian Silverman9c614bc2016-02-15 20:20:02 -0500329 DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
Austin Schuh40c16522018-10-28 20:27:54 -0700330 parser.key().data(), static_cast<int>(parser.key().length()),
Brian Silverman9c614bc2016-02-15 20:20:02 -0500331 ::google::protobuf::internal::WireFormatLite::PARSE,
332 "google.protobuf.Struct.FieldsEntry.key"));
333 } else {
334 goto handle_unusual;
335 }
Brian Silverman9c614bc2016-02-15 20:20:02 -0500336 break;
337 }
338
339 default: {
340 handle_unusual:
Austin Schuh40c16522018-10-28 20:27:54 -0700341 if (tag == 0) {
Brian Silverman9c614bc2016-02-15 20:20:02 -0500342 goto success;
343 }
Austin Schuh40c16522018-10-28 20:27:54 -0700344 DO_(::google::protobuf::internal::WireFormat::SkipField(
345 input, tag, _internal_metadata_.mutable_unknown_fields()));
Brian Silverman9c614bc2016-02-15 20:20:02 -0500346 break;
347 }
348 }
349 }
350success:
351 // @@protoc_insertion_point(parse_success:google.protobuf.Struct)
352 return true;
353failure:
354 // @@protoc_insertion_point(parse_failure:google.protobuf.Struct)
355 return false;
356#undef DO_
357}
358
359void Struct::SerializeWithCachedSizes(
360 ::google::protobuf::io::CodedOutputStream* output) const {
361 // @@protoc_insertion_point(serialize_start:google.protobuf.Struct)
Austin Schuh40c16522018-10-28 20:27:54 -0700362 ::google::protobuf::uint32 cached_has_bits = 0;
363 (void) cached_has_bits;
364
Brian Silverman9c614bc2016-02-15 20:20:02 -0500365 // map<string, .google.protobuf.Value> fields = 1;
Austin Schuh40c16522018-10-28 20:27:54 -0700366 if (!this->fields().empty()) {
367 typedef ::google::protobuf::Map< ::std::string, ::google::protobuf::Value >::const_pointer
368 ConstPtr;
369 typedef ConstPtr SortItem;
370 typedef ::google::protobuf::internal::CompareByDerefFirst<SortItem> Less;
371 struct Utf8Check {
372 static void Check(ConstPtr p) {
373 ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
374 p->first.data(), static_cast<int>(p->first.length()),
375 ::google::protobuf::internal::WireFormatLite::SERIALIZE,
376 "google.protobuf.Struct.FieldsEntry.key");
377 }
378 };
379
380 if (output->IsSerializationDeterministic() &&
381 this->fields().size() > 1) {
382 ::std::unique_ptr<SortItem[]> items(
383 new SortItem[this->fields().size()]);
384 typedef ::google::protobuf::Map< ::std::string, ::google::protobuf::Value >::size_type size_type;
385 size_type n = 0;
386 for (::google::protobuf::Map< ::std::string, ::google::protobuf::Value >::const_iterator
387 it = this->fields().begin();
388 it != this->fields().end(); ++it, ++n) {
389 items[static_cast<ptrdiff_t>(n)] = SortItem(&*it);
390 }
391 ::std::sort(&items[0], &items[static_cast<ptrdiff_t>(n)], Less());
392 ::std::unique_ptr<Struct_FieldsEntry_DoNotUse> entry;
393 for (size_type i = 0; i < n; i++) {
394 entry.reset(fields_.NewEntryWrapper(
395 items[static_cast<ptrdiff_t>(i)]->first, items[static_cast<ptrdiff_t>(i)]->second));
396 ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
397 1, *entry, output);
398 if (entry->GetArena() != NULL) {
399 entry.release();
400 }
401 Utf8Check::Check(items[static_cast<ptrdiff_t>(i)]);
402 }
403 } else {
404 ::std::unique_ptr<Struct_FieldsEntry_DoNotUse> entry;
405 for (::google::protobuf::Map< ::std::string, ::google::protobuf::Value >::const_iterator
406 it = this->fields().begin();
407 it != this->fields().end(); ++it) {
408 entry.reset(fields_.NewEntryWrapper(
409 it->first, it->second));
410 ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
411 1, *entry, output);
412 if (entry->GetArena() != NULL) {
413 entry.release();
414 }
415 Utf8Check::Check(&*it);
416 }
Brian Silverman9c614bc2016-02-15 20:20:02 -0500417 }
418 }
419
Austin Schuh40c16522018-10-28 20:27:54 -0700420 if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
421 ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
422 (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output);
423 }
Brian Silverman9c614bc2016-02-15 20:20:02 -0500424 // @@protoc_insertion_point(serialize_end:google.protobuf.Struct)
425}
426
Austin Schuh40c16522018-10-28 20:27:54 -0700427::google::protobuf::uint8* Struct::InternalSerializeWithCachedSizesToArray(
428 bool deterministic, ::google::protobuf::uint8* target) const {
429 (void)deterministic; // Unused
Brian Silverman9c614bc2016-02-15 20:20:02 -0500430 // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Struct)
Austin Schuh40c16522018-10-28 20:27:54 -0700431 ::google::protobuf::uint32 cached_has_bits = 0;
432 (void) cached_has_bits;
433
Brian Silverman9c614bc2016-02-15 20:20:02 -0500434 // map<string, .google.protobuf.Value> fields = 1;
Austin Schuh40c16522018-10-28 20:27:54 -0700435 if (!this->fields().empty()) {
436 typedef ::google::protobuf::Map< ::std::string, ::google::protobuf::Value >::const_pointer
437 ConstPtr;
438 typedef ConstPtr SortItem;
439 typedef ::google::protobuf::internal::CompareByDerefFirst<SortItem> Less;
440 struct Utf8Check {
441 static void Check(ConstPtr p) {
442 ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
443 p->first.data(), static_cast<int>(p->first.length()),
444 ::google::protobuf::internal::WireFormatLite::SERIALIZE,
445 "google.protobuf.Struct.FieldsEntry.key");
446 }
447 };
448
449 if (deterministic &&
450 this->fields().size() > 1) {
451 ::std::unique_ptr<SortItem[]> items(
452 new SortItem[this->fields().size()]);
453 typedef ::google::protobuf::Map< ::std::string, ::google::protobuf::Value >::size_type size_type;
454 size_type n = 0;
455 for (::google::protobuf::Map< ::std::string, ::google::protobuf::Value >::const_iterator
456 it = this->fields().begin();
457 it != this->fields().end(); ++it, ++n) {
458 items[static_cast<ptrdiff_t>(n)] = SortItem(&*it);
459 }
460 ::std::sort(&items[0], &items[static_cast<ptrdiff_t>(n)], Less());
461 ::std::unique_ptr<Struct_FieldsEntry_DoNotUse> entry;
462 for (size_type i = 0; i < n; i++) {
463 entry.reset(fields_.NewEntryWrapper(
464 items[static_cast<ptrdiff_t>(i)]->first, items[static_cast<ptrdiff_t>(i)]->second));
465 target = ::google::protobuf::internal::WireFormatLite::
466 InternalWriteMessageNoVirtualToArray(
467 1, *entry, deterministic, target);
468;
469 if (entry->GetArena() != NULL) {
470 entry.release();
471 }
472 Utf8Check::Check(items[static_cast<ptrdiff_t>(i)]);
473 }
474 } else {
475 ::std::unique_ptr<Struct_FieldsEntry_DoNotUse> entry;
476 for (::google::protobuf::Map< ::std::string, ::google::protobuf::Value >::const_iterator
477 it = this->fields().begin();
478 it != this->fields().end(); ++it) {
479 entry.reset(fields_.NewEntryWrapper(
480 it->first, it->second));
481 target = ::google::protobuf::internal::WireFormatLite::
482 InternalWriteMessageNoVirtualToArray(
483 1, *entry, deterministic, target);
484;
485 if (entry->GetArena() != NULL) {
486 entry.release();
487 }
488 Utf8Check::Check(&*it);
489 }
Brian Silverman9c614bc2016-02-15 20:20:02 -0500490 }
491 }
492
Austin Schuh40c16522018-10-28 20:27:54 -0700493 if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
494 target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
495 (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target);
496 }
Brian Silverman9c614bc2016-02-15 20:20:02 -0500497 // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Struct)
498 return target;
499}
500
Austin Schuh40c16522018-10-28 20:27:54 -0700501size_t Struct::ByteSizeLong() const {
502// @@protoc_insertion_point(message_byte_size_start:google.protobuf.Struct)
503 size_t total_size = 0;
Brian Silverman9c614bc2016-02-15 20:20:02 -0500504
Austin Schuh40c16522018-10-28 20:27:54 -0700505 if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
506 total_size +=
507 ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
508 (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()));
509 }
Brian Silverman9c614bc2016-02-15 20:20:02 -0500510 // map<string, .google.protobuf.Value> fields = 1;
Austin Schuh40c16522018-10-28 20:27:54 -0700511 total_size += 1 *
512 ::google::protobuf::internal::FromIntSize(this->fields_size());
Brian Silverman9c614bc2016-02-15 20:20:02 -0500513 {
Austin Schuh40c16522018-10-28 20:27:54 -0700514 ::std::unique_ptr<Struct_FieldsEntry_DoNotUse> entry;
Brian Silverman9c614bc2016-02-15 20:20:02 -0500515 for (::google::protobuf::Map< ::std::string, ::google::protobuf::Value >::const_iterator
516 it = this->fields().begin();
517 it != this->fields().end(); ++it) {
Austin Schuh40c16522018-10-28 20:27:54 -0700518 if (entry.get() != NULL && entry->GetArena() != NULL) {
519 entry.release();
520 }
Brian Silverman9c614bc2016-02-15 20:20:02 -0500521 entry.reset(fields_.NewEntryWrapper(it->first, it->second));
522 total_size += ::google::protobuf::internal::WireFormatLite::
523 MessageSizeNoVirtual(*entry);
524 }
Austin Schuh40c16522018-10-28 20:27:54 -0700525 if (entry.get() != NULL && entry->GetArena() != NULL) {
526 entry.release();
527 }
Brian Silverman9c614bc2016-02-15 20:20:02 -0500528 }
529
Austin Schuh40c16522018-10-28 20:27:54 -0700530 int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
531 SetCachedSize(cached_size);
Brian Silverman9c614bc2016-02-15 20:20:02 -0500532 return total_size;
533}
534
535void Struct::MergeFrom(const ::google::protobuf::Message& from) {
Austin Schuh40c16522018-10-28 20:27:54 -0700536// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.Struct)
537 GOOGLE_DCHECK_NE(&from, this);
538 const Struct* source =
Brian Silverman9c614bc2016-02-15 20:20:02 -0500539 ::google::protobuf::internal::DynamicCastToGenerated<const Struct>(
540 &from);
541 if (source == NULL) {
Austin Schuh40c16522018-10-28 20:27:54 -0700542 // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.Struct)
Brian Silverman9c614bc2016-02-15 20:20:02 -0500543 ::google::protobuf::internal::ReflectionOps::Merge(from, this);
544 } else {
Austin Schuh40c16522018-10-28 20:27:54 -0700545 // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.Struct)
Brian Silverman9c614bc2016-02-15 20:20:02 -0500546 MergeFrom(*source);
547 }
548}
549
550void Struct::MergeFrom(const Struct& from) {
Austin Schuh40c16522018-10-28 20:27:54 -0700551// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.Struct)
552 GOOGLE_DCHECK_NE(&from, this);
553 _internal_metadata_.MergeFrom(from._internal_metadata_);
554 ::google::protobuf::uint32 cached_has_bits = 0;
555 (void) cached_has_bits;
556
Brian Silverman9c614bc2016-02-15 20:20:02 -0500557 fields_.MergeFrom(from.fields_);
558}
559
560void Struct::CopyFrom(const ::google::protobuf::Message& from) {
Austin Schuh40c16522018-10-28 20:27:54 -0700561// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.Struct)
Brian Silverman9c614bc2016-02-15 20:20:02 -0500562 if (&from == this) return;
563 Clear();
564 MergeFrom(from);
565}
566
567void Struct::CopyFrom(const Struct& from) {
Austin Schuh40c16522018-10-28 20:27:54 -0700568// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.Struct)
Brian Silverman9c614bc2016-02-15 20:20:02 -0500569 if (&from == this) return;
570 Clear();
571 MergeFrom(from);
572}
573
574bool Struct::IsInitialized() const {
Brian Silverman9c614bc2016-02-15 20:20:02 -0500575 return true;
576}
577
578void Struct::Swap(Struct* other) {
579 if (other == this) return;
Austin Schuh40c16522018-10-28 20:27:54 -0700580 if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
581 InternalSwap(other);
582 } else {
583 Struct* temp = New(GetArenaNoVirtual());
584 temp->MergeFrom(*other);
585 other->CopyFrom(*this);
586 InternalSwap(temp);
587 if (GetArenaNoVirtual() == NULL) {
588 delete temp;
589 }
590 }
591}
592void Struct::UnsafeArenaSwap(Struct* other) {
593 if (other == this) return;
594 GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
Brian Silverman9c614bc2016-02-15 20:20:02 -0500595 InternalSwap(other);
596}
597void Struct::InternalSwap(Struct* other) {
Austin Schuh40c16522018-10-28 20:27:54 -0700598 using std::swap;
Brian Silverman9c614bc2016-02-15 20:20:02 -0500599 fields_.Swap(&other->fields_);
600 _internal_metadata_.Swap(&other->_internal_metadata_);
Brian Silverman9c614bc2016-02-15 20:20:02 -0500601}
602
603::google::protobuf::Metadata Struct::GetMetadata() const {
Austin Schuh40c16522018-10-28 20:27:54 -0700604 protobuf_google_2fprotobuf_2fstruct_2eproto::protobuf_AssignDescriptorsOnce();
605 return ::protobuf_google_2fprotobuf_2fstruct_2eproto::file_level_metadata[kIndexInFileMessages];
Brian Silverman9c614bc2016-02-15 20:20:02 -0500606}
607
Brian Silverman9c614bc2016-02-15 20:20:02 -0500608
609// ===================================================================
610
Austin Schuh40c16522018-10-28 20:27:54 -0700611void Value::InitAsDefaultInstance() {
612 ::google::protobuf::_Value_default_instance_.null_value_ = 0;
613 ::google::protobuf::_Value_default_instance_.number_value_ = 0;
614 ::google::protobuf::_Value_default_instance_.string_value_.UnsafeSetDefault(
615 &::google::protobuf::internal::GetEmptyStringAlreadyInited());
616 ::google::protobuf::_Value_default_instance_.bool_value_ = false;
617 ::google::protobuf::_Value_default_instance_.struct_value_ = const_cast< ::google::protobuf::Struct*>(
618 ::google::protobuf::Struct::internal_default_instance());
619 ::google::protobuf::_Value_default_instance_.list_value_ = const_cast< ::google::protobuf::ListValue*>(
620 ::google::protobuf::ListValue::internal_default_instance());
621}
622void Value::set_allocated_struct_value(::google::protobuf::Struct* struct_value) {
623 ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
624 clear_kind();
625 if (struct_value) {
626 ::google::protobuf::Arena* submessage_arena =
627 ::google::protobuf::Arena::GetArena(struct_value);
628 if (message_arena != submessage_arena) {
629 struct_value = ::google::protobuf::internal::GetOwnedMessage(
630 message_arena, struct_value, submessage_arena);
631 }
632 set_has_struct_value();
633 kind_.struct_value_ = struct_value;
634 }
635 // @@protoc_insertion_point(field_set_allocated:google.protobuf.Value.struct_value)
636}
637void Value::set_allocated_list_value(::google::protobuf::ListValue* list_value) {
638 ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
639 clear_kind();
640 if (list_value) {
641 ::google::protobuf::Arena* submessage_arena =
642 ::google::protobuf::Arena::GetArena(list_value);
643 if (message_arena != submessage_arena) {
644 list_value = ::google::protobuf::internal::GetOwnedMessage(
645 message_arena, list_value, submessage_arena);
646 }
647 set_has_list_value();
648 kind_.list_value_ = list_value;
649 }
650 // @@protoc_insertion_point(field_set_allocated:google.protobuf.Value.list_value)
651}
Brian Silverman9c614bc2016-02-15 20:20:02 -0500652#if !defined(_MSC_VER) || _MSC_VER >= 1900
653const int Value::kNullValueFieldNumber;
654const int Value::kNumberValueFieldNumber;
655const int Value::kStringValueFieldNumber;
656const int Value::kBoolValueFieldNumber;
657const int Value::kStructValueFieldNumber;
658const int Value::kListValueFieldNumber;
659#endif // !defined(_MSC_VER) || _MSC_VER >= 1900
660
661Value::Value()
662 : ::google::protobuf::Message(), _internal_metadata_(NULL) {
Austin Schuh40c16522018-10-28 20:27:54 -0700663 ::google::protobuf::internal::InitSCC(
664 &protobuf_google_2fprotobuf_2fstruct_2eproto::scc_info_ListValue.base);
Brian Silverman9c614bc2016-02-15 20:20:02 -0500665 SharedCtor();
666 // @@protoc_insertion_point(constructor:google.protobuf.Value)
667}
Austin Schuh40c16522018-10-28 20:27:54 -0700668Value::Value(::google::protobuf::Arena* arena)
669 : ::google::protobuf::Message(),
670 _internal_metadata_(arena) {
671 ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2fstruct_2eproto::scc_info_ListValue.base);
672 SharedCtor();
673 RegisterArenaDtor(arena);
674 // @@protoc_insertion_point(arena_constructor:google.protobuf.Value)
Brian Silverman9c614bc2016-02-15 20:20:02 -0500675}
Brian Silverman9c614bc2016-02-15 20:20:02 -0500676Value::Value(const Value& from)
677 : ::google::protobuf::Message(),
Austin Schuh40c16522018-10-28 20:27:54 -0700678 _internal_metadata_(NULL) {
679 _internal_metadata_.MergeFrom(from._internal_metadata_);
680 clear_has_kind();
681 switch (from.kind_case()) {
682 case kNullValue: {
683 set_null_value(from.null_value());
684 break;
685 }
686 case kNumberValue: {
687 set_number_value(from.number_value());
688 break;
689 }
690 case kStringValue: {
691 set_string_value(from.string_value());
692 break;
693 }
694 case kBoolValue: {
695 set_bool_value(from.bool_value());
696 break;
697 }
698 case kStructValue: {
699 mutable_struct_value()->::google::protobuf::Struct::MergeFrom(from.struct_value());
700 break;
701 }
702 case kListValue: {
703 mutable_list_value()->::google::protobuf::ListValue::MergeFrom(from.list_value());
704 break;
705 }
706 case KIND_NOT_SET: {
707 break;
708 }
709 }
Brian Silverman9c614bc2016-02-15 20:20:02 -0500710 // @@protoc_insertion_point(copy_constructor:google.protobuf.Value)
711}
712
713void Value::SharedCtor() {
Brian Silverman9c614bc2016-02-15 20:20:02 -0500714 clear_has_kind();
715}
716
717Value::~Value() {
718 // @@protoc_insertion_point(destructor:google.protobuf.Value)
719 SharedDtor();
720}
721
722void Value::SharedDtor() {
Austin Schuh40c16522018-10-28 20:27:54 -0700723 GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
Brian Silverman9c614bc2016-02-15 20:20:02 -0500724 if (has_kind()) {
725 clear_kind();
726 }
Brian Silverman9c614bc2016-02-15 20:20:02 -0500727}
728
Austin Schuh40c16522018-10-28 20:27:54 -0700729void Value::ArenaDtor(void* object) {
730 Value* _this = reinterpret_cast< Value* >(object);
731 (void)_this;
732}
733void Value::RegisterArenaDtor(::google::protobuf::Arena* arena) {
734}
Brian Silverman9c614bc2016-02-15 20:20:02 -0500735void Value::SetCachedSize(int size) const {
Austin Schuh40c16522018-10-28 20:27:54 -0700736 _cached_size_.Set(size);
Brian Silverman9c614bc2016-02-15 20:20:02 -0500737}
738const ::google::protobuf::Descriptor* Value::descriptor() {
Austin Schuh40c16522018-10-28 20:27:54 -0700739 ::protobuf_google_2fprotobuf_2fstruct_2eproto::protobuf_AssignDescriptorsOnce();
740 return ::protobuf_google_2fprotobuf_2fstruct_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
Brian Silverman9c614bc2016-02-15 20:20:02 -0500741}
742
743const Value& Value::default_instance() {
Austin Schuh40c16522018-10-28 20:27:54 -0700744 ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2fstruct_2eproto::scc_info_ListValue.base);
745 return *internal_default_instance();
Brian Silverman9c614bc2016-02-15 20:20:02 -0500746}
747
Brian Silverman9c614bc2016-02-15 20:20:02 -0500748
749void Value::clear_kind() {
Austin Schuh40c16522018-10-28 20:27:54 -0700750// @@protoc_insertion_point(one_of_clear_start:google.protobuf.Value)
751 switch (kind_case()) {
Brian Silverman9c614bc2016-02-15 20:20:02 -0500752 case kNullValue: {
753 // No need to clear
754 break;
755 }
756 case kNumberValue: {
757 // No need to clear
758 break;
759 }
760 case kStringValue: {
Austin Schuh40c16522018-10-28 20:27:54 -0700761 kind_.string_value_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
762 GetArenaNoVirtual());
Brian Silverman9c614bc2016-02-15 20:20:02 -0500763 break;
764 }
765 case kBoolValue: {
766 // No need to clear
767 break;
768 }
769 case kStructValue: {
Austin Schuh40c16522018-10-28 20:27:54 -0700770 if (GetArenaNoVirtual() == NULL) {
771 delete kind_.struct_value_;
772 }
Brian Silverman9c614bc2016-02-15 20:20:02 -0500773 break;
774 }
775 case kListValue: {
Austin Schuh40c16522018-10-28 20:27:54 -0700776 if (GetArenaNoVirtual() == NULL) {
777 delete kind_.list_value_;
778 }
Brian Silverman9c614bc2016-02-15 20:20:02 -0500779 break;
780 }
781 case KIND_NOT_SET: {
782 break;
783 }
784 }
785 _oneof_case_[0] = KIND_NOT_SET;
786}
787
788
789void Value::Clear() {
Austin Schuh40c16522018-10-28 20:27:54 -0700790// @@protoc_insertion_point(message_clear_start:google.protobuf.Value)
791 ::google::protobuf::uint32 cached_has_bits = 0;
792 // Prevent compiler warnings about cached_has_bits being unused
793 (void) cached_has_bits;
794
Brian Silverman9c614bc2016-02-15 20:20:02 -0500795 clear_kind();
Austin Schuh40c16522018-10-28 20:27:54 -0700796 _internal_metadata_.Clear();
Brian Silverman9c614bc2016-02-15 20:20:02 -0500797}
798
799bool Value::MergePartialFromCodedStream(
800 ::google::protobuf::io::CodedInputStream* input) {
Austin Schuh40c16522018-10-28 20:27:54 -0700801#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
Brian Silverman9c614bc2016-02-15 20:20:02 -0500802 ::google::protobuf::uint32 tag;
803 // @@protoc_insertion_point(parse_start:google.protobuf.Value)
804 for (;;) {
Austin Schuh40c16522018-10-28 20:27:54 -0700805 ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
Brian Silverman9c614bc2016-02-15 20:20:02 -0500806 tag = p.first;
807 if (!p.second) goto handle_unusual;
808 switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
Austin Schuh40c16522018-10-28 20:27:54 -0700809 // .google.protobuf.NullValue null_value = 1;
Brian Silverman9c614bc2016-02-15 20:20:02 -0500810 case 1: {
Austin Schuh40c16522018-10-28 20:27:54 -0700811 if (static_cast< ::google::protobuf::uint8>(tag) ==
812 static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
Brian Silverman9c614bc2016-02-15 20:20:02 -0500813 int value;
814 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
815 int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
816 input, &value)));
817 set_null_value(static_cast< ::google::protobuf::NullValue >(value));
818 } else {
819 goto handle_unusual;
820 }
Brian Silverman9c614bc2016-02-15 20:20:02 -0500821 break;
822 }
823
Austin Schuh40c16522018-10-28 20:27:54 -0700824 // double number_value = 2;
Brian Silverman9c614bc2016-02-15 20:20:02 -0500825 case 2: {
Austin Schuh40c16522018-10-28 20:27:54 -0700826 if (static_cast< ::google::protobuf::uint8>(tag) ==
827 static_cast< ::google::protobuf::uint8>(17u /* 17 & 0xFF */)) {
Brian Silverman9c614bc2016-02-15 20:20:02 -0500828 clear_kind();
829 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
830 double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
831 input, &kind_.number_value_)));
832 set_has_number_value();
833 } else {
834 goto handle_unusual;
835 }
Brian Silverman9c614bc2016-02-15 20:20:02 -0500836 break;
837 }
838
Austin Schuh40c16522018-10-28 20:27:54 -0700839 // string string_value = 3;
Brian Silverman9c614bc2016-02-15 20:20:02 -0500840 case 3: {
Austin Schuh40c16522018-10-28 20:27:54 -0700841 if (static_cast< ::google::protobuf::uint8>(tag) ==
842 static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
Brian Silverman9c614bc2016-02-15 20:20:02 -0500843 DO_(::google::protobuf::internal::WireFormatLite::ReadString(
844 input, this->mutable_string_value()));
845 DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
Austin Schuh40c16522018-10-28 20:27:54 -0700846 this->string_value().data(), static_cast<int>(this->string_value().length()),
Brian Silverman9c614bc2016-02-15 20:20:02 -0500847 ::google::protobuf::internal::WireFormatLite::PARSE,
848 "google.protobuf.Value.string_value"));
849 } else {
850 goto handle_unusual;
851 }
Brian Silverman9c614bc2016-02-15 20:20:02 -0500852 break;
853 }
854
Austin Schuh40c16522018-10-28 20:27:54 -0700855 // bool bool_value = 4;
Brian Silverman9c614bc2016-02-15 20:20:02 -0500856 case 4: {
Austin Schuh40c16522018-10-28 20:27:54 -0700857 if (static_cast< ::google::protobuf::uint8>(tag) ==
858 static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) {
Brian Silverman9c614bc2016-02-15 20:20:02 -0500859 clear_kind();
860 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
861 bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
862 input, &kind_.bool_value_)));
863 set_has_bool_value();
864 } else {
865 goto handle_unusual;
866 }
Brian Silverman9c614bc2016-02-15 20:20:02 -0500867 break;
868 }
869
Austin Schuh40c16522018-10-28 20:27:54 -0700870 // .google.protobuf.Struct struct_value = 5;
Brian Silverman9c614bc2016-02-15 20:20:02 -0500871 case 5: {
Austin Schuh40c16522018-10-28 20:27:54 -0700872 if (static_cast< ::google::protobuf::uint8>(tag) ==
873 static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) {
874 DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
Brian Silverman9c614bc2016-02-15 20:20:02 -0500875 input, mutable_struct_value()));
876 } else {
877 goto handle_unusual;
878 }
Brian Silverman9c614bc2016-02-15 20:20:02 -0500879 break;
880 }
881
Austin Schuh40c16522018-10-28 20:27:54 -0700882 // .google.protobuf.ListValue list_value = 6;
Brian Silverman9c614bc2016-02-15 20:20:02 -0500883 case 6: {
Austin Schuh40c16522018-10-28 20:27:54 -0700884 if (static_cast< ::google::protobuf::uint8>(tag) ==
885 static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) {
886 DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
Brian Silverman9c614bc2016-02-15 20:20:02 -0500887 input, mutable_list_value()));
888 } else {
889 goto handle_unusual;
890 }
Brian Silverman9c614bc2016-02-15 20:20:02 -0500891 break;
892 }
893
894 default: {
895 handle_unusual:
Austin Schuh40c16522018-10-28 20:27:54 -0700896 if (tag == 0) {
Brian Silverman9c614bc2016-02-15 20:20:02 -0500897 goto success;
898 }
Austin Schuh40c16522018-10-28 20:27:54 -0700899 DO_(::google::protobuf::internal::WireFormat::SkipField(
900 input, tag, _internal_metadata_.mutable_unknown_fields()));
Brian Silverman9c614bc2016-02-15 20:20:02 -0500901 break;
902 }
903 }
904 }
905success:
906 // @@protoc_insertion_point(parse_success:google.protobuf.Value)
907 return true;
908failure:
909 // @@protoc_insertion_point(parse_failure:google.protobuf.Value)
910 return false;
911#undef DO_
912}
913
914void Value::SerializeWithCachedSizes(
915 ::google::protobuf::io::CodedOutputStream* output) const {
916 // @@protoc_insertion_point(serialize_start:google.protobuf.Value)
Austin Schuh40c16522018-10-28 20:27:54 -0700917 ::google::protobuf::uint32 cached_has_bits = 0;
918 (void) cached_has_bits;
919
920 // .google.protobuf.NullValue null_value = 1;
Brian Silverman9c614bc2016-02-15 20:20:02 -0500921 if (has_null_value()) {
922 ::google::protobuf::internal::WireFormatLite::WriteEnum(
923 1, this->null_value(), output);
924 }
925
Austin Schuh40c16522018-10-28 20:27:54 -0700926 // double number_value = 2;
Brian Silverman9c614bc2016-02-15 20:20:02 -0500927 if (has_number_value()) {
928 ::google::protobuf::internal::WireFormatLite::WriteDouble(2, this->number_value(), output);
929 }
930
Austin Schuh40c16522018-10-28 20:27:54 -0700931 // string string_value = 3;
Brian Silverman9c614bc2016-02-15 20:20:02 -0500932 if (has_string_value()) {
933 ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
Austin Schuh40c16522018-10-28 20:27:54 -0700934 this->string_value().data(), static_cast<int>(this->string_value().length()),
Brian Silverman9c614bc2016-02-15 20:20:02 -0500935 ::google::protobuf::internal::WireFormatLite::SERIALIZE,
936 "google.protobuf.Value.string_value");
937 ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
938 3, this->string_value(), output);
939 }
940
Austin Schuh40c16522018-10-28 20:27:54 -0700941 // bool bool_value = 4;
Brian Silverman9c614bc2016-02-15 20:20:02 -0500942 if (has_bool_value()) {
943 ::google::protobuf::internal::WireFormatLite::WriteBool(4, this->bool_value(), output);
944 }
945
Austin Schuh40c16522018-10-28 20:27:54 -0700946 // .google.protobuf.Struct struct_value = 5;
Brian Silverman9c614bc2016-02-15 20:20:02 -0500947 if (has_struct_value()) {
948 ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
Austin Schuh40c16522018-10-28 20:27:54 -0700949 5, this->_internal_struct_value(), output);
Brian Silverman9c614bc2016-02-15 20:20:02 -0500950 }
951
Austin Schuh40c16522018-10-28 20:27:54 -0700952 // .google.protobuf.ListValue list_value = 6;
Brian Silverman9c614bc2016-02-15 20:20:02 -0500953 if (has_list_value()) {
954 ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
Austin Schuh40c16522018-10-28 20:27:54 -0700955 6, this->_internal_list_value(), output);
Brian Silverman9c614bc2016-02-15 20:20:02 -0500956 }
957
Austin Schuh40c16522018-10-28 20:27:54 -0700958 if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
959 ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
960 (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output);
961 }
Brian Silverman9c614bc2016-02-15 20:20:02 -0500962 // @@protoc_insertion_point(serialize_end:google.protobuf.Value)
963}
964
Austin Schuh40c16522018-10-28 20:27:54 -0700965::google::protobuf::uint8* Value::InternalSerializeWithCachedSizesToArray(
966 bool deterministic, ::google::protobuf::uint8* target) const {
967 (void)deterministic; // Unused
Brian Silverman9c614bc2016-02-15 20:20:02 -0500968 // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Value)
Austin Schuh40c16522018-10-28 20:27:54 -0700969 ::google::protobuf::uint32 cached_has_bits = 0;
970 (void) cached_has_bits;
971
972 // .google.protobuf.NullValue null_value = 1;
Brian Silverman9c614bc2016-02-15 20:20:02 -0500973 if (has_null_value()) {
974 target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
975 1, this->null_value(), target);
976 }
977
Austin Schuh40c16522018-10-28 20:27:54 -0700978 // double number_value = 2;
Brian Silverman9c614bc2016-02-15 20:20:02 -0500979 if (has_number_value()) {
980 target = ::google::protobuf::internal::WireFormatLite::WriteDoubleToArray(2, this->number_value(), target);
981 }
982
Austin Schuh40c16522018-10-28 20:27:54 -0700983 // string string_value = 3;
Brian Silverman9c614bc2016-02-15 20:20:02 -0500984 if (has_string_value()) {
985 ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
Austin Schuh40c16522018-10-28 20:27:54 -0700986 this->string_value().data(), static_cast<int>(this->string_value().length()),
Brian Silverman9c614bc2016-02-15 20:20:02 -0500987 ::google::protobuf::internal::WireFormatLite::SERIALIZE,
988 "google.protobuf.Value.string_value");
989 target =
990 ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
991 3, this->string_value(), target);
992 }
993
Austin Schuh40c16522018-10-28 20:27:54 -0700994 // bool bool_value = 4;
Brian Silverman9c614bc2016-02-15 20:20:02 -0500995 if (has_bool_value()) {
996 target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(4, this->bool_value(), target);
997 }
998
Austin Schuh40c16522018-10-28 20:27:54 -0700999 // .google.protobuf.Struct struct_value = 5;
Brian Silverman9c614bc2016-02-15 20:20:02 -05001000 if (has_struct_value()) {
1001 target = ::google::protobuf::internal::WireFormatLite::
Austin Schuh40c16522018-10-28 20:27:54 -07001002 InternalWriteMessageToArray(
1003 5, this->_internal_struct_value(), deterministic, target);
Brian Silverman9c614bc2016-02-15 20:20:02 -05001004 }
1005
Austin Schuh40c16522018-10-28 20:27:54 -07001006 // .google.protobuf.ListValue list_value = 6;
Brian Silverman9c614bc2016-02-15 20:20:02 -05001007 if (has_list_value()) {
1008 target = ::google::protobuf::internal::WireFormatLite::
Austin Schuh40c16522018-10-28 20:27:54 -07001009 InternalWriteMessageToArray(
1010 6, this->_internal_list_value(), deterministic, target);
Brian Silverman9c614bc2016-02-15 20:20:02 -05001011 }
1012
Austin Schuh40c16522018-10-28 20:27:54 -07001013 if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
1014 target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
1015 (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target);
1016 }
Brian Silverman9c614bc2016-02-15 20:20:02 -05001017 // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Value)
1018 return target;
1019}
1020
Austin Schuh40c16522018-10-28 20:27:54 -07001021size_t Value::ByteSizeLong() const {
1022// @@protoc_insertion_point(message_byte_size_start:google.protobuf.Value)
1023 size_t total_size = 0;
Brian Silverman9c614bc2016-02-15 20:20:02 -05001024
Austin Schuh40c16522018-10-28 20:27:54 -07001025 if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
1026 total_size +=
1027 ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
1028 (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()));
1029 }
Brian Silverman9c614bc2016-02-15 20:20:02 -05001030 switch (kind_case()) {
Austin Schuh40c16522018-10-28 20:27:54 -07001031 // .google.protobuf.NullValue null_value = 1;
Brian Silverman9c614bc2016-02-15 20:20:02 -05001032 case kNullValue: {
1033 total_size += 1 +
1034 ::google::protobuf::internal::WireFormatLite::EnumSize(this->null_value());
1035 break;
1036 }
Austin Schuh40c16522018-10-28 20:27:54 -07001037 // double number_value = 2;
Brian Silverman9c614bc2016-02-15 20:20:02 -05001038 case kNumberValue: {
1039 total_size += 1 + 8;
1040 break;
1041 }
Austin Schuh40c16522018-10-28 20:27:54 -07001042 // string string_value = 3;
Brian Silverman9c614bc2016-02-15 20:20:02 -05001043 case kStringValue: {
1044 total_size += 1 +
1045 ::google::protobuf::internal::WireFormatLite::StringSize(
1046 this->string_value());
1047 break;
1048 }
Austin Schuh40c16522018-10-28 20:27:54 -07001049 // bool bool_value = 4;
Brian Silverman9c614bc2016-02-15 20:20:02 -05001050 case kBoolValue: {
1051 total_size += 1 + 1;
1052 break;
1053 }
Austin Schuh40c16522018-10-28 20:27:54 -07001054 // .google.protobuf.Struct struct_value = 5;
Brian Silverman9c614bc2016-02-15 20:20:02 -05001055 case kStructValue: {
1056 total_size += 1 +
Austin Schuh40c16522018-10-28 20:27:54 -07001057 ::google::protobuf::internal::WireFormatLite::MessageSize(
Brian Silverman9c614bc2016-02-15 20:20:02 -05001058 *kind_.struct_value_);
1059 break;
1060 }
Austin Schuh40c16522018-10-28 20:27:54 -07001061 // .google.protobuf.ListValue list_value = 6;
Brian Silverman9c614bc2016-02-15 20:20:02 -05001062 case kListValue: {
1063 total_size += 1 +
Austin Schuh40c16522018-10-28 20:27:54 -07001064 ::google::protobuf::internal::WireFormatLite::MessageSize(
Brian Silverman9c614bc2016-02-15 20:20:02 -05001065 *kind_.list_value_);
1066 break;
1067 }
1068 case KIND_NOT_SET: {
1069 break;
1070 }
1071 }
Austin Schuh40c16522018-10-28 20:27:54 -07001072 int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
1073 SetCachedSize(cached_size);
Brian Silverman9c614bc2016-02-15 20:20:02 -05001074 return total_size;
1075}
1076
1077void Value::MergeFrom(const ::google::protobuf::Message& from) {
Austin Schuh40c16522018-10-28 20:27:54 -07001078// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.Value)
1079 GOOGLE_DCHECK_NE(&from, this);
1080 const Value* source =
Brian Silverman9c614bc2016-02-15 20:20:02 -05001081 ::google::protobuf::internal::DynamicCastToGenerated<const Value>(
1082 &from);
1083 if (source == NULL) {
Austin Schuh40c16522018-10-28 20:27:54 -07001084 // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.Value)
Brian Silverman9c614bc2016-02-15 20:20:02 -05001085 ::google::protobuf::internal::ReflectionOps::Merge(from, this);
1086 } else {
Austin Schuh40c16522018-10-28 20:27:54 -07001087 // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.Value)
Brian Silverman9c614bc2016-02-15 20:20:02 -05001088 MergeFrom(*source);
1089 }
1090}
1091
1092void Value::MergeFrom(const Value& from) {
Austin Schuh40c16522018-10-28 20:27:54 -07001093// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.Value)
1094 GOOGLE_DCHECK_NE(&from, this);
1095 _internal_metadata_.MergeFrom(from._internal_metadata_);
1096 ::google::protobuf::uint32 cached_has_bits = 0;
1097 (void) cached_has_bits;
1098
Brian Silverman9c614bc2016-02-15 20:20:02 -05001099 switch (from.kind_case()) {
1100 case kNullValue: {
1101 set_null_value(from.null_value());
1102 break;
1103 }
1104 case kNumberValue: {
1105 set_number_value(from.number_value());
1106 break;
1107 }
1108 case kStringValue: {
1109 set_string_value(from.string_value());
1110 break;
1111 }
1112 case kBoolValue: {
1113 set_bool_value(from.bool_value());
1114 break;
1115 }
1116 case kStructValue: {
1117 mutable_struct_value()->::google::protobuf::Struct::MergeFrom(from.struct_value());
1118 break;
1119 }
1120 case kListValue: {
1121 mutable_list_value()->::google::protobuf::ListValue::MergeFrom(from.list_value());
1122 break;
1123 }
1124 case KIND_NOT_SET: {
1125 break;
1126 }
1127 }
1128}
1129
1130void Value::CopyFrom(const ::google::protobuf::Message& from) {
Austin Schuh40c16522018-10-28 20:27:54 -07001131// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.Value)
Brian Silverman9c614bc2016-02-15 20:20:02 -05001132 if (&from == this) return;
1133 Clear();
1134 MergeFrom(from);
1135}
1136
1137void Value::CopyFrom(const Value& from) {
Austin Schuh40c16522018-10-28 20:27:54 -07001138// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.Value)
Brian Silverman9c614bc2016-02-15 20:20:02 -05001139 if (&from == this) return;
1140 Clear();
1141 MergeFrom(from);
1142}
1143
1144bool Value::IsInitialized() const {
Brian Silverman9c614bc2016-02-15 20:20:02 -05001145 return true;
1146}
1147
1148void Value::Swap(Value* other) {
1149 if (other == this) return;
Austin Schuh40c16522018-10-28 20:27:54 -07001150 if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
1151 InternalSwap(other);
1152 } else {
1153 Value* temp = New(GetArenaNoVirtual());
1154 temp->MergeFrom(*other);
1155 other->CopyFrom(*this);
1156 InternalSwap(temp);
1157 if (GetArenaNoVirtual() == NULL) {
1158 delete temp;
1159 }
1160 }
1161}
1162void Value::UnsafeArenaSwap(Value* other) {
1163 if (other == this) return;
1164 GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
Brian Silverman9c614bc2016-02-15 20:20:02 -05001165 InternalSwap(other);
1166}
1167void Value::InternalSwap(Value* other) {
Austin Schuh40c16522018-10-28 20:27:54 -07001168 using std::swap;
1169 swap(kind_, other->kind_);
1170 swap(_oneof_case_[0], other->_oneof_case_[0]);
Brian Silverman9c614bc2016-02-15 20:20:02 -05001171 _internal_metadata_.Swap(&other->_internal_metadata_);
Brian Silverman9c614bc2016-02-15 20:20:02 -05001172}
1173
1174::google::protobuf::Metadata Value::GetMetadata() const {
Austin Schuh40c16522018-10-28 20:27:54 -07001175 protobuf_google_2fprotobuf_2fstruct_2eproto::protobuf_AssignDescriptorsOnce();
1176 return ::protobuf_google_2fprotobuf_2fstruct_2eproto::file_level_metadata[kIndexInFileMessages];
Brian Silverman9c614bc2016-02-15 20:20:02 -05001177}
1178
Brian Silverman9c614bc2016-02-15 20:20:02 -05001179
1180// ===================================================================
1181
Austin Schuh40c16522018-10-28 20:27:54 -07001182void ListValue::InitAsDefaultInstance() {
1183}
Brian Silverman9c614bc2016-02-15 20:20:02 -05001184#if !defined(_MSC_VER) || _MSC_VER >= 1900
1185const int ListValue::kValuesFieldNumber;
1186#endif // !defined(_MSC_VER) || _MSC_VER >= 1900
1187
1188ListValue::ListValue()
1189 : ::google::protobuf::Message(), _internal_metadata_(NULL) {
Austin Schuh40c16522018-10-28 20:27:54 -07001190 ::google::protobuf::internal::InitSCC(
1191 &protobuf_google_2fprotobuf_2fstruct_2eproto::scc_info_ListValue.base);
Brian Silverman9c614bc2016-02-15 20:20:02 -05001192 SharedCtor();
1193 // @@protoc_insertion_point(constructor:google.protobuf.ListValue)
1194}
Austin Schuh40c16522018-10-28 20:27:54 -07001195ListValue::ListValue(::google::protobuf::Arena* arena)
1196 : ::google::protobuf::Message(),
1197 _internal_metadata_(arena),
1198 values_(arena) {
1199 ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2fstruct_2eproto::scc_info_ListValue.base);
1200 SharedCtor();
1201 RegisterArenaDtor(arena);
1202 // @@protoc_insertion_point(arena_constructor:google.protobuf.ListValue)
Brian Silverman9c614bc2016-02-15 20:20:02 -05001203}
Brian Silverman9c614bc2016-02-15 20:20:02 -05001204ListValue::ListValue(const ListValue& from)
1205 : ::google::protobuf::Message(),
Austin Schuh40c16522018-10-28 20:27:54 -07001206 _internal_metadata_(NULL),
1207 values_(from.values_) {
1208 _internal_metadata_.MergeFrom(from._internal_metadata_);
Brian Silverman9c614bc2016-02-15 20:20:02 -05001209 // @@protoc_insertion_point(copy_constructor:google.protobuf.ListValue)
1210}
1211
1212void ListValue::SharedCtor() {
Brian Silverman9c614bc2016-02-15 20:20:02 -05001213}
1214
1215ListValue::~ListValue() {
1216 // @@protoc_insertion_point(destructor:google.protobuf.ListValue)
1217 SharedDtor();
1218}
1219
1220void ListValue::SharedDtor() {
Austin Schuh40c16522018-10-28 20:27:54 -07001221 GOOGLE_DCHECK(GetArenaNoVirtual() == NULL);
Brian Silverman9c614bc2016-02-15 20:20:02 -05001222}
1223
Austin Schuh40c16522018-10-28 20:27:54 -07001224void ListValue::ArenaDtor(void* object) {
1225 ListValue* _this = reinterpret_cast< ListValue* >(object);
1226 (void)_this;
1227}
1228void ListValue::RegisterArenaDtor(::google::protobuf::Arena* arena) {
1229}
Brian Silverman9c614bc2016-02-15 20:20:02 -05001230void ListValue::SetCachedSize(int size) const {
Austin Schuh40c16522018-10-28 20:27:54 -07001231 _cached_size_.Set(size);
Brian Silverman9c614bc2016-02-15 20:20:02 -05001232}
1233const ::google::protobuf::Descriptor* ListValue::descriptor() {
Austin Schuh40c16522018-10-28 20:27:54 -07001234 ::protobuf_google_2fprotobuf_2fstruct_2eproto::protobuf_AssignDescriptorsOnce();
1235 return ::protobuf_google_2fprotobuf_2fstruct_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
Brian Silverman9c614bc2016-02-15 20:20:02 -05001236}
1237
1238const ListValue& ListValue::default_instance() {
Austin Schuh40c16522018-10-28 20:27:54 -07001239 ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2fstruct_2eproto::scc_info_ListValue.base);
1240 return *internal_default_instance();
Brian Silverman9c614bc2016-02-15 20:20:02 -05001241}
1242
Brian Silverman9c614bc2016-02-15 20:20:02 -05001243
1244void ListValue::Clear() {
Austin Schuh40c16522018-10-28 20:27:54 -07001245// @@protoc_insertion_point(message_clear_start:google.protobuf.ListValue)
1246 ::google::protobuf::uint32 cached_has_bits = 0;
1247 // Prevent compiler warnings about cached_has_bits being unused
1248 (void) cached_has_bits;
1249
Brian Silverman9c614bc2016-02-15 20:20:02 -05001250 values_.Clear();
Austin Schuh40c16522018-10-28 20:27:54 -07001251 _internal_metadata_.Clear();
Brian Silverman9c614bc2016-02-15 20:20:02 -05001252}
1253
1254bool ListValue::MergePartialFromCodedStream(
1255 ::google::protobuf::io::CodedInputStream* input) {
Austin Schuh40c16522018-10-28 20:27:54 -07001256#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
Brian Silverman9c614bc2016-02-15 20:20:02 -05001257 ::google::protobuf::uint32 tag;
1258 // @@protoc_insertion_point(parse_start:google.protobuf.ListValue)
1259 for (;;) {
Austin Schuh40c16522018-10-28 20:27:54 -07001260 ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
Brian Silverman9c614bc2016-02-15 20:20:02 -05001261 tag = p.first;
1262 if (!p.second) goto handle_unusual;
1263 switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
1264 // repeated .google.protobuf.Value values = 1;
1265 case 1: {
Austin Schuh40c16522018-10-28 20:27:54 -07001266 if (static_cast< ::google::protobuf::uint8>(tag) ==
1267 static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
1268 DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
Brian Silverman9c614bc2016-02-15 20:20:02 -05001269 input, add_values()));
1270 } else {
1271 goto handle_unusual;
1272 }
Brian Silverman9c614bc2016-02-15 20:20:02 -05001273 break;
1274 }
1275
1276 default: {
1277 handle_unusual:
Austin Schuh40c16522018-10-28 20:27:54 -07001278 if (tag == 0) {
Brian Silverman9c614bc2016-02-15 20:20:02 -05001279 goto success;
1280 }
Austin Schuh40c16522018-10-28 20:27:54 -07001281 DO_(::google::protobuf::internal::WireFormat::SkipField(
1282 input, tag, _internal_metadata_.mutable_unknown_fields()));
Brian Silverman9c614bc2016-02-15 20:20:02 -05001283 break;
1284 }
1285 }
1286 }
1287success:
1288 // @@protoc_insertion_point(parse_success:google.protobuf.ListValue)
1289 return true;
1290failure:
1291 // @@protoc_insertion_point(parse_failure:google.protobuf.ListValue)
1292 return false;
1293#undef DO_
1294}
1295
1296void ListValue::SerializeWithCachedSizes(
1297 ::google::protobuf::io::CodedOutputStream* output) const {
1298 // @@protoc_insertion_point(serialize_start:google.protobuf.ListValue)
Austin Schuh40c16522018-10-28 20:27:54 -07001299 ::google::protobuf::uint32 cached_has_bits = 0;
1300 (void) cached_has_bits;
1301
Brian Silverman9c614bc2016-02-15 20:20:02 -05001302 // repeated .google.protobuf.Value values = 1;
Austin Schuh40c16522018-10-28 20:27:54 -07001303 for (unsigned int i = 0,
1304 n = static_cast<unsigned int>(this->values_size()); i < n; i++) {
Brian Silverman9c614bc2016-02-15 20:20:02 -05001305 ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
Austin Schuh40c16522018-10-28 20:27:54 -07001306 1,
1307 this->values(static_cast<int>(i)),
1308 output);
Brian Silverman9c614bc2016-02-15 20:20:02 -05001309 }
1310
Austin Schuh40c16522018-10-28 20:27:54 -07001311 if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
1312 ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
1313 (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output);
1314 }
Brian Silverman9c614bc2016-02-15 20:20:02 -05001315 // @@protoc_insertion_point(serialize_end:google.protobuf.ListValue)
1316}
1317
Austin Schuh40c16522018-10-28 20:27:54 -07001318::google::protobuf::uint8* ListValue::InternalSerializeWithCachedSizesToArray(
1319 bool deterministic, ::google::protobuf::uint8* target) const {
1320 (void)deterministic; // Unused
Brian Silverman9c614bc2016-02-15 20:20:02 -05001321 // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.ListValue)
Austin Schuh40c16522018-10-28 20:27:54 -07001322 ::google::protobuf::uint32 cached_has_bits = 0;
1323 (void) cached_has_bits;
1324
Brian Silverman9c614bc2016-02-15 20:20:02 -05001325 // repeated .google.protobuf.Value values = 1;
Austin Schuh40c16522018-10-28 20:27:54 -07001326 for (unsigned int i = 0,
1327 n = static_cast<unsigned int>(this->values_size()); i < n; i++) {
Brian Silverman9c614bc2016-02-15 20:20:02 -05001328 target = ::google::protobuf::internal::WireFormatLite::
Austin Schuh40c16522018-10-28 20:27:54 -07001329 InternalWriteMessageToArray(
1330 1, this->values(static_cast<int>(i)), deterministic, target);
Brian Silverman9c614bc2016-02-15 20:20:02 -05001331 }
1332
Austin Schuh40c16522018-10-28 20:27:54 -07001333 if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
1334 target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
1335 (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target);
1336 }
Brian Silverman9c614bc2016-02-15 20:20:02 -05001337 // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.ListValue)
1338 return target;
1339}
1340
Austin Schuh40c16522018-10-28 20:27:54 -07001341size_t ListValue::ByteSizeLong() const {
1342// @@protoc_insertion_point(message_byte_size_start:google.protobuf.ListValue)
1343 size_t total_size = 0;
Brian Silverman9c614bc2016-02-15 20:20:02 -05001344
Austin Schuh40c16522018-10-28 20:27:54 -07001345 if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
Brian Silverman9c614bc2016-02-15 20:20:02 -05001346 total_size +=
Austin Schuh40c16522018-10-28 20:27:54 -07001347 ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
1348 (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()));
1349 }
1350 // repeated .google.protobuf.Value values = 1;
1351 {
1352 unsigned int count = static_cast<unsigned int>(this->values_size());
1353 total_size += 1UL * count;
1354 for (unsigned int i = 0; i < count; i++) {
1355 total_size +=
1356 ::google::protobuf::internal::WireFormatLite::MessageSize(
1357 this->values(static_cast<int>(i)));
1358 }
Brian Silverman9c614bc2016-02-15 20:20:02 -05001359 }
1360
Austin Schuh40c16522018-10-28 20:27:54 -07001361 int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
1362 SetCachedSize(cached_size);
Brian Silverman9c614bc2016-02-15 20:20:02 -05001363 return total_size;
1364}
1365
1366void ListValue::MergeFrom(const ::google::protobuf::Message& from) {
Austin Schuh40c16522018-10-28 20:27:54 -07001367// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.ListValue)
1368 GOOGLE_DCHECK_NE(&from, this);
1369 const ListValue* source =
Brian Silverman9c614bc2016-02-15 20:20:02 -05001370 ::google::protobuf::internal::DynamicCastToGenerated<const ListValue>(
1371 &from);
1372 if (source == NULL) {
Austin Schuh40c16522018-10-28 20:27:54 -07001373 // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.ListValue)
Brian Silverman9c614bc2016-02-15 20:20:02 -05001374 ::google::protobuf::internal::ReflectionOps::Merge(from, this);
1375 } else {
Austin Schuh40c16522018-10-28 20:27:54 -07001376 // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.ListValue)
Brian Silverman9c614bc2016-02-15 20:20:02 -05001377 MergeFrom(*source);
1378 }
1379}
1380
1381void ListValue::MergeFrom(const ListValue& from) {
Austin Schuh40c16522018-10-28 20:27:54 -07001382// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.ListValue)
1383 GOOGLE_DCHECK_NE(&from, this);
1384 _internal_metadata_.MergeFrom(from._internal_metadata_);
1385 ::google::protobuf::uint32 cached_has_bits = 0;
1386 (void) cached_has_bits;
1387
Brian Silverman9c614bc2016-02-15 20:20:02 -05001388 values_.MergeFrom(from.values_);
1389}
1390
1391void ListValue::CopyFrom(const ::google::protobuf::Message& from) {
Austin Schuh40c16522018-10-28 20:27:54 -07001392// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.ListValue)
Brian Silverman9c614bc2016-02-15 20:20:02 -05001393 if (&from == this) return;
1394 Clear();
1395 MergeFrom(from);
1396}
1397
1398void ListValue::CopyFrom(const ListValue& from) {
Austin Schuh40c16522018-10-28 20:27:54 -07001399// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.ListValue)
Brian Silverman9c614bc2016-02-15 20:20:02 -05001400 if (&from == this) return;
1401 Clear();
1402 MergeFrom(from);
1403}
1404
1405bool ListValue::IsInitialized() const {
Brian Silverman9c614bc2016-02-15 20:20:02 -05001406 return true;
1407}
1408
1409void ListValue::Swap(ListValue* other) {
1410 if (other == this) return;
Austin Schuh40c16522018-10-28 20:27:54 -07001411 if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) {
1412 InternalSwap(other);
1413 } else {
1414 ListValue* temp = New(GetArenaNoVirtual());
1415 temp->MergeFrom(*other);
1416 other->CopyFrom(*this);
1417 InternalSwap(temp);
1418 if (GetArenaNoVirtual() == NULL) {
1419 delete temp;
1420 }
1421 }
1422}
1423void ListValue::UnsafeArenaSwap(ListValue* other) {
1424 if (other == this) return;
1425 GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual());
Brian Silverman9c614bc2016-02-15 20:20:02 -05001426 InternalSwap(other);
1427}
1428void ListValue::InternalSwap(ListValue* other) {
Austin Schuh40c16522018-10-28 20:27:54 -07001429 using std::swap;
1430 CastToBase(&values_)->InternalSwap(CastToBase(&other->values_));
Brian Silverman9c614bc2016-02-15 20:20:02 -05001431 _internal_metadata_.Swap(&other->_internal_metadata_);
Brian Silverman9c614bc2016-02-15 20:20:02 -05001432}
1433
1434::google::protobuf::Metadata ListValue::GetMetadata() const {
Austin Schuh40c16522018-10-28 20:27:54 -07001435 protobuf_google_2fprotobuf_2fstruct_2eproto::protobuf_AssignDescriptorsOnce();
1436 return ::protobuf_google_2fprotobuf_2fstruct_2eproto::file_level_metadata[kIndexInFileMessages];
Brian Silverman9c614bc2016-02-15 20:20:02 -05001437}
1438
Brian Silverman9c614bc2016-02-15 20:20:02 -05001439
1440// @@protoc_insertion_point(namespace_scope)
Austin Schuh40c16522018-10-28 20:27:54 -07001441} // namespace protobuf
1442} // namespace google
1443namespace google {
1444namespace protobuf {
1445template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::google::protobuf::Struct_FieldsEntry_DoNotUse* Arena::CreateMaybeMessage< ::google::protobuf::Struct_FieldsEntry_DoNotUse >(Arena* arena) {
1446 return Arena::CreateMessageInternal< ::google::protobuf::Struct_FieldsEntry_DoNotUse >(arena);
1447}
1448template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::google::protobuf::Struct* Arena::CreateMaybeMessage< ::google::protobuf::Struct >(Arena* arena) {
1449 return Arena::CreateMessageInternal< ::google::protobuf::Struct >(arena);
1450}
1451template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::google::protobuf::Value* Arena::CreateMaybeMessage< ::google::protobuf::Value >(Arena* arena) {
1452 return Arena::CreateMessageInternal< ::google::protobuf::Value >(arena);
1453}
1454template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::google::protobuf::ListValue* Arena::CreateMaybeMessage< ::google::protobuf::ListValue >(Arena* arena) {
1455 return Arena::CreateMessageInternal< ::google::protobuf::ListValue >(arena);
1456}
Brian Silverman9c614bc2016-02-15 20:20:02 -05001457} // namespace protobuf
1458} // namespace google
1459
1460// @@protoc_insertion_point(global_scope)