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 | |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 4 | #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 Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 10 | #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 Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 16 | // This is a temporary google only hack |
| 17 | #ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS |
| 18 | #include "third_party/protobuf/version.h" |
| 19 | #endif |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 20 | // @@protoc_insertion_point(includes) |
| 21 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 22 | namespace protobuf_google_2fprotobuf_2fstruct_2eproto { |
| 23 | extern PROTOBUF_INTERNAL_EXPORT_protobuf_google_2fprotobuf_2fstruct_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_ListValue; |
| 24 | } // namespace protobuf_google_2fprotobuf_2fstruct_2eproto |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 25 | namespace google { |
| 26 | namespace protobuf { |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 27 | class Struct_FieldsEntry_DoNotUseDefaultTypeInternal { |
| 28 | public: |
| 29 | ::google::protobuf::internal::ExplicitlyConstructed<Struct_FieldsEntry_DoNotUse> |
| 30 | _instance; |
| 31 | } _Struct_FieldsEntry_DoNotUse_default_instance_; |
| 32 | class StructDefaultTypeInternal { |
| 33 | public: |
| 34 | ::google::protobuf::internal::ExplicitlyConstructed<Struct> |
| 35 | _instance; |
| 36 | } _Struct_default_instance_; |
| 37 | class ValueDefaultTypeInternal { |
| 38 | public: |
| 39 | ::google::protobuf::internal::ExplicitlyConstructed<Value> |
| 40 | _instance; |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 41 | 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 Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 47 | } _Value_default_instance_; |
| 48 | class ListValueDefaultTypeInternal { |
| 49 | public: |
| 50 | ::google::protobuf::internal::ExplicitlyConstructed<ListValue> |
| 51 | _instance; |
| 52 | } _ListValue_default_instance_; |
| 53 | } // namespace protobuf |
| 54 | } // namespace google |
| 55 | namespace protobuf_google_2fprotobuf_2fstruct_2eproto { |
| 56 | static void InitDefaultsListValue() { |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 57 | GOOGLE_PROTOBUF_VERIFY_VERSION; |
| 58 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 59 | { |
| 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 Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 82 | } |
| 83 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 84 | LIBPROTOBUF_EXPORT ::google::protobuf::internal::SCCInfo<0> scc_info_ListValue = |
| 85 | {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsListValue}, {}}; |
| 86 | |
| 87 | void InitDefaults() { |
| 88 | ::google::protobuf::internal::InitSCC(&scc_info_ListValue.base); |
| 89 | } |
| 90 | |
| 91 | ::google::protobuf::Metadata file_level_metadata[4]; |
| 92 | const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors[1]; |
| 93 | |
| 94 | const ::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 | }; |
| 129 | static 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 | |
| 136 | static ::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 | |
| 143 | void 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 | |
| 150 | void protobuf_AssignDescriptorsOnce() { |
| 151 | static ::google::protobuf::internal::once_flag once; |
| 152 | ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors); |
| 153 | } |
| 154 | |
| 155 | void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD; |
| 156 | void protobuf_RegisterTypes(const ::std::string&) { |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 157 | protobuf_AssignDescriptorsOnce(); |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 158 | ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 4); |
| 159 | } |
| 160 | |
| 161 | void 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 | |
| 188 | void 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. |
| 193 | struct StaticDescriptorInitializer { |
| 194 | StaticDescriptorInitializer() { |
| 195 | AddDescriptors(); |
| 196 | } |
| 197 | } static_descriptor_initializer; |
| 198 | } // namespace protobuf_google_2fprotobuf_2fstruct_2eproto |
| 199 | namespace google { |
| 200 | namespace protobuf { |
| 201 | const ::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 Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 204 | } |
| 205 | bool NullValue_IsValid(int value) { |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 206 | switch (value) { |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 207 | case 0: |
| 208 | return true; |
| 209 | default: |
| 210 | return false; |
| 211 | } |
| 212 | } |
| 213 | |
| 214 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 215 | // =================================================================== |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 216 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 217 | Struct_FieldsEntry_DoNotUse::Struct_FieldsEntry_DoNotUse() {} |
| 218 | Struct_FieldsEntry_DoNotUse::Struct_FieldsEntry_DoNotUse(::google::protobuf::Arena* arena) : SuperType(arena) {} |
| 219 | void Struct_FieldsEntry_DoNotUse::MergeFrom(const Struct_FieldsEntry_DoNotUse& other) { |
| 220 | MergeFromInternal(other); |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 221 | } |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 222 | ::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 | } |
| 226 | void Struct_FieldsEntry_DoNotUse::MergeFrom( |
| 227 | const ::google::protobuf::Message& other) { |
| 228 | ::google::protobuf::Message::MergeFrom(other); |
| 229 | } |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 230 | |
| 231 | |
| 232 | // =================================================================== |
| 233 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 234 | void Struct::InitAsDefaultInstance() { |
| 235 | } |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 236 | #if !defined(_MSC_VER) || _MSC_VER >= 1900 |
| 237 | const int Struct::kFieldsFieldNumber; |
| 238 | #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 |
| 239 | |
| 240 | Struct::Struct() |
| 241 | : ::google::protobuf::Message(), _internal_metadata_(NULL) { |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 242 | ::google::protobuf::internal::InitSCC( |
| 243 | &protobuf_google_2fprotobuf_2fstruct_2eproto::scc_info_ListValue.base); |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 244 | SharedCtor(); |
| 245 | // @@protoc_insertion_point(constructor:google.protobuf.Struct) |
| 246 | } |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 247 | Struct::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 Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 255 | } |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 256 | Struct::Struct(const Struct& from) |
| 257 | : ::google::protobuf::Message(), |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 258 | _internal_metadata_(NULL) { |
| 259 | _internal_metadata_.MergeFrom(from._internal_metadata_); |
| 260 | fields_.MergeFrom(from.fields_); |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 261 | // @@protoc_insertion_point(copy_constructor:google.protobuf.Struct) |
| 262 | } |
| 263 | |
| 264 | void Struct::SharedCtor() { |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 265 | } |
| 266 | |
| 267 | Struct::~Struct() { |
| 268 | // @@protoc_insertion_point(destructor:google.protobuf.Struct) |
| 269 | SharedDtor(); |
| 270 | } |
| 271 | |
| 272 | void Struct::SharedDtor() { |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 273 | GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 274 | } |
| 275 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 276 | void Struct::ArenaDtor(void* object) { |
| 277 | Struct* _this = reinterpret_cast< Struct* >(object); |
| 278 | (void)_this; |
| 279 | } |
| 280 | void Struct::RegisterArenaDtor(::google::protobuf::Arena* arena) { |
| 281 | } |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 282 | void Struct::SetCachedSize(int size) const { |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 283 | _cached_size_.Set(size); |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 284 | } |
| 285 | const ::google::protobuf::Descriptor* Struct::descriptor() { |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 286 | ::protobuf_google_2fprotobuf_2fstruct_2eproto::protobuf_AssignDescriptorsOnce(); |
| 287 | return ::protobuf_google_2fprotobuf_2fstruct_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 288 | } |
| 289 | |
| 290 | const Struct& Struct::default_instance() { |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 291 | ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2fstruct_2eproto::scc_info_ListValue.base); |
| 292 | return *internal_default_instance(); |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 293 | } |
| 294 | |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 295 | |
| 296 | void Struct::Clear() { |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 297 | // @@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 Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 302 | fields_.Clear(); |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 303 | _internal_metadata_.Clear(); |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 304 | } |
| 305 | |
| 306 | bool Struct::MergePartialFromCodedStream( |
| 307 | ::google::protobuf::io::CodedInputStream* input) { |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 308 | #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 309 | ::google::protobuf::uint32 tag; |
| 310 | // @@protoc_insertion_point(parse_start:google.protobuf.Struct) |
| 311 | for (;;) { |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 312 | ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 313 | 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 Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 318 | 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 Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 327 | DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 328 | input, &parser)); |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 329 | DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 330 | parser.key().data(), static_cast<int>(parser.key().length()), |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 331 | ::google::protobuf::internal::WireFormatLite::PARSE, |
| 332 | "google.protobuf.Struct.FieldsEntry.key")); |
| 333 | } else { |
| 334 | goto handle_unusual; |
| 335 | } |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 336 | break; |
| 337 | } |
| 338 | |
| 339 | default: { |
| 340 | handle_unusual: |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 341 | if (tag == 0) { |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 342 | goto success; |
| 343 | } |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 344 | DO_(::google::protobuf::internal::WireFormat::SkipField( |
| 345 | input, tag, _internal_metadata_.mutable_unknown_fields())); |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 346 | break; |
| 347 | } |
| 348 | } |
| 349 | } |
| 350 | success: |
| 351 | // @@protoc_insertion_point(parse_success:google.protobuf.Struct) |
| 352 | return true; |
| 353 | failure: |
| 354 | // @@protoc_insertion_point(parse_failure:google.protobuf.Struct) |
| 355 | return false; |
| 356 | #undef DO_ |
| 357 | } |
| 358 | |
| 359 | void Struct::SerializeWithCachedSizes( |
| 360 | ::google::protobuf::io::CodedOutputStream* output) const { |
| 361 | // @@protoc_insertion_point(serialize_start:google.protobuf.Struct) |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 362 | ::google::protobuf::uint32 cached_has_bits = 0; |
| 363 | (void) cached_has_bits; |
| 364 | |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 365 | // map<string, .google.protobuf.Value> fields = 1; |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 366 | 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 Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 417 | } |
| 418 | } |
| 419 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 420 | 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 Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 424 | // @@protoc_insertion_point(serialize_end:google.protobuf.Struct) |
| 425 | } |
| 426 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 427 | ::google::protobuf::uint8* Struct::InternalSerializeWithCachedSizesToArray( |
| 428 | bool deterministic, ::google::protobuf::uint8* target) const { |
| 429 | (void)deterministic; // Unused |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 430 | // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Struct) |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 431 | ::google::protobuf::uint32 cached_has_bits = 0; |
| 432 | (void) cached_has_bits; |
| 433 | |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 434 | // map<string, .google.protobuf.Value> fields = 1; |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 435 | 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 Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 490 | } |
| 491 | } |
| 492 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 493 | 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 Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 497 | // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Struct) |
| 498 | return target; |
| 499 | } |
| 500 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 501 | size_t Struct::ByteSizeLong() const { |
| 502 | // @@protoc_insertion_point(message_byte_size_start:google.protobuf.Struct) |
| 503 | size_t total_size = 0; |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 504 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 505 | 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 Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 510 | // map<string, .google.protobuf.Value> fields = 1; |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 511 | total_size += 1 * |
| 512 | ::google::protobuf::internal::FromIntSize(this->fields_size()); |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 513 | { |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 514 | ::std::unique_ptr<Struct_FieldsEntry_DoNotUse> entry; |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 515 | for (::google::protobuf::Map< ::std::string, ::google::protobuf::Value >::const_iterator |
| 516 | it = this->fields().begin(); |
| 517 | it != this->fields().end(); ++it) { |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 518 | if (entry.get() != NULL && entry->GetArena() != NULL) { |
| 519 | entry.release(); |
| 520 | } |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 521 | entry.reset(fields_.NewEntryWrapper(it->first, it->second)); |
| 522 | total_size += ::google::protobuf::internal::WireFormatLite:: |
| 523 | MessageSizeNoVirtual(*entry); |
| 524 | } |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 525 | if (entry.get() != NULL && entry->GetArena() != NULL) { |
| 526 | entry.release(); |
| 527 | } |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 528 | } |
| 529 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 530 | int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); |
| 531 | SetCachedSize(cached_size); |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 532 | return total_size; |
| 533 | } |
| 534 | |
| 535 | void Struct::MergeFrom(const ::google::protobuf::Message& from) { |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 536 | // @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.Struct) |
| 537 | GOOGLE_DCHECK_NE(&from, this); |
| 538 | const Struct* source = |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 539 | ::google::protobuf::internal::DynamicCastToGenerated<const Struct>( |
| 540 | &from); |
| 541 | if (source == NULL) { |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 542 | // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.Struct) |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 543 | ::google::protobuf::internal::ReflectionOps::Merge(from, this); |
| 544 | } else { |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 545 | // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.Struct) |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 546 | MergeFrom(*source); |
| 547 | } |
| 548 | } |
| 549 | |
| 550 | void Struct::MergeFrom(const Struct& from) { |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 551 | // @@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 Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 557 | fields_.MergeFrom(from.fields_); |
| 558 | } |
| 559 | |
| 560 | void Struct::CopyFrom(const ::google::protobuf::Message& from) { |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 561 | // @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.Struct) |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 562 | if (&from == this) return; |
| 563 | Clear(); |
| 564 | MergeFrom(from); |
| 565 | } |
| 566 | |
| 567 | void Struct::CopyFrom(const Struct& from) { |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 568 | // @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.Struct) |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 569 | if (&from == this) return; |
| 570 | Clear(); |
| 571 | MergeFrom(from); |
| 572 | } |
| 573 | |
| 574 | bool Struct::IsInitialized() const { |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 575 | return true; |
| 576 | } |
| 577 | |
| 578 | void Struct::Swap(Struct* other) { |
| 579 | if (other == this) return; |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 580 | 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 | } |
| 592 | void Struct::UnsafeArenaSwap(Struct* other) { |
| 593 | if (other == this) return; |
| 594 | GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 595 | InternalSwap(other); |
| 596 | } |
| 597 | void Struct::InternalSwap(Struct* other) { |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 598 | using std::swap; |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 599 | fields_.Swap(&other->fields_); |
| 600 | _internal_metadata_.Swap(&other->_internal_metadata_); |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 601 | } |
| 602 | |
| 603 | ::google::protobuf::Metadata Struct::GetMetadata() const { |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 604 | protobuf_google_2fprotobuf_2fstruct_2eproto::protobuf_AssignDescriptorsOnce(); |
| 605 | return ::protobuf_google_2fprotobuf_2fstruct_2eproto::file_level_metadata[kIndexInFileMessages]; |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 606 | } |
| 607 | |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 608 | |
| 609 | // =================================================================== |
| 610 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 611 | void 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 | } |
| 622 | void 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 | } |
| 637 | void 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 Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 652 | #if !defined(_MSC_VER) || _MSC_VER >= 1900 |
| 653 | const int Value::kNullValueFieldNumber; |
| 654 | const int Value::kNumberValueFieldNumber; |
| 655 | const int Value::kStringValueFieldNumber; |
| 656 | const int Value::kBoolValueFieldNumber; |
| 657 | const int Value::kStructValueFieldNumber; |
| 658 | const int Value::kListValueFieldNumber; |
| 659 | #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 |
| 660 | |
| 661 | Value::Value() |
| 662 | : ::google::protobuf::Message(), _internal_metadata_(NULL) { |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 663 | ::google::protobuf::internal::InitSCC( |
| 664 | &protobuf_google_2fprotobuf_2fstruct_2eproto::scc_info_ListValue.base); |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 665 | SharedCtor(); |
| 666 | // @@protoc_insertion_point(constructor:google.protobuf.Value) |
| 667 | } |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 668 | Value::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 Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 675 | } |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 676 | Value::Value(const Value& from) |
| 677 | : ::google::protobuf::Message(), |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 678 | _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 Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 710 | // @@protoc_insertion_point(copy_constructor:google.protobuf.Value) |
| 711 | } |
| 712 | |
| 713 | void Value::SharedCtor() { |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 714 | clear_has_kind(); |
| 715 | } |
| 716 | |
| 717 | Value::~Value() { |
| 718 | // @@protoc_insertion_point(destructor:google.protobuf.Value) |
| 719 | SharedDtor(); |
| 720 | } |
| 721 | |
| 722 | void Value::SharedDtor() { |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 723 | GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 724 | if (has_kind()) { |
| 725 | clear_kind(); |
| 726 | } |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 727 | } |
| 728 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 729 | void Value::ArenaDtor(void* object) { |
| 730 | Value* _this = reinterpret_cast< Value* >(object); |
| 731 | (void)_this; |
| 732 | } |
| 733 | void Value::RegisterArenaDtor(::google::protobuf::Arena* arena) { |
| 734 | } |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 735 | void Value::SetCachedSize(int size) const { |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 736 | _cached_size_.Set(size); |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 737 | } |
| 738 | const ::google::protobuf::Descriptor* Value::descriptor() { |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 739 | ::protobuf_google_2fprotobuf_2fstruct_2eproto::protobuf_AssignDescriptorsOnce(); |
| 740 | return ::protobuf_google_2fprotobuf_2fstruct_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 741 | } |
| 742 | |
| 743 | const Value& Value::default_instance() { |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 744 | ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2fstruct_2eproto::scc_info_ListValue.base); |
| 745 | return *internal_default_instance(); |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 746 | } |
| 747 | |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 748 | |
| 749 | void Value::clear_kind() { |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 750 | // @@protoc_insertion_point(one_of_clear_start:google.protobuf.Value) |
| 751 | switch (kind_case()) { |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 752 | 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 Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 761 | kind_.string_value_.Destroy(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), |
| 762 | GetArenaNoVirtual()); |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 763 | break; |
| 764 | } |
| 765 | case kBoolValue: { |
| 766 | // No need to clear |
| 767 | break; |
| 768 | } |
| 769 | case kStructValue: { |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 770 | if (GetArenaNoVirtual() == NULL) { |
| 771 | delete kind_.struct_value_; |
| 772 | } |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 773 | break; |
| 774 | } |
| 775 | case kListValue: { |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 776 | if (GetArenaNoVirtual() == NULL) { |
| 777 | delete kind_.list_value_; |
| 778 | } |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 779 | break; |
| 780 | } |
| 781 | case KIND_NOT_SET: { |
| 782 | break; |
| 783 | } |
| 784 | } |
| 785 | _oneof_case_[0] = KIND_NOT_SET; |
| 786 | } |
| 787 | |
| 788 | |
| 789 | void Value::Clear() { |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 790 | // @@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 Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 795 | clear_kind(); |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 796 | _internal_metadata_.Clear(); |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 797 | } |
| 798 | |
| 799 | bool Value::MergePartialFromCodedStream( |
| 800 | ::google::protobuf::io::CodedInputStream* input) { |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 801 | #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 802 | ::google::protobuf::uint32 tag; |
| 803 | // @@protoc_insertion_point(parse_start:google.protobuf.Value) |
| 804 | for (;;) { |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 805 | ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 806 | tag = p.first; |
| 807 | if (!p.second) goto handle_unusual; |
| 808 | switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 809 | // .google.protobuf.NullValue null_value = 1; |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 810 | case 1: { |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 811 | if (static_cast< ::google::protobuf::uint8>(tag) == |
| 812 | static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 813 | 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 Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 821 | break; |
| 822 | } |
| 823 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 824 | // double number_value = 2; |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 825 | case 2: { |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 826 | if (static_cast< ::google::protobuf::uint8>(tag) == |
| 827 | static_cast< ::google::protobuf::uint8>(17u /* 17 & 0xFF */)) { |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 828 | 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 Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 836 | break; |
| 837 | } |
| 838 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 839 | // string string_value = 3; |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 840 | case 3: { |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 841 | if (static_cast< ::google::protobuf::uint8>(tag) == |
| 842 | static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 843 | DO_(::google::protobuf::internal::WireFormatLite::ReadString( |
| 844 | input, this->mutable_string_value())); |
| 845 | DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 846 | this->string_value().data(), static_cast<int>(this->string_value().length()), |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 847 | ::google::protobuf::internal::WireFormatLite::PARSE, |
| 848 | "google.protobuf.Value.string_value")); |
| 849 | } else { |
| 850 | goto handle_unusual; |
| 851 | } |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 852 | break; |
| 853 | } |
| 854 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 855 | // bool bool_value = 4; |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 856 | case 4: { |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 857 | if (static_cast< ::google::protobuf::uint8>(tag) == |
| 858 | static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) { |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 859 | 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 Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 867 | break; |
| 868 | } |
| 869 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 870 | // .google.protobuf.Struct struct_value = 5; |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 871 | case 5: { |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 872 | if (static_cast< ::google::protobuf::uint8>(tag) == |
| 873 | static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) { |
| 874 | DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 875 | input, mutable_struct_value())); |
| 876 | } else { |
| 877 | goto handle_unusual; |
| 878 | } |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 879 | break; |
| 880 | } |
| 881 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 882 | // .google.protobuf.ListValue list_value = 6; |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 883 | case 6: { |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 884 | if (static_cast< ::google::protobuf::uint8>(tag) == |
| 885 | static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) { |
| 886 | DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 887 | input, mutable_list_value())); |
| 888 | } else { |
| 889 | goto handle_unusual; |
| 890 | } |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 891 | break; |
| 892 | } |
| 893 | |
| 894 | default: { |
| 895 | handle_unusual: |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 896 | if (tag == 0) { |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 897 | goto success; |
| 898 | } |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 899 | DO_(::google::protobuf::internal::WireFormat::SkipField( |
| 900 | input, tag, _internal_metadata_.mutable_unknown_fields())); |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 901 | break; |
| 902 | } |
| 903 | } |
| 904 | } |
| 905 | success: |
| 906 | // @@protoc_insertion_point(parse_success:google.protobuf.Value) |
| 907 | return true; |
| 908 | failure: |
| 909 | // @@protoc_insertion_point(parse_failure:google.protobuf.Value) |
| 910 | return false; |
| 911 | #undef DO_ |
| 912 | } |
| 913 | |
| 914 | void Value::SerializeWithCachedSizes( |
| 915 | ::google::protobuf::io::CodedOutputStream* output) const { |
| 916 | // @@protoc_insertion_point(serialize_start:google.protobuf.Value) |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 917 | ::google::protobuf::uint32 cached_has_bits = 0; |
| 918 | (void) cached_has_bits; |
| 919 | |
| 920 | // .google.protobuf.NullValue null_value = 1; |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 921 | if (has_null_value()) { |
| 922 | ::google::protobuf::internal::WireFormatLite::WriteEnum( |
| 923 | 1, this->null_value(), output); |
| 924 | } |
| 925 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 926 | // double number_value = 2; |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 927 | if (has_number_value()) { |
| 928 | ::google::protobuf::internal::WireFormatLite::WriteDouble(2, this->number_value(), output); |
| 929 | } |
| 930 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 931 | // string string_value = 3; |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 932 | if (has_string_value()) { |
| 933 | ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 934 | this->string_value().data(), static_cast<int>(this->string_value().length()), |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 935 | ::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 Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 941 | // bool bool_value = 4; |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 942 | if (has_bool_value()) { |
| 943 | ::google::protobuf::internal::WireFormatLite::WriteBool(4, this->bool_value(), output); |
| 944 | } |
| 945 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 946 | // .google.protobuf.Struct struct_value = 5; |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 947 | if (has_struct_value()) { |
| 948 | ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 949 | 5, this->_internal_struct_value(), output); |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 950 | } |
| 951 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 952 | // .google.protobuf.ListValue list_value = 6; |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 953 | if (has_list_value()) { |
| 954 | ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 955 | 6, this->_internal_list_value(), output); |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 956 | } |
| 957 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 958 | 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 Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 962 | // @@protoc_insertion_point(serialize_end:google.protobuf.Value) |
| 963 | } |
| 964 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 965 | ::google::protobuf::uint8* Value::InternalSerializeWithCachedSizesToArray( |
| 966 | bool deterministic, ::google::protobuf::uint8* target) const { |
| 967 | (void)deterministic; // Unused |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 968 | // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.Value) |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 969 | ::google::protobuf::uint32 cached_has_bits = 0; |
| 970 | (void) cached_has_bits; |
| 971 | |
| 972 | // .google.protobuf.NullValue null_value = 1; |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 973 | if (has_null_value()) { |
| 974 | target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( |
| 975 | 1, this->null_value(), target); |
| 976 | } |
| 977 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 978 | // double number_value = 2; |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 979 | if (has_number_value()) { |
| 980 | target = ::google::protobuf::internal::WireFormatLite::WriteDoubleToArray(2, this->number_value(), target); |
| 981 | } |
| 982 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 983 | // string string_value = 3; |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 984 | if (has_string_value()) { |
| 985 | ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 986 | this->string_value().data(), static_cast<int>(this->string_value().length()), |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 987 | ::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 Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 994 | // bool bool_value = 4; |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 995 | if (has_bool_value()) { |
| 996 | target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(4, this->bool_value(), target); |
| 997 | } |
| 998 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 999 | // .google.protobuf.Struct struct_value = 5; |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1000 | if (has_struct_value()) { |
| 1001 | target = ::google::protobuf::internal::WireFormatLite:: |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 1002 | InternalWriteMessageToArray( |
| 1003 | 5, this->_internal_struct_value(), deterministic, target); |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1004 | } |
| 1005 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 1006 | // .google.protobuf.ListValue list_value = 6; |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1007 | if (has_list_value()) { |
| 1008 | target = ::google::protobuf::internal::WireFormatLite:: |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 1009 | InternalWriteMessageToArray( |
| 1010 | 6, this->_internal_list_value(), deterministic, target); |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1011 | } |
| 1012 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 1013 | 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 Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1017 | // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.Value) |
| 1018 | return target; |
| 1019 | } |
| 1020 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 1021 | size_t Value::ByteSizeLong() const { |
| 1022 | // @@protoc_insertion_point(message_byte_size_start:google.protobuf.Value) |
| 1023 | size_t total_size = 0; |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1024 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 1025 | 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 Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1030 | switch (kind_case()) { |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 1031 | // .google.protobuf.NullValue null_value = 1; |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1032 | case kNullValue: { |
| 1033 | total_size += 1 + |
| 1034 | ::google::protobuf::internal::WireFormatLite::EnumSize(this->null_value()); |
| 1035 | break; |
| 1036 | } |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 1037 | // double number_value = 2; |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1038 | case kNumberValue: { |
| 1039 | total_size += 1 + 8; |
| 1040 | break; |
| 1041 | } |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 1042 | // string string_value = 3; |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1043 | case kStringValue: { |
| 1044 | total_size += 1 + |
| 1045 | ::google::protobuf::internal::WireFormatLite::StringSize( |
| 1046 | this->string_value()); |
| 1047 | break; |
| 1048 | } |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 1049 | // bool bool_value = 4; |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1050 | case kBoolValue: { |
| 1051 | total_size += 1 + 1; |
| 1052 | break; |
| 1053 | } |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 1054 | // .google.protobuf.Struct struct_value = 5; |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1055 | case kStructValue: { |
| 1056 | total_size += 1 + |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 1057 | ::google::protobuf::internal::WireFormatLite::MessageSize( |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1058 | *kind_.struct_value_); |
| 1059 | break; |
| 1060 | } |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 1061 | // .google.protobuf.ListValue list_value = 6; |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1062 | case kListValue: { |
| 1063 | total_size += 1 + |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 1064 | ::google::protobuf::internal::WireFormatLite::MessageSize( |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1065 | *kind_.list_value_); |
| 1066 | break; |
| 1067 | } |
| 1068 | case KIND_NOT_SET: { |
| 1069 | break; |
| 1070 | } |
| 1071 | } |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 1072 | int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); |
| 1073 | SetCachedSize(cached_size); |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1074 | return total_size; |
| 1075 | } |
| 1076 | |
| 1077 | void Value::MergeFrom(const ::google::protobuf::Message& from) { |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 1078 | // @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.Value) |
| 1079 | GOOGLE_DCHECK_NE(&from, this); |
| 1080 | const Value* source = |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1081 | ::google::protobuf::internal::DynamicCastToGenerated<const Value>( |
| 1082 | &from); |
| 1083 | if (source == NULL) { |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 1084 | // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.Value) |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1085 | ::google::protobuf::internal::ReflectionOps::Merge(from, this); |
| 1086 | } else { |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 1087 | // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.Value) |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1088 | MergeFrom(*source); |
| 1089 | } |
| 1090 | } |
| 1091 | |
| 1092 | void Value::MergeFrom(const Value& from) { |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 1093 | // @@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 Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1099 | 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 | |
| 1130 | void Value::CopyFrom(const ::google::protobuf::Message& from) { |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 1131 | // @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.Value) |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1132 | if (&from == this) return; |
| 1133 | Clear(); |
| 1134 | MergeFrom(from); |
| 1135 | } |
| 1136 | |
| 1137 | void Value::CopyFrom(const Value& from) { |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 1138 | // @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.Value) |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1139 | if (&from == this) return; |
| 1140 | Clear(); |
| 1141 | MergeFrom(from); |
| 1142 | } |
| 1143 | |
| 1144 | bool Value::IsInitialized() const { |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1145 | return true; |
| 1146 | } |
| 1147 | |
| 1148 | void Value::Swap(Value* other) { |
| 1149 | if (other == this) return; |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 1150 | 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 | } |
| 1162 | void Value::UnsafeArenaSwap(Value* other) { |
| 1163 | if (other == this) return; |
| 1164 | GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1165 | InternalSwap(other); |
| 1166 | } |
| 1167 | void Value::InternalSwap(Value* other) { |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 1168 | using std::swap; |
| 1169 | swap(kind_, other->kind_); |
| 1170 | swap(_oneof_case_[0], other->_oneof_case_[0]); |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1171 | _internal_metadata_.Swap(&other->_internal_metadata_); |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1172 | } |
| 1173 | |
| 1174 | ::google::protobuf::Metadata Value::GetMetadata() const { |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 1175 | protobuf_google_2fprotobuf_2fstruct_2eproto::protobuf_AssignDescriptorsOnce(); |
| 1176 | return ::protobuf_google_2fprotobuf_2fstruct_2eproto::file_level_metadata[kIndexInFileMessages]; |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1177 | } |
| 1178 | |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1179 | |
| 1180 | // =================================================================== |
| 1181 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 1182 | void ListValue::InitAsDefaultInstance() { |
| 1183 | } |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1184 | #if !defined(_MSC_VER) || _MSC_VER >= 1900 |
| 1185 | const int ListValue::kValuesFieldNumber; |
| 1186 | #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 |
| 1187 | |
| 1188 | ListValue::ListValue() |
| 1189 | : ::google::protobuf::Message(), _internal_metadata_(NULL) { |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 1190 | ::google::protobuf::internal::InitSCC( |
| 1191 | &protobuf_google_2fprotobuf_2fstruct_2eproto::scc_info_ListValue.base); |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1192 | SharedCtor(); |
| 1193 | // @@protoc_insertion_point(constructor:google.protobuf.ListValue) |
| 1194 | } |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 1195 | ListValue::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 Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1203 | } |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1204 | ListValue::ListValue(const ListValue& from) |
| 1205 | : ::google::protobuf::Message(), |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 1206 | _internal_metadata_(NULL), |
| 1207 | values_(from.values_) { |
| 1208 | _internal_metadata_.MergeFrom(from._internal_metadata_); |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1209 | // @@protoc_insertion_point(copy_constructor:google.protobuf.ListValue) |
| 1210 | } |
| 1211 | |
| 1212 | void ListValue::SharedCtor() { |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1213 | } |
| 1214 | |
| 1215 | ListValue::~ListValue() { |
| 1216 | // @@protoc_insertion_point(destructor:google.protobuf.ListValue) |
| 1217 | SharedDtor(); |
| 1218 | } |
| 1219 | |
| 1220 | void ListValue::SharedDtor() { |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 1221 | GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1222 | } |
| 1223 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 1224 | void ListValue::ArenaDtor(void* object) { |
| 1225 | ListValue* _this = reinterpret_cast< ListValue* >(object); |
| 1226 | (void)_this; |
| 1227 | } |
| 1228 | void ListValue::RegisterArenaDtor(::google::protobuf::Arena* arena) { |
| 1229 | } |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1230 | void ListValue::SetCachedSize(int size) const { |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 1231 | _cached_size_.Set(size); |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1232 | } |
| 1233 | const ::google::protobuf::Descriptor* ListValue::descriptor() { |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 1234 | ::protobuf_google_2fprotobuf_2fstruct_2eproto::protobuf_AssignDescriptorsOnce(); |
| 1235 | return ::protobuf_google_2fprotobuf_2fstruct_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1236 | } |
| 1237 | |
| 1238 | const ListValue& ListValue::default_instance() { |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 1239 | ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2fstruct_2eproto::scc_info_ListValue.base); |
| 1240 | return *internal_default_instance(); |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1241 | } |
| 1242 | |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1243 | |
| 1244 | void ListValue::Clear() { |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 1245 | // @@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 Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1250 | values_.Clear(); |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 1251 | _internal_metadata_.Clear(); |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1252 | } |
| 1253 | |
| 1254 | bool ListValue::MergePartialFromCodedStream( |
| 1255 | ::google::protobuf::io::CodedInputStream* input) { |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 1256 | #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1257 | ::google::protobuf::uint32 tag; |
| 1258 | // @@protoc_insertion_point(parse_start:google.protobuf.ListValue) |
| 1259 | for (;;) { |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 1260 | ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1261 | 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 Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 1266 | if (static_cast< ::google::protobuf::uint8>(tag) == |
| 1267 | static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { |
| 1268 | DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1269 | input, add_values())); |
| 1270 | } else { |
| 1271 | goto handle_unusual; |
| 1272 | } |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1273 | break; |
| 1274 | } |
| 1275 | |
| 1276 | default: { |
| 1277 | handle_unusual: |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 1278 | if (tag == 0) { |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1279 | goto success; |
| 1280 | } |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 1281 | DO_(::google::protobuf::internal::WireFormat::SkipField( |
| 1282 | input, tag, _internal_metadata_.mutable_unknown_fields())); |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1283 | break; |
| 1284 | } |
| 1285 | } |
| 1286 | } |
| 1287 | success: |
| 1288 | // @@protoc_insertion_point(parse_success:google.protobuf.ListValue) |
| 1289 | return true; |
| 1290 | failure: |
| 1291 | // @@protoc_insertion_point(parse_failure:google.protobuf.ListValue) |
| 1292 | return false; |
| 1293 | #undef DO_ |
| 1294 | } |
| 1295 | |
| 1296 | void ListValue::SerializeWithCachedSizes( |
| 1297 | ::google::protobuf::io::CodedOutputStream* output) const { |
| 1298 | // @@protoc_insertion_point(serialize_start:google.protobuf.ListValue) |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 1299 | ::google::protobuf::uint32 cached_has_bits = 0; |
| 1300 | (void) cached_has_bits; |
| 1301 | |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1302 | // repeated .google.protobuf.Value values = 1; |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 1303 | for (unsigned int i = 0, |
| 1304 | n = static_cast<unsigned int>(this->values_size()); i < n; i++) { |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1305 | ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 1306 | 1, |
| 1307 | this->values(static_cast<int>(i)), |
| 1308 | output); |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1309 | } |
| 1310 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 1311 | 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 Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1315 | // @@protoc_insertion_point(serialize_end:google.protobuf.ListValue) |
| 1316 | } |
| 1317 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 1318 | ::google::protobuf::uint8* ListValue::InternalSerializeWithCachedSizesToArray( |
| 1319 | bool deterministic, ::google::protobuf::uint8* target) const { |
| 1320 | (void)deterministic; // Unused |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1321 | // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.ListValue) |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 1322 | ::google::protobuf::uint32 cached_has_bits = 0; |
| 1323 | (void) cached_has_bits; |
| 1324 | |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1325 | // repeated .google.protobuf.Value values = 1; |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 1326 | for (unsigned int i = 0, |
| 1327 | n = static_cast<unsigned int>(this->values_size()); i < n; i++) { |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1328 | target = ::google::protobuf::internal::WireFormatLite:: |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 1329 | InternalWriteMessageToArray( |
| 1330 | 1, this->values(static_cast<int>(i)), deterministic, target); |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1331 | } |
| 1332 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 1333 | 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 Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1337 | // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.ListValue) |
| 1338 | return target; |
| 1339 | } |
| 1340 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 1341 | size_t ListValue::ByteSizeLong() const { |
| 1342 | // @@protoc_insertion_point(message_byte_size_start:google.protobuf.ListValue) |
| 1343 | size_t total_size = 0; |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1344 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 1345 | if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) { |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1346 | total_size += |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 1347 | ::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 Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1359 | } |
| 1360 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 1361 | int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); |
| 1362 | SetCachedSize(cached_size); |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1363 | return total_size; |
| 1364 | } |
| 1365 | |
| 1366 | void ListValue::MergeFrom(const ::google::protobuf::Message& from) { |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 1367 | // @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.ListValue) |
| 1368 | GOOGLE_DCHECK_NE(&from, this); |
| 1369 | const ListValue* source = |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1370 | ::google::protobuf::internal::DynamicCastToGenerated<const ListValue>( |
| 1371 | &from); |
| 1372 | if (source == NULL) { |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 1373 | // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.ListValue) |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1374 | ::google::protobuf::internal::ReflectionOps::Merge(from, this); |
| 1375 | } else { |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 1376 | // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.ListValue) |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1377 | MergeFrom(*source); |
| 1378 | } |
| 1379 | } |
| 1380 | |
| 1381 | void ListValue::MergeFrom(const ListValue& from) { |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 1382 | // @@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 Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1388 | values_.MergeFrom(from.values_); |
| 1389 | } |
| 1390 | |
| 1391 | void ListValue::CopyFrom(const ::google::protobuf::Message& from) { |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 1392 | // @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.ListValue) |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1393 | if (&from == this) return; |
| 1394 | Clear(); |
| 1395 | MergeFrom(from); |
| 1396 | } |
| 1397 | |
| 1398 | void ListValue::CopyFrom(const ListValue& from) { |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 1399 | // @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.ListValue) |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1400 | if (&from == this) return; |
| 1401 | Clear(); |
| 1402 | MergeFrom(from); |
| 1403 | } |
| 1404 | |
| 1405 | bool ListValue::IsInitialized() const { |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1406 | return true; |
| 1407 | } |
| 1408 | |
| 1409 | void ListValue::Swap(ListValue* other) { |
| 1410 | if (other == this) return; |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 1411 | 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 | } |
| 1423 | void ListValue::UnsafeArenaSwap(ListValue* other) { |
| 1424 | if (other == this) return; |
| 1425 | GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1426 | InternalSwap(other); |
| 1427 | } |
| 1428 | void ListValue::InternalSwap(ListValue* other) { |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 1429 | using std::swap; |
| 1430 | CastToBase(&values_)->InternalSwap(CastToBase(&other->values_)); |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1431 | _internal_metadata_.Swap(&other->_internal_metadata_); |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1432 | } |
| 1433 | |
| 1434 | ::google::protobuf::Metadata ListValue::GetMetadata() const { |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 1435 | protobuf_google_2fprotobuf_2fstruct_2eproto::protobuf_AssignDescriptorsOnce(); |
| 1436 | return ::protobuf_google_2fprotobuf_2fstruct_2eproto::file_level_metadata[kIndexInFileMessages]; |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1437 | } |
| 1438 | |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1439 | |
| 1440 | // @@protoc_insertion_point(namespace_scope) |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 1441 | } // namespace protobuf |
| 1442 | } // namespace google |
| 1443 | namespace google { |
| 1444 | namespace protobuf { |
| 1445 | template<> 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 | } |
| 1448 | template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::google::protobuf::Struct* Arena::CreateMaybeMessage< ::google::protobuf::Struct >(Arena* arena) { |
| 1449 | return Arena::CreateMessageInternal< ::google::protobuf::Struct >(arena); |
| 1450 | } |
| 1451 | template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::google::protobuf::Value* Arena::CreateMaybeMessage< ::google::protobuf::Value >(Arena* arena) { |
| 1452 | return Arena::CreateMessageInternal< ::google::protobuf::Value >(arena); |
| 1453 | } |
| 1454 | template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::google::protobuf::ListValue* Arena::CreateMaybeMessage< ::google::protobuf::ListValue >(Arena* arena) { |
| 1455 | return Arena::CreateMessageInternal< ::google::protobuf::ListValue >(arena); |
| 1456 | } |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1457 | } // namespace protobuf |
| 1458 | } // namespace google |
| 1459 | |
| 1460 | // @@protoc_insertion_point(global_scope) |