123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407 |
- // Generated by the protocol buffer compiler. DO NOT EDIT!
- // source: google/protobuf/unittest_preserve_unknown_enum.proto
- #include <google/protobuf/unittest_preserve_unknown_enum.pb.h>
- #include <algorithm>
- #include <google/protobuf/stubs/common.h>
- #include <google/protobuf/stubs/port.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 proto3_preserve_unknown_enum_unittest {
- class MyMessageDefaultTypeInternal {
- public:
- ::google::protobuf::internal::ExplicitlyConstructed<MyMessage>
- _instance;
- int oneof_e_1_;
- int oneof_e_2_;
- } _MyMessage_default_instance_;
- class MyMessagePlusExtraDefaultTypeInternal {
- public:
- ::google::protobuf::internal::ExplicitlyConstructed<MyMessagePlusExtra>
- _instance;
- int oneof_e_1_;
- int oneof_e_2_;
- } _MyMessagePlusExtra_default_instance_;
- } // namespace proto3_preserve_unknown_enum_unittest
- namespace protobuf_google_2fprotobuf_2funittest_5fpreserve_5funknown_5fenum_2eproto {
- static void InitDefaultsMyMessage() {
- GOOGLE_PROTOBUF_VERIFY_VERSION;
- {
- void* ptr = &::proto3_preserve_unknown_enum_unittest::_MyMessage_default_instance_;
- new (ptr) ::proto3_preserve_unknown_enum_unittest::MyMessage();
- ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
- }
- ::proto3_preserve_unknown_enum_unittest::MyMessage::InitAsDefaultInstance();
- }
- ::google::protobuf::internal::SCCInfo<0> scc_info_MyMessage =
- {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsMyMessage}, {}};
- static void InitDefaultsMyMessagePlusExtra() {
- GOOGLE_PROTOBUF_VERIFY_VERSION;
- {
- void* ptr = &::proto3_preserve_unknown_enum_unittest::_MyMessagePlusExtra_default_instance_;
- new (ptr) ::proto3_preserve_unknown_enum_unittest::MyMessagePlusExtra();
- ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
- }
- ::proto3_preserve_unknown_enum_unittest::MyMessagePlusExtra::InitAsDefaultInstance();
- }
- ::google::protobuf::internal::SCCInfo<0> scc_info_MyMessagePlusExtra =
- {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsMyMessagePlusExtra}, {}};
- void InitDefaults() {
- ::google::protobuf::internal::InitSCC(&scc_info_MyMessage.base);
- ::google::protobuf::internal::InitSCC(&scc_info_MyMessagePlusExtra.base);
- }
- ::google::protobuf::Metadata file_level_metadata[2];
- const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors[2];
- const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
- ~0u, // no _has_bits_
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_preserve_unknown_enum_unittest::MyMessage, _internal_metadata_),
- ~0u, // no _extensions_
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_preserve_unknown_enum_unittest::MyMessage, _oneof_case_[0]),
- ~0u, // no _weak_field_map_
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_preserve_unknown_enum_unittest::MyMessage, e_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_preserve_unknown_enum_unittest::MyMessage, repeated_e_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_preserve_unknown_enum_unittest::MyMessage, repeated_packed_e_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_preserve_unknown_enum_unittest::MyMessage, repeated_packed_unexpected_e_),
- offsetof(::proto3_preserve_unknown_enum_unittest::MyMessageDefaultTypeInternal, oneof_e_1_),
- offsetof(::proto3_preserve_unknown_enum_unittest::MyMessageDefaultTypeInternal, oneof_e_2_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_preserve_unknown_enum_unittest::MyMessage, o_),
- ~0u, // no _has_bits_
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_preserve_unknown_enum_unittest::MyMessagePlusExtra, _internal_metadata_),
- ~0u, // no _extensions_
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_preserve_unknown_enum_unittest::MyMessagePlusExtra, _oneof_case_[0]),
- ~0u, // no _weak_field_map_
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_preserve_unknown_enum_unittest::MyMessagePlusExtra, e_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_preserve_unknown_enum_unittest::MyMessagePlusExtra, repeated_e_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_preserve_unknown_enum_unittest::MyMessagePlusExtra, repeated_packed_e_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_preserve_unknown_enum_unittest::MyMessagePlusExtra, repeated_packed_unexpected_e_),
- offsetof(::proto3_preserve_unknown_enum_unittest::MyMessagePlusExtraDefaultTypeInternal, oneof_e_1_),
- offsetof(::proto3_preserve_unknown_enum_unittest::MyMessagePlusExtraDefaultTypeInternal, oneof_e_2_),
- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::proto3_preserve_unknown_enum_unittest::MyMessagePlusExtra, o_),
- };
- static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
- { 0, -1, sizeof(::proto3_preserve_unknown_enum_unittest::MyMessage)},
- { 12, -1, sizeof(::proto3_preserve_unknown_enum_unittest::MyMessagePlusExtra)},
- };
- static ::google::protobuf::Message const * const file_default_instances[] = {
- reinterpret_cast<const ::google::protobuf::Message*>(&::proto3_preserve_unknown_enum_unittest::_MyMessage_default_instance_),
- reinterpret_cast<const ::google::protobuf::Message*>(&::proto3_preserve_unknown_enum_unittest::_MyMessagePlusExtra_default_instance_),
- };
- void protobuf_AssignDescriptors() {
- AddDescriptors();
- AssignDescriptors(
- "google/protobuf/unittest_preserve_unknown_enum.proto", schemas, file_default_instances, TableStruct::offsets,
- file_level_metadata, file_level_enum_descriptors, NULL);
- }
- void protobuf_AssignDescriptorsOnce() {
- static ::google::protobuf::internal::once_flag once;
- ::google::protobuf::internal::call_once(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, 2);
- }
- void AddDescriptorsImpl() {
- InitDefaults();
- static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
- "\n4google/protobuf/unittest_preserve_unkn"
- "own_enum.proto\022%proto3_preserve_unknown_"
- "enum_unittest\"\301\003\n\tMyMessage\0228\n\001e\030\001 \001(\0162-"
- ".proto3_preserve_unknown_enum_unittest.M"
- "yEnum\022A\n\nrepeated_e\030\002 \003(\0162-.proto3_prese"
- "rve_unknown_enum_unittest.MyEnum\022L\n\021repe"
- "ated_packed_e\030\003 \003(\0162-.proto3_preserve_un"
- "known_enum_unittest.MyEnumB\002\020\001\022\\\n\034repeat"
- "ed_packed_unexpected_e\030\004 \003(\01626.proto3_pr"
- "eserve_unknown_enum_unittest.MyEnumPlusE"
- "xtra\022B\n\toneof_e_1\030\005 \001(\0162-.proto3_preserv"
- "e_unknown_enum_unittest.MyEnumH\000\022B\n\toneo"
- "f_e_2\030\006 \001(\0162-.proto3_preserve_unknown_en"
- "um_unittest.MyEnumH\000B\003\n\001o\"\373\003\n\022MyMessageP"
- "lusExtra\022A\n\001e\030\001 \001(\01626.proto3_preserve_un"
- "known_enum_unittest.MyEnumPlusExtra\022J\n\nr"
- "epeated_e\030\002 \003(\01626.proto3_preserve_unknow"
- "n_enum_unittest.MyEnumPlusExtra\022U\n\021repea"
- "ted_packed_e\030\003 \003(\01626.proto3_preserve_unk"
- "nown_enum_unittest.MyEnumPlusExtraB\002\020\001\022`"
- "\n\034repeated_packed_unexpected_e\030\004 \003(\01626.p"
- "roto3_preserve_unknown_enum_unittest.MyE"
- "numPlusExtraB\002\020\001\022K\n\toneof_e_1\030\005 \001(\01626.pr"
- "oto3_preserve_unknown_enum_unittest.MyEn"
- "umPlusExtraH\000\022K\n\toneof_e_2\030\006 \001(\01626.proto"
- "3_preserve_unknown_enum_unittest.MyEnumP"
- "lusExtraH\000B\003\n\001o*#\n\006MyEnum\022\007\n\003FOO\020\000\022\007\n\003BA"
- "R\020\001\022\007\n\003BAZ\020\002*\?\n\017MyEnumPlusExtra\022\t\n\005E_FOO"
- "\020\000\022\t\n\005E_BAR\020\001\022\t\n\005E_BAZ\020\002\022\013\n\007E_EXTRA\020\003B,\242"
- "\002\014UnknownEnums\252\002\032Google.Protobuf.TestPro"
- "tosb\006proto3"
- };
- ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
- descriptor, 1211);
- ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
- "google/protobuf/unittest_preserve_unknown_enum.proto", &protobuf_RegisterTypes);
- }
- void AddDescriptors() {
- static ::google::protobuf::internal::once_flag once;
- ::google::protobuf::internal::call_once(once, AddDescriptorsImpl);
- }
- // Force AddDescriptors() to be called at dynamic initialization time.
- struct StaticDescriptorInitializer {
- StaticDescriptorInitializer() {
- AddDescriptors();
- }
- } static_descriptor_initializer;
- } // namespace protobuf_google_2fprotobuf_2funittest_5fpreserve_5funknown_5fenum_2eproto
- namespace proto3_preserve_unknown_enum_unittest {
- const ::google::protobuf::EnumDescriptor* MyEnum_descriptor() {
- protobuf_google_2fprotobuf_2funittest_5fpreserve_5funknown_5fenum_2eproto::protobuf_AssignDescriptorsOnce();
- return protobuf_google_2fprotobuf_2funittest_5fpreserve_5funknown_5fenum_2eproto::file_level_enum_descriptors[0];
- }
- bool MyEnum_IsValid(int value) {
- switch (value) {
- case 0:
- case 1:
- case 2:
- return true;
- default:
- return false;
- }
- }
- const ::google::protobuf::EnumDescriptor* MyEnumPlusExtra_descriptor() {
- protobuf_google_2fprotobuf_2funittest_5fpreserve_5funknown_5fenum_2eproto::protobuf_AssignDescriptorsOnce();
- return protobuf_google_2fprotobuf_2funittest_5fpreserve_5funknown_5fenum_2eproto::file_level_enum_descriptors[1];
- }
- bool MyEnumPlusExtra_IsValid(int value) {
- switch (value) {
- case 0:
- case 1:
- case 2:
- case 3:
- return true;
- default:
- return false;
- }
- }
- // ===================================================================
- void MyMessage::InitAsDefaultInstance() {
- ::proto3_preserve_unknown_enum_unittest::_MyMessage_default_instance_.oneof_e_1_ = 0;
- ::proto3_preserve_unknown_enum_unittest::_MyMessage_default_instance_.oneof_e_2_ = 0;
- }
- #if !defined(_MSC_VER) || _MSC_VER >= 1900
- const int MyMessage::kEFieldNumber;
- const int MyMessage::kRepeatedEFieldNumber;
- const int MyMessage::kRepeatedPackedEFieldNumber;
- const int MyMessage::kRepeatedPackedUnexpectedEFieldNumber;
- const int MyMessage::kOneofE1FieldNumber;
- const int MyMessage::kOneofE2FieldNumber;
- #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
- MyMessage::MyMessage()
- : ::google::protobuf::Message(), _internal_metadata_(NULL) {
- ::google::protobuf::internal::InitSCC(
- &protobuf_google_2fprotobuf_2funittest_5fpreserve_5funknown_5fenum_2eproto::scc_info_MyMessage.base);
- SharedCtor();
- // @@protoc_insertion_point(constructor:proto3_preserve_unknown_enum_unittest.MyMessage)
- }
- MyMessage::MyMessage(const MyMessage& from)
- : ::google::protobuf::Message(),
- _internal_metadata_(NULL),
- repeated_e_(from.repeated_e_),
- repeated_packed_e_(from.repeated_packed_e_),
- repeated_packed_unexpected_e_(from.repeated_packed_unexpected_e_) {
- _internal_metadata_.MergeFrom(from._internal_metadata_);
- e_ = from.e_;
- clear_has_o();
- switch (from.o_case()) {
- case kOneofE1: {
- set_oneof_e_1(from.oneof_e_1());
- break;
- }
- case kOneofE2: {
- set_oneof_e_2(from.oneof_e_2());
- break;
- }
- case O_NOT_SET: {
- break;
- }
- }
- // @@protoc_insertion_point(copy_constructor:proto3_preserve_unknown_enum_unittest.MyMessage)
- }
- void MyMessage::SharedCtor() {
- e_ = 0;
- clear_has_o();
- }
- MyMessage::~MyMessage() {
- // @@protoc_insertion_point(destructor:proto3_preserve_unknown_enum_unittest.MyMessage)
- SharedDtor();
- }
- void MyMessage::SharedDtor() {
- if (has_o()) {
- clear_o();
- }
- }
- void MyMessage::SetCachedSize(int size) const {
- _cached_size_.Set(size);
- }
- const ::google::protobuf::Descriptor* MyMessage::descriptor() {
- ::protobuf_google_2fprotobuf_2funittest_5fpreserve_5funknown_5fenum_2eproto::protobuf_AssignDescriptorsOnce();
- return ::protobuf_google_2fprotobuf_2funittest_5fpreserve_5funknown_5fenum_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
- }
- const MyMessage& MyMessage::default_instance() {
- ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2funittest_5fpreserve_5funknown_5fenum_2eproto::scc_info_MyMessage.base);
- return *internal_default_instance();
- }
- void MyMessage::clear_o() {
- // @@protoc_insertion_point(one_of_clear_start:proto3_preserve_unknown_enum_unittest.MyMessage)
- switch (o_case()) {
- case kOneofE1: {
- // No need to clear
- break;
- }
- case kOneofE2: {
- // No need to clear
- break;
- }
- case O_NOT_SET: {
- break;
- }
- }
- _oneof_case_[0] = O_NOT_SET;
- }
- void MyMessage::Clear() {
- // @@protoc_insertion_point(message_clear_start:proto3_preserve_unknown_enum_unittest.MyMessage)
- ::google::protobuf::uint32 cached_has_bits = 0;
- // Prevent compiler warnings about cached_has_bits being unused
- (void) cached_has_bits;
- repeated_e_.Clear();
- repeated_packed_e_.Clear();
- repeated_packed_unexpected_e_.Clear();
- e_ = 0;
- clear_o();
- _internal_metadata_.Clear();
- }
- bool MyMessage::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:proto3_preserve_unknown_enum_unittest.MyMessage)
- 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)) {
- // .proto3_preserve_unknown_enum_unittest.MyEnum e = 1;
- case 1: {
- if (static_cast< ::google::protobuf::uint8>(tag) ==
- static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
- int value;
- DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
- int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
- input, &value)));
- set_e(static_cast< ::proto3_preserve_unknown_enum_unittest::MyEnum >(value));
- } else {
- goto handle_unusual;
- }
- break;
- }
- // repeated .proto3_preserve_unknown_enum_unittest.MyEnum repeated_e = 2;
- case 2: {
- if (static_cast< ::google::protobuf::uint8>(tag) ==
- static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
- ::google::protobuf::uint32 length;
- DO_(input->ReadVarint32(&length));
- ::google::protobuf::io::CodedInputStream::Limit limit = input->PushLimit(static_cast<int>(length));
- while (input->BytesUntilLimit() > 0) {
- int value;
- DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
- int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
- input, &value)));
- add_repeated_e(static_cast< ::proto3_preserve_unknown_enum_unittest::MyEnum >(value));
- }
- input->PopLimit(limit);
- } else if (
- static_cast< ::google::protobuf::uint8>(tag) ==
- static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
- int value;
- DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
- int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
- input, &value)));
- add_repeated_e(static_cast< ::proto3_preserve_unknown_enum_unittest::MyEnum >(value));
- } else {
- goto handle_unusual;
- }
- break;
- }
- // repeated .proto3_preserve_unknown_enum_unittest.MyEnum repeated_packed_e = 3 [packed = true];
- case 3: {
- if (static_cast< ::google::protobuf::uint8>(tag) ==
- static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
- ::google::protobuf::uint32 length;
- DO_(input->ReadVarint32(&length));
- ::google::protobuf::io::CodedInputStream::Limit limit = input->PushLimit(static_cast<int>(length));
- while (input->BytesUntilLimit() > 0) {
- int value;
- DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
- int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
- input, &value)));
- add_repeated_packed_e(static_cast< ::proto3_preserve_unknown_enum_unittest::MyEnum >(value));
- }
- input->PopLimit(limit);
- } else if (
- static_cast< ::google::protobuf::uint8>(tag) ==
- static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) {
- int value;
- DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
- int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
- input, &value)));
- add_repeated_packed_e(static_cast< ::proto3_preserve_unknown_enum_unittest::MyEnum >(value));
- } else {
- goto handle_unusual;
- }
- break;
- }
- // repeated .proto3_preserve_unknown_enum_unittest.MyEnumPlusExtra repeated_packed_unexpected_e = 4;
- case 4: {
- if (static_cast< ::google::protobuf::uint8>(tag) ==
- static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) {
- ::google::protobuf::uint32 length;
- DO_(input->ReadVarint32(&length));
- ::google::protobuf::io::CodedInputStream::Limit limit = input->PushLimit(static_cast<int>(length));
- while (input->BytesUntilLimit() > 0) {
- int value;
- DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
- int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
- input, &value)));
- add_repeated_packed_unexpected_e(static_cast< ::proto3_preserve_unknown_enum_unittest::MyEnumPlusExtra >(value));
- }
- input->PopLimit(limit);
- } else if (
- static_cast< ::google::protobuf::uint8>(tag) ==
- static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) {
- int value;
- DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
- int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
- input, &value)));
- add_repeated_packed_unexpected_e(static_cast< ::proto3_preserve_unknown_enum_unittest::MyEnumPlusExtra >(value));
- } else {
- goto handle_unusual;
- }
- break;
- }
- // .proto3_preserve_unknown_enum_unittest.MyEnum oneof_e_1 = 5;
- case 5: {
- if (static_cast< ::google::protobuf::uint8>(tag) ==
- static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) {
- int value;
- DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
- int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
- input, &value)));
- set_oneof_e_1(static_cast< ::proto3_preserve_unknown_enum_unittest::MyEnum >(value));
- } else {
- goto handle_unusual;
- }
- break;
- }
- // .proto3_preserve_unknown_enum_unittest.MyEnum oneof_e_2 = 6;
- case 6: {
- if (static_cast< ::google::protobuf::uint8>(tag) ==
- static_cast< ::google::protobuf::uint8>(48u /* 48 & 0xFF */)) {
- int value;
- DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
- int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
- input, &value)));
- set_oneof_e_2(static_cast< ::proto3_preserve_unknown_enum_unittest::MyEnum >(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:proto3_preserve_unknown_enum_unittest.MyMessage)
- return true;
- failure:
- // @@protoc_insertion_point(parse_failure:proto3_preserve_unknown_enum_unittest.MyMessage)
- return false;
- #undef DO_
- }
- void MyMessage::SerializeWithCachedSizes(
- ::google::protobuf::io::CodedOutputStream* output) const {
- // @@protoc_insertion_point(serialize_start:proto3_preserve_unknown_enum_unittest.MyMessage)
- ::google::protobuf::uint32 cached_has_bits = 0;
- (void) cached_has_bits;
- // .proto3_preserve_unknown_enum_unittest.MyEnum e = 1;
- if (this->e() != 0) {
- ::google::protobuf::internal::WireFormatLite::WriteEnum(
- 1, this->e(), output);
- }
- // repeated .proto3_preserve_unknown_enum_unittest.MyEnum repeated_e = 2;
- if (this->repeated_e_size() > 0) {
- ::google::protobuf::internal::WireFormatLite::WriteTag(
- 2,
- ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
- output);
- output->WriteVarint32(
- static_cast< ::google::protobuf::uint32>(_repeated_e_cached_byte_size_));
- }
- for (int i = 0, n = this->repeated_e_size(); i < n; i++) {
- ::google::protobuf::internal::WireFormatLite::WriteEnumNoTag(
- this->repeated_e(i), output);
- }
- // repeated .proto3_preserve_unknown_enum_unittest.MyEnum repeated_packed_e = 3 [packed = true];
- if (this->repeated_packed_e_size() > 0) {
- ::google::protobuf::internal::WireFormatLite::WriteTag(
- 3,
- ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
- output);
- output->WriteVarint32(
- static_cast< ::google::protobuf::uint32>(_repeated_packed_e_cached_byte_size_));
- }
- for (int i = 0, n = this->repeated_packed_e_size(); i < n; i++) {
- ::google::protobuf::internal::WireFormatLite::WriteEnumNoTag(
- this->repeated_packed_e(i), output);
- }
- // repeated .proto3_preserve_unknown_enum_unittest.MyEnumPlusExtra repeated_packed_unexpected_e = 4;
- if (this->repeated_packed_unexpected_e_size() > 0) {
- ::google::protobuf::internal::WireFormatLite::WriteTag(
- 4,
- ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
- output);
- output->WriteVarint32(
- static_cast< ::google::protobuf::uint32>(_repeated_packed_unexpected_e_cached_byte_size_));
- }
- for (int i = 0, n = this->repeated_packed_unexpected_e_size(); i < n; i++) {
- ::google::protobuf::internal::WireFormatLite::WriteEnumNoTag(
- this->repeated_packed_unexpected_e(i), output);
- }
- // .proto3_preserve_unknown_enum_unittest.MyEnum oneof_e_1 = 5;
- if (has_oneof_e_1()) {
- ::google::protobuf::internal::WireFormatLite::WriteEnum(
- 5, this->oneof_e_1(), output);
- }
- // .proto3_preserve_unknown_enum_unittest.MyEnum oneof_e_2 = 6;
- if (has_oneof_e_2()) {
- ::google::protobuf::internal::WireFormatLite::WriteEnum(
- 6, this->oneof_e_2(), 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:proto3_preserve_unknown_enum_unittest.MyMessage)
- }
- ::google::protobuf::uint8* MyMessage::InternalSerializeWithCachedSizesToArray(
- bool deterministic, ::google::protobuf::uint8* target) const {
- (void)deterministic; // Unused
- // @@protoc_insertion_point(serialize_to_array_start:proto3_preserve_unknown_enum_unittest.MyMessage)
- ::google::protobuf::uint32 cached_has_bits = 0;
- (void) cached_has_bits;
- // .proto3_preserve_unknown_enum_unittest.MyEnum e = 1;
- if (this->e() != 0) {
- target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
- 1, this->e(), target);
- }
- // repeated .proto3_preserve_unknown_enum_unittest.MyEnum repeated_e = 2;
- if (this->repeated_e_size() > 0) {
- target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
- 2,
- ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
- target);
- target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( static_cast< ::google::protobuf::uint32>(
- _repeated_e_cached_byte_size_), target);
- target = ::google::protobuf::internal::WireFormatLite::WriteEnumNoTagToArray(
- this->repeated_e_, target);
- }
- // repeated .proto3_preserve_unknown_enum_unittest.MyEnum repeated_packed_e = 3 [packed = true];
- if (this->repeated_packed_e_size() > 0) {
- target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
- 3,
- ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
- target);
- target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( static_cast< ::google::protobuf::uint32>(
- _repeated_packed_e_cached_byte_size_), target);
- target = ::google::protobuf::internal::WireFormatLite::WriteEnumNoTagToArray(
- this->repeated_packed_e_, target);
- }
- // repeated .proto3_preserve_unknown_enum_unittest.MyEnumPlusExtra repeated_packed_unexpected_e = 4;
- if (this->repeated_packed_unexpected_e_size() > 0) {
- target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
- 4,
- ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
- target);
- target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( static_cast< ::google::protobuf::uint32>(
- _repeated_packed_unexpected_e_cached_byte_size_), target);
- target = ::google::protobuf::internal::WireFormatLite::WriteEnumNoTagToArray(
- this->repeated_packed_unexpected_e_, target);
- }
- // .proto3_preserve_unknown_enum_unittest.MyEnum oneof_e_1 = 5;
- if (has_oneof_e_1()) {
- target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
- 5, this->oneof_e_1(), target);
- }
- // .proto3_preserve_unknown_enum_unittest.MyEnum oneof_e_2 = 6;
- if (has_oneof_e_2()) {
- target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
- 6, this->oneof_e_2(), 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:proto3_preserve_unknown_enum_unittest.MyMessage)
- return target;
- }
- size_t MyMessage::ByteSizeLong() const {
- // @@protoc_insertion_point(message_byte_size_start:proto3_preserve_unknown_enum_unittest.MyMessage)
- 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 .proto3_preserve_unknown_enum_unittest.MyEnum repeated_e = 2;
- {
- size_t data_size = 0;
- unsigned int count = static_cast<unsigned int>(this->repeated_e_size());for (unsigned int i = 0; i < count; i++) {
- data_size += ::google::protobuf::internal::WireFormatLite::EnumSize(
- this->repeated_e(static_cast<int>(i)));
- }
- if (data_size > 0) {
- total_size += 1 +
- ::google::protobuf::internal::WireFormatLite::Int32Size(
- static_cast< ::google::protobuf::int32>(data_size));
- }
- int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
- GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
- _repeated_e_cached_byte_size_ = cached_size;
- GOOGLE_SAFE_CONCURRENT_WRITES_END();
- total_size += data_size;
- }
- // repeated .proto3_preserve_unknown_enum_unittest.MyEnum repeated_packed_e = 3 [packed = true];
- {
- size_t data_size = 0;
- unsigned int count = static_cast<unsigned int>(this->repeated_packed_e_size());for (unsigned int i = 0; i < count; i++) {
- data_size += ::google::protobuf::internal::WireFormatLite::EnumSize(
- this->repeated_packed_e(static_cast<int>(i)));
- }
- if (data_size > 0) {
- total_size += 1 +
- ::google::protobuf::internal::WireFormatLite::Int32Size(
- static_cast< ::google::protobuf::int32>(data_size));
- }
- int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
- GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
- _repeated_packed_e_cached_byte_size_ = cached_size;
- GOOGLE_SAFE_CONCURRENT_WRITES_END();
- total_size += data_size;
- }
- // repeated .proto3_preserve_unknown_enum_unittest.MyEnumPlusExtra repeated_packed_unexpected_e = 4;
- {
- size_t data_size = 0;
- unsigned int count = static_cast<unsigned int>(this->repeated_packed_unexpected_e_size());for (unsigned int i = 0; i < count; i++) {
- data_size += ::google::protobuf::internal::WireFormatLite::EnumSize(
- this->repeated_packed_unexpected_e(static_cast<int>(i)));
- }
- if (data_size > 0) {
- total_size += 1 +
- ::google::protobuf::internal::WireFormatLite::Int32Size(
- static_cast< ::google::protobuf::int32>(data_size));
- }
- int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
- GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
- _repeated_packed_unexpected_e_cached_byte_size_ = cached_size;
- GOOGLE_SAFE_CONCURRENT_WRITES_END();
- total_size += data_size;
- }
- // .proto3_preserve_unknown_enum_unittest.MyEnum e = 1;
- if (this->e() != 0) {
- total_size += 1 +
- ::google::protobuf::internal::WireFormatLite::EnumSize(this->e());
- }
- switch (o_case()) {
- // .proto3_preserve_unknown_enum_unittest.MyEnum oneof_e_1 = 5;
- case kOneofE1: {
- total_size += 1 +
- ::google::protobuf::internal::WireFormatLite::EnumSize(this->oneof_e_1());
- break;
- }
- // .proto3_preserve_unknown_enum_unittest.MyEnum oneof_e_2 = 6;
- case kOneofE2: {
- total_size += 1 +
- ::google::protobuf::internal::WireFormatLite::EnumSize(this->oneof_e_2());
- break;
- }
- case O_NOT_SET: {
- break;
- }
- }
- int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
- SetCachedSize(cached_size);
- return total_size;
- }
- void MyMessage::MergeFrom(const ::google::protobuf::Message& from) {
- // @@protoc_insertion_point(generalized_merge_from_start:proto3_preserve_unknown_enum_unittest.MyMessage)
- GOOGLE_DCHECK_NE(&from, this);
- const MyMessage* source =
- ::google::protobuf::internal::DynamicCastToGenerated<const MyMessage>(
- &from);
- if (source == NULL) {
- // @@protoc_insertion_point(generalized_merge_from_cast_fail:proto3_preserve_unknown_enum_unittest.MyMessage)
- ::google::protobuf::internal::ReflectionOps::Merge(from, this);
- } else {
- // @@protoc_insertion_point(generalized_merge_from_cast_success:proto3_preserve_unknown_enum_unittest.MyMessage)
- MergeFrom(*source);
- }
- }
- void MyMessage::MergeFrom(const MyMessage& from) {
- // @@protoc_insertion_point(class_specific_merge_from_start:proto3_preserve_unknown_enum_unittest.MyMessage)
- GOOGLE_DCHECK_NE(&from, this);
- _internal_metadata_.MergeFrom(from._internal_metadata_);
- ::google::protobuf::uint32 cached_has_bits = 0;
- (void) cached_has_bits;
- repeated_e_.MergeFrom(from.repeated_e_);
- repeated_packed_e_.MergeFrom(from.repeated_packed_e_);
- repeated_packed_unexpected_e_.MergeFrom(from.repeated_packed_unexpected_e_);
- if (from.e() != 0) {
- set_e(from.e());
- }
- switch (from.o_case()) {
- case kOneofE1: {
- set_oneof_e_1(from.oneof_e_1());
- break;
- }
- case kOneofE2: {
- set_oneof_e_2(from.oneof_e_2());
- break;
- }
- case O_NOT_SET: {
- break;
- }
- }
- }
- void MyMessage::CopyFrom(const ::google::protobuf::Message& from) {
- // @@protoc_insertion_point(generalized_copy_from_start:proto3_preserve_unknown_enum_unittest.MyMessage)
- if (&from == this) return;
- Clear();
- MergeFrom(from);
- }
- void MyMessage::CopyFrom(const MyMessage& from) {
- // @@protoc_insertion_point(class_specific_copy_from_start:proto3_preserve_unknown_enum_unittest.MyMessage)
- if (&from == this) return;
- Clear();
- MergeFrom(from);
- }
- bool MyMessage::IsInitialized() const {
- return true;
- }
- void MyMessage::Swap(MyMessage* other) {
- if (other == this) return;
- InternalSwap(other);
- }
- void MyMessage::InternalSwap(MyMessage* other) {
- using std::swap;
- repeated_e_.InternalSwap(&other->repeated_e_);
- repeated_packed_e_.InternalSwap(&other->repeated_packed_e_);
- repeated_packed_unexpected_e_.InternalSwap(&other->repeated_packed_unexpected_e_);
- swap(e_, other->e_);
- swap(o_, other->o_);
- swap(_oneof_case_[0], other->_oneof_case_[0]);
- _internal_metadata_.Swap(&other->_internal_metadata_);
- }
- ::google::protobuf::Metadata MyMessage::GetMetadata() const {
- protobuf_google_2fprotobuf_2funittest_5fpreserve_5funknown_5fenum_2eproto::protobuf_AssignDescriptorsOnce();
- return ::protobuf_google_2fprotobuf_2funittest_5fpreserve_5funknown_5fenum_2eproto::file_level_metadata[kIndexInFileMessages];
- }
- // ===================================================================
- void MyMessagePlusExtra::InitAsDefaultInstance() {
- ::proto3_preserve_unknown_enum_unittest::_MyMessagePlusExtra_default_instance_.oneof_e_1_ = 0;
- ::proto3_preserve_unknown_enum_unittest::_MyMessagePlusExtra_default_instance_.oneof_e_2_ = 0;
- }
- #if !defined(_MSC_VER) || _MSC_VER >= 1900
- const int MyMessagePlusExtra::kEFieldNumber;
- const int MyMessagePlusExtra::kRepeatedEFieldNumber;
- const int MyMessagePlusExtra::kRepeatedPackedEFieldNumber;
- const int MyMessagePlusExtra::kRepeatedPackedUnexpectedEFieldNumber;
- const int MyMessagePlusExtra::kOneofE1FieldNumber;
- const int MyMessagePlusExtra::kOneofE2FieldNumber;
- #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
- MyMessagePlusExtra::MyMessagePlusExtra()
- : ::google::protobuf::Message(), _internal_metadata_(NULL) {
- ::google::protobuf::internal::InitSCC(
- &protobuf_google_2fprotobuf_2funittest_5fpreserve_5funknown_5fenum_2eproto::scc_info_MyMessagePlusExtra.base);
- SharedCtor();
- // @@protoc_insertion_point(constructor:proto3_preserve_unknown_enum_unittest.MyMessagePlusExtra)
- }
- MyMessagePlusExtra::MyMessagePlusExtra(const MyMessagePlusExtra& from)
- : ::google::protobuf::Message(),
- _internal_metadata_(NULL),
- repeated_e_(from.repeated_e_),
- repeated_packed_e_(from.repeated_packed_e_),
- repeated_packed_unexpected_e_(from.repeated_packed_unexpected_e_) {
- _internal_metadata_.MergeFrom(from._internal_metadata_);
- e_ = from.e_;
- clear_has_o();
- switch (from.o_case()) {
- case kOneofE1: {
- set_oneof_e_1(from.oneof_e_1());
- break;
- }
- case kOneofE2: {
- set_oneof_e_2(from.oneof_e_2());
- break;
- }
- case O_NOT_SET: {
- break;
- }
- }
- // @@protoc_insertion_point(copy_constructor:proto3_preserve_unknown_enum_unittest.MyMessagePlusExtra)
- }
- void MyMessagePlusExtra::SharedCtor() {
- e_ = 0;
- clear_has_o();
- }
- MyMessagePlusExtra::~MyMessagePlusExtra() {
- // @@protoc_insertion_point(destructor:proto3_preserve_unknown_enum_unittest.MyMessagePlusExtra)
- SharedDtor();
- }
- void MyMessagePlusExtra::SharedDtor() {
- if (has_o()) {
- clear_o();
- }
- }
- void MyMessagePlusExtra::SetCachedSize(int size) const {
- _cached_size_.Set(size);
- }
- const ::google::protobuf::Descriptor* MyMessagePlusExtra::descriptor() {
- ::protobuf_google_2fprotobuf_2funittest_5fpreserve_5funknown_5fenum_2eproto::protobuf_AssignDescriptorsOnce();
- return ::protobuf_google_2fprotobuf_2funittest_5fpreserve_5funknown_5fenum_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
- }
- const MyMessagePlusExtra& MyMessagePlusExtra::default_instance() {
- ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2funittest_5fpreserve_5funknown_5fenum_2eproto::scc_info_MyMessagePlusExtra.base);
- return *internal_default_instance();
- }
- void MyMessagePlusExtra::clear_o() {
- // @@protoc_insertion_point(one_of_clear_start:proto3_preserve_unknown_enum_unittest.MyMessagePlusExtra)
- switch (o_case()) {
- case kOneofE1: {
- // No need to clear
- break;
- }
- case kOneofE2: {
- // No need to clear
- break;
- }
- case O_NOT_SET: {
- break;
- }
- }
- _oneof_case_[0] = O_NOT_SET;
- }
- void MyMessagePlusExtra::Clear() {
- // @@protoc_insertion_point(message_clear_start:proto3_preserve_unknown_enum_unittest.MyMessagePlusExtra)
- ::google::protobuf::uint32 cached_has_bits = 0;
- // Prevent compiler warnings about cached_has_bits being unused
- (void) cached_has_bits;
- repeated_e_.Clear();
- repeated_packed_e_.Clear();
- repeated_packed_unexpected_e_.Clear();
- e_ = 0;
- clear_o();
- _internal_metadata_.Clear();
- }
- bool MyMessagePlusExtra::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:proto3_preserve_unknown_enum_unittest.MyMessagePlusExtra)
- 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)) {
- // .proto3_preserve_unknown_enum_unittest.MyEnumPlusExtra e = 1;
- case 1: {
- if (static_cast< ::google::protobuf::uint8>(tag) ==
- static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
- int value;
- DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
- int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
- input, &value)));
- set_e(static_cast< ::proto3_preserve_unknown_enum_unittest::MyEnumPlusExtra >(value));
- } else {
- goto handle_unusual;
- }
- break;
- }
- // repeated .proto3_preserve_unknown_enum_unittest.MyEnumPlusExtra repeated_e = 2;
- case 2: {
- if (static_cast< ::google::protobuf::uint8>(tag) ==
- static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
- ::google::protobuf::uint32 length;
- DO_(input->ReadVarint32(&length));
- ::google::protobuf::io::CodedInputStream::Limit limit = input->PushLimit(static_cast<int>(length));
- while (input->BytesUntilLimit() > 0) {
- int value;
- DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
- int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
- input, &value)));
- add_repeated_e(static_cast< ::proto3_preserve_unknown_enum_unittest::MyEnumPlusExtra >(value));
- }
- input->PopLimit(limit);
- } else if (
- static_cast< ::google::protobuf::uint8>(tag) ==
- static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
- int value;
- DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
- int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
- input, &value)));
- add_repeated_e(static_cast< ::proto3_preserve_unknown_enum_unittest::MyEnumPlusExtra >(value));
- } else {
- goto handle_unusual;
- }
- break;
- }
- // repeated .proto3_preserve_unknown_enum_unittest.MyEnumPlusExtra repeated_packed_e = 3 [packed = true];
- case 3: {
- if (static_cast< ::google::protobuf::uint8>(tag) ==
- static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
- ::google::protobuf::uint32 length;
- DO_(input->ReadVarint32(&length));
- ::google::protobuf::io::CodedInputStream::Limit limit = input->PushLimit(static_cast<int>(length));
- while (input->BytesUntilLimit() > 0) {
- int value;
- DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
- int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
- input, &value)));
- add_repeated_packed_e(static_cast< ::proto3_preserve_unknown_enum_unittest::MyEnumPlusExtra >(value));
- }
- input->PopLimit(limit);
- } else if (
- static_cast< ::google::protobuf::uint8>(tag) ==
- static_cast< ::google::protobuf::uint8>(24u /* 24 & 0xFF */)) {
- int value;
- DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
- int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
- input, &value)));
- add_repeated_packed_e(static_cast< ::proto3_preserve_unknown_enum_unittest::MyEnumPlusExtra >(value));
- } else {
- goto handle_unusual;
- }
- break;
- }
- // repeated .proto3_preserve_unknown_enum_unittest.MyEnumPlusExtra repeated_packed_unexpected_e = 4 [packed = true];
- case 4: {
- if (static_cast< ::google::protobuf::uint8>(tag) ==
- static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) {
- ::google::protobuf::uint32 length;
- DO_(input->ReadVarint32(&length));
- ::google::protobuf::io::CodedInputStream::Limit limit = input->PushLimit(static_cast<int>(length));
- while (input->BytesUntilLimit() > 0) {
- int value;
- DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
- int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
- input, &value)));
- add_repeated_packed_unexpected_e(static_cast< ::proto3_preserve_unknown_enum_unittest::MyEnumPlusExtra >(value));
- }
- input->PopLimit(limit);
- } else if (
- static_cast< ::google::protobuf::uint8>(tag) ==
- static_cast< ::google::protobuf::uint8>(32u /* 32 & 0xFF */)) {
- int value;
- DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
- int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
- input, &value)));
- add_repeated_packed_unexpected_e(static_cast< ::proto3_preserve_unknown_enum_unittest::MyEnumPlusExtra >(value));
- } else {
- goto handle_unusual;
- }
- break;
- }
- // .proto3_preserve_unknown_enum_unittest.MyEnumPlusExtra oneof_e_1 = 5;
- case 5: {
- if (static_cast< ::google::protobuf::uint8>(tag) ==
- static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) {
- int value;
- DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
- int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
- input, &value)));
- set_oneof_e_1(static_cast< ::proto3_preserve_unknown_enum_unittest::MyEnumPlusExtra >(value));
- } else {
- goto handle_unusual;
- }
- break;
- }
- // .proto3_preserve_unknown_enum_unittest.MyEnumPlusExtra oneof_e_2 = 6;
- case 6: {
- if (static_cast< ::google::protobuf::uint8>(tag) ==
- static_cast< ::google::protobuf::uint8>(48u /* 48 & 0xFF */)) {
- int value;
- DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
- int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
- input, &value)));
- set_oneof_e_2(static_cast< ::proto3_preserve_unknown_enum_unittest::MyEnumPlusExtra >(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:proto3_preserve_unknown_enum_unittest.MyMessagePlusExtra)
- return true;
- failure:
- // @@protoc_insertion_point(parse_failure:proto3_preserve_unknown_enum_unittest.MyMessagePlusExtra)
- return false;
- #undef DO_
- }
- void MyMessagePlusExtra::SerializeWithCachedSizes(
- ::google::protobuf::io::CodedOutputStream* output) const {
- // @@protoc_insertion_point(serialize_start:proto3_preserve_unknown_enum_unittest.MyMessagePlusExtra)
- ::google::protobuf::uint32 cached_has_bits = 0;
- (void) cached_has_bits;
- // .proto3_preserve_unknown_enum_unittest.MyEnumPlusExtra e = 1;
- if (this->e() != 0) {
- ::google::protobuf::internal::WireFormatLite::WriteEnum(
- 1, this->e(), output);
- }
- // repeated .proto3_preserve_unknown_enum_unittest.MyEnumPlusExtra repeated_e = 2;
- if (this->repeated_e_size() > 0) {
- ::google::protobuf::internal::WireFormatLite::WriteTag(
- 2,
- ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
- output);
- output->WriteVarint32(
- static_cast< ::google::protobuf::uint32>(_repeated_e_cached_byte_size_));
- }
- for (int i = 0, n = this->repeated_e_size(); i < n; i++) {
- ::google::protobuf::internal::WireFormatLite::WriteEnumNoTag(
- this->repeated_e(i), output);
- }
- // repeated .proto3_preserve_unknown_enum_unittest.MyEnumPlusExtra repeated_packed_e = 3 [packed = true];
- if (this->repeated_packed_e_size() > 0) {
- ::google::protobuf::internal::WireFormatLite::WriteTag(
- 3,
- ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
- output);
- output->WriteVarint32(
- static_cast< ::google::protobuf::uint32>(_repeated_packed_e_cached_byte_size_));
- }
- for (int i = 0, n = this->repeated_packed_e_size(); i < n; i++) {
- ::google::protobuf::internal::WireFormatLite::WriteEnumNoTag(
- this->repeated_packed_e(i), output);
- }
- // repeated .proto3_preserve_unknown_enum_unittest.MyEnumPlusExtra repeated_packed_unexpected_e = 4 [packed = true];
- if (this->repeated_packed_unexpected_e_size() > 0) {
- ::google::protobuf::internal::WireFormatLite::WriteTag(
- 4,
- ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
- output);
- output->WriteVarint32(
- static_cast< ::google::protobuf::uint32>(_repeated_packed_unexpected_e_cached_byte_size_));
- }
- for (int i = 0, n = this->repeated_packed_unexpected_e_size(); i < n; i++) {
- ::google::protobuf::internal::WireFormatLite::WriteEnumNoTag(
- this->repeated_packed_unexpected_e(i), output);
- }
- // .proto3_preserve_unknown_enum_unittest.MyEnumPlusExtra oneof_e_1 = 5;
- if (has_oneof_e_1()) {
- ::google::protobuf::internal::WireFormatLite::WriteEnum(
- 5, this->oneof_e_1(), output);
- }
- // .proto3_preserve_unknown_enum_unittest.MyEnumPlusExtra oneof_e_2 = 6;
- if (has_oneof_e_2()) {
- ::google::protobuf::internal::WireFormatLite::WriteEnum(
- 6, this->oneof_e_2(), 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:proto3_preserve_unknown_enum_unittest.MyMessagePlusExtra)
- }
- ::google::protobuf::uint8* MyMessagePlusExtra::InternalSerializeWithCachedSizesToArray(
- bool deterministic, ::google::protobuf::uint8* target) const {
- (void)deterministic; // Unused
- // @@protoc_insertion_point(serialize_to_array_start:proto3_preserve_unknown_enum_unittest.MyMessagePlusExtra)
- ::google::protobuf::uint32 cached_has_bits = 0;
- (void) cached_has_bits;
- // .proto3_preserve_unknown_enum_unittest.MyEnumPlusExtra e = 1;
- if (this->e() != 0) {
- target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
- 1, this->e(), target);
- }
- // repeated .proto3_preserve_unknown_enum_unittest.MyEnumPlusExtra repeated_e = 2;
- if (this->repeated_e_size() > 0) {
- target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
- 2,
- ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
- target);
- target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( static_cast< ::google::protobuf::uint32>(
- _repeated_e_cached_byte_size_), target);
- target = ::google::protobuf::internal::WireFormatLite::WriteEnumNoTagToArray(
- this->repeated_e_, target);
- }
- // repeated .proto3_preserve_unknown_enum_unittest.MyEnumPlusExtra repeated_packed_e = 3 [packed = true];
- if (this->repeated_packed_e_size() > 0) {
- target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
- 3,
- ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
- target);
- target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( static_cast< ::google::protobuf::uint32>(
- _repeated_packed_e_cached_byte_size_), target);
- target = ::google::protobuf::internal::WireFormatLite::WriteEnumNoTagToArray(
- this->repeated_packed_e_, target);
- }
- // repeated .proto3_preserve_unknown_enum_unittest.MyEnumPlusExtra repeated_packed_unexpected_e = 4 [packed = true];
- if (this->repeated_packed_unexpected_e_size() > 0) {
- target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
- 4,
- ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
- target);
- target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( static_cast< ::google::protobuf::uint32>(
- _repeated_packed_unexpected_e_cached_byte_size_), target);
- target = ::google::protobuf::internal::WireFormatLite::WriteEnumNoTagToArray(
- this->repeated_packed_unexpected_e_, target);
- }
- // .proto3_preserve_unknown_enum_unittest.MyEnumPlusExtra oneof_e_1 = 5;
- if (has_oneof_e_1()) {
- target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
- 5, this->oneof_e_1(), target);
- }
- // .proto3_preserve_unknown_enum_unittest.MyEnumPlusExtra oneof_e_2 = 6;
- if (has_oneof_e_2()) {
- target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
- 6, this->oneof_e_2(), 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:proto3_preserve_unknown_enum_unittest.MyMessagePlusExtra)
- return target;
- }
- size_t MyMessagePlusExtra::ByteSizeLong() const {
- // @@protoc_insertion_point(message_byte_size_start:proto3_preserve_unknown_enum_unittest.MyMessagePlusExtra)
- 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 .proto3_preserve_unknown_enum_unittest.MyEnumPlusExtra repeated_e = 2;
- {
- size_t data_size = 0;
- unsigned int count = static_cast<unsigned int>(this->repeated_e_size());for (unsigned int i = 0; i < count; i++) {
- data_size += ::google::protobuf::internal::WireFormatLite::EnumSize(
- this->repeated_e(static_cast<int>(i)));
- }
- if (data_size > 0) {
- total_size += 1 +
- ::google::protobuf::internal::WireFormatLite::Int32Size(
- static_cast< ::google::protobuf::int32>(data_size));
- }
- int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
- GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
- _repeated_e_cached_byte_size_ = cached_size;
- GOOGLE_SAFE_CONCURRENT_WRITES_END();
- total_size += data_size;
- }
- // repeated .proto3_preserve_unknown_enum_unittest.MyEnumPlusExtra repeated_packed_e = 3 [packed = true];
- {
- size_t data_size = 0;
- unsigned int count = static_cast<unsigned int>(this->repeated_packed_e_size());for (unsigned int i = 0; i < count; i++) {
- data_size += ::google::protobuf::internal::WireFormatLite::EnumSize(
- this->repeated_packed_e(static_cast<int>(i)));
- }
- if (data_size > 0) {
- total_size += 1 +
- ::google::protobuf::internal::WireFormatLite::Int32Size(
- static_cast< ::google::protobuf::int32>(data_size));
- }
- int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
- GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
- _repeated_packed_e_cached_byte_size_ = cached_size;
- GOOGLE_SAFE_CONCURRENT_WRITES_END();
- total_size += data_size;
- }
- // repeated .proto3_preserve_unknown_enum_unittest.MyEnumPlusExtra repeated_packed_unexpected_e = 4 [packed = true];
- {
- size_t data_size = 0;
- unsigned int count = static_cast<unsigned int>(this->repeated_packed_unexpected_e_size());for (unsigned int i = 0; i < count; i++) {
- data_size += ::google::protobuf::internal::WireFormatLite::EnumSize(
- this->repeated_packed_unexpected_e(static_cast<int>(i)));
- }
- if (data_size > 0) {
- total_size += 1 +
- ::google::protobuf::internal::WireFormatLite::Int32Size(
- static_cast< ::google::protobuf::int32>(data_size));
- }
- int cached_size = ::google::protobuf::internal::ToCachedSize(data_size);
- GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
- _repeated_packed_unexpected_e_cached_byte_size_ = cached_size;
- GOOGLE_SAFE_CONCURRENT_WRITES_END();
- total_size += data_size;
- }
- // .proto3_preserve_unknown_enum_unittest.MyEnumPlusExtra e = 1;
- if (this->e() != 0) {
- total_size += 1 +
- ::google::protobuf::internal::WireFormatLite::EnumSize(this->e());
- }
- switch (o_case()) {
- // .proto3_preserve_unknown_enum_unittest.MyEnumPlusExtra oneof_e_1 = 5;
- case kOneofE1: {
- total_size += 1 +
- ::google::protobuf::internal::WireFormatLite::EnumSize(this->oneof_e_1());
- break;
- }
- // .proto3_preserve_unknown_enum_unittest.MyEnumPlusExtra oneof_e_2 = 6;
- case kOneofE2: {
- total_size += 1 +
- ::google::protobuf::internal::WireFormatLite::EnumSize(this->oneof_e_2());
- break;
- }
- case O_NOT_SET: {
- break;
- }
- }
- int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
- SetCachedSize(cached_size);
- return total_size;
- }
- void MyMessagePlusExtra::MergeFrom(const ::google::protobuf::Message& from) {
- // @@protoc_insertion_point(generalized_merge_from_start:proto3_preserve_unknown_enum_unittest.MyMessagePlusExtra)
- GOOGLE_DCHECK_NE(&from, this);
- const MyMessagePlusExtra* source =
- ::google::protobuf::internal::DynamicCastToGenerated<const MyMessagePlusExtra>(
- &from);
- if (source == NULL) {
- // @@protoc_insertion_point(generalized_merge_from_cast_fail:proto3_preserve_unknown_enum_unittest.MyMessagePlusExtra)
- ::google::protobuf::internal::ReflectionOps::Merge(from, this);
- } else {
- // @@protoc_insertion_point(generalized_merge_from_cast_success:proto3_preserve_unknown_enum_unittest.MyMessagePlusExtra)
- MergeFrom(*source);
- }
- }
- void MyMessagePlusExtra::MergeFrom(const MyMessagePlusExtra& from) {
- // @@protoc_insertion_point(class_specific_merge_from_start:proto3_preserve_unknown_enum_unittest.MyMessagePlusExtra)
- GOOGLE_DCHECK_NE(&from, this);
- _internal_metadata_.MergeFrom(from._internal_metadata_);
- ::google::protobuf::uint32 cached_has_bits = 0;
- (void) cached_has_bits;
- repeated_e_.MergeFrom(from.repeated_e_);
- repeated_packed_e_.MergeFrom(from.repeated_packed_e_);
- repeated_packed_unexpected_e_.MergeFrom(from.repeated_packed_unexpected_e_);
- if (from.e() != 0) {
- set_e(from.e());
- }
- switch (from.o_case()) {
- case kOneofE1: {
- set_oneof_e_1(from.oneof_e_1());
- break;
- }
- case kOneofE2: {
- set_oneof_e_2(from.oneof_e_2());
- break;
- }
- case O_NOT_SET: {
- break;
- }
- }
- }
- void MyMessagePlusExtra::CopyFrom(const ::google::protobuf::Message& from) {
- // @@protoc_insertion_point(generalized_copy_from_start:proto3_preserve_unknown_enum_unittest.MyMessagePlusExtra)
- if (&from == this) return;
- Clear();
- MergeFrom(from);
- }
- void MyMessagePlusExtra::CopyFrom(const MyMessagePlusExtra& from) {
- // @@protoc_insertion_point(class_specific_copy_from_start:proto3_preserve_unknown_enum_unittest.MyMessagePlusExtra)
- if (&from == this) return;
- Clear();
- MergeFrom(from);
- }
- bool MyMessagePlusExtra::IsInitialized() const {
- return true;
- }
- void MyMessagePlusExtra::Swap(MyMessagePlusExtra* other) {
- if (other == this) return;
- InternalSwap(other);
- }
- void MyMessagePlusExtra::InternalSwap(MyMessagePlusExtra* other) {
- using std::swap;
- repeated_e_.InternalSwap(&other->repeated_e_);
- repeated_packed_e_.InternalSwap(&other->repeated_packed_e_);
- repeated_packed_unexpected_e_.InternalSwap(&other->repeated_packed_unexpected_e_);
- swap(e_, other->e_);
- swap(o_, other->o_);
- swap(_oneof_case_[0], other->_oneof_case_[0]);
- _internal_metadata_.Swap(&other->_internal_metadata_);
- }
- ::google::protobuf::Metadata MyMessagePlusExtra::GetMetadata() const {
- protobuf_google_2fprotobuf_2funittest_5fpreserve_5funknown_5fenum_2eproto::protobuf_AssignDescriptorsOnce();
- return ::protobuf_google_2fprotobuf_2funittest_5fpreserve_5funknown_5fenum_2eproto::file_level_metadata[kIndexInFileMessages];
- }
- // @@protoc_insertion_point(namespace_scope)
- } // namespace proto3_preserve_unknown_enum_unittest
- namespace google {
- namespace protobuf {
- template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::proto3_preserve_unknown_enum_unittest::MyMessage* Arena::CreateMaybeMessage< ::proto3_preserve_unknown_enum_unittest::MyMessage >(Arena* arena) {
- return Arena::CreateInternal< ::proto3_preserve_unknown_enum_unittest::MyMessage >(arena);
- }
- template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::proto3_preserve_unknown_enum_unittest::MyMessagePlusExtra* Arena::CreateMaybeMessage< ::proto3_preserve_unknown_enum_unittest::MyMessagePlusExtra >(Arena* arena) {
- return Arena::CreateInternal< ::proto3_preserve_unknown_enum_unittest::MyMessagePlusExtra >(arena);
- }
- } // namespace protobuf
- } // namespace google
- // @@protoc_insertion_point(global_scope)
|