field_mask.pb.cc 82 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035
  1. // Generated by the protocol buffer compiler. DO NOT EDIT!
  2. // source: google/protobuf/util/internal/testdata/field_mask.proto
  3. #include <google/protobuf/util/internal/testdata/field_mask.pb.h>
  4. #include <algorithm>
  5. #include <google/protobuf/stubs/common.h>
  6. #include <google/protobuf/stubs/port.h>
  7. #include <google/protobuf/io/coded_stream.h>
  8. #include <google/protobuf/wire_format_lite_inl.h>
  9. #include <google/protobuf/descriptor.h>
  10. #include <google/protobuf/generated_message_reflection.h>
  11. #include <google/protobuf/reflection_ops.h>
  12. #include <google/protobuf/wire_format.h>
  13. // This is a temporary google only hack
  14. #ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
  15. #include "third_party/protobuf/version.h"
  16. #endif
  17. // @@protoc_insertion_point(includes)
  18. namespace protobuf_google_2fprotobuf_2ffield_5fmask_2eproto {
  19. extern PROTOBUF_INTERNAL_EXPORT_protobuf_google_2fprotobuf_2ffield_5fmask_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_FieldMask;
  20. } // namespace protobuf_google_2fprotobuf_2ffield_5fmask_2eproto
  21. namespace protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2ffield_5fmask_2eproto {
  22. extern PROTOBUF_INTERNAL_EXPORT_protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2ffield_5fmask_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_FieldMaskWrapper;
  23. extern PROTOBUF_INTERNAL_EXPORT_protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2ffield_5fmask_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_NestedFieldMask;
  24. } // namespace protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2ffield_5fmask_2eproto
  25. namespace google {
  26. namespace protobuf {
  27. namespace testing {
  28. class NestedFieldMaskDefaultTypeInternal {
  29. public:
  30. ::google::protobuf::internal::ExplicitlyConstructed<NestedFieldMask>
  31. _instance;
  32. } _NestedFieldMask_default_instance_;
  33. class FieldMaskTestDefaultTypeInternal {
  34. public:
  35. ::google::protobuf::internal::ExplicitlyConstructed<FieldMaskTest>
  36. _instance;
  37. } _FieldMaskTest_default_instance_;
  38. class FieldMaskTestCasesDefaultTypeInternal {
  39. public:
  40. ::google::protobuf::internal::ExplicitlyConstructed<FieldMaskTestCases>
  41. _instance;
  42. } _FieldMaskTestCases_default_instance_;
  43. class FieldMaskWrapperDefaultTypeInternal {
  44. public:
  45. ::google::protobuf::internal::ExplicitlyConstructed<FieldMaskWrapper>
  46. _instance;
  47. } _FieldMaskWrapper_default_instance_;
  48. } // namespace testing
  49. } // namespace protobuf
  50. } // namespace google
  51. namespace protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2ffield_5fmask_2eproto {
  52. static void InitDefaultsNestedFieldMask() {
  53. GOOGLE_PROTOBUF_VERIFY_VERSION;
  54. {
  55. void* ptr = &::google::protobuf::testing::_NestedFieldMask_default_instance_;
  56. new (ptr) ::google::protobuf::testing::NestedFieldMask();
  57. ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  58. }
  59. ::google::protobuf::testing::NestedFieldMask::InitAsDefaultInstance();
  60. }
  61. ::google::protobuf::internal::SCCInfo<1> scc_info_NestedFieldMask =
  62. {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsNestedFieldMask}, {
  63. &protobuf_google_2fprotobuf_2ffield_5fmask_2eproto::scc_info_FieldMask.base,}};
  64. static void InitDefaultsFieldMaskTest() {
  65. GOOGLE_PROTOBUF_VERIFY_VERSION;
  66. {
  67. void* ptr = &::google::protobuf::testing::_FieldMaskTest_default_instance_;
  68. new (ptr) ::google::protobuf::testing::FieldMaskTest();
  69. ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  70. }
  71. ::google::protobuf::testing::FieldMaskTest::InitAsDefaultInstance();
  72. }
  73. ::google::protobuf::internal::SCCInfo<2> scc_info_FieldMaskTest =
  74. {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsFieldMaskTest}, {
  75. &protobuf_google_2fprotobuf_2ffield_5fmask_2eproto::scc_info_FieldMask.base,
  76. &protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2ffield_5fmask_2eproto::scc_info_NestedFieldMask.base,}};
  77. static void InitDefaultsFieldMaskTestCases() {
  78. GOOGLE_PROTOBUF_VERIFY_VERSION;
  79. {
  80. void* ptr = &::google::protobuf::testing::_FieldMaskTestCases_default_instance_;
  81. new (ptr) ::google::protobuf::testing::FieldMaskTestCases();
  82. ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  83. }
  84. ::google::protobuf::testing::FieldMaskTestCases::InitAsDefaultInstance();
  85. }
  86. ::google::protobuf::internal::SCCInfo<1> scc_info_FieldMaskTestCases =
  87. {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsFieldMaskTestCases}, {
  88. &protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2ffield_5fmask_2eproto::scc_info_FieldMaskWrapper.base,}};
  89. static void InitDefaultsFieldMaskWrapper() {
  90. GOOGLE_PROTOBUF_VERIFY_VERSION;
  91. {
  92. void* ptr = &::google::protobuf::testing::_FieldMaskWrapper_default_instance_;
  93. new (ptr) ::google::protobuf::testing::FieldMaskWrapper();
  94. ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  95. }
  96. ::google::protobuf::testing::FieldMaskWrapper::InitAsDefaultInstance();
  97. }
  98. ::google::protobuf::internal::SCCInfo<1> scc_info_FieldMaskWrapper =
  99. {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsFieldMaskWrapper}, {
  100. &protobuf_google_2fprotobuf_2ffield_5fmask_2eproto::scc_info_FieldMask.base,}};
  101. void InitDefaults() {
  102. ::google::protobuf::internal::InitSCC(&scc_info_NestedFieldMask.base);
  103. ::google::protobuf::internal::InitSCC(&scc_info_FieldMaskTest.base);
  104. ::google::protobuf::internal::InitSCC(&scc_info_FieldMaskTestCases.base);
  105. ::google::protobuf::internal::InitSCC(&scc_info_FieldMaskWrapper.base);
  106. }
  107. ::google::protobuf::Metadata file_level_metadata[4];
  108. const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
  109. ~0u, // no _has_bits_
  110. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::testing::NestedFieldMask, _internal_metadata_),
  111. ~0u, // no _extensions_
  112. ~0u, // no _oneof_case_
  113. ~0u, // no _weak_field_map_
  114. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::testing::NestedFieldMask, data_),
  115. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::testing::NestedFieldMask, single_mask_),
  116. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::testing::NestedFieldMask, repeated_mask_),
  117. ~0u, // no _has_bits_
  118. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::testing::FieldMaskTest, _internal_metadata_),
  119. ~0u, // no _extensions_
  120. ~0u, // no _oneof_case_
  121. ~0u, // no _weak_field_map_
  122. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::testing::FieldMaskTest, id_),
  123. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::testing::FieldMaskTest, single_mask_),
  124. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::testing::FieldMaskTest, repeated_mask_),
  125. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::testing::FieldMaskTest, nested_mask_),
  126. ~0u, // no _has_bits_
  127. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::testing::FieldMaskTestCases, _internal_metadata_),
  128. ~0u, // no _extensions_
  129. ~0u, // no _oneof_case_
  130. ~0u, // no _weak_field_map_
  131. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::testing::FieldMaskTestCases, single_mask_),
  132. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::testing::FieldMaskTestCases, multiple_mask_),
  133. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::testing::FieldMaskTestCases, snake_camel_),
  134. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::testing::FieldMaskTestCases, empty_field_),
  135. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::testing::FieldMaskTestCases, apiary_format1_),
  136. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::testing::FieldMaskTestCases, apiary_format2_),
  137. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::testing::FieldMaskTestCases, apiary_format3_),
  138. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::testing::FieldMaskTestCases, map_key1_),
  139. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::testing::FieldMaskTestCases, map_key2_),
  140. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::testing::FieldMaskTestCases, map_key3_),
  141. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::testing::FieldMaskTestCases, map_key4_),
  142. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::testing::FieldMaskTestCases, map_key5_),
  143. ~0u, // no _has_bits_
  144. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::testing::FieldMaskWrapper, _internal_metadata_),
  145. ~0u, // no _extensions_
  146. ~0u, // no _oneof_case_
  147. ~0u, // no _weak_field_map_
  148. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::testing::FieldMaskWrapper, mask_),
  149. };
  150. static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
  151. { 0, -1, sizeof(::google::protobuf::testing::NestedFieldMask)},
  152. { 8, -1, sizeof(::google::protobuf::testing::FieldMaskTest)},
  153. { 17, -1, sizeof(::google::protobuf::testing::FieldMaskTestCases)},
  154. { 34, -1, sizeof(::google::protobuf::testing::FieldMaskWrapper)},
  155. };
  156. static ::google::protobuf::Message const * const file_default_instances[] = {
  157. reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::testing::_NestedFieldMask_default_instance_),
  158. reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::testing::_FieldMaskTest_default_instance_),
  159. reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::testing::_FieldMaskTestCases_default_instance_),
  160. reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::testing::_FieldMaskWrapper_default_instance_),
  161. };
  162. void protobuf_AssignDescriptors() {
  163. AddDescriptors();
  164. AssignDescriptors(
  165. "google/protobuf/util/internal/testdata/field_mask.proto", schemas, file_default_instances, TableStruct::offsets,
  166. file_level_metadata, NULL, NULL);
  167. }
  168. void protobuf_AssignDescriptorsOnce() {
  169. static ::google::protobuf::internal::once_flag once;
  170. ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors);
  171. }
  172. void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD;
  173. void protobuf_RegisterTypes(const ::std::string&) {
  174. protobuf_AssignDescriptorsOnce();
  175. ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 4);
  176. }
  177. void AddDescriptorsImpl() {
  178. InitDefaults();
  179. static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
  180. "\n7google/protobuf/util/internal/testdata"
  181. "/field_mask.proto\022\027google.protobuf.testi"
  182. "ng\032 google/protobuf/field_mask.proto\"\203\001\n"
  183. "\017NestedFieldMask\022\014\n\004data\030\001 \001(\t\022/\n\013single"
  184. "_mask\030\002 \001(\0132\032.google.protobuf.FieldMask\022"
  185. "1\n\rrepeated_mask\030\003 \003(\0132\032.google.protobuf"
  186. ".FieldMask\"\276\001\n\rFieldMaskTest\022\n\n\002id\030\001 \001(\t"
  187. "\022/\n\013single_mask\030\002 \001(\0132\032.google.protobuf."
  188. "FieldMask\0221\n\rrepeated_mask\030\003 \003(\0132\032.googl"
  189. "e.protobuf.FieldMask\022=\n\013nested_mask\030\004 \003("
  190. "\0132(.google.protobuf.testing.NestedFieldM"
  191. "ask\"\220\006\n\022FieldMaskTestCases\022>\n\013single_mas"
  192. "k\030\001 \001(\0132).google.protobuf.testing.FieldM"
  193. "askWrapper\022@\n\rmultiple_mask\030\002 \001(\0132).goog"
  194. "le.protobuf.testing.FieldMaskWrapper\022>\n\013"
  195. "snake_camel\030\003 \001(\0132).google.protobuf.test"
  196. "ing.FieldMaskWrapper\022>\n\013empty_field\030\004 \001("
  197. "\0132).google.protobuf.testing.FieldMaskWra"
  198. "pper\022A\n\016apiary_format1\030\005 \001(\0132).google.pr"
  199. "otobuf.testing.FieldMaskWrapper\022A\n\016apiar"
  200. "y_format2\030\006 \001(\0132).google.protobuf.testin"
  201. "g.FieldMaskWrapper\022A\n\016apiary_format3\030\007 \001"
  202. "(\0132).google.protobuf.testing.FieldMaskWr"
  203. "apper\022;\n\010map_key1\030\010 \001(\0132).google.protobu"
  204. "f.testing.FieldMaskWrapper\022;\n\010map_key2\030\t"
  205. " \001(\0132).google.protobuf.testing.FieldMask"
  206. "Wrapper\022;\n\010map_key3\030\n \001(\0132).google.proto"
  207. "buf.testing.FieldMaskWrapper\022;\n\010map_key4"
  208. "\030\013 \001(\0132).google.protobuf.testing.FieldMa"
  209. "skWrapper\022;\n\010map_key5\030\014 \001(\0132).google.pro"
  210. "tobuf.testing.FieldMaskWrapper\"<\n\020FieldM"
  211. "askWrapper\022(\n\004mask\030\001 \001(\0132\032.google.protob"
  212. "uf.FieldMask2x\n\024FieldMaskTestService\022`\n\004"
  213. "Call\022+.google.protobuf.testing.FieldMask"
  214. "TestCases\032+.google.protobuf.testing.Fiel"
  215. "dMaskTestCasesb\006proto3"
  216. };
  217. ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
  218. descriptor, 1422);
  219. ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
  220. "google/protobuf/util/internal/testdata/field_mask.proto", &protobuf_RegisterTypes);
  221. ::protobuf_google_2fprotobuf_2ffield_5fmask_2eproto::AddDescriptors();
  222. }
  223. void AddDescriptors() {
  224. static ::google::protobuf::internal::once_flag once;
  225. ::google::protobuf::internal::call_once(once, AddDescriptorsImpl);
  226. }
  227. // Force AddDescriptors() to be called at dynamic initialization time.
  228. struct StaticDescriptorInitializer {
  229. StaticDescriptorInitializer() {
  230. AddDescriptors();
  231. }
  232. } static_descriptor_initializer;
  233. } // namespace protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2ffield_5fmask_2eproto
  234. namespace google {
  235. namespace protobuf {
  236. namespace testing {
  237. // ===================================================================
  238. void NestedFieldMask::InitAsDefaultInstance() {
  239. ::google::protobuf::testing::_NestedFieldMask_default_instance_._instance.get_mutable()->single_mask_ = const_cast< ::google::protobuf::FieldMask*>(
  240. ::google::protobuf::FieldMask::internal_default_instance());
  241. }
  242. void NestedFieldMask::clear_single_mask() {
  243. if (GetArenaNoVirtual() == NULL && single_mask_ != NULL) {
  244. delete single_mask_;
  245. }
  246. single_mask_ = NULL;
  247. }
  248. void NestedFieldMask::clear_repeated_mask() {
  249. repeated_mask_.Clear();
  250. }
  251. #if !defined(_MSC_VER) || _MSC_VER >= 1900
  252. const int NestedFieldMask::kDataFieldNumber;
  253. const int NestedFieldMask::kSingleMaskFieldNumber;
  254. const int NestedFieldMask::kRepeatedMaskFieldNumber;
  255. #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
  256. NestedFieldMask::NestedFieldMask()
  257. : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  258. ::google::protobuf::internal::InitSCC(
  259. &protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2ffield_5fmask_2eproto::scc_info_NestedFieldMask.base);
  260. SharedCtor();
  261. // @@protoc_insertion_point(constructor:google.protobuf.testing.NestedFieldMask)
  262. }
  263. NestedFieldMask::NestedFieldMask(const NestedFieldMask& from)
  264. : ::google::protobuf::Message(),
  265. _internal_metadata_(NULL),
  266. repeated_mask_(from.repeated_mask_) {
  267. _internal_metadata_.MergeFrom(from._internal_metadata_);
  268. data_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  269. if (from.data().size() > 0) {
  270. data_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.data_);
  271. }
  272. if (from.has_single_mask()) {
  273. single_mask_ = new ::google::protobuf::FieldMask(*from.single_mask_);
  274. } else {
  275. single_mask_ = NULL;
  276. }
  277. // @@protoc_insertion_point(copy_constructor:google.protobuf.testing.NestedFieldMask)
  278. }
  279. void NestedFieldMask::SharedCtor() {
  280. data_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  281. single_mask_ = NULL;
  282. }
  283. NestedFieldMask::~NestedFieldMask() {
  284. // @@protoc_insertion_point(destructor:google.protobuf.testing.NestedFieldMask)
  285. SharedDtor();
  286. }
  287. void NestedFieldMask::SharedDtor() {
  288. data_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  289. if (this != internal_default_instance()) delete single_mask_;
  290. }
  291. void NestedFieldMask::SetCachedSize(int size) const {
  292. _cached_size_.Set(size);
  293. }
  294. const ::google::protobuf::Descriptor* NestedFieldMask::descriptor() {
  295. ::protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2ffield_5fmask_2eproto::protobuf_AssignDescriptorsOnce();
  296. return ::protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2ffield_5fmask_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
  297. }
  298. const NestedFieldMask& NestedFieldMask::default_instance() {
  299. ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2ffield_5fmask_2eproto::scc_info_NestedFieldMask.base);
  300. return *internal_default_instance();
  301. }
  302. void NestedFieldMask::Clear() {
  303. // @@protoc_insertion_point(message_clear_start:google.protobuf.testing.NestedFieldMask)
  304. ::google::protobuf::uint32 cached_has_bits = 0;
  305. // Prevent compiler warnings about cached_has_bits being unused
  306. (void) cached_has_bits;
  307. repeated_mask_.Clear();
  308. data_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  309. if (GetArenaNoVirtual() == NULL && single_mask_ != NULL) {
  310. delete single_mask_;
  311. }
  312. single_mask_ = NULL;
  313. _internal_metadata_.Clear();
  314. }
  315. bool NestedFieldMask::MergePartialFromCodedStream(
  316. ::google::protobuf::io::CodedInputStream* input) {
  317. #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  318. ::google::protobuf::uint32 tag;
  319. // @@protoc_insertion_point(parse_start:google.protobuf.testing.NestedFieldMask)
  320. for (;;) {
  321. ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
  322. tag = p.first;
  323. if (!p.second) goto handle_unusual;
  324. switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
  325. // string data = 1;
  326. case 1: {
  327. if (static_cast< ::google::protobuf::uint8>(tag) ==
  328. static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
  329. DO_(::google::protobuf::internal::WireFormatLite::ReadString(
  330. input, this->mutable_data()));
  331. DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  332. this->data().data(), static_cast<int>(this->data().length()),
  333. ::google::protobuf::internal::WireFormatLite::PARSE,
  334. "google.protobuf.testing.NestedFieldMask.data"));
  335. } else {
  336. goto handle_unusual;
  337. }
  338. break;
  339. }
  340. // .google.protobuf.FieldMask single_mask = 2;
  341. case 2: {
  342. if (static_cast< ::google::protobuf::uint8>(tag) ==
  343. static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
  344. DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
  345. input, mutable_single_mask()));
  346. } else {
  347. goto handle_unusual;
  348. }
  349. break;
  350. }
  351. // repeated .google.protobuf.FieldMask repeated_mask = 3;
  352. case 3: {
  353. if (static_cast< ::google::protobuf::uint8>(tag) ==
  354. static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
  355. DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
  356. input, add_repeated_mask()));
  357. } else {
  358. goto handle_unusual;
  359. }
  360. break;
  361. }
  362. default: {
  363. handle_unusual:
  364. if (tag == 0) {
  365. goto success;
  366. }
  367. DO_(::google::protobuf::internal::WireFormat::SkipField(
  368. input, tag, _internal_metadata_.mutable_unknown_fields()));
  369. break;
  370. }
  371. }
  372. }
  373. success:
  374. // @@protoc_insertion_point(parse_success:google.protobuf.testing.NestedFieldMask)
  375. return true;
  376. failure:
  377. // @@protoc_insertion_point(parse_failure:google.protobuf.testing.NestedFieldMask)
  378. return false;
  379. #undef DO_
  380. }
  381. void NestedFieldMask::SerializeWithCachedSizes(
  382. ::google::protobuf::io::CodedOutputStream* output) const {
  383. // @@protoc_insertion_point(serialize_start:google.protobuf.testing.NestedFieldMask)
  384. ::google::protobuf::uint32 cached_has_bits = 0;
  385. (void) cached_has_bits;
  386. // string data = 1;
  387. if (this->data().size() > 0) {
  388. ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  389. this->data().data(), static_cast<int>(this->data().length()),
  390. ::google::protobuf::internal::WireFormatLite::SERIALIZE,
  391. "google.protobuf.testing.NestedFieldMask.data");
  392. ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
  393. 1, this->data(), output);
  394. }
  395. // .google.protobuf.FieldMask single_mask = 2;
  396. if (this->has_single_mask()) {
  397. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  398. 2, this->_internal_single_mask(), output);
  399. }
  400. // repeated .google.protobuf.FieldMask repeated_mask = 3;
  401. for (unsigned int i = 0,
  402. n = static_cast<unsigned int>(this->repeated_mask_size()); i < n; i++) {
  403. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  404. 3,
  405. this->repeated_mask(static_cast<int>(i)),
  406. output);
  407. }
  408. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  409. ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
  410. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output);
  411. }
  412. // @@protoc_insertion_point(serialize_end:google.protobuf.testing.NestedFieldMask)
  413. }
  414. ::google::protobuf::uint8* NestedFieldMask::InternalSerializeWithCachedSizesToArray(
  415. bool deterministic, ::google::protobuf::uint8* target) const {
  416. (void)deterministic; // Unused
  417. // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.testing.NestedFieldMask)
  418. ::google::protobuf::uint32 cached_has_bits = 0;
  419. (void) cached_has_bits;
  420. // string data = 1;
  421. if (this->data().size() > 0) {
  422. ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  423. this->data().data(), static_cast<int>(this->data().length()),
  424. ::google::protobuf::internal::WireFormatLite::SERIALIZE,
  425. "google.protobuf.testing.NestedFieldMask.data");
  426. target =
  427. ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
  428. 1, this->data(), target);
  429. }
  430. // .google.protobuf.FieldMask single_mask = 2;
  431. if (this->has_single_mask()) {
  432. target = ::google::protobuf::internal::WireFormatLite::
  433. InternalWriteMessageToArray(
  434. 2, this->_internal_single_mask(), deterministic, target);
  435. }
  436. // repeated .google.protobuf.FieldMask repeated_mask = 3;
  437. for (unsigned int i = 0,
  438. n = static_cast<unsigned int>(this->repeated_mask_size()); i < n; i++) {
  439. target = ::google::protobuf::internal::WireFormatLite::
  440. InternalWriteMessageToArray(
  441. 3, this->repeated_mask(static_cast<int>(i)), deterministic, target);
  442. }
  443. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  444. target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
  445. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target);
  446. }
  447. // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.testing.NestedFieldMask)
  448. return target;
  449. }
  450. size_t NestedFieldMask::ByteSizeLong() const {
  451. // @@protoc_insertion_point(message_byte_size_start:google.protobuf.testing.NestedFieldMask)
  452. size_t total_size = 0;
  453. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  454. total_size +=
  455. ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
  456. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()));
  457. }
  458. // repeated .google.protobuf.FieldMask repeated_mask = 3;
  459. {
  460. unsigned int count = static_cast<unsigned int>(this->repeated_mask_size());
  461. total_size += 1UL * count;
  462. for (unsigned int i = 0; i < count; i++) {
  463. total_size +=
  464. ::google::protobuf::internal::WireFormatLite::MessageSize(
  465. this->repeated_mask(static_cast<int>(i)));
  466. }
  467. }
  468. // string data = 1;
  469. if (this->data().size() > 0) {
  470. total_size += 1 +
  471. ::google::protobuf::internal::WireFormatLite::StringSize(
  472. this->data());
  473. }
  474. // .google.protobuf.FieldMask single_mask = 2;
  475. if (this->has_single_mask()) {
  476. total_size += 1 +
  477. ::google::protobuf::internal::WireFormatLite::MessageSize(
  478. *single_mask_);
  479. }
  480. int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  481. SetCachedSize(cached_size);
  482. return total_size;
  483. }
  484. void NestedFieldMask::MergeFrom(const ::google::protobuf::Message& from) {
  485. // @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.testing.NestedFieldMask)
  486. GOOGLE_DCHECK_NE(&from, this);
  487. const NestedFieldMask* source =
  488. ::google::protobuf::internal::DynamicCastToGenerated<const NestedFieldMask>(
  489. &from);
  490. if (source == NULL) {
  491. // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.testing.NestedFieldMask)
  492. ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  493. } else {
  494. // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.testing.NestedFieldMask)
  495. MergeFrom(*source);
  496. }
  497. }
  498. void NestedFieldMask::MergeFrom(const NestedFieldMask& from) {
  499. // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.testing.NestedFieldMask)
  500. GOOGLE_DCHECK_NE(&from, this);
  501. _internal_metadata_.MergeFrom(from._internal_metadata_);
  502. ::google::protobuf::uint32 cached_has_bits = 0;
  503. (void) cached_has_bits;
  504. repeated_mask_.MergeFrom(from.repeated_mask_);
  505. if (from.data().size() > 0) {
  506. data_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.data_);
  507. }
  508. if (from.has_single_mask()) {
  509. mutable_single_mask()->::google::protobuf::FieldMask::MergeFrom(from.single_mask());
  510. }
  511. }
  512. void NestedFieldMask::CopyFrom(const ::google::protobuf::Message& from) {
  513. // @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.testing.NestedFieldMask)
  514. if (&from == this) return;
  515. Clear();
  516. MergeFrom(from);
  517. }
  518. void NestedFieldMask::CopyFrom(const NestedFieldMask& from) {
  519. // @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.testing.NestedFieldMask)
  520. if (&from == this) return;
  521. Clear();
  522. MergeFrom(from);
  523. }
  524. bool NestedFieldMask::IsInitialized() const {
  525. return true;
  526. }
  527. void NestedFieldMask::Swap(NestedFieldMask* other) {
  528. if (other == this) return;
  529. InternalSwap(other);
  530. }
  531. void NestedFieldMask::InternalSwap(NestedFieldMask* other) {
  532. using std::swap;
  533. CastToBase(&repeated_mask_)->InternalSwap(CastToBase(&other->repeated_mask_));
  534. data_.Swap(&other->data_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
  535. GetArenaNoVirtual());
  536. swap(single_mask_, other->single_mask_);
  537. _internal_metadata_.Swap(&other->_internal_metadata_);
  538. }
  539. ::google::protobuf::Metadata NestedFieldMask::GetMetadata() const {
  540. protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2ffield_5fmask_2eproto::protobuf_AssignDescriptorsOnce();
  541. return ::protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2ffield_5fmask_2eproto::file_level_metadata[kIndexInFileMessages];
  542. }
  543. // ===================================================================
  544. void FieldMaskTest::InitAsDefaultInstance() {
  545. ::google::protobuf::testing::_FieldMaskTest_default_instance_._instance.get_mutable()->single_mask_ = const_cast< ::google::protobuf::FieldMask*>(
  546. ::google::protobuf::FieldMask::internal_default_instance());
  547. }
  548. void FieldMaskTest::clear_single_mask() {
  549. if (GetArenaNoVirtual() == NULL && single_mask_ != NULL) {
  550. delete single_mask_;
  551. }
  552. single_mask_ = NULL;
  553. }
  554. void FieldMaskTest::clear_repeated_mask() {
  555. repeated_mask_.Clear();
  556. }
  557. #if !defined(_MSC_VER) || _MSC_VER >= 1900
  558. const int FieldMaskTest::kIdFieldNumber;
  559. const int FieldMaskTest::kSingleMaskFieldNumber;
  560. const int FieldMaskTest::kRepeatedMaskFieldNumber;
  561. const int FieldMaskTest::kNestedMaskFieldNumber;
  562. #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
  563. FieldMaskTest::FieldMaskTest()
  564. : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  565. ::google::protobuf::internal::InitSCC(
  566. &protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2ffield_5fmask_2eproto::scc_info_FieldMaskTest.base);
  567. SharedCtor();
  568. // @@protoc_insertion_point(constructor:google.protobuf.testing.FieldMaskTest)
  569. }
  570. FieldMaskTest::FieldMaskTest(const FieldMaskTest& from)
  571. : ::google::protobuf::Message(),
  572. _internal_metadata_(NULL),
  573. repeated_mask_(from.repeated_mask_),
  574. nested_mask_(from.nested_mask_) {
  575. _internal_metadata_.MergeFrom(from._internal_metadata_);
  576. id_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  577. if (from.id().size() > 0) {
  578. id_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.id_);
  579. }
  580. if (from.has_single_mask()) {
  581. single_mask_ = new ::google::protobuf::FieldMask(*from.single_mask_);
  582. } else {
  583. single_mask_ = NULL;
  584. }
  585. // @@protoc_insertion_point(copy_constructor:google.protobuf.testing.FieldMaskTest)
  586. }
  587. void FieldMaskTest::SharedCtor() {
  588. id_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  589. single_mask_ = NULL;
  590. }
  591. FieldMaskTest::~FieldMaskTest() {
  592. // @@protoc_insertion_point(destructor:google.protobuf.testing.FieldMaskTest)
  593. SharedDtor();
  594. }
  595. void FieldMaskTest::SharedDtor() {
  596. id_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  597. if (this != internal_default_instance()) delete single_mask_;
  598. }
  599. void FieldMaskTest::SetCachedSize(int size) const {
  600. _cached_size_.Set(size);
  601. }
  602. const ::google::protobuf::Descriptor* FieldMaskTest::descriptor() {
  603. ::protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2ffield_5fmask_2eproto::protobuf_AssignDescriptorsOnce();
  604. return ::protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2ffield_5fmask_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
  605. }
  606. const FieldMaskTest& FieldMaskTest::default_instance() {
  607. ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2ffield_5fmask_2eproto::scc_info_FieldMaskTest.base);
  608. return *internal_default_instance();
  609. }
  610. void FieldMaskTest::Clear() {
  611. // @@protoc_insertion_point(message_clear_start:google.protobuf.testing.FieldMaskTest)
  612. ::google::protobuf::uint32 cached_has_bits = 0;
  613. // Prevent compiler warnings about cached_has_bits being unused
  614. (void) cached_has_bits;
  615. repeated_mask_.Clear();
  616. nested_mask_.Clear();
  617. id_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  618. if (GetArenaNoVirtual() == NULL && single_mask_ != NULL) {
  619. delete single_mask_;
  620. }
  621. single_mask_ = NULL;
  622. _internal_metadata_.Clear();
  623. }
  624. bool FieldMaskTest::MergePartialFromCodedStream(
  625. ::google::protobuf::io::CodedInputStream* input) {
  626. #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  627. ::google::protobuf::uint32 tag;
  628. // @@protoc_insertion_point(parse_start:google.protobuf.testing.FieldMaskTest)
  629. for (;;) {
  630. ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
  631. tag = p.first;
  632. if (!p.second) goto handle_unusual;
  633. switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
  634. // string id = 1;
  635. case 1: {
  636. if (static_cast< ::google::protobuf::uint8>(tag) ==
  637. static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
  638. DO_(::google::protobuf::internal::WireFormatLite::ReadString(
  639. input, this->mutable_id()));
  640. DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  641. this->id().data(), static_cast<int>(this->id().length()),
  642. ::google::protobuf::internal::WireFormatLite::PARSE,
  643. "google.protobuf.testing.FieldMaskTest.id"));
  644. } else {
  645. goto handle_unusual;
  646. }
  647. break;
  648. }
  649. // .google.protobuf.FieldMask single_mask = 2;
  650. case 2: {
  651. if (static_cast< ::google::protobuf::uint8>(tag) ==
  652. static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
  653. DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
  654. input, mutable_single_mask()));
  655. } else {
  656. goto handle_unusual;
  657. }
  658. break;
  659. }
  660. // repeated .google.protobuf.FieldMask repeated_mask = 3;
  661. case 3: {
  662. if (static_cast< ::google::protobuf::uint8>(tag) ==
  663. static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
  664. DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
  665. input, add_repeated_mask()));
  666. } else {
  667. goto handle_unusual;
  668. }
  669. break;
  670. }
  671. // repeated .google.protobuf.testing.NestedFieldMask nested_mask = 4;
  672. case 4: {
  673. if (static_cast< ::google::protobuf::uint8>(tag) ==
  674. static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) {
  675. DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
  676. input, add_nested_mask()));
  677. } else {
  678. goto handle_unusual;
  679. }
  680. break;
  681. }
  682. default: {
  683. handle_unusual:
  684. if (tag == 0) {
  685. goto success;
  686. }
  687. DO_(::google::protobuf::internal::WireFormat::SkipField(
  688. input, tag, _internal_metadata_.mutable_unknown_fields()));
  689. break;
  690. }
  691. }
  692. }
  693. success:
  694. // @@protoc_insertion_point(parse_success:google.protobuf.testing.FieldMaskTest)
  695. return true;
  696. failure:
  697. // @@protoc_insertion_point(parse_failure:google.protobuf.testing.FieldMaskTest)
  698. return false;
  699. #undef DO_
  700. }
  701. void FieldMaskTest::SerializeWithCachedSizes(
  702. ::google::protobuf::io::CodedOutputStream* output) const {
  703. // @@protoc_insertion_point(serialize_start:google.protobuf.testing.FieldMaskTest)
  704. ::google::protobuf::uint32 cached_has_bits = 0;
  705. (void) cached_has_bits;
  706. // string id = 1;
  707. if (this->id().size() > 0) {
  708. ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  709. this->id().data(), static_cast<int>(this->id().length()),
  710. ::google::protobuf::internal::WireFormatLite::SERIALIZE,
  711. "google.protobuf.testing.FieldMaskTest.id");
  712. ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
  713. 1, this->id(), output);
  714. }
  715. // .google.protobuf.FieldMask single_mask = 2;
  716. if (this->has_single_mask()) {
  717. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  718. 2, this->_internal_single_mask(), output);
  719. }
  720. // repeated .google.protobuf.FieldMask repeated_mask = 3;
  721. for (unsigned int i = 0,
  722. n = static_cast<unsigned int>(this->repeated_mask_size()); i < n; i++) {
  723. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  724. 3,
  725. this->repeated_mask(static_cast<int>(i)),
  726. output);
  727. }
  728. // repeated .google.protobuf.testing.NestedFieldMask nested_mask = 4;
  729. for (unsigned int i = 0,
  730. n = static_cast<unsigned int>(this->nested_mask_size()); i < n; i++) {
  731. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  732. 4,
  733. this->nested_mask(static_cast<int>(i)),
  734. output);
  735. }
  736. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  737. ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
  738. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output);
  739. }
  740. // @@protoc_insertion_point(serialize_end:google.protobuf.testing.FieldMaskTest)
  741. }
  742. ::google::protobuf::uint8* FieldMaskTest::InternalSerializeWithCachedSizesToArray(
  743. bool deterministic, ::google::protobuf::uint8* target) const {
  744. (void)deterministic; // Unused
  745. // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.testing.FieldMaskTest)
  746. ::google::protobuf::uint32 cached_has_bits = 0;
  747. (void) cached_has_bits;
  748. // string id = 1;
  749. if (this->id().size() > 0) {
  750. ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  751. this->id().data(), static_cast<int>(this->id().length()),
  752. ::google::protobuf::internal::WireFormatLite::SERIALIZE,
  753. "google.protobuf.testing.FieldMaskTest.id");
  754. target =
  755. ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
  756. 1, this->id(), target);
  757. }
  758. // .google.protobuf.FieldMask single_mask = 2;
  759. if (this->has_single_mask()) {
  760. target = ::google::protobuf::internal::WireFormatLite::
  761. InternalWriteMessageToArray(
  762. 2, this->_internal_single_mask(), deterministic, target);
  763. }
  764. // repeated .google.protobuf.FieldMask repeated_mask = 3;
  765. for (unsigned int i = 0,
  766. n = static_cast<unsigned int>(this->repeated_mask_size()); i < n; i++) {
  767. target = ::google::protobuf::internal::WireFormatLite::
  768. InternalWriteMessageToArray(
  769. 3, this->repeated_mask(static_cast<int>(i)), deterministic, target);
  770. }
  771. // repeated .google.protobuf.testing.NestedFieldMask nested_mask = 4;
  772. for (unsigned int i = 0,
  773. n = static_cast<unsigned int>(this->nested_mask_size()); i < n; i++) {
  774. target = ::google::protobuf::internal::WireFormatLite::
  775. InternalWriteMessageToArray(
  776. 4, this->nested_mask(static_cast<int>(i)), deterministic, target);
  777. }
  778. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  779. target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
  780. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target);
  781. }
  782. // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.testing.FieldMaskTest)
  783. return target;
  784. }
  785. size_t FieldMaskTest::ByteSizeLong() const {
  786. // @@protoc_insertion_point(message_byte_size_start:google.protobuf.testing.FieldMaskTest)
  787. size_t total_size = 0;
  788. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  789. total_size +=
  790. ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
  791. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()));
  792. }
  793. // repeated .google.protobuf.FieldMask repeated_mask = 3;
  794. {
  795. unsigned int count = static_cast<unsigned int>(this->repeated_mask_size());
  796. total_size += 1UL * count;
  797. for (unsigned int i = 0; i < count; i++) {
  798. total_size +=
  799. ::google::protobuf::internal::WireFormatLite::MessageSize(
  800. this->repeated_mask(static_cast<int>(i)));
  801. }
  802. }
  803. // repeated .google.protobuf.testing.NestedFieldMask nested_mask = 4;
  804. {
  805. unsigned int count = static_cast<unsigned int>(this->nested_mask_size());
  806. total_size += 1UL * count;
  807. for (unsigned int i = 0; i < count; i++) {
  808. total_size +=
  809. ::google::protobuf::internal::WireFormatLite::MessageSize(
  810. this->nested_mask(static_cast<int>(i)));
  811. }
  812. }
  813. // string id = 1;
  814. if (this->id().size() > 0) {
  815. total_size += 1 +
  816. ::google::protobuf::internal::WireFormatLite::StringSize(
  817. this->id());
  818. }
  819. // .google.protobuf.FieldMask single_mask = 2;
  820. if (this->has_single_mask()) {
  821. total_size += 1 +
  822. ::google::protobuf::internal::WireFormatLite::MessageSize(
  823. *single_mask_);
  824. }
  825. int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  826. SetCachedSize(cached_size);
  827. return total_size;
  828. }
  829. void FieldMaskTest::MergeFrom(const ::google::protobuf::Message& from) {
  830. // @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.testing.FieldMaskTest)
  831. GOOGLE_DCHECK_NE(&from, this);
  832. const FieldMaskTest* source =
  833. ::google::protobuf::internal::DynamicCastToGenerated<const FieldMaskTest>(
  834. &from);
  835. if (source == NULL) {
  836. // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.testing.FieldMaskTest)
  837. ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  838. } else {
  839. // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.testing.FieldMaskTest)
  840. MergeFrom(*source);
  841. }
  842. }
  843. void FieldMaskTest::MergeFrom(const FieldMaskTest& from) {
  844. // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.testing.FieldMaskTest)
  845. GOOGLE_DCHECK_NE(&from, this);
  846. _internal_metadata_.MergeFrom(from._internal_metadata_);
  847. ::google::protobuf::uint32 cached_has_bits = 0;
  848. (void) cached_has_bits;
  849. repeated_mask_.MergeFrom(from.repeated_mask_);
  850. nested_mask_.MergeFrom(from.nested_mask_);
  851. if (from.id().size() > 0) {
  852. id_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.id_);
  853. }
  854. if (from.has_single_mask()) {
  855. mutable_single_mask()->::google::protobuf::FieldMask::MergeFrom(from.single_mask());
  856. }
  857. }
  858. void FieldMaskTest::CopyFrom(const ::google::protobuf::Message& from) {
  859. // @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.testing.FieldMaskTest)
  860. if (&from == this) return;
  861. Clear();
  862. MergeFrom(from);
  863. }
  864. void FieldMaskTest::CopyFrom(const FieldMaskTest& from) {
  865. // @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.testing.FieldMaskTest)
  866. if (&from == this) return;
  867. Clear();
  868. MergeFrom(from);
  869. }
  870. bool FieldMaskTest::IsInitialized() const {
  871. return true;
  872. }
  873. void FieldMaskTest::Swap(FieldMaskTest* other) {
  874. if (other == this) return;
  875. InternalSwap(other);
  876. }
  877. void FieldMaskTest::InternalSwap(FieldMaskTest* other) {
  878. using std::swap;
  879. CastToBase(&repeated_mask_)->InternalSwap(CastToBase(&other->repeated_mask_));
  880. CastToBase(&nested_mask_)->InternalSwap(CastToBase(&other->nested_mask_));
  881. id_.Swap(&other->id_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
  882. GetArenaNoVirtual());
  883. swap(single_mask_, other->single_mask_);
  884. _internal_metadata_.Swap(&other->_internal_metadata_);
  885. }
  886. ::google::protobuf::Metadata FieldMaskTest::GetMetadata() const {
  887. protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2ffield_5fmask_2eproto::protobuf_AssignDescriptorsOnce();
  888. return ::protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2ffield_5fmask_2eproto::file_level_metadata[kIndexInFileMessages];
  889. }
  890. // ===================================================================
  891. void FieldMaskTestCases::InitAsDefaultInstance() {
  892. ::google::protobuf::testing::_FieldMaskTestCases_default_instance_._instance.get_mutable()->single_mask_ = const_cast< ::google::protobuf::testing::FieldMaskWrapper*>(
  893. ::google::protobuf::testing::FieldMaskWrapper::internal_default_instance());
  894. ::google::protobuf::testing::_FieldMaskTestCases_default_instance_._instance.get_mutable()->multiple_mask_ = const_cast< ::google::protobuf::testing::FieldMaskWrapper*>(
  895. ::google::protobuf::testing::FieldMaskWrapper::internal_default_instance());
  896. ::google::protobuf::testing::_FieldMaskTestCases_default_instance_._instance.get_mutable()->snake_camel_ = const_cast< ::google::protobuf::testing::FieldMaskWrapper*>(
  897. ::google::protobuf::testing::FieldMaskWrapper::internal_default_instance());
  898. ::google::protobuf::testing::_FieldMaskTestCases_default_instance_._instance.get_mutable()->empty_field_ = const_cast< ::google::protobuf::testing::FieldMaskWrapper*>(
  899. ::google::protobuf::testing::FieldMaskWrapper::internal_default_instance());
  900. ::google::protobuf::testing::_FieldMaskTestCases_default_instance_._instance.get_mutable()->apiary_format1_ = const_cast< ::google::protobuf::testing::FieldMaskWrapper*>(
  901. ::google::protobuf::testing::FieldMaskWrapper::internal_default_instance());
  902. ::google::protobuf::testing::_FieldMaskTestCases_default_instance_._instance.get_mutable()->apiary_format2_ = const_cast< ::google::protobuf::testing::FieldMaskWrapper*>(
  903. ::google::protobuf::testing::FieldMaskWrapper::internal_default_instance());
  904. ::google::protobuf::testing::_FieldMaskTestCases_default_instance_._instance.get_mutable()->apiary_format3_ = const_cast< ::google::protobuf::testing::FieldMaskWrapper*>(
  905. ::google::protobuf::testing::FieldMaskWrapper::internal_default_instance());
  906. ::google::protobuf::testing::_FieldMaskTestCases_default_instance_._instance.get_mutable()->map_key1_ = const_cast< ::google::protobuf::testing::FieldMaskWrapper*>(
  907. ::google::protobuf::testing::FieldMaskWrapper::internal_default_instance());
  908. ::google::protobuf::testing::_FieldMaskTestCases_default_instance_._instance.get_mutable()->map_key2_ = const_cast< ::google::protobuf::testing::FieldMaskWrapper*>(
  909. ::google::protobuf::testing::FieldMaskWrapper::internal_default_instance());
  910. ::google::protobuf::testing::_FieldMaskTestCases_default_instance_._instance.get_mutable()->map_key3_ = const_cast< ::google::protobuf::testing::FieldMaskWrapper*>(
  911. ::google::protobuf::testing::FieldMaskWrapper::internal_default_instance());
  912. ::google::protobuf::testing::_FieldMaskTestCases_default_instance_._instance.get_mutable()->map_key4_ = const_cast< ::google::protobuf::testing::FieldMaskWrapper*>(
  913. ::google::protobuf::testing::FieldMaskWrapper::internal_default_instance());
  914. ::google::protobuf::testing::_FieldMaskTestCases_default_instance_._instance.get_mutable()->map_key5_ = const_cast< ::google::protobuf::testing::FieldMaskWrapper*>(
  915. ::google::protobuf::testing::FieldMaskWrapper::internal_default_instance());
  916. }
  917. #if !defined(_MSC_VER) || _MSC_VER >= 1900
  918. const int FieldMaskTestCases::kSingleMaskFieldNumber;
  919. const int FieldMaskTestCases::kMultipleMaskFieldNumber;
  920. const int FieldMaskTestCases::kSnakeCamelFieldNumber;
  921. const int FieldMaskTestCases::kEmptyFieldFieldNumber;
  922. const int FieldMaskTestCases::kApiaryFormat1FieldNumber;
  923. const int FieldMaskTestCases::kApiaryFormat2FieldNumber;
  924. const int FieldMaskTestCases::kApiaryFormat3FieldNumber;
  925. const int FieldMaskTestCases::kMapKey1FieldNumber;
  926. const int FieldMaskTestCases::kMapKey2FieldNumber;
  927. const int FieldMaskTestCases::kMapKey3FieldNumber;
  928. const int FieldMaskTestCases::kMapKey4FieldNumber;
  929. const int FieldMaskTestCases::kMapKey5FieldNumber;
  930. #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
  931. FieldMaskTestCases::FieldMaskTestCases()
  932. : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  933. ::google::protobuf::internal::InitSCC(
  934. &protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2ffield_5fmask_2eproto::scc_info_FieldMaskTestCases.base);
  935. SharedCtor();
  936. // @@protoc_insertion_point(constructor:google.protobuf.testing.FieldMaskTestCases)
  937. }
  938. FieldMaskTestCases::FieldMaskTestCases(const FieldMaskTestCases& from)
  939. : ::google::protobuf::Message(),
  940. _internal_metadata_(NULL) {
  941. _internal_metadata_.MergeFrom(from._internal_metadata_);
  942. if (from.has_single_mask()) {
  943. single_mask_ = new ::google::protobuf::testing::FieldMaskWrapper(*from.single_mask_);
  944. } else {
  945. single_mask_ = NULL;
  946. }
  947. if (from.has_multiple_mask()) {
  948. multiple_mask_ = new ::google::protobuf::testing::FieldMaskWrapper(*from.multiple_mask_);
  949. } else {
  950. multiple_mask_ = NULL;
  951. }
  952. if (from.has_snake_camel()) {
  953. snake_camel_ = new ::google::protobuf::testing::FieldMaskWrapper(*from.snake_camel_);
  954. } else {
  955. snake_camel_ = NULL;
  956. }
  957. if (from.has_empty_field()) {
  958. empty_field_ = new ::google::protobuf::testing::FieldMaskWrapper(*from.empty_field_);
  959. } else {
  960. empty_field_ = NULL;
  961. }
  962. if (from.has_apiary_format1()) {
  963. apiary_format1_ = new ::google::protobuf::testing::FieldMaskWrapper(*from.apiary_format1_);
  964. } else {
  965. apiary_format1_ = NULL;
  966. }
  967. if (from.has_apiary_format2()) {
  968. apiary_format2_ = new ::google::protobuf::testing::FieldMaskWrapper(*from.apiary_format2_);
  969. } else {
  970. apiary_format2_ = NULL;
  971. }
  972. if (from.has_apiary_format3()) {
  973. apiary_format3_ = new ::google::protobuf::testing::FieldMaskWrapper(*from.apiary_format3_);
  974. } else {
  975. apiary_format3_ = NULL;
  976. }
  977. if (from.has_map_key1()) {
  978. map_key1_ = new ::google::protobuf::testing::FieldMaskWrapper(*from.map_key1_);
  979. } else {
  980. map_key1_ = NULL;
  981. }
  982. if (from.has_map_key2()) {
  983. map_key2_ = new ::google::protobuf::testing::FieldMaskWrapper(*from.map_key2_);
  984. } else {
  985. map_key2_ = NULL;
  986. }
  987. if (from.has_map_key3()) {
  988. map_key3_ = new ::google::protobuf::testing::FieldMaskWrapper(*from.map_key3_);
  989. } else {
  990. map_key3_ = NULL;
  991. }
  992. if (from.has_map_key4()) {
  993. map_key4_ = new ::google::protobuf::testing::FieldMaskWrapper(*from.map_key4_);
  994. } else {
  995. map_key4_ = NULL;
  996. }
  997. if (from.has_map_key5()) {
  998. map_key5_ = new ::google::protobuf::testing::FieldMaskWrapper(*from.map_key5_);
  999. } else {
  1000. map_key5_ = NULL;
  1001. }
  1002. // @@protoc_insertion_point(copy_constructor:google.protobuf.testing.FieldMaskTestCases)
  1003. }
  1004. void FieldMaskTestCases::SharedCtor() {
  1005. ::memset(&single_mask_, 0, static_cast<size_t>(
  1006. reinterpret_cast<char*>(&map_key5_) -
  1007. reinterpret_cast<char*>(&single_mask_)) + sizeof(map_key5_));
  1008. }
  1009. FieldMaskTestCases::~FieldMaskTestCases() {
  1010. // @@protoc_insertion_point(destructor:google.protobuf.testing.FieldMaskTestCases)
  1011. SharedDtor();
  1012. }
  1013. void FieldMaskTestCases::SharedDtor() {
  1014. if (this != internal_default_instance()) delete single_mask_;
  1015. if (this != internal_default_instance()) delete multiple_mask_;
  1016. if (this != internal_default_instance()) delete snake_camel_;
  1017. if (this != internal_default_instance()) delete empty_field_;
  1018. if (this != internal_default_instance()) delete apiary_format1_;
  1019. if (this != internal_default_instance()) delete apiary_format2_;
  1020. if (this != internal_default_instance()) delete apiary_format3_;
  1021. if (this != internal_default_instance()) delete map_key1_;
  1022. if (this != internal_default_instance()) delete map_key2_;
  1023. if (this != internal_default_instance()) delete map_key3_;
  1024. if (this != internal_default_instance()) delete map_key4_;
  1025. if (this != internal_default_instance()) delete map_key5_;
  1026. }
  1027. void FieldMaskTestCases::SetCachedSize(int size) const {
  1028. _cached_size_.Set(size);
  1029. }
  1030. const ::google::protobuf::Descriptor* FieldMaskTestCases::descriptor() {
  1031. ::protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2ffield_5fmask_2eproto::protobuf_AssignDescriptorsOnce();
  1032. return ::protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2ffield_5fmask_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
  1033. }
  1034. const FieldMaskTestCases& FieldMaskTestCases::default_instance() {
  1035. ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2ffield_5fmask_2eproto::scc_info_FieldMaskTestCases.base);
  1036. return *internal_default_instance();
  1037. }
  1038. void FieldMaskTestCases::Clear() {
  1039. // @@protoc_insertion_point(message_clear_start:google.protobuf.testing.FieldMaskTestCases)
  1040. ::google::protobuf::uint32 cached_has_bits = 0;
  1041. // Prevent compiler warnings about cached_has_bits being unused
  1042. (void) cached_has_bits;
  1043. if (GetArenaNoVirtual() == NULL && single_mask_ != NULL) {
  1044. delete single_mask_;
  1045. }
  1046. single_mask_ = NULL;
  1047. if (GetArenaNoVirtual() == NULL && multiple_mask_ != NULL) {
  1048. delete multiple_mask_;
  1049. }
  1050. multiple_mask_ = NULL;
  1051. if (GetArenaNoVirtual() == NULL && snake_camel_ != NULL) {
  1052. delete snake_camel_;
  1053. }
  1054. snake_camel_ = NULL;
  1055. if (GetArenaNoVirtual() == NULL && empty_field_ != NULL) {
  1056. delete empty_field_;
  1057. }
  1058. empty_field_ = NULL;
  1059. if (GetArenaNoVirtual() == NULL && apiary_format1_ != NULL) {
  1060. delete apiary_format1_;
  1061. }
  1062. apiary_format1_ = NULL;
  1063. if (GetArenaNoVirtual() == NULL && apiary_format2_ != NULL) {
  1064. delete apiary_format2_;
  1065. }
  1066. apiary_format2_ = NULL;
  1067. if (GetArenaNoVirtual() == NULL && apiary_format3_ != NULL) {
  1068. delete apiary_format3_;
  1069. }
  1070. apiary_format3_ = NULL;
  1071. if (GetArenaNoVirtual() == NULL && map_key1_ != NULL) {
  1072. delete map_key1_;
  1073. }
  1074. map_key1_ = NULL;
  1075. if (GetArenaNoVirtual() == NULL && map_key2_ != NULL) {
  1076. delete map_key2_;
  1077. }
  1078. map_key2_ = NULL;
  1079. if (GetArenaNoVirtual() == NULL && map_key3_ != NULL) {
  1080. delete map_key3_;
  1081. }
  1082. map_key3_ = NULL;
  1083. if (GetArenaNoVirtual() == NULL && map_key4_ != NULL) {
  1084. delete map_key4_;
  1085. }
  1086. map_key4_ = NULL;
  1087. if (GetArenaNoVirtual() == NULL && map_key5_ != NULL) {
  1088. delete map_key5_;
  1089. }
  1090. map_key5_ = NULL;
  1091. _internal_metadata_.Clear();
  1092. }
  1093. bool FieldMaskTestCases::MergePartialFromCodedStream(
  1094. ::google::protobuf::io::CodedInputStream* input) {
  1095. #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  1096. ::google::protobuf::uint32 tag;
  1097. // @@protoc_insertion_point(parse_start:google.protobuf.testing.FieldMaskTestCases)
  1098. for (;;) {
  1099. ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
  1100. tag = p.first;
  1101. if (!p.second) goto handle_unusual;
  1102. switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
  1103. // .google.protobuf.testing.FieldMaskWrapper single_mask = 1;
  1104. case 1: {
  1105. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1106. static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
  1107. DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
  1108. input, mutable_single_mask()));
  1109. } else {
  1110. goto handle_unusual;
  1111. }
  1112. break;
  1113. }
  1114. // .google.protobuf.testing.FieldMaskWrapper multiple_mask = 2;
  1115. case 2: {
  1116. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1117. static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
  1118. DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
  1119. input, mutable_multiple_mask()));
  1120. } else {
  1121. goto handle_unusual;
  1122. }
  1123. break;
  1124. }
  1125. // .google.protobuf.testing.FieldMaskWrapper snake_camel = 3;
  1126. case 3: {
  1127. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1128. static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
  1129. DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
  1130. input, mutable_snake_camel()));
  1131. } else {
  1132. goto handle_unusual;
  1133. }
  1134. break;
  1135. }
  1136. // .google.protobuf.testing.FieldMaskWrapper empty_field = 4;
  1137. case 4: {
  1138. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1139. static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) {
  1140. DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
  1141. input, mutable_empty_field()));
  1142. } else {
  1143. goto handle_unusual;
  1144. }
  1145. break;
  1146. }
  1147. // .google.protobuf.testing.FieldMaskWrapper apiary_format1 = 5;
  1148. case 5: {
  1149. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1150. static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) {
  1151. DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
  1152. input, mutable_apiary_format1()));
  1153. } else {
  1154. goto handle_unusual;
  1155. }
  1156. break;
  1157. }
  1158. // .google.protobuf.testing.FieldMaskWrapper apiary_format2 = 6;
  1159. case 6: {
  1160. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1161. static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) {
  1162. DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
  1163. input, mutable_apiary_format2()));
  1164. } else {
  1165. goto handle_unusual;
  1166. }
  1167. break;
  1168. }
  1169. // .google.protobuf.testing.FieldMaskWrapper apiary_format3 = 7;
  1170. case 7: {
  1171. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1172. static_cast< ::google::protobuf::uint8>(58u /* 58 & 0xFF */)) {
  1173. DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
  1174. input, mutable_apiary_format3()));
  1175. } else {
  1176. goto handle_unusual;
  1177. }
  1178. break;
  1179. }
  1180. // .google.protobuf.testing.FieldMaskWrapper map_key1 = 8;
  1181. case 8: {
  1182. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1183. static_cast< ::google::protobuf::uint8>(66u /* 66 & 0xFF */)) {
  1184. DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
  1185. input, mutable_map_key1()));
  1186. } else {
  1187. goto handle_unusual;
  1188. }
  1189. break;
  1190. }
  1191. // .google.protobuf.testing.FieldMaskWrapper map_key2 = 9;
  1192. case 9: {
  1193. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1194. static_cast< ::google::protobuf::uint8>(74u /* 74 & 0xFF */)) {
  1195. DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
  1196. input, mutable_map_key2()));
  1197. } else {
  1198. goto handle_unusual;
  1199. }
  1200. break;
  1201. }
  1202. // .google.protobuf.testing.FieldMaskWrapper map_key3 = 10;
  1203. case 10: {
  1204. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1205. static_cast< ::google::protobuf::uint8>(82u /* 82 & 0xFF */)) {
  1206. DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
  1207. input, mutable_map_key3()));
  1208. } else {
  1209. goto handle_unusual;
  1210. }
  1211. break;
  1212. }
  1213. // .google.protobuf.testing.FieldMaskWrapper map_key4 = 11;
  1214. case 11: {
  1215. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1216. static_cast< ::google::protobuf::uint8>(90u /* 90 & 0xFF */)) {
  1217. DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
  1218. input, mutable_map_key4()));
  1219. } else {
  1220. goto handle_unusual;
  1221. }
  1222. break;
  1223. }
  1224. // .google.protobuf.testing.FieldMaskWrapper map_key5 = 12;
  1225. case 12: {
  1226. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1227. static_cast< ::google::protobuf::uint8>(98u /* 98 & 0xFF */)) {
  1228. DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
  1229. input, mutable_map_key5()));
  1230. } else {
  1231. goto handle_unusual;
  1232. }
  1233. break;
  1234. }
  1235. default: {
  1236. handle_unusual:
  1237. if (tag == 0) {
  1238. goto success;
  1239. }
  1240. DO_(::google::protobuf::internal::WireFormat::SkipField(
  1241. input, tag, _internal_metadata_.mutable_unknown_fields()));
  1242. break;
  1243. }
  1244. }
  1245. }
  1246. success:
  1247. // @@protoc_insertion_point(parse_success:google.protobuf.testing.FieldMaskTestCases)
  1248. return true;
  1249. failure:
  1250. // @@protoc_insertion_point(parse_failure:google.protobuf.testing.FieldMaskTestCases)
  1251. return false;
  1252. #undef DO_
  1253. }
  1254. void FieldMaskTestCases::SerializeWithCachedSizes(
  1255. ::google::protobuf::io::CodedOutputStream* output) const {
  1256. // @@protoc_insertion_point(serialize_start:google.protobuf.testing.FieldMaskTestCases)
  1257. ::google::protobuf::uint32 cached_has_bits = 0;
  1258. (void) cached_has_bits;
  1259. // .google.protobuf.testing.FieldMaskWrapper single_mask = 1;
  1260. if (this->has_single_mask()) {
  1261. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  1262. 1, this->_internal_single_mask(), output);
  1263. }
  1264. // .google.protobuf.testing.FieldMaskWrapper multiple_mask = 2;
  1265. if (this->has_multiple_mask()) {
  1266. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  1267. 2, this->_internal_multiple_mask(), output);
  1268. }
  1269. // .google.protobuf.testing.FieldMaskWrapper snake_camel = 3;
  1270. if (this->has_snake_camel()) {
  1271. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  1272. 3, this->_internal_snake_camel(), output);
  1273. }
  1274. // .google.protobuf.testing.FieldMaskWrapper empty_field = 4;
  1275. if (this->has_empty_field()) {
  1276. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  1277. 4, this->_internal_empty_field(), output);
  1278. }
  1279. // .google.protobuf.testing.FieldMaskWrapper apiary_format1 = 5;
  1280. if (this->has_apiary_format1()) {
  1281. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  1282. 5, this->_internal_apiary_format1(), output);
  1283. }
  1284. // .google.protobuf.testing.FieldMaskWrapper apiary_format2 = 6;
  1285. if (this->has_apiary_format2()) {
  1286. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  1287. 6, this->_internal_apiary_format2(), output);
  1288. }
  1289. // .google.protobuf.testing.FieldMaskWrapper apiary_format3 = 7;
  1290. if (this->has_apiary_format3()) {
  1291. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  1292. 7, this->_internal_apiary_format3(), output);
  1293. }
  1294. // .google.protobuf.testing.FieldMaskWrapper map_key1 = 8;
  1295. if (this->has_map_key1()) {
  1296. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  1297. 8, this->_internal_map_key1(), output);
  1298. }
  1299. // .google.protobuf.testing.FieldMaskWrapper map_key2 = 9;
  1300. if (this->has_map_key2()) {
  1301. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  1302. 9, this->_internal_map_key2(), output);
  1303. }
  1304. // .google.protobuf.testing.FieldMaskWrapper map_key3 = 10;
  1305. if (this->has_map_key3()) {
  1306. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  1307. 10, this->_internal_map_key3(), output);
  1308. }
  1309. // .google.protobuf.testing.FieldMaskWrapper map_key4 = 11;
  1310. if (this->has_map_key4()) {
  1311. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  1312. 11, this->_internal_map_key4(), output);
  1313. }
  1314. // .google.protobuf.testing.FieldMaskWrapper map_key5 = 12;
  1315. if (this->has_map_key5()) {
  1316. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  1317. 12, this->_internal_map_key5(), output);
  1318. }
  1319. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  1320. ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
  1321. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output);
  1322. }
  1323. // @@protoc_insertion_point(serialize_end:google.protobuf.testing.FieldMaskTestCases)
  1324. }
  1325. ::google::protobuf::uint8* FieldMaskTestCases::InternalSerializeWithCachedSizesToArray(
  1326. bool deterministic, ::google::protobuf::uint8* target) const {
  1327. (void)deterministic; // Unused
  1328. // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.testing.FieldMaskTestCases)
  1329. ::google::protobuf::uint32 cached_has_bits = 0;
  1330. (void) cached_has_bits;
  1331. // .google.protobuf.testing.FieldMaskWrapper single_mask = 1;
  1332. if (this->has_single_mask()) {
  1333. target = ::google::protobuf::internal::WireFormatLite::
  1334. InternalWriteMessageToArray(
  1335. 1, this->_internal_single_mask(), deterministic, target);
  1336. }
  1337. // .google.protobuf.testing.FieldMaskWrapper multiple_mask = 2;
  1338. if (this->has_multiple_mask()) {
  1339. target = ::google::protobuf::internal::WireFormatLite::
  1340. InternalWriteMessageToArray(
  1341. 2, this->_internal_multiple_mask(), deterministic, target);
  1342. }
  1343. // .google.protobuf.testing.FieldMaskWrapper snake_camel = 3;
  1344. if (this->has_snake_camel()) {
  1345. target = ::google::protobuf::internal::WireFormatLite::
  1346. InternalWriteMessageToArray(
  1347. 3, this->_internal_snake_camel(), deterministic, target);
  1348. }
  1349. // .google.protobuf.testing.FieldMaskWrapper empty_field = 4;
  1350. if (this->has_empty_field()) {
  1351. target = ::google::protobuf::internal::WireFormatLite::
  1352. InternalWriteMessageToArray(
  1353. 4, this->_internal_empty_field(), deterministic, target);
  1354. }
  1355. // .google.protobuf.testing.FieldMaskWrapper apiary_format1 = 5;
  1356. if (this->has_apiary_format1()) {
  1357. target = ::google::protobuf::internal::WireFormatLite::
  1358. InternalWriteMessageToArray(
  1359. 5, this->_internal_apiary_format1(), deterministic, target);
  1360. }
  1361. // .google.protobuf.testing.FieldMaskWrapper apiary_format2 = 6;
  1362. if (this->has_apiary_format2()) {
  1363. target = ::google::protobuf::internal::WireFormatLite::
  1364. InternalWriteMessageToArray(
  1365. 6, this->_internal_apiary_format2(), deterministic, target);
  1366. }
  1367. // .google.protobuf.testing.FieldMaskWrapper apiary_format3 = 7;
  1368. if (this->has_apiary_format3()) {
  1369. target = ::google::protobuf::internal::WireFormatLite::
  1370. InternalWriteMessageToArray(
  1371. 7, this->_internal_apiary_format3(), deterministic, target);
  1372. }
  1373. // .google.protobuf.testing.FieldMaskWrapper map_key1 = 8;
  1374. if (this->has_map_key1()) {
  1375. target = ::google::protobuf::internal::WireFormatLite::
  1376. InternalWriteMessageToArray(
  1377. 8, this->_internal_map_key1(), deterministic, target);
  1378. }
  1379. // .google.protobuf.testing.FieldMaskWrapper map_key2 = 9;
  1380. if (this->has_map_key2()) {
  1381. target = ::google::protobuf::internal::WireFormatLite::
  1382. InternalWriteMessageToArray(
  1383. 9, this->_internal_map_key2(), deterministic, target);
  1384. }
  1385. // .google.protobuf.testing.FieldMaskWrapper map_key3 = 10;
  1386. if (this->has_map_key3()) {
  1387. target = ::google::protobuf::internal::WireFormatLite::
  1388. InternalWriteMessageToArray(
  1389. 10, this->_internal_map_key3(), deterministic, target);
  1390. }
  1391. // .google.protobuf.testing.FieldMaskWrapper map_key4 = 11;
  1392. if (this->has_map_key4()) {
  1393. target = ::google::protobuf::internal::WireFormatLite::
  1394. InternalWriteMessageToArray(
  1395. 11, this->_internal_map_key4(), deterministic, target);
  1396. }
  1397. // .google.protobuf.testing.FieldMaskWrapper map_key5 = 12;
  1398. if (this->has_map_key5()) {
  1399. target = ::google::protobuf::internal::WireFormatLite::
  1400. InternalWriteMessageToArray(
  1401. 12, this->_internal_map_key5(), deterministic, target);
  1402. }
  1403. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  1404. target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
  1405. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target);
  1406. }
  1407. // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.testing.FieldMaskTestCases)
  1408. return target;
  1409. }
  1410. size_t FieldMaskTestCases::ByteSizeLong() const {
  1411. // @@protoc_insertion_point(message_byte_size_start:google.protobuf.testing.FieldMaskTestCases)
  1412. size_t total_size = 0;
  1413. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  1414. total_size +=
  1415. ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
  1416. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()));
  1417. }
  1418. // .google.protobuf.testing.FieldMaskWrapper single_mask = 1;
  1419. if (this->has_single_mask()) {
  1420. total_size += 1 +
  1421. ::google::protobuf::internal::WireFormatLite::MessageSize(
  1422. *single_mask_);
  1423. }
  1424. // .google.protobuf.testing.FieldMaskWrapper multiple_mask = 2;
  1425. if (this->has_multiple_mask()) {
  1426. total_size += 1 +
  1427. ::google::protobuf::internal::WireFormatLite::MessageSize(
  1428. *multiple_mask_);
  1429. }
  1430. // .google.protobuf.testing.FieldMaskWrapper snake_camel = 3;
  1431. if (this->has_snake_camel()) {
  1432. total_size += 1 +
  1433. ::google::protobuf::internal::WireFormatLite::MessageSize(
  1434. *snake_camel_);
  1435. }
  1436. // .google.protobuf.testing.FieldMaskWrapper empty_field = 4;
  1437. if (this->has_empty_field()) {
  1438. total_size += 1 +
  1439. ::google::protobuf::internal::WireFormatLite::MessageSize(
  1440. *empty_field_);
  1441. }
  1442. // .google.protobuf.testing.FieldMaskWrapper apiary_format1 = 5;
  1443. if (this->has_apiary_format1()) {
  1444. total_size += 1 +
  1445. ::google::protobuf::internal::WireFormatLite::MessageSize(
  1446. *apiary_format1_);
  1447. }
  1448. // .google.protobuf.testing.FieldMaskWrapper apiary_format2 = 6;
  1449. if (this->has_apiary_format2()) {
  1450. total_size += 1 +
  1451. ::google::protobuf::internal::WireFormatLite::MessageSize(
  1452. *apiary_format2_);
  1453. }
  1454. // .google.protobuf.testing.FieldMaskWrapper apiary_format3 = 7;
  1455. if (this->has_apiary_format3()) {
  1456. total_size += 1 +
  1457. ::google::protobuf::internal::WireFormatLite::MessageSize(
  1458. *apiary_format3_);
  1459. }
  1460. // .google.protobuf.testing.FieldMaskWrapper map_key1 = 8;
  1461. if (this->has_map_key1()) {
  1462. total_size += 1 +
  1463. ::google::protobuf::internal::WireFormatLite::MessageSize(
  1464. *map_key1_);
  1465. }
  1466. // .google.protobuf.testing.FieldMaskWrapper map_key2 = 9;
  1467. if (this->has_map_key2()) {
  1468. total_size += 1 +
  1469. ::google::protobuf::internal::WireFormatLite::MessageSize(
  1470. *map_key2_);
  1471. }
  1472. // .google.protobuf.testing.FieldMaskWrapper map_key3 = 10;
  1473. if (this->has_map_key3()) {
  1474. total_size += 1 +
  1475. ::google::protobuf::internal::WireFormatLite::MessageSize(
  1476. *map_key3_);
  1477. }
  1478. // .google.protobuf.testing.FieldMaskWrapper map_key4 = 11;
  1479. if (this->has_map_key4()) {
  1480. total_size += 1 +
  1481. ::google::protobuf::internal::WireFormatLite::MessageSize(
  1482. *map_key4_);
  1483. }
  1484. // .google.protobuf.testing.FieldMaskWrapper map_key5 = 12;
  1485. if (this->has_map_key5()) {
  1486. total_size += 1 +
  1487. ::google::protobuf::internal::WireFormatLite::MessageSize(
  1488. *map_key5_);
  1489. }
  1490. int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  1491. SetCachedSize(cached_size);
  1492. return total_size;
  1493. }
  1494. void FieldMaskTestCases::MergeFrom(const ::google::protobuf::Message& from) {
  1495. // @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.testing.FieldMaskTestCases)
  1496. GOOGLE_DCHECK_NE(&from, this);
  1497. const FieldMaskTestCases* source =
  1498. ::google::protobuf::internal::DynamicCastToGenerated<const FieldMaskTestCases>(
  1499. &from);
  1500. if (source == NULL) {
  1501. // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.testing.FieldMaskTestCases)
  1502. ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  1503. } else {
  1504. // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.testing.FieldMaskTestCases)
  1505. MergeFrom(*source);
  1506. }
  1507. }
  1508. void FieldMaskTestCases::MergeFrom(const FieldMaskTestCases& from) {
  1509. // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.testing.FieldMaskTestCases)
  1510. GOOGLE_DCHECK_NE(&from, this);
  1511. _internal_metadata_.MergeFrom(from._internal_metadata_);
  1512. ::google::protobuf::uint32 cached_has_bits = 0;
  1513. (void) cached_has_bits;
  1514. if (from.has_single_mask()) {
  1515. mutable_single_mask()->::google::protobuf::testing::FieldMaskWrapper::MergeFrom(from.single_mask());
  1516. }
  1517. if (from.has_multiple_mask()) {
  1518. mutable_multiple_mask()->::google::protobuf::testing::FieldMaskWrapper::MergeFrom(from.multiple_mask());
  1519. }
  1520. if (from.has_snake_camel()) {
  1521. mutable_snake_camel()->::google::protobuf::testing::FieldMaskWrapper::MergeFrom(from.snake_camel());
  1522. }
  1523. if (from.has_empty_field()) {
  1524. mutable_empty_field()->::google::protobuf::testing::FieldMaskWrapper::MergeFrom(from.empty_field());
  1525. }
  1526. if (from.has_apiary_format1()) {
  1527. mutable_apiary_format1()->::google::protobuf::testing::FieldMaskWrapper::MergeFrom(from.apiary_format1());
  1528. }
  1529. if (from.has_apiary_format2()) {
  1530. mutable_apiary_format2()->::google::protobuf::testing::FieldMaskWrapper::MergeFrom(from.apiary_format2());
  1531. }
  1532. if (from.has_apiary_format3()) {
  1533. mutable_apiary_format3()->::google::protobuf::testing::FieldMaskWrapper::MergeFrom(from.apiary_format3());
  1534. }
  1535. if (from.has_map_key1()) {
  1536. mutable_map_key1()->::google::protobuf::testing::FieldMaskWrapper::MergeFrom(from.map_key1());
  1537. }
  1538. if (from.has_map_key2()) {
  1539. mutable_map_key2()->::google::protobuf::testing::FieldMaskWrapper::MergeFrom(from.map_key2());
  1540. }
  1541. if (from.has_map_key3()) {
  1542. mutable_map_key3()->::google::protobuf::testing::FieldMaskWrapper::MergeFrom(from.map_key3());
  1543. }
  1544. if (from.has_map_key4()) {
  1545. mutable_map_key4()->::google::protobuf::testing::FieldMaskWrapper::MergeFrom(from.map_key4());
  1546. }
  1547. if (from.has_map_key5()) {
  1548. mutable_map_key5()->::google::protobuf::testing::FieldMaskWrapper::MergeFrom(from.map_key5());
  1549. }
  1550. }
  1551. void FieldMaskTestCases::CopyFrom(const ::google::protobuf::Message& from) {
  1552. // @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.testing.FieldMaskTestCases)
  1553. if (&from == this) return;
  1554. Clear();
  1555. MergeFrom(from);
  1556. }
  1557. void FieldMaskTestCases::CopyFrom(const FieldMaskTestCases& from) {
  1558. // @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.testing.FieldMaskTestCases)
  1559. if (&from == this) return;
  1560. Clear();
  1561. MergeFrom(from);
  1562. }
  1563. bool FieldMaskTestCases::IsInitialized() const {
  1564. return true;
  1565. }
  1566. void FieldMaskTestCases::Swap(FieldMaskTestCases* other) {
  1567. if (other == this) return;
  1568. InternalSwap(other);
  1569. }
  1570. void FieldMaskTestCases::InternalSwap(FieldMaskTestCases* other) {
  1571. using std::swap;
  1572. swap(single_mask_, other->single_mask_);
  1573. swap(multiple_mask_, other->multiple_mask_);
  1574. swap(snake_camel_, other->snake_camel_);
  1575. swap(empty_field_, other->empty_field_);
  1576. swap(apiary_format1_, other->apiary_format1_);
  1577. swap(apiary_format2_, other->apiary_format2_);
  1578. swap(apiary_format3_, other->apiary_format3_);
  1579. swap(map_key1_, other->map_key1_);
  1580. swap(map_key2_, other->map_key2_);
  1581. swap(map_key3_, other->map_key3_);
  1582. swap(map_key4_, other->map_key4_);
  1583. swap(map_key5_, other->map_key5_);
  1584. _internal_metadata_.Swap(&other->_internal_metadata_);
  1585. }
  1586. ::google::protobuf::Metadata FieldMaskTestCases::GetMetadata() const {
  1587. protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2ffield_5fmask_2eproto::protobuf_AssignDescriptorsOnce();
  1588. return ::protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2ffield_5fmask_2eproto::file_level_metadata[kIndexInFileMessages];
  1589. }
  1590. // ===================================================================
  1591. void FieldMaskWrapper::InitAsDefaultInstance() {
  1592. ::google::protobuf::testing::_FieldMaskWrapper_default_instance_._instance.get_mutable()->mask_ = const_cast< ::google::protobuf::FieldMask*>(
  1593. ::google::protobuf::FieldMask::internal_default_instance());
  1594. }
  1595. void FieldMaskWrapper::clear_mask() {
  1596. if (GetArenaNoVirtual() == NULL && mask_ != NULL) {
  1597. delete mask_;
  1598. }
  1599. mask_ = NULL;
  1600. }
  1601. #if !defined(_MSC_VER) || _MSC_VER >= 1900
  1602. const int FieldMaskWrapper::kMaskFieldNumber;
  1603. #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
  1604. FieldMaskWrapper::FieldMaskWrapper()
  1605. : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  1606. ::google::protobuf::internal::InitSCC(
  1607. &protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2ffield_5fmask_2eproto::scc_info_FieldMaskWrapper.base);
  1608. SharedCtor();
  1609. // @@protoc_insertion_point(constructor:google.protobuf.testing.FieldMaskWrapper)
  1610. }
  1611. FieldMaskWrapper::FieldMaskWrapper(const FieldMaskWrapper& from)
  1612. : ::google::protobuf::Message(),
  1613. _internal_metadata_(NULL) {
  1614. _internal_metadata_.MergeFrom(from._internal_metadata_);
  1615. if (from.has_mask()) {
  1616. mask_ = new ::google::protobuf::FieldMask(*from.mask_);
  1617. } else {
  1618. mask_ = NULL;
  1619. }
  1620. // @@protoc_insertion_point(copy_constructor:google.protobuf.testing.FieldMaskWrapper)
  1621. }
  1622. void FieldMaskWrapper::SharedCtor() {
  1623. mask_ = NULL;
  1624. }
  1625. FieldMaskWrapper::~FieldMaskWrapper() {
  1626. // @@protoc_insertion_point(destructor:google.protobuf.testing.FieldMaskWrapper)
  1627. SharedDtor();
  1628. }
  1629. void FieldMaskWrapper::SharedDtor() {
  1630. if (this != internal_default_instance()) delete mask_;
  1631. }
  1632. void FieldMaskWrapper::SetCachedSize(int size) const {
  1633. _cached_size_.Set(size);
  1634. }
  1635. const ::google::protobuf::Descriptor* FieldMaskWrapper::descriptor() {
  1636. ::protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2ffield_5fmask_2eproto::protobuf_AssignDescriptorsOnce();
  1637. return ::protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2ffield_5fmask_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
  1638. }
  1639. const FieldMaskWrapper& FieldMaskWrapper::default_instance() {
  1640. ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2ffield_5fmask_2eproto::scc_info_FieldMaskWrapper.base);
  1641. return *internal_default_instance();
  1642. }
  1643. void FieldMaskWrapper::Clear() {
  1644. // @@protoc_insertion_point(message_clear_start:google.protobuf.testing.FieldMaskWrapper)
  1645. ::google::protobuf::uint32 cached_has_bits = 0;
  1646. // Prevent compiler warnings about cached_has_bits being unused
  1647. (void) cached_has_bits;
  1648. if (GetArenaNoVirtual() == NULL && mask_ != NULL) {
  1649. delete mask_;
  1650. }
  1651. mask_ = NULL;
  1652. _internal_metadata_.Clear();
  1653. }
  1654. bool FieldMaskWrapper::MergePartialFromCodedStream(
  1655. ::google::protobuf::io::CodedInputStream* input) {
  1656. #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  1657. ::google::protobuf::uint32 tag;
  1658. // @@protoc_insertion_point(parse_start:google.protobuf.testing.FieldMaskWrapper)
  1659. for (;;) {
  1660. ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
  1661. tag = p.first;
  1662. if (!p.second) goto handle_unusual;
  1663. switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
  1664. // .google.protobuf.FieldMask mask = 1;
  1665. case 1: {
  1666. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1667. static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
  1668. DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
  1669. input, mutable_mask()));
  1670. } else {
  1671. goto handle_unusual;
  1672. }
  1673. break;
  1674. }
  1675. default: {
  1676. handle_unusual:
  1677. if (tag == 0) {
  1678. goto success;
  1679. }
  1680. DO_(::google::protobuf::internal::WireFormat::SkipField(
  1681. input, tag, _internal_metadata_.mutable_unknown_fields()));
  1682. break;
  1683. }
  1684. }
  1685. }
  1686. success:
  1687. // @@protoc_insertion_point(parse_success:google.protobuf.testing.FieldMaskWrapper)
  1688. return true;
  1689. failure:
  1690. // @@protoc_insertion_point(parse_failure:google.protobuf.testing.FieldMaskWrapper)
  1691. return false;
  1692. #undef DO_
  1693. }
  1694. void FieldMaskWrapper::SerializeWithCachedSizes(
  1695. ::google::protobuf::io::CodedOutputStream* output) const {
  1696. // @@protoc_insertion_point(serialize_start:google.protobuf.testing.FieldMaskWrapper)
  1697. ::google::protobuf::uint32 cached_has_bits = 0;
  1698. (void) cached_has_bits;
  1699. // .google.protobuf.FieldMask mask = 1;
  1700. if (this->has_mask()) {
  1701. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  1702. 1, this->_internal_mask(), output);
  1703. }
  1704. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  1705. ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
  1706. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output);
  1707. }
  1708. // @@protoc_insertion_point(serialize_end:google.protobuf.testing.FieldMaskWrapper)
  1709. }
  1710. ::google::protobuf::uint8* FieldMaskWrapper::InternalSerializeWithCachedSizesToArray(
  1711. bool deterministic, ::google::protobuf::uint8* target) const {
  1712. (void)deterministic; // Unused
  1713. // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.testing.FieldMaskWrapper)
  1714. ::google::protobuf::uint32 cached_has_bits = 0;
  1715. (void) cached_has_bits;
  1716. // .google.protobuf.FieldMask mask = 1;
  1717. if (this->has_mask()) {
  1718. target = ::google::protobuf::internal::WireFormatLite::
  1719. InternalWriteMessageToArray(
  1720. 1, this->_internal_mask(), deterministic, target);
  1721. }
  1722. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  1723. target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
  1724. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target);
  1725. }
  1726. // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.testing.FieldMaskWrapper)
  1727. return target;
  1728. }
  1729. size_t FieldMaskWrapper::ByteSizeLong() const {
  1730. // @@protoc_insertion_point(message_byte_size_start:google.protobuf.testing.FieldMaskWrapper)
  1731. size_t total_size = 0;
  1732. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  1733. total_size +=
  1734. ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
  1735. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()));
  1736. }
  1737. // .google.protobuf.FieldMask mask = 1;
  1738. if (this->has_mask()) {
  1739. total_size += 1 +
  1740. ::google::protobuf::internal::WireFormatLite::MessageSize(
  1741. *mask_);
  1742. }
  1743. int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  1744. SetCachedSize(cached_size);
  1745. return total_size;
  1746. }
  1747. void FieldMaskWrapper::MergeFrom(const ::google::protobuf::Message& from) {
  1748. // @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.testing.FieldMaskWrapper)
  1749. GOOGLE_DCHECK_NE(&from, this);
  1750. const FieldMaskWrapper* source =
  1751. ::google::protobuf::internal::DynamicCastToGenerated<const FieldMaskWrapper>(
  1752. &from);
  1753. if (source == NULL) {
  1754. // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.testing.FieldMaskWrapper)
  1755. ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  1756. } else {
  1757. // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.testing.FieldMaskWrapper)
  1758. MergeFrom(*source);
  1759. }
  1760. }
  1761. void FieldMaskWrapper::MergeFrom(const FieldMaskWrapper& from) {
  1762. // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.testing.FieldMaskWrapper)
  1763. GOOGLE_DCHECK_NE(&from, this);
  1764. _internal_metadata_.MergeFrom(from._internal_metadata_);
  1765. ::google::protobuf::uint32 cached_has_bits = 0;
  1766. (void) cached_has_bits;
  1767. if (from.has_mask()) {
  1768. mutable_mask()->::google::protobuf::FieldMask::MergeFrom(from.mask());
  1769. }
  1770. }
  1771. void FieldMaskWrapper::CopyFrom(const ::google::protobuf::Message& from) {
  1772. // @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.testing.FieldMaskWrapper)
  1773. if (&from == this) return;
  1774. Clear();
  1775. MergeFrom(from);
  1776. }
  1777. void FieldMaskWrapper::CopyFrom(const FieldMaskWrapper& from) {
  1778. // @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.testing.FieldMaskWrapper)
  1779. if (&from == this) return;
  1780. Clear();
  1781. MergeFrom(from);
  1782. }
  1783. bool FieldMaskWrapper::IsInitialized() const {
  1784. return true;
  1785. }
  1786. void FieldMaskWrapper::Swap(FieldMaskWrapper* other) {
  1787. if (other == this) return;
  1788. InternalSwap(other);
  1789. }
  1790. void FieldMaskWrapper::InternalSwap(FieldMaskWrapper* other) {
  1791. using std::swap;
  1792. swap(mask_, other->mask_);
  1793. _internal_metadata_.Swap(&other->_internal_metadata_);
  1794. }
  1795. ::google::protobuf::Metadata FieldMaskWrapper::GetMetadata() const {
  1796. protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2ffield_5fmask_2eproto::protobuf_AssignDescriptorsOnce();
  1797. return ::protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2ffield_5fmask_2eproto::file_level_metadata[kIndexInFileMessages];
  1798. }
  1799. // @@protoc_insertion_point(namespace_scope)
  1800. } // namespace testing
  1801. } // namespace protobuf
  1802. } // namespace google
  1803. namespace google {
  1804. namespace protobuf {
  1805. template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::google::protobuf::testing::NestedFieldMask* Arena::CreateMaybeMessage< ::google::protobuf::testing::NestedFieldMask >(Arena* arena) {
  1806. return Arena::CreateInternal< ::google::protobuf::testing::NestedFieldMask >(arena);
  1807. }
  1808. template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::google::protobuf::testing::FieldMaskTest* Arena::CreateMaybeMessage< ::google::protobuf::testing::FieldMaskTest >(Arena* arena) {
  1809. return Arena::CreateInternal< ::google::protobuf::testing::FieldMaskTest >(arena);
  1810. }
  1811. template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::google::protobuf::testing::FieldMaskTestCases* Arena::CreateMaybeMessage< ::google::protobuf::testing::FieldMaskTestCases >(Arena* arena) {
  1812. return Arena::CreateInternal< ::google::protobuf::testing::FieldMaskTestCases >(arena);
  1813. }
  1814. template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::google::protobuf::testing::FieldMaskWrapper* Arena::CreateMaybeMessage< ::google::protobuf::testing::FieldMaskWrapper >(Arena* arena) {
  1815. return Arena::CreateInternal< ::google::protobuf::testing::FieldMaskWrapper >(arena);
  1816. }
  1817. } // namespace protobuf
  1818. } // namespace google
  1819. // @@protoc_insertion_point(global_scope)