Files
firebase-ios-sdk/Firestore/Protos/cpp/google/firestore/v1/document.pb.cc
T
Gil 6af931d4e8 Migrate Firestore to the v1 protocol (#2200)
* Use python executable directly

  * python2 is not guaranteed to exist
  * scripts aren't directly executable on Windows

* Add Firestore v1 protos

* Point cmake at Firestore v1 protos

* Regenerate protobuf-related sources

* Make local protos refer to v1 protos

* fixup! Regenerate protobuf-related sources

* Remove v1beta1 protos

* s/v1beta1/v1/g in source.

* s/v1beta1/v1/ in the Xcode project

* Remove stale bug comments.

This was fixed by adding an explicit FieldPath API rather than exposing
escaping to the end user.
2018-12-21 11:28:48 -08:00

2301 lines
87 KiB
C++

/*
* Copyright 2018 Google
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/firestore/v1/document.proto
#include "google/firestore/v1/document.pb.h"
#include <algorithm>
#include <google/protobuf/stubs/common.h>
#include <google/protobuf/stubs/port.h>
#include <google/protobuf/stubs/once.h>
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/wire_format_lite_inl.h>
#include <google/protobuf/descriptor.h>
#include <google/protobuf/generated_message_reflection.h>
#include <google/protobuf/reflection_ops.h>
#include <google/protobuf/wire_format.h>
// This is a temporary google only hack
#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
#include "third_party/protobuf/version.h"
#endif
// @@protoc_insertion_point(includes)
namespace google {
namespace firestore {
namespace v1 {
class Document_FieldsEntry_DoNotUseDefaultTypeInternal {
public:
::google::protobuf::internal::ExplicitlyConstructed<Document_FieldsEntry_DoNotUse>
_instance;
} _Document_FieldsEntry_DoNotUse_default_instance_;
class DocumentDefaultTypeInternal {
public:
::google::protobuf::internal::ExplicitlyConstructed<Document>
_instance;
} _Document_default_instance_;
class ValueDefaultTypeInternal {
public:
::google::protobuf::internal::ExplicitlyConstructed<Value>
_instance;
int null_value_;
bool boolean_value_;
::google::protobuf::int64 integer_value_;
double double_value_;
const ::google::protobuf::Timestamp* timestamp_value_;
::google::protobuf::internal::ArenaStringPtr string_value_;
::google::protobuf::internal::ArenaStringPtr bytes_value_;
::google::protobuf::internal::ArenaStringPtr reference_value_;
const ::google::type::LatLng* geo_point_value_;
const ::google::firestore::v1::ArrayValue* array_value_;
const ::google::firestore::v1::MapValue* map_value_;
} _Value_default_instance_;
class ArrayValueDefaultTypeInternal {
public:
::google::protobuf::internal::ExplicitlyConstructed<ArrayValue>
_instance;
} _ArrayValue_default_instance_;
class MapValue_FieldsEntry_DoNotUseDefaultTypeInternal {
public:
::google::protobuf::internal::ExplicitlyConstructed<MapValue_FieldsEntry_DoNotUse>
_instance;
} _MapValue_FieldsEntry_DoNotUse_default_instance_;
class MapValueDefaultTypeInternal {
public:
::google::protobuf::internal::ExplicitlyConstructed<MapValue>
_instance;
} _MapValue_default_instance_;
} // namespace v1
} // namespace firestore
} // namespace google
namespace protobuf_google_2ffirestore_2fv1_2fdocument_2eproto {
void InitDefaultsDocument_FieldsEntry_DoNotUseImpl() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
::google::protobuf::internal::InitProtobufDefaultsForceUnique();
#else
::google::protobuf::internal::InitProtobufDefaults();
#endif // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
protobuf_google_2ffirestore_2fv1_2fdocument_2eproto::InitDefaultsArrayValue();
{
void* ptr = &::google::firestore::v1::_Document_FieldsEntry_DoNotUse_default_instance_;
new (ptr) ::google::firestore::v1::Document_FieldsEntry_DoNotUse();
}
::google::firestore::v1::Document_FieldsEntry_DoNotUse::InitAsDefaultInstance();
}
void InitDefaultsDocument_FieldsEntry_DoNotUse() {
static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
::google::protobuf::GoogleOnceInit(&once, &InitDefaultsDocument_FieldsEntry_DoNotUseImpl);
}
void InitDefaultsDocumentImpl() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
::google::protobuf::internal::InitProtobufDefaultsForceUnique();
#else
::google::protobuf::internal::InitProtobufDefaults();
#endif // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
protobuf_google_2ffirestore_2fv1_2fdocument_2eproto::InitDefaultsDocument_FieldsEntry_DoNotUse();
protobuf_google_2fprotobuf_2ftimestamp_2eproto::InitDefaultsTimestamp();
{
void* ptr = &::google::firestore::v1::_Document_default_instance_;
new (ptr) ::google::firestore::v1::Document();
::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
}
::google::firestore::v1::Document::InitAsDefaultInstance();
}
void InitDefaultsDocument() {
static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
::google::protobuf::GoogleOnceInit(&once, &InitDefaultsDocumentImpl);
}
void InitDefaultsArrayValueImpl() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
::google::protobuf::internal::InitProtobufDefaultsForceUnique();
#else
::google::protobuf::internal::InitProtobufDefaults();
#endif // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
protobuf_google_2fprotobuf_2ftimestamp_2eproto::InitDefaultsTimestamp();
protobuf_google_2ftype_2flatlng_2eproto::InitDefaultsLatLng();
{
void* ptr = &::google::firestore::v1::_Value_default_instance_;
new (ptr) ::google::firestore::v1::Value();
::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
}
{
void* ptr = &::google::firestore::v1::_ArrayValue_default_instance_;
new (ptr) ::google::firestore::v1::ArrayValue();
::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
}
{
void* ptr = &::google::firestore::v1::_MapValue_FieldsEntry_DoNotUse_default_instance_;
new (ptr) ::google::firestore::v1::MapValue_FieldsEntry_DoNotUse();
}
{
void* ptr = &::google::firestore::v1::_MapValue_default_instance_;
new (ptr) ::google::firestore::v1::MapValue();
::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
}
::google::firestore::v1::Value::InitAsDefaultInstance();
::google::firestore::v1::ArrayValue::InitAsDefaultInstance();
::google::firestore::v1::MapValue_FieldsEntry_DoNotUse::InitAsDefaultInstance();
::google::firestore::v1::MapValue::InitAsDefaultInstance();
}
void InitDefaultsArrayValue() {
static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
::google::protobuf::GoogleOnceInit(&once, &InitDefaultsArrayValueImpl);
}
::google::protobuf::Metadata file_level_metadata[6];
const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::firestore::v1::Document_FieldsEntry_DoNotUse, _has_bits_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::firestore::v1::Document_FieldsEntry_DoNotUse, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::firestore::v1::Document_FieldsEntry_DoNotUse, key_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::firestore::v1::Document_FieldsEntry_DoNotUse, value_),
0,
1,
~0u, // no _has_bits_
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::firestore::v1::Document, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::firestore::v1::Document, name_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::firestore::v1::Document, fields_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::firestore::v1::Document, create_time_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::firestore::v1::Document, update_time_),
~0u, // no _has_bits_
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::firestore::v1::Value, _internal_metadata_),
~0u, // no _extensions_
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::firestore::v1::Value, _oneof_case_[0]),
~0u, // no _weak_field_map_
offsetof(::google::firestore::v1::ValueDefaultTypeInternal, null_value_),
offsetof(::google::firestore::v1::ValueDefaultTypeInternal, boolean_value_),
offsetof(::google::firestore::v1::ValueDefaultTypeInternal, integer_value_),
offsetof(::google::firestore::v1::ValueDefaultTypeInternal, double_value_),
offsetof(::google::firestore::v1::ValueDefaultTypeInternal, timestamp_value_),
offsetof(::google::firestore::v1::ValueDefaultTypeInternal, string_value_),
offsetof(::google::firestore::v1::ValueDefaultTypeInternal, bytes_value_),
offsetof(::google::firestore::v1::ValueDefaultTypeInternal, reference_value_),
offsetof(::google::firestore::v1::ValueDefaultTypeInternal, geo_point_value_),
offsetof(::google::firestore::v1::ValueDefaultTypeInternal, array_value_),
offsetof(::google::firestore::v1::ValueDefaultTypeInternal, map_value_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::firestore::v1::Value, value_type_),
~0u, // no _has_bits_
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::firestore::v1::ArrayValue, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::firestore::v1::ArrayValue, values_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::firestore::v1::MapValue_FieldsEntry_DoNotUse, _has_bits_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::firestore::v1::MapValue_FieldsEntry_DoNotUse, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::firestore::v1::MapValue_FieldsEntry_DoNotUse, key_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::firestore::v1::MapValue_FieldsEntry_DoNotUse, value_),
0,
1,
~0u, // no _has_bits_
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::firestore::v1::MapValue, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::firestore::v1::MapValue, fields_),
};
static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
{ 0, 7, sizeof(::google::firestore::v1::Document_FieldsEntry_DoNotUse)},
{ 9, -1, sizeof(::google::firestore::v1::Document)},
{ 18, -1, sizeof(::google::firestore::v1::Value)},
{ 35, -1, sizeof(::google::firestore::v1::ArrayValue)},
{ 41, 48, sizeof(::google::firestore::v1::MapValue_FieldsEntry_DoNotUse)},
{ 50, -1, sizeof(::google::firestore::v1::MapValue)},
};
static ::google::protobuf::Message const * const file_default_instances[] = {
reinterpret_cast<const ::google::protobuf::Message*>(&::google::firestore::v1::_Document_FieldsEntry_DoNotUse_default_instance_),
reinterpret_cast<const ::google::protobuf::Message*>(&::google::firestore::v1::_Document_default_instance_),
reinterpret_cast<const ::google::protobuf::Message*>(&::google::firestore::v1::_Value_default_instance_),
reinterpret_cast<const ::google::protobuf::Message*>(&::google::firestore::v1::_ArrayValue_default_instance_),
reinterpret_cast<const ::google::protobuf::Message*>(&::google::firestore::v1::_MapValue_FieldsEntry_DoNotUse_default_instance_),
reinterpret_cast<const ::google::protobuf::Message*>(&::google::firestore::v1::_MapValue_default_instance_),
};
void protobuf_AssignDescriptors() {
AddDescriptors();
::google::protobuf::MessageFactory* factory = NULL;
AssignDescriptors(
"google/firestore/v1/document.proto", schemas, file_default_instances, TableStruct::offsets, factory,
file_level_metadata, NULL, NULL);
}
void protobuf_AssignDescriptorsOnce() {
static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
::google::protobuf::GoogleOnceInit(&once, &protobuf_AssignDescriptors);
}
void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD;
void protobuf_RegisterTypes(const ::std::string&) {
protobuf_AssignDescriptorsOnce();
::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 6);
}
void AddDescriptorsImpl() {
InitDefaults();
static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
"\n\"google/firestore/v1/document.proto\022\023go"
"ogle.firestore.v1\032\034google/api/annotation"
"s.proto\032\034google/protobuf/struct.proto\032\037g"
"oogle/protobuf/timestamp.proto\032\030google/t"
"ype/latlng.proto\"\200\002\n\010Document\022\014\n\004name\030\001 "
"\001(\t\0229\n\006fields\030\002 \003(\0132).google.firestore.v"
"1.Document.FieldsEntry\022/\n\013create_time\030\003 "
"\001(\0132\032.google.protobuf.Timestamp\022/\n\013updat"
"e_time\030\004 \001(\0132\032.google.protobuf.Timestamp"
"\032I\n\013FieldsEntry\022\013\n\003key\030\001 \001(\t\022)\n\005value\030\002 "
"\001(\0132\032.google.firestore.v1.Value:\0028\001\"\256\003\n\005"
"Value\0220\n\nnull_value\030\013 \001(\0162\032.google.proto"
"buf.NullValueH\000\022\027\n\rboolean_value\030\001 \001(\010H\000"
"\022\027\n\rinteger_value\030\002 \001(\003H\000\022\026\n\014double_valu"
"e\030\003 \001(\001H\000\0225\n\017timestamp_value\030\n \001(\0132\032.goo"
"gle.protobuf.TimestampH\000\022\026\n\014string_value"
"\030\021 \001(\tH\000\022\025\n\013bytes_value\030\022 \001(\014H\000\022\031\n\017refer"
"ence_value\030\005 \001(\tH\000\022.\n\017geo_point_value\030\010 "
"\001(\0132\023.google.type.LatLngH\000\0226\n\013array_valu"
"e\030\t \001(\0132\037.google.firestore.v1.ArrayValue"
"H\000\0222\n\tmap_value\030\006 \001(\0132\035.google.firestore"
".v1.MapValueH\000B\014\n\nvalue_type\"8\n\nArrayVal"
"ue\022*\n\006values\030\001 \003(\0132\032.google.firestore.v1"
".Value\"\220\001\n\010MapValue\0229\n\006fields\030\001 \003(\0132).go"
"ogle.firestore.v1.MapValue.FieldsEntry\032I"
"\n\013FieldsEntry\022\013\n\003key\030\001 \001(\t\022)\n\005value\030\002 \001("
"\0132\032.google.firestore.v1.Value:\0028\001B\261\001\n\027co"
"m.google.firestore.v1B\rDocumentProtoP\001Z<"
"google.golang.org/genproto/googleapis/fi"
"restore/v1;firestore\242\002\004GCFS\252\002\036Google.Clo"
"ud.Firestore.V1Beta1\312\002\036Google\\Cloud\\Fire"
"store\\V1beta1b\006proto3"
};
::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
descriptor, 1261);
::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
"google/firestore/v1/document.proto", &protobuf_RegisterTypes);
::protobuf_google_2fapi_2fannotations_2eproto::AddDescriptors();
::protobuf_google_2fprotobuf_2fstruct_2eproto::AddDescriptors();
::protobuf_google_2fprotobuf_2ftimestamp_2eproto::AddDescriptors();
::protobuf_google_2ftype_2flatlng_2eproto::AddDescriptors();
}
void AddDescriptors() {
static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl);
}
// Force AddDescriptors() to be called at dynamic initialization time.
struct StaticDescriptorInitializer {
StaticDescriptorInitializer() {
AddDescriptors();
}
} static_descriptor_initializer;
} // namespace protobuf_google_2ffirestore_2fv1_2fdocument_2eproto
namespace google {
namespace firestore {
namespace v1 {
// ===================================================================
Document_FieldsEntry_DoNotUse::Document_FieldsEntry_DoNotUse() {}
Document_FieldsEntry_DoNotUse::Document_FieldsEntry_DoNotUse(::google::protobuf::Arena* arena) : SuperType(arena) {}
void Document_FieldsEntry_DoNotUse::MergeFrom(const Document_FieldsEntry_DoNotUse& other) {
MergeFromInternal(other);
}
::google::protobuf::Metadata Document_FieldsEntry_DoNotUse::GetMetadata() const {
::protobuf_google_2ffirestore_2fv1_2fdocument_2eproto::protobuf_AssignDescriptorsOnce();
return ::protobuf_google_2ffirestore_2fv1_2fdocument_2eproto::file_level_metadata[0];
}
void Document_FieldsEntry_DoNotUse::MergeFrom(
const ::google::protobuf::Message& other) {
::google::protobuf::Message::MergeFrom(other);
}
// ===================================================================
void Document::InitAsDefaultInstance() {
::google::firestore::v1::_Document_default_instance_._instance.get_mutable()->create_time_ = const_cast< ::google::protobuf::Timestamp*>(
::google::protobuf::Timestamp::internal_default_instance());
::google::firestore::v1::_Document_default_instance_._instance.get_mutable()->update_time_ = const_cast< ::google::protobuf::Timestamp*>(
::google::protobuf::Timestamp::internal_default_instance());
}
void Document::clear_create_time() {
if (GetArenaNoVirtual() == NULL && create_time_ != NULL) {
delete create_time_;
}
create_time_ = NULL;
}
void Document::clear_update_time() {
if (GetArenaNoVirtual() == NULL && update_time_ != NULL) {
delete update_time_;
}
update_time_ = NULL;
}
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int Document::kNameFieldNumber;
const int Document::kFieldsFieldNumber;
const int Document::kCreateTimeFieldNumber;
const int Document::kUpdateTimeFieldNumber;
#endif // !defined(_MSC_VER) || _MSC_VER >= 1900
Document::Document()
: ::google::protobuf::Message(), _internal_metadata_(NULL) {
if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
::protobuf_google_2ffirestore_2fv1_2fdocument_2eproto::InitDefaultsDocument();
}
SharedCtor();
// @@protoc_insertion_point(constructor:google.firestore.v1.Document)
}
Document::Document(const Document& from)
: ::google::protobuf::Message(),
_internal_metadata_(NULL),
_cached_size_(0) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
fields_.MergeFrom(from.fields_);
name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
if (from.name().size() > 0) {
name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_);
}
if (from.has_create_time()) {
create_time_ = new ::google::protobuf::Timestamp(*from.create_time_);
} else {
create_time_ = NULL;
}
if (from.has_update_time()) {
update_time_ = new ::google::protobuf::Timestamp(*from.update_time_);
} else {
update_time_ = NULL;
}
// @@protoc_insertion_point(copy_constructor:google.firestore.v1.Document)
}
void Document::SharedCtor() {
name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
::memset(&create_time_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&update_time_) -
reinterpret_cast<char*>(&create_time_)) + sizeof(update_time_));
_cached_size_ = 0;
}
Document::~Document() {
// @@protoc_insertion_point(destructor:google.firestore.v1.Document)
SharedDtor();
}
void Document::SharedDtor() {
name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
if (this != internal_default_instance()) delete create_time_;
if (this != internal_default_instance()) delete update_time_;
}
void Document::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* Document::descriptor() {
::protobuf_google_2ffirestore_2fv1_2fdocument_2eproto::protobuf_AssignDescriptorsOnce();
return ::protobuf_google_2ffirestore_2fv1_2fdocument_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
}
const Document& Document::default_instance() {
::protobuf_google_2ffirestore_2fv1_2fdocument_2eproto::InitDefaultsDocument();
return *internal_default_instance();
}
Document* Document::New(::google::protobuf::Arena* arena) const {
Document* n = new Document;
if (arena != NULL) {
arena->Own(n);
}
return n;
}
void Document::Clear() {
// @@protoc_insertion_point(message_clear_start:google.firestore.v1.Document)
::google::protobuf::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
fields_.Clear();
name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
if (GetArenaNoVirtual() == NULL && create_time_ != NULL) {
delete create_time_;
}
create_time_ = NULL;
if (GetArenaNoVirtual() == NULL && update_time_ != NULL) {
delete update_time_;
}
update_time_ = NULL;
_internal_metadata_.Clear();
}
bool Document::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
::google::protobuf::uint32 tag;
// @@protoc_insertion_point(parse_start:google.firestore.v1.Document)
for (;;) {
::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
tag = p.first;
if (!p.second) goto handle_unusual;
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// string name = 1;
case 1: {
if (static_cast< ::google::protobuf::uint8>(tag) ==
static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
DO_(::google::protobuf::internal::WireFormatLite::ReadString(
input, this->mutable_name()));
DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
this->name().data(), static_cast<int>(this->name().length()),
::google::protobuf::internal::WireFormatLite::PARSE,
"google.firestore.v1.Document.name"));
} else {
goto handle_unusual;
}
break;
}
// map<string, .google.firestore.v1.Value> fields = 2;
case 2: {
if (static_cast< ::google::protobuf::uint8>(tag) ==
static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
Document_FieldsEntry_DoNotUse::Parser< ::google::protobuf::internal::MapField<
Document_FieldsEntry_DoNotUse,
::std::string, ::google::firestore::v1::Value,
::google::protobuf::internal::WireFormatLite::TYPE_STRING,
::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE,
0 >,
::google::protobuf::Map< ::std::string, ::google::firestore::v1::Value > > parser(&fields_);
DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
input, &parser));
DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
parser.key().data(), static_cast<int>(parser.key().length()),
::google::protobuf::internal::WireFormatLite::PARSE,
"google.firestore.v1.Document.FieldsEntry.key"));
} else {
goto handle_unusual;
}
break;
}
// .google.protobuf.Timestamp create_time = 3;
case 3: {
if (static_cast< ::google::protobuf::uint8>(tag) ==
static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
input, mutable_create_time()));
} else {
goto handle_unusual;
}
break;
}
// .google.protobuf.Timestamp update_time = 4;
case 4: {
if (static_cast< ::google::protobuf::uint8>(tag) ==
static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) {
DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
input, mutable_update_time()));
} else {
goto handle_unusual;
}
break;
}
default: {
handle_unusual:
if (tag == 0) {
goto success;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, _internal_metadata_.mutable_unknown_fields()));
break;
}
}
}
success:
// @@protoc_insertion_point(parse_success:google.firestore.v1.Document)
return true;
failure:
// @@protoc_insertion_point(parse_failure:google.firestore.v1.Document)
return false;
#undef DO_
}
void Document::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// @@protoc_insertion_point(serialize_start:google.firestore.v1.Document)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// string name = 1;
if (this->name().size() > 0) {
::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
this->name().data(), static_cast<int>(this->name().length()),
::google::protobuf::internal::WireFormatLite::SERIALIZE,
"google.firestore.v1.Document.name");
::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
1, this->name(), output);
}
// map<string, .google.firestore.v1.Value> fields = 2;
if (!this->fields().empty()) {
typedef ::google::protobuf::Map< ::std::string, ::google::firestore::v1::Value >::const_pointer
ConstPtr;
typedef ConstPtr SortItem;
typedef ::google::protobuf::internal::CompareByDerefFirst<SortItem> Less;
struct Utf8Check {
static void Check(ConstPtr p) {
::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
p->first.data(), static_cast<int>(p->first.length()),
::google::protobuf::internal::WireFormatLite::SERIALIZE,
"google.firestore.v1.Document.FieldsEntry.key");
}
};
if (output->IsSerializationDeterministic() &&
this->fields().size() > 1) {
::google::protobuf::scoped_array<SortItem> items(
new SortItem[this->fields().size()]);
typedef ::google::protobuf::Map< ::std::string, ::google::firestore::v1::Value >::size_type size_type;
size_type n = 0;
for (::google::protobuf::Map< ::std::string, ::google::firestore::v1::Value >::const_iterator
it = this->fields().begin();
it != this->fields().end(); ++it, ++n) {
items[static_cast<ptrdiff_t>(n)] = SortItem(&*it);
}
::std::sort(&items[0], &items[static_cast<ptrdiff_t>(n)], Less());
::google::protobuf::scoped_ptr<Document_FieldsEntry_DoNotUse> entry;
for (size_type i = 0; i < n; i++) {
entry.reset(fields_.NewEntryWrapper(
items[static_cast<ptrdiff_t>(i)]->first, items[static_cast<ptrdiff_t>(i)]->second));
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
2, *entry, output);
Utf8Check::Check(items[static_cast<ptrdiff_t>(i)]);
}
} else {
::google::protobuf::scoped_ptr<Document_FieldsEntry_DoNotUse> entry;
for (::google::protobuf::Map< ::std::string, ::google::firestore::v1::Value >::const_iterator
it = this->fields().begin();
it != this->fields().end(); ++it) {
entry.reset(fields_.NewEntryWrapper(
it->first, it->second));
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
2, *entry, output);
Utf8Check::Check(&*it);
}
}
}
// .google.protobuf.Timestamp create_time = 3;
if (this->has_create_time()) {
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
3, *this->create_time_, output);
}
// .google.protobuf.Timestamp update_time = 4;
if (this->has_update_time()) {
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
4, *this->update_time_, output);
}
if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
(::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output);
}
// @@protoc_insertion_point(serialize_end:google.firestore.v1.Document)
}
::google::protobuf::uint8* Document::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
(void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:google.firestore.v1.Document)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// string name = 1;
if (this->name().size() > 0) {
::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
this->name().data(), static_cast<int>(this->name().length()),
::google::protobuf::internal::WireFormatLite::SERIALIZE,
"google.firestore.v1.Document.name");
target =
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
1, this->name(), target);
}
// map<string, .google.firestore.v1.Value> fields = 2;
if (!this->fields().empty()) {
typedef ::google::protobuf::Map< ::std::string, ::google::firestore::v1::Value >::const_pointer
ConstPtr;
typedef ConstPtr SortItem;
typedef ::google::protobuf::internal::CompareByDerefFirst<SortItem> Less;
struct Utf8Check {
static void Check(ConstPtr p) {
::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
p->first.data(), static_cast<int>(p->first.length()),
::google::protobuf::internal::WireFormatLite::SERIALIZE,
"google.firestore.v1.Document.FieldsEntry.key");
}
};
if (deterministic &&
this->fields().size() > 1) {
::google::protobuf::scoped_array<SortItem> items(
new SortItem[this->fields().size()]);
typedef ::google::protobuf::Map< ::std::string, ::google::firestore::v1::Value >::size_type size_type;
size_type n = 0;
for (::google::protobuf::Map< ::std::string, ::google::firestore::v1::Value >::const_iterator
it = this->fields().begin();
it != this->fields().end(); ++it, ++n) {
items[static_cast<ptrdiff_t>(n)] = SortItem(&*it);
}
::std::sort(&items[0], &items[static_cast<ptrdiff_t>(n)], Less());
::google::protobuf::scoped_ptr<Document_FieldsEntry_DoNotUse> entry;
for (size_type i = 0; i < n; i++) {
entry.reset(fields_.NewEntryWrapper(
items[static_cast<ptrdiff_t>(i)]->first, items[static_cast<ptrdiff_t>(i)]->second));
target = ::google::protobuf::internal::WireFormatLite::
InternalWriteMessageNoVirtualToArray(
2, *entry, deterministic, target);
;
Utf8Check::Check(items[static_cast<ptrdiff_t>(i)]);
}
} else {
::google::protobuf::scoped_ptr<Document_FieldsEntry_DoNotUse> entry;
for (::google::protobuf::Map< ::std::string, ::google::firestore::v1::Value >::const_iterator
it = this->fields().begin();
it != this->fields().end(); ++it) {
entry.reset(fields_.NewEntryWrapper(
it->first, it->second));
target = ::google::protobuf::internal::WireFormatLite::
InternalWriteMessageNoVirtualToArray(
2, *entry, deterministic, target);
;
Utf8Check::Check(&*it);
}
}
}
// .google.protobuf.Timestamp create_time = 3;
if (this->has_create_time()) {
target = ::google::protobuf::internal::WireFormatLite::
InternalWriteMessageToArray(
3, *this->create_time_, deterministic, target);
}
// .google.protobuf.Timestamp update_time = 4;
if (this->has_update_time()) {
target = ::google::protobuf::internal::WireFormatLite::
InternalWriteMessageToArray(
4, *this->update_time_, deterministic, target);
}
if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
(::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target);
}
// @@protoc_insertion_point(serialize_to_array_end:google.firestore.v1.Document)
return target;
}
size_t Document::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:google.firestore.v1.Document)
size_t total_size = 0;
if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
(::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()));
}
// map<string, .google.firestore.v1.Value> fields = 2;
total_size += 1 *
::google::protobuf::internal::FromIntSize(this->fields_size());
{
::google::protobuf::scoped_ptr<Document_FieldsEntry_DoNotUse> entry;
for (::google::protobuf::Map< ::std::string, ::google::firestore::v1::Value >::const_iterator
it = this->fields().begin();
it != this->fields().end(); ++it) {
entry.reset(fields_.NewEntryWrapper(it->first, it->second));
total_size += ::google::protobuf::internal::WireFormatLite::
MessageSizeNoVirtual(*entry);
}
}
// string name = 1;
if (this->name().size() > 0) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::StringSize(
this->name());
}
// .google.protobuf.Timestamp create_time = 3;
if (this->has_create_time()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::MessageSize(
*this->create_time_);
}
// .google.protobuf.Timestamp update_time = 4;
if (this->has_update_time()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::MessageSize(
*this->update_time_);
}
int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = cached_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void Document::MergeFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:google.firestore.v1.Document)
GOOGLE_DCHECK_NE(&from, this);
const Document* source =
::google::protobuf::internal::DynamicCastToGenerated<const Document>(
&from);
if (source == NULL) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:google.firestore.v1.Document)
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:google.firestore.v1.Document)
MergeFrom(*source);
}
}
void Document::MergeFrom(const Document& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:google.firestore.v1.Document)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
fields_.MergeFrom(from.fields_);
if (from.name().size() > 0) {
name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_);
}
if (from.has_create_time()) {
mutable_create_time()->::google::protobuf::Timestamp::MergeFrom(from.create_time());
}
if (from.has_update_time()) {
mutable_update_time()->::google::protobuf::Timestamp::MergeFrom(from.update_time());
}
}
void Document::CopyFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:google.firestore.v1.Document)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void Document::CopyFrom(const Document& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:google.firestore.v1.Document)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool Document::IsInitialized() const {
return true;
}
void Document::Swap(Document* other) {
if (other == this) return;
InternalSwap(other);
}
void Document::InternalSwap(Document* other) {
using std::swap;
fields_.Swap(&other->fields_);
name_.Swap(&other->name_);
swap(create_time_, other->create_time_);
swap(update_time_, other->update_time_);
_internal_metadata_.Swap(&other->_internal_metadata_);
swap(_cached_size_, other->_cached_size_);
}
::google::protobuf::Metadata Document::GetMetadata() const {
protobuf_google_2ffirestore_2fv1_2fdocument_2eproto::protobuf_AssignDescriptorsOnce();
return ::protobuf_google_2ffirestore_2fv1_2fdocument_2eproto::file_level_metadata[kIndexInFileMessages];
}
// ===================================================================
void Value::InitAsDefaultInstance() {
::google::firestore::v1::_Value_default_instance_.null_value_ = 0;
::google::firestore::v1::_Value_default_instance_.boolean_value_ = false;
::google::firestore::v1::_Value_default_instance_.integer_value_ = GOOGLE_LONGLONG(0);
::google::firestore::v1::_Value_default_instance_.double_value_ = 0;
::google::firestore::v1::_Value_default_instance_.timestamp_value_ = const_cast< ::google::protobuf::Timestamp*>(
::google::protobuf::Timestamp::internal_default_instance());
::google::firestore::v1::_Value_default_instance_.string_value_.UnsafeSetDefault(
&::google::protobuf::internal::GetEmptyStringAlreadyInited());
::google::firestore::v1::_Value_default_instance_.bytes_value_.UnsafeSetDefault(
&::google::protobuf::internal::GetEmptyStringAlreadyInited());
::google::firestore::v1::_Value_default_instance_.reference_value_.UnsafeSetDefault(
&::google::protobuf::internal::GetEmptyStringAlreadyInited());
::google::firestore::v1::_Value_default_instance_.geo_point_value_ = const_cast< ::google::type::LatLng*>(
::google::type::LatLng::internal_default_instance());
::google::firestore::v1::_Value_default_instance_.array_value_ = const_cast< ::google::firestore::v1::ArrayValue*>(
::google::firestore::v1::ArrayValue::internal_default_instance());
::google::firestore::v1::_Value_default_instance_.map_value_ = const_cast< ::google::firestore::v1::MapValue*>(
::google::firestore::v1::MapValue::internal_default_instance());
}
void Value::set_allocated_timestamp_value(::google::protobuf::Timestamp* timestamp_value) {
::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
clear_value_type();
if (timestamp_value) {
::google::protobuf::Arena* submessage_arena =
reinterpret_cast< ::google::protobuf::MessageLite*>(timestamp_value)->GetArena();
if (message_arena != submessage_arena) {
timestamp_value = ::google::protobuf::internal::GetOwnedMessage(
message_arena, timestamp_value, submessage_arena);
}
set_has_timestamp_value();
value_type_.timestamp_value_ = timestamp_value;
}
// @@protoc_insertion_point(field_set_allocated:google.firestore.v1.Value.timestamp_value)
}
void Value::clear_timestamp_value() {
if (has_timestamp_value()) {
delete value_type_.timestamp_value_;
clear_has_value_type();
}
}
void Value::set_allocated_geo_point_value(::google::type::LatLng* geo_point_value) {
::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
clear_value_type();
if (geo_point_value) {
::google::protobuf::Arena* submessage_arena = NULL;
if (message_arena != submessage_arena) {
geo_point_value = ::google::protobuf::internal::GetOwnedMessage(
message_arena, geo_point_value, submessage_arena);
}
set_has_geo_point_value();
value_type_.geo_point_value_ = geo_point_value;
}
// @@protoc_insertion_point(field_set_allocated:google.firestore.v1.Value.geo_point_value)
}
void Value::clear_geo_point_value() {
if (has_geo_point_value()) {
delete value_type_.geo_point_value_;
clear_has_value_type();
}
}
void Value::set_allocated_array_value(::google::firestore::v1::ArrayValue* array_value) {
::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
clear_value_type();
if (array_value) {
::google::protobuf::Arena* submessage_arena = NULL;
if (message_arena != submessage_arena) {
array_value = ::google::protobuf::internal::GetOwnedMessage(
message_arena, array_value, submessage_arena);
}
set_has_array_value();
value_type_.array_value_ = array_value;
}
// @@protoc_insertion_point(field_set_allocated:google.firestore.v1.Value.array_value)
}
void Value::set_allocated_map_value(::google::firestore::v1::MapValue* map_value) {
::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
clear_value_type();
if (map_value) {
::google::protobuf::Arena* submessage_arena = NULL;
if (message_arena != submessage_arena) {
map_value = ::google::protobuf::internal::GetOwnedMessage(
message_arena, map_value, submessage_arena);
}
set_has_map_value();
value_type_.map_value_ = map_value;
}
// @@protoc_insertion_point(field_set_allocated:google.firestore.v1.Value.map_value)
}
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int Value::kNullValueFieldNumber;
const int Value::kBooleanValueFieldNumber;
const int Value::kIntegerValueFieldNumber;
const int Value::kDoubleValueFieldNumber;
const int Value::kTimestampValueFieldNumber;
const int Value::kStringValueFieldNumber;
const int Value::kBytesValueFieldNumber;
const int Value::kReferenceValueFieldNumber;
const int Value::kGeoPointValueFieldNumber;
const int Value::kArrayValueFieldNumber;
const int Value::kMapValueFieldNumber;
#endif // !defined(_MSC_VER) || _MSC_VER >= 1900
Value::Value()
: ::google::protobuf::Message(), _internal_metadata_(NULL) {
if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
::protobuf_google_2ffirestore_2fv1_2fdocument_2eproto::InitDefaultsArrayValue();
}
SharedCtor();
// @@protoc_insertion_point(constructor:google.firestore.v1.Value)
}
Value::Value(const Value& from)
: ::google::protobuf::Message(),
_internal_metadata_(NULL),
_cached_size_(0) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
clear_has_value_type();
switch (from.value_type_case()) {
case kNullValue: {
set_null_value(from.null_value());
break;
}
case kBooleanValue: {
set_boolean_value(from.boolean_value());
break;
}
case kIntegerValue: {
set_integer_value(from.integer_value());
break;
}
case kDoubleValue: {
set_double_value(from.double_value());
break;
}
case kTimestampValue: {
mutable_timestamp_value()->::google::protobuf::Timestamp::MergeFrom(from.timestamp_value());
break;
}
case kStringValue: {
set_string_value(from.string_value());
break;
}
case kBytesValue: {
set_bytes_value(from.bytes_value());
break;
}
case kReferenceValue: {
set_reference_value(from.reference_value());
break;
}
case kGeoPointValue: {
mutable_geo_point_value()->::google::type::LatLng::MergeFrom(from.geo_point_value());
break;
}
case kArrayValue: {
mutable_array_value()->::google::firestore::v1::ArrayValue::MergeFrom(from.array_value());
break;
}
case kMapValue: {
mutable_map_value()->::google::firestore::v1::MapValue::MergeFrom(from.map_value());
break;
}
case VALUE_TYPE_NOT_SET: {
break;
}
}
// @@protoc_insertion_point(copy_constructor:google.firestore.v1.Value)
}
void Value::SharedCtor() {
clear_has_value_type();
_cached_size_ = 0;
}
Value::~Value() {
// @@protoc_insertion_point(destructor:google.firestore.v1.Value)
SharedDtor();
}
void Value::SharedDtor() {
if (has_value_type()) {
clear_value_type();
}
}
void Value::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* Value::descriptor() {
::protobuf_google_2ffirestore_2fv1_2fdocument_2eproto::protobuf_AssignDescriptorsOnce();
return ::protobuf_google_2ffirestore_2fv1_2fdocument_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
}
const Value& Value::default_instance() {
::protobuf_google_2ffirestore_2fv1_2fdocument_2eproto::InitDefaultsArrayValue();
return *internal_default_instance();
}
Value* Value::New(::google::protobuf::Arena* arena) const {
Value* n = new Value;
if (arena != NULL) {
arena->Own(n);
}
return n;
}
void Value::clear_value_type() {
// @@protoc_insertion_point(one_of_clear_start:google.firestore.v1.Value)
switch (value_type_case()) {
case kNullValue: {
// No need to clear
break;
}
case kBooleanValue: {
// No need to clear
break;
}
case kIntegerValue: {
// No need to clear
break;
}
case kDoubleValue: {
// No need to clear
break;
}
case kTimestampValue: {
delete value_type_.timestamp_value_;
break;
}
case kStringValue: {
value_type_.string_value_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
break;
}
case kBytesValue: {
value_type_.bytes_value_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
break;
}
case kReferenceValue: {
value_type_.reference_value_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
break;
}
case kGeoPointValue: {
delete value_type_.geo_point_value_;
break;
}
case kArrayValue: {
delete value_type_.array_value_;
break;
}
case kMapValue: {
delete value_type_.map_value_;
break;
}
case VALUE_TYPE_NOT_SET: {
break;
}
}
_oneof_case_[0] = VALUE_TYPE_NOT_SET;
}
void Value::Clear() {
// @@protoc_insertion_point(message_clear_start:google.firestore.v1.Value)
::google::protobuf::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
clear_value_type();
_internal_metadata_.Clear();
}
bool Value::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
::google::protobuf::uint32 tag;
// @@protoc_insertion_point(parse_start:google.firestore.v1.Value)
for (;;) {
::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(16383u);
tag = p.first;
if (!p.second) goto handle_unusual;
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// bool boolean_value = 1;
case 1: {
if (static_cast< ::google::protobuf::uint8>(tag) ==
static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
clear_value_type();
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
input, &value_type_.boolean_value_)));
set_has_boolean_value();
} else {
goto handle_unusual;
}
break;
}
// int64 integer_value = 2;
case 2: {
if (static_cast< ::google::protobuf::uint8>(tag) ==
static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
clear_value_type();
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
input, &value_type_.integer_value_)));
set_has_integer_value();
} else {
goto handle_unusual;
}
break;
}
// double double_value = 3;
case 3: {
if (static_cast< ::google::protobuf::uint8>(tag) ==
static_cast< ::google::protobuf::uint8>(25u /* 25 & 0xFF */)) {
clear_value_type();
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
input, &value_type_.double_value_)));
set_has_double_value();
} else {
goto handle_unusual;
}
break;
}
// string reference_value = 5;
case 5: {
if (static_cast< ::google::protobuf::uint8>(tag) ==
static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) {
DO_(::google::protobuf::internal::WireFormatLite::ReadString(
input, this->mutable_reference_value()));
DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
this->reference_value().data(), static_cast<int>(this->reference_value().length()),
::google::protobuf::internal::WireFormatLite::PARSE,
"google.firestore.v1.Value.reference_value"));
} else {
goto handle_unusual;
}
break;
}
// .google.firestore.v1.MapValue map_value = 6;
case 6: {
if (static_cast< ::google::protobuf::uint8>(tag) ==
static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) {
DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
input, mutable_map_value()));
} else {
goto handle_unusual;
}
break;
}
// .google.type.LatLng geo_point_value = 8;
case 8: {
if (static_cast< ::google::protobuf::uint8>(tag) ==
static_cast< ::google::protobuf::uint8>(66u /* 66 & 0xFF */)) {
DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
input, mutable_geo_point_value()));
} else {
goto handle_unusual;
}
break;
}
// .google.firestore.v1.ArrayValue array_value = 9;
case 9: {
if (static_cast< ::google::protobuf::uint8>(tag) ==
static_cast< ::google::protobuf::uint8>(74u /* 74 & 0xFF */)) {
DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
input, mutable_array_value()));
} else {
goto handle_unusual;
}
break;
}
// .google.protobuf.Timestamp timestamp_value = 10;
case 10: {
if (static_cast< ::google::protobuf::uint8>(tag) ==
static_cast< ::google::protobuf::uint8>(82u /* 82 & 0xFF */)) {
DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
input, mutable_timestamp_value()));
} else {
goto handle_unusual;
}
break;
}
// .google.protobuf.NullValue null_value = 11;
case 11: {
if (static_cast< ::google::protobuf::uint8>(tag) ==
static_cast< ::google::protobuf::uint8>(88u /* 88 & 0xFF */)) {
int value;
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
input, &value)));
set_null_value(static_cast< ::google::protobuf::NullValue >(value));
} else {
goto handle_unusual;
}
break;
}
// string string_value = 17;
case 17: {
if (static_cast< ::google::protobuf::uint8>(tag) ==
static_cast< ::google::protobuf::uint8>(138u /* 138 & 0xFF */)) {
DO_(::google::protobuf::internal::WireFormatLite::ReadString(
input, this->mutable_string_value()));
DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
this->string_value().data(), static_cast<int>(this->string_value().length()),
::google::protobuf::internal::WireFormatLite::PARSE,
"google.firestore.v1.Value.string_value"));
} else {
goto handle_unusual;
}
break;
}
// bytes bytes_value = 18;
case 18: {
if (static_cast< ::google::protobuf::uint8>(tag) ==
static_cast< ::google::protobuf::uint8>(146u /* 146 & 0xFF */)) {
DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
input, this->mutable_bytes_value()));
} else {
goto handle_unusual;
}
break;
}
default: {
handle_unusual:
if (tag == 0) {
goto success;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, _internal_metadata_.mutable_unknown_fields()));
break;
}
}
}
success:
// @@protoc_insertion_point(parse_success:google.firestore.v1.Value)
return true;
failure:
// @@protoc_insertion_point(parse_failure:google.firestore.v1.Value)
return false;
#undef DO_
}
void Value::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// @@protoc_insertion_point(serialize_start:google.firestore.v1.Value)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// bool boolean_value = 1;
if (has_boolean_value()) {
::google::protobuf::internal::WireFormatLite::WriteBool(1, this->boolean_value(), output);
}
// int64 integer_value = 2;
if (has_integer_value()) {
::google::protobuf::internal::WireFormatLite::WriteInt64(2, this->integer_value(), output);
}
// double double_value = 3;
if (has_double_value()) {
::google::protobuf::internal::WireFormatLite::WriteDouble(3, this->double_value(), output);
}
// string reference_value = 5;
if (has_reference_value()) {
::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
this->reference_value().data(), static_cast<int>(this->reference_value().length()),
::google::protobuf::internal::WireFormatLite::SERIALIZE,
"google.firestore.v1.Value.reference_value");
::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
5, this->reference_value(), output);
}
// .google.firestore.v1.MapValue map_value = 6;
if (has_map_value()) {
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
6, *value_type_.map_value_, output);
}
// .google.type.LatLng geo_point_value = 8;
if (has_geo_point_value()) {
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
8, *value_type_.geo_point_value_, output);
}
// .google.firestore.v1.ArrayValue array_value = 9;
if (has_array_value()) {
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
9, *value_type_.array_value_, output);
}
// .google.protobuf.Timestamp timestamp_value = 10;
if (has_timestamp_value()) {
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
10, *value_type_.timestamp_value_, output);
}
// .google.protobuf.NullValue null_value = 11;
if (has_null_value()) {
::google::protobuf::internal::WireFormatLite::WriteEnum(
11, this->null_value(), output);
}
// string string_value = 17;
if (has_string_value()) {
::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
this->string_value().data(), static_cast<int>(this->string_value().length()),
::google::protobuf::internal::WireFormatLite::SERIALIZE,
"google.firestore.v1.Value.string_value");
::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
17, this->string_value(), output);
}
// bytes bytes_value = 18;
if (has_bytes_value()) {
::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(
18, this->bytes_value(), output);
}
if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
(::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output);
}
// @@protoc_insertion_point(serialize_end:google.firestore.v1.Value)
}
::google::protobuf::uint8* Value::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
(void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:google.firestore.v1.Value)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// bool boolean_value = 1;
if (has_boolean_value()) {
target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(1, this->boolean_value(), target);
}
// int64 integer_value = 2;
if (has_integer_value()) {
target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(2, this->integer_value(), target);
}
// double double_value = 3;
if (has_double_value()) {
target = ::google::protobuf::internal::WireFormatLite::WriteDoubleToArray(3, this->double_value(), target);
}
// string reference_value = 5;
if (has_reference_value()) {
::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
this->reference_value().data(), static_cast<int>(this->reference_value().length()),
::google::protobuf::internal::WireFormatLite::SERIALIZE,
"google.firestore.v1.Value.reference_value");
target =
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
5, this->reference_value(), target);
}
// .google.firestore.v1.MapValue map_value = 6;
if (has_map_value()) {
target = ::google::protobuf::internal::WireFormatLite::
InternalWriteMessageToArray(
6, *value_type_.map_value_, deterministic, target);
}
// .google.type.LatLng geo_point_value = 8;
if (has_geo_point_value()) {
target = ::google::protobuf::internal::WireFormatLite::
InternalWriteMessageToArray(
8, *value_type_.geo_point_value_, deterministic, target);
}
// .google.firestore.v1.ArrayValue array_value = 9;
if (has_array_value()) {
target = ::google::protobuf::internal::WireFormatLite::
InternalWriteMessageToArray(
9, *value_type_.array_value_, deterministic, target);
}
// .google.protobuf.Timestamp timestamp_value = 10;
if (has_timestamp_value()) {
target = ::google::protobuf::internal::WireFormatLite::
InternalWriteMessageToArray(
10, *value_type_.timestamp_value_, deterministic, target);
}
// .google.protobuf.NullValue null_value = 11;
if (has_null_value()) {
target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
11, this->null_value(), target);
}
// string string_value = 17;
if (has_string_value()) {
::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
this->string_value().data(), static_cast<int>(this->string_value().length()),
::google::protobuf::internal::WireFormatLite::SERIALIZE,
"google.firestore.v1.Value.string_value");
target =
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
17, this->string_value(), target);
}
// bytes bytes_value = 18;
if (has_bytes_value()) {
target =
::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
18, this->bytes_value(), target);
}
if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
(::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target);
}
// @@protoc_insertion_point(serialize_to_array_end:google.firestore.v1.Value)
return target;
}
size_t Value::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:google.firestore.v1.Value)
size_t total_size = 0;
if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
(::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()));
}
switch (value_type_case()) {
// .google.protobuf.NullValue null_value = 11;
case kNullValue: {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::EnumSize(this->null_value());
break;
}
// bool boolean_value = 1;
case kBooleanValue: {
total_size += 1 + 1;
break;
}
// int64 integer_value = 2;
case kIntegerValue: {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::Int64Size(
this->integer_value());
break;
}
// double double_value = 3;
case kDoubleValue: {
total_size += 1 + 8;
break;
}
// .google.protobuf.Timestamp timestamp_value = 10;
case kTimestampValue: {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::MessageSize(
*value_type_.timestamp_value_);
break;
}
// string string_value = 17;
case kStringValue: {
total_size += 2 +
::google::protobuf::internal::WireFormatLite::StringSize(
this->string_value());
break;
}
// bytes bytes_value = 18;
case kBytesValue: {
total_size += 2 +
::google::protobuf::internal::WireFormatLite::BytesSize(
this->bytes_value());
break;
}
// string reference_value = 5;
case kReferenceValue: {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::StringSize(
this->reference_value());
break;
}
// .google.type.LatLng geo_point_value = 8;
case kGeoPointValue: {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::MessageSize(
*value_type_.geo_point_value_);
break;
}
// .google.firestore.v1.ArrayValue array_value = 9;
case kArrayValue: {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::MessageSize(
*value_type_.array_value_);
break;
}
// .google.firestore.v1.MapValue map_value = 6;
case kMapValue: {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::MessageSize(
*value_type_.map_value_);
break;
}
case VALUE_TYPE_NOT_SET: {
break;
}
}
int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = cached_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void Value::MergeFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:google.firestore.v1.Value)
GOOGLE_DCHECK_NE(&from, this);
const Value* source =
::google::protobuf::internal::DynamicCastToGenerated<const Value>(
&from);
if (source == NULL) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:google.firestore.v1.Value)
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:google.firestore.v1.Value)
MergeFrom(*source);
}
}
void Value::MergeFrom(const Value& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:google.firestore.v1.Value)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
switch (from.value_type_case()) {
case kNullValue: {
set_null_value(from.null_value());
break;
}
case kBooleanValue: {
set_boolean_value(from.boolean_value());
break;
}
case kIntegerValue: {
set_integer_value(from.integer_value());
break;
}
case kDoubleValue: {
set_double_value(from.double_value());
break;
}
case kTimestampValue: {
mutable_timestamp_value()->::google::protobuf::Timestamp::MergeFrom(from.timestamp_value());
break;
}
case kStringValue: {
set_string_value(from.string_value());
break;
}
case kBytesValue: {
set_bytes_value(from.bytes_value());
break;
}
case kReferenceValue: {
set_reference_value(from.reference_value());
break;
}
case kGeoPointValue: {
mutable_geo_point_value()->::google::type::LatLng::MergeFrom(from.geo_point_value());
break;
}
case kArrayValue: {
mutable_array_value()->::google::firestore::v1::ArrayValue::MergeFrom(from.array_value());
break;
}
case kMapValue: {
mutable_map_value()->::google::firestore::v1::MapValue::MergeFrom(from.map_value());
break;
}
case VALUE_TYPE_NOT_SET: {
break;
}
}
}
void Value::CopyFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:google.firestore.v1.Value)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void Value::CopyFrom(const Value& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:google.firestore.v1.Value)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool Value::IsInitialized() const {
return true;
}
void Value::Swap(Value* other) {
if (other == this) return;
InternalSwap(other);
}
void Value::InternalSwap(Value* other) {
using std::swap;
swap(value_type_, other->value_type_);
swap(_oneof_case_[0], other->_oneof_case_[0]);
_internal_metadata_.Swap(&other->_internal_metadata_);
swap(_cached_size_, other->_cached_size_);
}
::google::protobuf::Metadata Value::GetMetadata() const {
protobuf_google_2ffirestore_2fv1_2fdocument_2eproto::protobuf_AssignDescriptorsOnce();
return ::protobuf_google_2ffirestore_2fv1_2fdocument_2eproto::file_level_metadata[kIndexInFileMessages];
}
// ===================================================================
void ArrayValue::InitAsDefaultInstance() {
}
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int ArrayValue::kValuesFieldNumber;
#endif // !defined(_MSC_VER) || _MSC_VER >= 1900
ArrayValue::ArrayValue()
: ::google::protobuf::Message(), _internal_metadata_(NULL) {
if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
::protobuf_google_2ffirestore_2fv1_2fdocument_2eproto::InitDefaultsArrayValue();
}
SharedCtor();
// @@protoc_insertion_point(constructor:google.firestore.v1.ArrayValue)
}
ArrayValue::ArrayValue(const ArrayValue& from)
: ::google::protobuf::Message(),
_internal_metadata_(NULL),
values_(from.values_),
_cached_size_(0) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
// @@protoc_insertion_point(copy_constructor:google.firestore.v1.ArrayValue)
}
void ArrayValue::SharedCtor() {
_cached_size_ = 0;
}
ArrayValue::~ArrayValue() {
// @@protoc_insertion_point(destructor:google.firestore.v1.ArrayValue)
SharedDtor();
}
void ArrayValue::SharedDtor() {
}
void ArrayValue::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* ArrayValue::descriptor() {
::protobuf_google_2ffirestore_2fv1_2fdocument_2eproto::protobuf_AssignDescriptorsOnce();
return ::protobuf_google_2ffirestore_2fv1_2fdocument_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
}
const ArrayValue& ArrayValue::default_instance() {
::protobuf_google_2ffirestore_2fv1_2fdocument_2eproto::InitDefaultsArrayValue();
return *internal_default_instance();
}
ArrayValue* ArrayValue::New(::google::protobuf::Arena* arena) const {
ArrayValue* n = new ArrayValue;
if (arena != NULL) {
arena->Own(n);
}
return n;
}
void ArrayValue::Clear() {
// @@protoc_insertion_point(message_clear_start:google.firestore.v1.ArrayValue)
::google::protobuf::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
values_.Clear();
_internal_metadata_.Clear();
}
bool ArrayValue::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
::google::protobuf::uint32 tag;
// @@protoc_insertion_point(parse_start:google.firestore.v1.ArrayValue)
for (;;) {
::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
tag = p.first;
if (!p.second) goto handle_unusual;
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// repeated .google.firestore.v1.Value values = 1;
case 1: {
if (static_cast< ::google::protobuf::uint8>(tag) ==
static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_values()));
} else {
goto handle_unusual;
}
break;
}
default: {
handle_unusual:
if (tag == 0) {
goto success;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, _internal_metadata_.mutable_unknown_fields()));
break;
}
}
}
success:
// @@protoc_insertion_point(parse_success:google.firestore.v1.ArrayValue)
return true;
failure:
// @@protoc_insertion_point(parse_failure:google.firestore.v1.ArrayValue)
return false;
#undef DO_
}
void ArrayValue::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// @@protoc_insertion_point(serialize_start:google.firestore.v1.ArrayValue)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// repeated .google.firestore.v1.Value values = 1;
for (unsigned int i = 0,
n = static_cast<unsigned int>(this->values_size()); i < n; i++) {
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
1, this->values(static_cast<int>(i)), output);
}
if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
(::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output);
}
// @@protoc_insertion_point(serialize_end:google.firestore.v1.ArrayValue)
}
::google::protobuf::uint8* ArrayValue::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
(void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:google.firestore.v1.ArrayValue)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// repeated .google.firestore.v1.Value values = 1;
for (unsigned int i = 0,
n = static_cast<unsigned int>(this->values_size()); i < n; i++) {
target = ::google::protobuf::internal::WireFormatLite::
InternalWriteMessageToArray(
1, this->values(static_cast<int>(i)), deterministic, target);
}
if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
(::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target);
}
// @@protoc_insertion_point(serialize_to_array_end:google.firestore.v1.ArrayValue)
return target;
}
size_t ArrayValue::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:google.firestore.v1.ArrayValue)
size_t total_size = 0;
if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
(::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()));
}
// repeated .google.firestore.v1.Value values = 1;
{
unsigned int count = static_cast<unsigned int>(this->values_size());
total_size += 1UL * count;
for (unsigned int i = 0; i < count; i++) {
total_size +=
::google::protobuf::internal::WireFormatLite::MessageSize(
this->values(static_cast<int>(i)));
}
}
int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = cached_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void ArrayValue::MergeFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:google.firestore.v1.ArrayValue)
GOOGLE_DCHECK_NE(&from, this);
const ArrayValue* source =
::google::protobuf::internal::DynamicCastToGenerated<const ArrayValue>(
&from);
if (source == NULL) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:google.firestore.v1.ArrayValue)
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:google.firestore.v1.ArrayValue)
MergeFrom(*source);
}
}
void ArrayValue::MergeFrom(const ArrayValue& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:google.firestore.v1.ArrayValue)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
values_.MergeFrom(from.values_);
}
void ArrayValue::CopyFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:google.firestore.v1.ArrayValue)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void ArrayValue::CopyFrom(const ArrayValue& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:google.firestore.v1.ArrayValue)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool ArrayValue::IsInitialized() const {
return true;
}
void ArrayValue::Swap(ArrayValue* other) {
if (other == this) return;
InternalSwap(other);
}
void ArrayValue::InternalSwap(ArrayValue* other) {
using std::swap;
values_.InternalSwap(&other->values_);
_internal_metadata_.Swap(&other->_internal_metadata_);
swap(_cached_size_, other->_cached_size_);
}
::google::protobuf::Metadata ArrayValue::GetMetadata() const {
protobuf_google_2ffirestore_2fv1_2fdocument_2eproto::protobuf_AssignDescriptorsOnce();
return ::protobuf_google_2ffirestore_2fv1_2fdocument_2eproto::file_level_metadata[kIndexInFileMessages];
}
// ===================================================================
MapValue_FieldsEntry_DoNotUse::MapValue_FieldsEntry_DoNotUse() {}
MapValue_FieldsEntry_DoNotUse::MapValue_FieldsEntry_DoNotUse(::google::protobuf::Arena* arena) : SuperType(arena) {}
void MapValue_FieldsEntry_DoNotUse::MergeFrom(const MapValue_FieldsEntry_DoNotUse& other) {
MergeFromInternal(other);
}
::google::protobuf::Metadata MapValue_FieldsEntry_DoNotUse::GetMetadata() const {
::protobuf_google_2ffirestore_2fv1_2fdocument_2eproto::protobuf_AssignDescriptorsOnce();
return ::protobuf_google_2ffirestore_2fv1_2fdocument_2eproto::file_level_metadata[4];
}
void MapValue_FieldsEntry_DoNotUse::MergeFrom(
const ::google::protobuf::Message& other) {
::google::protobuf::Message::MergeFrom(other);
}
// ===================================================================
void MapValue::InitAsDefaultInstance() {
}
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int MapValue::kFieldsFieldNumber;
#endif // !defined(_MSC_VER) || _MSC_VER >= 1900
MapValue::MapValue()
: ::google::protobuf::Message(), _internal_metadata_(NULL) {
if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
::protobuf_google_2ffirestore_2fv1_2fdocument_2eproto::InitDefaultsArrayValue();
}
SharedCtor();
// @@protoc_insertion_point(constructor:google.firestore.v1.MapValue)
}
MapValue::MapValue(const MapValue& from)
: ::google::protobuf::Message(),
_internal_metadata_(NULL),
_cached_size_(0) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
fields_.MergeFrom(from.fields_);
// @@protoc_insertion_point(copy_constructor:google.firestore.v1.MapValue)
}
void MapValue::SharedCtor() {
_cached_size_ = 0;
}
MapValue::~MapValue() {
// @@protoc_insertion_point(destructor:google.firestore.v1.MapValue)
SharedDtor();
}
void MapValue::SharedDtor() {
}
void MapValue::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* MapValue::descriptor() {
::protobuf_google_2ffirestore_2fv1_2fdocument_2eproto::protobuf_AssignDescriptorsOnce();
return ::protobuf_google_2ffirestore_2fv1_2fdocument_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
}
const MapValue& MapValue::default_instance() {
::protobuf_google_2ffirestore_2fv1_2fdocument_2eproto::InitDefaultsArrayValue();
return *internal_default_instance();
}
MapValue* MapValue::New(::google::protobuf::Arena* arena) const {
MapValue* n = new MapValue;
if (arena != NULL) {
arena->Own(n);
}
return n;
}
void MapValue::Clear() {
// @@protoc_insertion_point(message_clear_start:google.firestore.v1.MapValue)
::google::protobuf::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
fields_.Clear();
_internal_metadata_.Clear();
}
bool MapValue::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
::google::protobuf::uint32 tag;
// @@protoc_insertion_point(parse_start:google.firestore.v1.MapValue)
for (;;) {
::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
tag = p.first;
if (!p.second) goto handle_unusual;
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// map<string, .google.firestore.v1.Value> fields = 1;
case 1: {
if (static_cast< ::google::protobuf::uint8>(tag) ==
static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
MapValue_FieldsEntry_DoNotUse::Parser< ::google::protobuf::internal::MapField<
MapValue_FieldsEntry_DoNotUse,
::std::string, ::google::firestore::v1::Value,
::google::protobuf::internal::WireFormatLite::TYPE_STRING,
::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE,
0 >,
::google::protobuf::Map< ::std::string, ::google::firestore::v1::Value > > parser(&fields_);
DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
input, &parser));
DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
parser.key().data(), static_cast<int>(parser.key().length()),
::google::protobuf::internal::WireFormatLite::PARSE,
"google.firestore.v1.MapValue.FieldsEntry.key"));
} else {
goto handle_unusual;
}
break;
}
default: {
handle_unusual:
if (tag == 0) {
goto success;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, _internal_metadata_.mutable_unknown_fields()));
break;
}
}
}
success:
// @@protoc_insertion_point(parse_success:google.firestore.v1.MapValue)
return true;
failure:
// @@protoc_insertion_point(parse_failure:google.firestore.v1.MapValue)
return false;
#undef DO_
}
void MapValue::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// @@protoc_insertion_point(serialize_start:google.firestore.v1.MapValue)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// map<string, .google.firestore.v1.Value> fields = 1;
if (!this->fields().empty()) {
typedef ::google::protobuf::Map< ::std::string, ::google::firestore::v1::Value >::const_pointer
ConstPtr;
typedef ConstPtr SortItem;
typedef ::google::protobuf::internal::CompareByDerefFirst<SortItem> Less;
struct Utf8Check {
static void Check(ConstPtr p) {
::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
p->first.data(), static_cast<int>(p->first.length()),
::google::protobuf::internal::WireFormatLite::SERIALIZE,
"google.firestore.v1.MapValue.FieldsEntry.key");
}
};
if (output->IsSerializationDeterministic() &&
this->fields().size() > 1) {
::google::protobuf::scoped_array<SortItem> items(
new SortItem[this->fields().size()]);
typedef ::google::protobuf::Map< ::std::string, ::google::firestore::v1::Value >::size_type size_type;
size_type n = 0;
for (::google::protobuf::Map< ::std::string, ::google::firestore::v1::Value >::const_iterator
it = this->fields().begin();
it != this->fields().end(); ++it, ++n) {
items[static_cast<ptrdiff_t>(n)] = SortItem(&*it);
}
::std::sort(&items[0], &items[static_cast<ptrdiff_t>(n)], Less());
::google::protobuf::scoped_ptr<MapValue_FieldsEntry_DoNotUse> entry;
for (size_type i = 0; i < n; i++) {
entry.reset(fields_.NewEntryWrapper(
items[static_cast<ptrdiff_t>(i)]->first, items[static_cast<ptrdiff_t>(i)]->second));
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
1, *entry, output);
Utf8Check::Check(items[static_cast<ptrdiff_t>(i)]);
}
} else {
::google::protobuf::scoped_ptr<MapValue_FieldsEntry_DoNotUse> entry;
for (::google::protobuf::Map< ::std::string, ::google::firestore::v1::Value >::const_iterator
it = this->fields().begin();
it != this->fields().end(); ++it) {
entry.reset(fields_.NewEntryWrapper(
it->first, it->second));
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
1, *entry, output);
Utf8Check::Check(&*it);
}
}
}
if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
(::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output);
}
// @@protoc_insertion_point(serialize_end:google.firestore.v1.MapValue)
}
::google::protobuf::uint8* MapValue::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
(void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:google.firestore.v1.MapValue)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// map<string, .google.firestore.v1.Value> fields = 1;
if (!this->fields().empty()) {
typedef ::google::protobuf::Map< ::std::string, ::google::firestore::v1::Value >::const_pointer
ConstPtr;
typedef ConstPtr SortItem;
typedef ::google::protobuf::internal::CompareByDerefFirst<SortItem> Less;
struct Utf8Check {
static void Check(ConstPtr p) {
::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
p->first.data(), static_cast<int>(p->first.length()),
::google::protobuf::internal::WireFormatLite::SERIALIZE,
"google.firestore.v1.MapValue.FieldsEntry.key");
}
};
if (deterministic &&
this->fields().size() > 1) {
::google::protobuf::scoped_array<SortItem> items(
new SortItem[this->fields().size()]);
typedef ::google::protobuf::Map< ::std::string, ::google::firestore::v1::Value >::size_type size_type;
size_type n = 0;
for (::google::protobuf::Map< ::std::string, ::google::firestore::v1::Value >::const_iterator
it = this->fields().begin();
it != this->fields().end(); ++it, ++n) {
items[static_cast<ptrdiff_t>(n)] = SortItem(&*it);
}
::std::sort(&items[0], &items[static_cast<ptrdiff_t>(n)], Less());
::google::protobuf::scoped_ptr<MapValue_FieldsEntry_DoNotUse> entry;
for (size_type i = 0; i < n; i++) {
entry.reset(fields_.NewEntryWrapper(
items[static_cast<ptrdiff_t>(i)]->first, items[static_cast<ptrdiff_t>(i)]->second));
target = ::google::protobuf::internal::WireFormatLite::
InternalWriteMessageNoVirtualToArray(
1, *entry, deterministic, target);
;
Utf8Check::Check(items[static_cast<ptrdiff_t>(i)]);
}
} else {
::google::protobuf::scoped_ptr<MapValue_FieldsEntry_DoNotUse> entry;
for (::google::protobuf::Map< ::std::string, ::google::firestore::v1::Value >::const_iterator
it = this->fields().begin();
it != this->fields().end(); ++it) {
entry.reset(fields_.NewEntryWrapper(
it->first, it->second));
target = ::google::protobuf::internal::WireFormatLite::
InternalWriteMessageNoVirtualToArray(
1, *entry, deterministic, target);
;
Utf8Check::Check(&*it);
}
}
}
if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
(::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target);
}
// @@protoc_insertion_point(serialize_to_array_end:google.firestore.v1.MapValue)
return target;
}
size_t MapValue::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:google.firestore.v1.MapValue)
size_t total_size = 0;
if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
(::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()));
}
// map<string, .google.firestore.v1.Value> fields = 1;
total_size += 1 *
::google::protobuf::internal::FromIntSize(this->fields_size());
{
::google::protobuf::scoped_ptr<MapValue_FieldsEntry_DoNotUse> entry;
for (::google::protobuf::Map< ::std::string, ::google::firestore::v1::Value >::const_iterator
it = this->fields().begin();
it != this->fields().end(); ++it) {
entry.reset(fields_.NewEntryWrapper(it->first, it->second));
total_size += ::google::protobuf::internal::WireFormatLite::
MessageSizeNoVirtual(*entry);
}
}
int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = cached_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void MapValue::MergeFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:google.firestore.v1.MapValue)
GOOGLE_DCHECK_NE(&from, this);
const MapValue* source =
::google::protobuf::internal::DynamicCastToGenerated<const MapValue>(
&from);
if (source == NULL) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:google.firestore.v1.MapValue)
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:google.firestore.v1.MapValue)
MergeFrom(*source);
}
}
void MapValue::MergeFrom(const MapValue& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:google.firestore.v1.MapValue)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
fields_.MergeFrom(from.fields_);
}
void MapValue::CopyFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:google.firestore.v1.MapValue)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void MapValue::CopyFrom(const MapValue& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:google.firestore.v1.MapValue)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool MapValue::IsInitialized() const {
return true;
}
void MapValue::Swap(MapValue* other) {
if (other == this) return;
InternalSwap(other);
}
void MapValue::InternalSwap(MapValue* other) {
using std::swap;
fields_.Swap(&other->fields_);
_internal_metadata_.Swap(&other->_internal_metadata_);
swap(_cached_size_, other->_cached_size_);
}
::google::protobuf::Metadata MapValue::GetMetadata() const {
protobuf_google_2ffirestore_2fv1_2fdocument_2eproto::protobuf_AssignDescriptorsOnce();
return ::protobuf_google_2ffirestore_2fv1_2fdocument_2eproto::file_level_metadata[kIndexInFileMessages];
}
// @@protoc_insertion_point(namespace_scope)
} // namespace v1
} // namespace firestore
} // namespace google
// @@protoc_insertion_point(global_scope)