addressbook.pb.cc 98 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599
  1. // Generated by the protocol buffer compiler. DO NOT EDIT!
  2. // source: addressbook.proto
  3. #include "addressbook.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_addressbook_2eproto {
  19. extern PROTOBUF_INTERNAL_EXPORT_protobuf_addressbook_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_Address;
  20. extern PROTOBUF_INTERNAL_EXPORT_protobuf_addressbook_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_PhoneNumber;
  21. extern PROTOBUF_INTERNAL_EXPORT_protobuf_addressbook_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_Job;
  22. extern PROTOBUF_INTERNAL_EXPORT_protobuf_addressbook_2eproto ::google::protobuf::internal::SCCInfo<3> scc_info_Contact;
  23. } // namespace protobuf_addressbook_2eproto
  24. namespace qtprotobuf {
  25. namespace examples {
  26. class PhoneNumberDefaultTypeInternal {
  27. public:
  28. ::google::protobuf::internal::ExplicitlyConstructed<PhoneNumber>
  29. _instance;
  30. } _PhoneNumber_default_instance_;
  31. class AddressDefaultTypeInternal {
  32. public:
  33. ::google::protobuf::internal::ExplicitlyConstructed<Address>
  34. _instance;
  35. } _Address_default_instance_;
  36. class JobDefaultTypeInternal {
  37. public:
  38. ::google::protobuf::internal::ExplicitlyConstructed<Job>
  39. _instance;
  40. } _Job_default_instance_;
  41. class ContactDefaultTypeInternal {
  42. public:
  43. ::google::protobuf::internal::ExplicitlyConstructed<Contact>
  44. _instance;
  45. } _Contact_default_instance_;
  46. class ContactsDefaultTypeInternal {
  47. public:
  48. ::google::protobuf::internal::ExplicitlyConstructed<Contacts>
  49. _instance;
  50. } _Contacts_default_instance_;
  51. class SimpleResultDefaultTypeInternal {
  52. public:
  53. ::google::protobuf::internal::ExplicitlyConstructed<SimpleResult>
  54. _instance;
  55. } _SimpleResult_default_instance_;
  56. class ListFrameDefaultTypeInternal {
  57. public:
  58. ::google::protobuf::internal::ExplicitlyConstructed<ListFrame>
  59. _instance;
  60. } _ListFrame_default_instance_;
  61. } // namespace examples
  62. } // namespace qtprotobuf
  63. namespace protobuf_addressbook_2eproto {
  64. static void InitDefaultsPhoneNumber() {
  65. GOOGLE_PROTOBUF_VERIFY_VERSION;
  66. {
  67. void* ptr = &::qtprotobuf::examples::_PhoneNumber_default_instance_;
  68. new (ptr) ::qtprotobuf::examples::PhoneNumber();
  69. ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  70. }
  71. ::qtprotobuf::examples::PhoneNumber::InitAsDefaultInstance();
  72. }
  73. ::google::protobuf::internal::SCCInfo<0> scc_info_PhoneNumber =
  74. {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsPhoneNumber}, {}};
  75. static void InitDefaultsAddress() {
  76. GOOGLE_PROTOBUF_VERIFY_VERSION;
  77. {
  78. void* ptr = &::qtprotobuf::examples::_Address_default_instance_;
  79. new (ptr) ::qtprotobuf::examples::Address();
  80. ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  81. }
  82. ::qtprotobuf::examples::Address::InitAsDefaultInstance();
  83. }
  84. ::google::protobuf::internal::SCCInfo<0> scc_info_Address =
  85. {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsAddress}, {}};
  86. static void InitDefaultsJob() {
  87. GOOGLE_PROTOBUF_VERIFY_VERSION;
  88. {
  89. void* ptr = &::qtprotobuf::examples::_Job_default_instance_;
  90. new (ptr) ::qtprotobuf::examples::Job();
  91. ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  92. }
  93. ::qtprotobuf::examples::Job::InitAsDefaultInstance();
  94. }
  95. ::google::protobuf::internal::SCCInfo<1> scc_info_Job =
  96. {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsJob}, {
  97. &protobuf_addressbook_2eproto::scc_info_Address.base,}};
  98. static void InitDefaultsContact() {
  99. GOOGLE_PROTOBUF_VERIFY_VERSION;
  100. {
  101. void* ptr = &::qtprotobuf::examples::_Contact_default_instance_;
  102. new (ptr) ::qtprotobuf::examples::Contact();
  103. ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  104. }
  105. ::qtprotobuf::examples::Contact::InitAsDefaultInstance();
  106. }
  107. ::google::protobuf::internal::SCCInfo<3> scc_info_Contact =
  108. {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 3, InitDefaultsContact}, {
  109. &protobuf_addressbook_2eproto::scc_info_PhoneNumber.base,
  110. &protobuf_addressbook_2eproto::scc_info_Address.base,
  111. &protobuf_addressbook_2eproto::scc_info_Job.base,}};
  112. static void InitDefaultsContacts() {
  113. GOOGLE_PROTOBUF_VERIFY_VERSION;
  114. {
  115. void* ptr = &::qtprotobuf::examples::_Contacts_default_instance_;
  116. new (ptr) ::qtprotobuf::examples::Contacts();
  117. ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  118. }
  119. ::qtprotobuf::examples::Contacts::InitAsDefaultInstance();
  120. }
  121. ::google::protobuf::internal::SCCInfo<1> scc_info_Contacts =
  122. {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsContacts}, {
  123. &protobuf_addressbook_2eproto::scc_info_Contact.base,}};
  124. static void InitDefaultsSimpleResult() {
  125. GOOGLE_PROTOBUF_VERIFY_VERSION;
  126. {
  127. void* ptr = &::qtprotobuf::examples::_SimpleResult_default_instance_;
  128. new (ptr) ::qtprotobuf::examples::SimpleResult();
  129. ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  130. }
  131. ::qtprotobuf::examples::SimpleResult::InitAsDefaultInstance();
  132. }
  133. ::google::protobuf::internal::SCCInfo<0> scc_info_SimpleResult =
  134. {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsSimpleResult}, {}};
  135. static void InitDefaultsListFrame() {
  136. GOOGLE_PROTOBUF_VERIFY_VERSION;
  137. {
  138. void* ptr = &::qtprotobuf::examples::_ListFrame_default_instance_;
  139. new (ptr) ::qtprotobuf::examples::ListFrame();
  140. ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  141. }
  142. ::qtprotobuf::examples::ListFrame::InitAsDefaultInstance();
  143. }
  144. ::google::protobuf::internal::SCCInfo<0> scc_info_ListFrame =
  145. {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsListFrame}, {}};
  146. void InitDefaults() {
  147. ::google::protobuf::internal::InitSCC(&scc_info_PhoneNumber.base);
  148. ::google::protobuf::internal::InitSCC(&scc_info_Address.base);
  149. ::google::protobuf::internal::InitSCC(&scc_info_Job.base);
  150. ::google::protobuf::internal::InitSCC(&scc_info_Contact.base);
  151. ::google::protobuf::internal::InitSCC(&scc_info_Contacts.base);
  152. ::google::protobuf::internal::InitSCC(&scc_info_SimpleResult.base);
  153. ::google::protobuf::internal::InitSCC(&scc_info_ListFrame.base);
  154. }
  155. ::google::protobuf::Metadata file_level_metadata[7];
  156. const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors[1];
  157. const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
  158. ~0u, // no _has_bits_
  159. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::qtprotobuf::examples::PhoneNumber, _internal_metadata_),
  160. ~0u, // no _extensions_
  161. ~0u, // no _oneof_case_
  162. ~0u, // no _weak_field_map_
  163. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::qtprotobuf::examples::PhoneNumber, countrycode_),
  164. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::qtprotobuf::examples::PhoneNumber, number_),
  165. ~0u, // no _has_bits_
  166. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::qtprotobuf::examples::Address, _internal_metadata_),
  167. ~0u, // no _extensions_
  168. ~0u, // no _oneof_case_
  169. ~0u, // no _weak_field_map_
  170. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::qtprotobuf::examples::Address, zipcode_),
  171. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::qtprotobuf::examples::Address, streetaddress1_),
  172. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::qtprotobuf::examples::Address, streetaddress2_),
  173. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::qtprotobuf::examples::Address, state_),
  174. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::qtprotobuf::examples::Address, country_),
  175. ~0u, // no _has_bits_
  176. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::qtprotobuf::examples::Job, _internal_metadata_),
  177. ~0u, // no _extensions_
  178. ~0u, // no _oneof_case_
  179. ~0u, // no _weak_field_map_
  180. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::qtprotobuf::examples::Job, title_),
  181. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::qtprotobuf::examples::Job, officeaddress_),
  182. ~0u, // no _has_bits_
  183. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::qtprotobuf::examples::Contact, _internal_metadata_),
  184. ~0u, // no _extensions_
  185. ~0u, // no _oneof_case_
  186. ~0u, // no _weak_field_map_
  187. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::qtprotobuf::examples::Contact, firstname_),
  188. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::qtprotobuf::examples::Contact, lastname_),
  189. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::qtprotobuf::examples::Contact, middlename_),
  190. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::qtprotobuf::examples::Contact, phones_),
  191. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::qtprotobuf::examples::Contact, address_),
  192. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::qtprotobuf::examples::Contact, job_),
  193. ~0u, // no _has_bits_
  194. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::qtprotobuf::examples::Contacts, _internal_metadata_),
  195. ~0u, // no _extensions_
  196. ~0u, // no _oneof_case_
  197. ~0u, // no _weak_field_map_
  198. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::qtprotobuf::examples::Contacts, list_),
  199. ~0u, // no _has_bits_
  200. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::qtprotobuf::examples::SimpleResult, _internal_metadata_),
  201. ~0u, // no _extensions_
  202. ~0u, // no _oneof_case_
  203. ~0u, // no _weak_field_map_
  204. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::qtprotobuf::examples::SimpleResult, ok_),
  205. ~0u, // no _has_bits_
  206. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::qtprotobuf::examples::ListFrame, _internal_metadata_),
  207. ~0u, // no _extensions_
  208. ~0u, // no _oneof_case_
  209. ~0u, // no _weak_field_map_
  210. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::qtprotobuf::examples::ListFrame, start_),
  211. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::qtprotobuf::examples::ListFrame, end_),
  212. };
  213. static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
  214. { 0, -1, sizeof(::qtprotobuf::examples::PhoneNumber)},
  215. { 7, -1, sizeof(::qtprotobuf::examples::Address)},
  216. { 17, -1, sizeof(::qtprotobuf::examples::Job)},
  217. { 24, -1, sizeof(::qtprotobuf::examples::Contact)},
  218. { 35, -1, sizeof(::qtprotobuf::examples::Contacts)},
  219. { 41, -1, sizeof(::qtprotobuf::examples::SimpleResult)},
  220. { 47, -1, sizeof(::qtprotobuf::examples::ListFrame)},
  221. };
  222. static ::google::protobuf::Message const * const file_default_instances[] = {
  223. reinterpret_cast<const ::google::protobuf::Message*>(&::qtprotobuf::examples::_PhoneNumber_default_instance_),
  224. reinterpret_cast<const ::google::protobuf::Message*>(&::qtprotobuf::examples::_Address_default_instance_),
  225. reinterpret_cast<const ::google::protobuf::Message*>(&::qtprotobuf::examples::_Job_default_instance_),
  226. reinterpret_cast<const ::google::protobuf::Message*>(&::qtprotobuf::examples::_Contact_default_instance_),
  227. reinterpret_cast<const ::google::protobuf::Message*>(&::qtprotobuf::examples::_Contacts_default_instance_),
  228. reinterpret_cast<const ::google::protobuf::Message*>(&::qtprotobuf::examples::_SimpleResult_default_instance_),
  229. reinterpret_cast<const ::google::protobuf::Message*>(&::qtprotobuf::examples::_ListFrame_default_instance_),
  230. };
  231. void protobuf_AssignDescriptors() {
  232. AddDescriptors();
  233. AssignDescriptors(
  234. "addressbook.proto", schemas, file_default_instances, TableStruct::offsets,
  235. file_level_metadata, file_level_enum_descriptors, NULL);
  236. }
  237. void protobuf_AssignDescriptorsOnce() {
  238. static ::google::protobuf::internal::once_flag once;
  239. ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors);
  240. }
  241. void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD;
  242. void protobuf_RegisterTypes(const ::std::string&) {
  243. protobuf_AssignDescriptorsOnce();
  244. ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 7);
  245. }
  246. void AddDescriptorsImpl() {
  247. InitDefaults();
  248. static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
  249. "\n\021addressbook.proto\022\023qtprotobuf.examples"
  250. "\"2\n\013PhoneNumber\022\023\n\013countryCode\030\001 \001(\r\022\016\n\006"
  251. "number\030\002 \001(\004\"j\n\007Address\022\017\n\007zipCode\030\001 \001(\004"
  252. "\022\026\n\016streetAddress1\030\002 \001(\t\022\026\n\016streetAddres"
  253. "s2\030\003 \001(\t\022\r\n\005state\030\004 \001(\t\022\017\n\007country\030\005 \001(\r"
  254. "\"I\n\003Job\022\r\n\005title\030\001 \001(\t\0223\n\rofficeAddress\030"
  255. "\002 \001(\0132\034.qtprotobuf.examples.Address\"\202\002\n\007"
  256. "Contact\022\021\n\tfirstName\030\001 \001(\t\022\020\n\010lastName\030\002"
  257. " \001(\t\022\022\n\nmiddleName\030\003 \001(\t\0220\n\006phones\030\004 \003(\013"
  258. "2 .qtprotobuf.examples.PhoneNumber\022-\n\007ad"
  259. "dress\030\005 \001(\0132\034.qtprotobuf.examples.Addres"
  260. "s\022%\n\003job\030\006 \001(\0132\030.qtprotobuf.examples.Job"
  261. "\"6\n\tPhoneType\022\010\n\004Home\020\000\022\010\n\004Work\020\001\022\n\n\006Mob"
  262. "ile\020\002\022\t\n\005Other\020\003\"6\n\010Contacts\022*\n\004list\030\001 \003"
  263. "(\0132\034.qtprotobuf.examples.Contact\"\032\n\014Simp"
  264. "leResult\022\n\n\002ok\030\001 \001(\010\"\'\n\tListFrame\022\r\n\005sta"
  265. "rt\030\001 \001(\021\022\013\n\003end\030\002 \001(\0212\231\003\n\013AddressBook\022K\n"
  266. "\naddContact\022\034.qtprotobuf.examples.Contac"
  267. "t\032\035.qtprotobuf.examples.Contacts\"\000\022N\n\rre"
  268. "moveContact\022\034.qtprotobuf.examples.Contac"
  269. "t\032\035.qtprotobuf.examples.Contacts\"\000\022M\n\010co"
  270. "ntacts\022\036.qtprotobuf.examples.ListFrame\032\035"
  271. ".qtprotobuf.examples.Contacts\"\0000\001\022M\n\010mak"
  272. "eCall\022\034.qtprotobuf.examples.Contact\032!.qt"
  273. "protobuf.examples.SimpleResult\"\000\022O\n\nnavi"
  274. "gateTo\022\034.qtprotobuf.examples.Address\032!.q"
  275. "tprotobuf.examples.SimpleResult\"\000b\006proto"
  276. "3"
  277. };
  278. ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
  279. descriptor, 1081);
  280. ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
  281. "addressbook.proto", &protobuf_RegisterTypes);
  282. }
  283. void AddDescriptors() {
  284. static ::google::protobuf::internal::once_flag once;
  285. ::google::protobuf::internal::call_once(once, AddDescriptorsImpl);
  286. }
  287. // Force AddDescriptors() to be called at dynamic initialization time.
  288. struct StaticDescriptorInitializer {
  289. StaticDescriptorInitializer() {
  290. AddDescriptors();
  291. }
  292. } static_descriptor_initializer;
  293. } // namespace protobuf_addressbook_2eproto
  294. namespace qtprotobuf {
  295. namespace examples {
  296. const ::google::protobuf::EnumDescriptor* Contact_PhoneType_descriptor() {
  297. protobuf_addressbook_2eproto::protobuf_AssignDescriptorsOnce();
  298. return protobuf_addressbook_2eproto::file_level_enum_descriptors[0];
  299. }
  300. bool Contact_PhoneType_IsValid(int value) {
  301. switch (value) {
  302. case 0:
  303. case 1:
  304. case 2:
  305. case 3:
  306. return true;
  307. default:
  308. return false;
  309. }
  310. }
  311. #if !defined(_MSC_VER) || _MSC_VER >= 1900
  312. const Contact_PhoneType Contact::Home;
  313. const Contact_PhoneType Contact::Work;
  314. const Contact_PhoneType Contact::Mobile;
  315. const Contact_PhoneType Contact::Other;
  316. const Contact_PhoneType Contact::PhoneType_MIN;
  317. const Contact_PhoneType Contact::PhoneType_MAX;
  318. const int Contact::PhoneType_ARRAYSIZE;
  319. #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
  320. // ===================================================================
  321. void PhoneNumber::InitAsDefaultInstance() {
  322. }
  323. #if !defined(_MSC_VER) || _MSC_VER >= 1900
  324. const int PhoneNumber::kCountryCodeFieldNumber;
  325. const int PhoneNumber::kNumberFieldNumber;
  326. #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
  327. PhoneNumber::PhoneNumber()
  328. : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  329. ::google::protobuf::internal::InitSCC(
  330. &protobuf_addressbook_2eproto::scc_info_PhoneNumber.base);
  331. SharedCtor();
  332. // @@protoc_insertion_point(constructor:qtprotobuf.examples.PhoneNumber)
  333. }
  334. PhoneNumber::PhoneNumber(const PhoneNumber& from)
  335. : ::google::protobuf::Message(),
  336. _internal_metadata_(NULL) {
  337. _internal_metadata_.MergeFrom(from._internal_metadata_);
  338. ::memcpy(&number_, &from.number_,
  339. static_cast<size_t>(reinterpret_cast<char*>(&countrycode_) -
  340. reinterpret_cast<char*>(&number_)) + sizeof(countrycode_));
  341. // @@protoc_insertion_point(copy_constructor:qtprotobuf.examples.PhoneNumber)
  342. }
  343. void PhoneNumber::SharedCtor() {
  344. ::memset(&number_, 0, static_cast<size_t>(
  345. reinterpret_cast<char*>(&countrycode_) -
  346. reinterpret_cast<char*>(&number_)) + sizeof(countrycode_));
  347. }
  348. PhoneNumber::~PhoneNumber() {
  349. // @@protoc_insertion_point(destructor:qtprotobuf.examples.PhoneNumber)
  350. SharedDtor();
  351. }
  352. void PhoneNumber::SharedDtor() {
  353. }
  354. void PhoneNumber::SetCachedSize(int size) const {
  355. _cached_size_.Set(size);
  356. }
  357. const ::google::protobuf::Descriptor* PhoneNumber::descriptor() {
  358. ::protobuf_addressbook_2eproto::protobuf_AssignDescriptorsOnce();
  359. return ::protobuf_addressbook_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
  360. }
  361. const PhoneNumber& PhoneNumber::default_instance() {
  362. ::google::protobuf::internal::InitSCC(&protobuf_addressbook_2eproto::scc_info_PhoneNumber.base);
  363. return *internal_default_instance();
  364. }
  365. void PhoneNumber::Clear() {
  366. // @@protoc_insertion_point(message_clear_start:qtprotobuf.examples.PhoneNumber)
  367. ::google::protobuf::uint32 cached_has_bits = 0;
  368. // Prevent compiler warnings about cached_has_bits being unused
  369. (void) cached_has_bits;
  370. ::memset(&number_, 0, static_cast<size_t>(
  371. reinterpret_cast<char*>(&countrycode_) -
  372. reinterpret_cast<char*>(&number_)) + sizeof(countrycode_));
  373. _internal_metadata_.Clear();
  374. }
  375. bool PhoneNumber::MergePartialFromCodedStream(
  376. ::google::protobuf::io::CodedInputStream* input) {
  377. #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  378. ::google::protobuf::uint32 tag;
  379. // @@protoc_insertion_point(parse_start:qtprotobuf.examples.PhoneNumber)
  380. for (;;) {
  381. ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
  382. tag = p.first;
  383. if (!p.second) goto handle_unusual;
  384. switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
  385. // uint32 countryCode = 1;
  386. case 1: {
  387. if (static_cast< ::google::protobuf::uint8>(tag) ==
  388. static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
  389. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  390. ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
  391. input, &countrycode_)));
  392. } else {
  393. goto handle_unusual;
  394. }
  395. break;
  396. }
  397. // uint64 number = 2;
  398. case 2: {
  399. if (static_cast< ::google::protobuf::uint8>(tag) ==
  400. static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
  401. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  402. ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>(
  403. input, &number_)));
  404. } else {
  405. goto handle_unusual;
  406. }
  407. break;
  408. }
  409. default: {
  410. handle_unusual:
  411. if (tag == 0) {
  412. goto success;
  413. }
  414. DO_(::google::protobuf::internal::WireFormat::SkipField(
  415. input, tag, _internal_metadata_.mutable_unknown_fields()));
  416. break;
  417. }
  418. }
  419. }
  420. success:
  421. // @@protoc_insertion_point(parse_success:qtprotobuf.examples.PhoneNumber)
  422. return true;
  423. failure:
  424. // @@protoc_insertion_point(parse_failure:qtprotobuf.examples.PhoneNumber)
  425. return false;
  426. #undef DO_
  427. }
  428. void PhoneNumber::SerializeWithCachedSizes(
  429. ::google::protobuf::io::CodedOutputStream* output) const {
  430. // @@protoc_insertion_point(serialize_start:qtprotobuf.examples.PhoneNumber)
  431. ::google::protobuf::uint32 cached_has_bits = 0;
  432. (void) cached_has_bits;
  433. // uint32 countryCode = 1;
  434. if (this->countrycode() != 0) {
  435. ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->countrycode(), output);
  436. }
  437. // uint64 number = 2;
  438. if (this->number() != 0) {
  439. ::google::protobuf::internal::WireFormatLite::WriteUInt64(2, this->number(), output);
  440. }
  441. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  442. ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
  443. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output);
  444. }
  445. // @@protoc_insertion_point(serialize_end:qtprotobuf.examples.PhoneNumber)
  446. }
  447. ::google::protobuf::uint8* PhoneNumber::InternalSerializeWithCachedSizesToArray(
  448. bool deterministic, ::google::protobuf::uint8* target) const {
  449. (void)deterministic; // Unused
  450. // @@protoc_insertion_point(serialize_to_array_start:qtprotobuf.examples.PhoneNumber)
  451. ::google::protobuf::uint32 cached_has_bits = 0;
  452. (void) cached_has_bits;
  453. // uint32 countryCode = 1;
  454. if (this->countrycode() != 0) {
  455. target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->countrycode(), target);
  456. }
  457. // uint64 number = 2;
  458. if (this->number() != 0) {
  459. target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(2, this->number(), target);
  460. }
  461. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  462. target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
  463. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target);
  464. }
  465. // @@protoc_insertion_point(serialize_to_array_end:qtprotobuf.examples.PhoneNumber)
  466. return target;
  467. }
  468. size_t PhoneNumber::ByteSizeLong() const {
  469. // @@protoc_insertion_point(message_byte_size_start:qtprotobuf.examples.PhoneNumber)
  470. size_t total_size = 0;
  471. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  472. total_size +=
  473. ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
  474. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()));
  475. }
  476. // uint64 number = 2;
  477. if (this->number() != 0) {
  478. total_size += 1 +
  479. ::google::protobuf::internal::WireFormatLite::UInt64Size(
  480. this->number());
  481. }
  482. // uint32 countryCode = 1;
  483. if (this->countrycode() != 0) {
  484. total_size += 1 +
  485. ::google::protobuf::internal::WireFormatLite::UInt32Size(
  486. this->countrycode());
  487. }
  488. int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  489. SetCachedSize(cached_size);
  490. return total_size;
  491. }
  492. void PhoneNumber::MergeFrom(const ::google::protobuf::Message& from) {
  493. // @@protoc_insertion_point(generalized_merge_from_start:qtprotobuf.examples.PhoneNumber)
  494. GOOGLE_DCHECK_NE(&from, this);
  495. const PhoneNumber* source =
  496. ::google::protobuf::internal::DynamicCastToGenerated<const PhoneNumber>(
  497. &from);
  498. if (source == NULL) {
  499. // @@protoc_insertion_point(generalized_merge_from_cast_fail:qtprotobuf.examples.PhoneNumber)
  500. ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  501. } else {
  502. // @@protoc_insertion_point(generalized_merge_from_cast_success:qtprotobuf.examples.PhoneNumber)
  503. MergeFrom(*source);
  504. }
  505. }
  506. void PhoneNumber::MergeFrom(const PhoneNumber& from) {
  507. // @@protoc_insertion_point(class_specific_merge_from_start:qtprotobuf.examples.PhoneNumber)
  508. GOOGLE_DCHECK_NE(&from, this);
  509. _internal_metadata_.MergeFrom(from._internal_metadata_);
  510. ::google::protobuf::uint32 cached_has_bits = 0;
  511. (void) cached_has_bits;
  512. if (from.number() != 0) {
  513. set_number(from.number());
  514. }
  515. if (from.countrycode() != 0) {
  516. set_countrycode(from.countrycode());
  517. }
  518. }
  519. void PhoneNumber::CopyFrom(const ::google::protobuf::Message& from) {
  520. // @@protoc_insertion_point(generalized_copy_from_start:qtprotobuf.examples.PhoneNumber)
  521. if (&from == this) return;
  522. Clear();
  523. MergeFrom(from);
  524. }
  525. void PhoneNumber::CopyFrom(const PhoneNumber& from) {
  526. // @@protoc_insertion_point(class_specific_copy_from_start:qtprotobuf.examples.PhoneNumber)
  527. if (&from == this) return;
  528. Clear();
  529. MergeFrom(from);
  530. }
  531. bool PhoneNumber::IsInitialized() const {
  532. return true;
  533. }
  534. void PhoneNumber::Swap(PhoneNumber* other) {
  535. if (other == this) return;
  536. InternalSwap(other);
  537. }
  538. void PhoneNumber::InternalSwap(PhoneNumber* other) {
  539. using std::swap;
  540. swap(number_, other->number_);
  541. swap(countrycode_, other->countrycode_);
  542. _internal_metadata_.Swap(&other->_internal_metadata_);
  543. }
  544. ::google::protobuf::Metadata PhoneNumber::GetMetadata() const {
  545. protobuf_addressbook_2eproto::protobuf_AssignDescriptorsOnce();
  546. return ::protobuf_addressbook_2eproto::file_level_metadata[kIndexInFileMessages];
  547. }
  548. // ===================================================================
  549. void Address::InitAsDefaultInstance() {
  550. }
  551. #if !defined(_MSC_VER) || _MSC_VER >= 1900
  552. const int Address::kZipCodeFieldNumber;
  553. const int Address::kStreetAddress1FieldNumber;
  554. const int Address::kStreetAddress2FieldNumber;
  555. const int Address::kStateFieldNumber;
  556. const int Address::kCountryFieldNumber;
  557. #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
  558. Address::Address()
  559. : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  560. ::google::protobuf::internal::InitSCC(
  561. &protobuf_addressbook_2eproto::scc_info_Address.base);
  562. SharedCtor();
  563. // @@protoc_insertion_point(constructor:qtprotobuf.examples.Address)
  564. }
  565. Address::Address(const Address& from)
  566. : ::google::protobuf::Message(),
  567. _internal_metadata_(NULL) {
  568. _internal_metadata_.MergeFrom(from._internal_metadata_);
  569. streetaddress1_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  570. if (from.streetaddress1().size() > 0) {
  571. streetaddress1_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.streetaddress1_);
  572. }
  573. streetaddress2_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  574. if (from.streetaddress2().size() > 0) {
  575. streetaddress2_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.streetaddress2_);
  576. }
  577. state_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  578. if (from.state().size() > 0) {
  579. state_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.state_);
  580. }
  581. ::memcpy(&zipcode_, &from.zipcode_,
  582. static_cast<size_t>(reinterpret_cast<char*>(&country_) -
  583. reinterpret_cast<char*>(&zipcode_)) + sizeof(country_));
  584. // @@protoc_insertion_point(copy_constructor:qtprotobuf.examples.Address)
  585. }
  586. void Address::SharedCtor() {
  587. streetaddress1_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  588. streetaddress2_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  589. state_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  590. ::memset(&zipcode_, 0, static_cast<size_t>(
  591. reinterpret_cast<char*>(&country_) -
  592. reinterpret_cast<char*>(&zipcode_)) + sizeof(country_));
  593. }
  594. Address::~Address() {
  595. // @@protoc_insertion_point(destructor:qtprotobuf.examples.Address)
  596. SharedDtor();
  597. }
  598. void Address::SharedDtor() {
  599. streetaddress1_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  600. streetaddress2_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  601. state_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  602. }
  603. void Address::SetCachedSize(int size) const {
  604. _cached_size_.Set(size);
  605. }
  606. const ::google::protobuf::Descriptor* Address::descriptor() {
  607. ::protobuf_addressbook_2eproto::protobuf_AssignDescriptorsOnce();
  608. return ::protobuf_addressbook_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
  609. }
  610. const Address& Address::default_instance() {
  611. ::google::protobuf::internal::InitSCC(&protobuf_addressbook_2eproto::scc_info_Address.base);
  612. return *internal_default_instance();
  613. }
  614. void Address::Clear() {
  615. // @@protoc_insertion_point(message_clear_start:qtprotobuf.examples.Address)
  616. ::google::protobuf::uint32 cached_has_bits = 0;
  617. // Prevent compiler warnings about cached_has_bits being unused
  618. (void) cached_has_bits;
  619. streetaddress1_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  620. streetaddress2_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  621. state_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  622. ::memset(&zipcode_, 0, static_cast<size_t>(
  623. reinterpret_cast<char*>(&country_) -
  624. reinterpret_cast<char*>(&zipcode_)) + sizeof(country_));
  625. _internal_metadata_.Clear();
  626. }
  627. bool Address::MergePartialFromCodedStream(
  628. ::google::protobuf::io::CodedInputStream* input) {
  629. #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  630. ::google::protobuf::uint32 tag;
  631. // @@protoc_insertion_point(parse_start:qtprotobuf.examples.Address)
  632. for (;;) {
  633. ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
  634. tag = p.first;
  635. if (!p.second) goto handle_unusual;
  636. switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
  637. // uint64 zipCode = 1;
  638. case 1: {
  639. if (static_cast< ::google::protobuf::uint8>(tag) ==
  640. static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
  641. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  642. ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>(
  643. input, &zipcode_)));
  644. } else {
  645. goto handle_unusual;
  646. }
  647. break;
  648. }
  649. // string streetAddress1 = 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::ReadString(
  654. input, this->mutable_streetaddress1()));
  655. DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  656. this->streetaddress1().data(), static_cast<int>(this->streetaddress1().length()),
  657. ::google::protobuf::internal::WireFormatLite::PARSE,
  658. "qtprotobuf.examples.Address.streetAddress1"));
  659. } else {
  660. goto handle_unusual;
  661. }
  662. break;
  663. }
  664. // string streetAddress2 = 3;
  665. case 3: {
  666. if (static_cast< ::google::protobuf::uint8>(tag) ==
  667. static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
  668. DO_(::google::protobuf::internal::WireFormatLite::ReadString(
  669. input, this->mutable_streetaddress2()));
  670. DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  671. this->streetaddress2().data(), static_cast<int>(this->streetaddress2().length()),
  672. ::google::protobuf::internal::WireFormatLite::PARSE,
  673. "qtprotobuf.examples.Address.streetAddress2"));
  674. } else {
  675. goto handle_unusual;
  676. }
  677. break;
  678. }
  679. // string state = 4;
  680. case 4: {
  681. if (static_cast< ::google::protobuf::uint8>(tag) ==
  682. static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) {
  683. DO_(::google::protobuf::internal::WireFormatLite::ReadString(
  684. input, this->mutable_state()));
  685. DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  686. this->state().data(), static_cast<int>(this->state().length()),
  687. ::google::protobuf::internal::WireFormatLite::PARSE,
  688. "qtprotobuf.examples.Address.state"));
  689. } else {
  690. goto handle_unusual;
  691. }
  692. break;
  693. }
  694. // uint32 country = 5;
  695. case 5: {
  696. if (static_cast< ::google::protobuf::uint8>(tag) ==
  697. static_cast< ::google::protobuf::uint8>(40u /* 40 & 0xFF */)) {
  698. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  699. ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
  700. input, &country_)));
  701. } else {
  702. goto handle_unusual;
  703. }
  704. break;
  705. }
  706. default: {
  707. handle_unusual:
  708. if (tag == 0) {
  709. goto success;
  710. }
  711. DO_(::google::protobuf::internal::WireFormat::SkipField(
  712. input, tag, _internal_metadata_.mutable_unknown_fields()));
  713. break;
  714. }
  715. }
  716. }
  717. success:
  718. // @@protoc_insertion_point(parse_success:qtprotobuf.examples.Address)
  719. return true;
  720. failure:
  721. // @@protoc_insertion_point(parse_failure:qtprotobuf.examples.Address)
  722. return false;
  723. #undef DO_
  724. }
  725. void Address::SerializeWithCachedSizes(
  726. ::google::protobuf::io::CodedOutputStream* output) const {
  727. // @@protoc_insertion_point(serialize_start:qtprotobuf.examples.Address)
  728. ::google::protobuf::uint32 cached_has_bits = 0;
  729. (void) cached_has_bits;
  730. // uint64 zipCode = 1;
  731. if (this->zipcode() != 0) {
  732. ::google::protobuf::internal::WireFormatLite::WriteUInt64(1, this->zipcode(), output);
  733. }
  734. // string streetAddress1 = 2;
  735. if (this->streetaddress1().size() > 0) {
  736. ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  737. this->streetaddress1().data(), static_cast<int>(this->streetaddress1().length()),
  738. ::google::protobuf::internal::WireFormatLite::SERIALIZE,
  739. "qtprotobuf.examples.Address.streetAddress1");
  740. ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
  741. 2, this->streetaddress1(), output);
  742. }
  743. // string streetAddress2 = 3;
  744. if (this->streetaddress2().size() > 0) {
  745. ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  746. this->streetaddress2().data(), static_cast<int>(this->streetaddress2().length()),
  747. ::google::protobuf::internal::WireFormatLite::SERIALIZE,
  748. "qtprotobuf.examples.Address.streetAddress2");
  749. ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
  750. 3, this->streetaddress2(), output);
  751. }
  752. // string state = 4;
  753. if (this->state().size() > 0) {
  754. ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  755. this->state().data(), static_cast<int>(this->state().length()),
  756. ::google::protobuf::internal::WireFormatLite::SERIALIZE,
  757. "qtprotobuf.examples.Address.state");
  758. ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
  759. 4, this->state(), output);
  760. }
  761. // uint32 country = 5;
  762. if (this->country() != 0) {
  763. ::google::protobuf::internal::WireFormatLite::WriteUInt32(5, this->country(), output);
  764. }
  765. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  766. ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
  767. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output);
  768. }
  769. // @@protoc_insertion_point(serialize_end:qtprotobuf.examples.Address)
  770. }
  771. ::google::protobuf::uint8* Address::InternalSerializeWithCachedSizesToArray(
  772. bool deterministic, ::google::protobuf::uint8* target) const {
  773. (void)deterministic; // Unused
  774. // @@protoc_insertion_point(serialize_to_array_start:qtprotobuf.examples.Address)
  775. ::google::protobuf::uint32 cached_has_bits = 0;
  776. (void) cached_has_bits;
  777. // uint64 zipCode = 1;
  778. if (this->zipcode() != 0) {
  779. target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(1, this->zipcode(), target);
  780. }
  781. // string streetAddress1 = 2;
  782. if (this->streetaddress1().size() > 0) {
  783. ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  784. this->streetaddress1().data(), static_cast<int>(this->streetaddress1().length()),
  785. ::google::protobuf::internal::WireFormatLite::SERIALIZE,
  786. "qtprotobuf.examples.Address.streetAddress1");
  787. target =
  788. ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
  789. 2, this->streetaddress1(), target);
  790. }
  791. // string streetAddress2 = 3;
  792. if (this->streetaddress2().size() > 0) {
  793. ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  794. this->streetaddress2().data(), static_cast<int>(this->streetaddress2().length()),
  795. ::google::protobuf::internal::WireFormatLite::SERIALIZE,
  796. "qtprotobuf.examples.Address.streetAddress2");
  797. target =
  798. ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
  799. 3, this->streetaddress2(), target);
  800. }
  801. // string state = 4;
  802. if (this->state().size() > 0) {
  803. ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  804. this->state().data(), static_cast<int>(this->state().length()),
  805. ::google::protobuf::internal::WireFormatLite::SERIALIZE,
  806. "qtprotobuf.examples.Address.state");
  807. target =
  808. ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
  809. 4, this->state(), target);
  810. }
  811. // uint32 country = 5;
  812. if (this->country() != 0) {
  813. target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(5, this->country(), target);
  814. }
  815. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  816. target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
  817. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target);
  818. }
  819. // @@protoc_insertion_point(serialize_to_array_end:qtprotobuf.examples.Address)
  820. return target;
  821. }
  822. size_t Address::ByteSizeLong() const {
  823. // @@protoc_insertion_point(message_byte_size_start:qtprotobuf.examples.Address)
  824. size_t total_size = 0;
  825. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  826. total_size +=
  827. ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
  828. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()));
  829. }
  830. // string streetAddress1 = 2;
  831. if (this->streetaddress1().size() > 0) {
  832. total_size += 1 +
  833. ::google::protobuf::internal::WireFormatLite::StringSize(
  834. this->streetaddress1());
  835. }
  836. // string streetAddress2 = 3;
  837. if (this->streetaddress2().size() > 0) {
  838. total_size += 1 +
  839. ::google::protobuf::internal::WireFormatLite::StringSize(
  840. this->streetaddress2());
  841. }
  842. // string state = 4;
  843. if (this->state().size() > 0) {
  844. total_size += 1 +
  845. ::google::protobuf::internal::WireFormatLite::StringSize(
  846. this->state());
  847. }
  848. // uint64 zipCode = 1;
  849. if (this->zipcode() != 0) {
  850. total_size += 1 +
  851. ::google::protobuf::internal::WireFormatLite::UInt64Size(
  852. this->zipcode());
  853. }
  854. // uint32 country = 5;
  855. if (this->country() != 0) {
  856. total_size += 1 +
  857. ::google::protobuf::internal::WireFormatLite::UInt32Size(
  858. this->country());
  859. }
  860. int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  861. SetCachedSize(cached_size);
  862. return total_size;
  863. }
  864. void Address::MergeFrom(const ::google::protobuf::Message& from) {
  865. // @@protoc_insertion_point(generalized_merge_from_start:qtprotobuf.examples.Address)
  866. GOOGLE_DCHECK_NE(&from, this);
  867. const Address* source =
  868. ::google::protobuf::internal::DynamicCastToGenerated<const Address>(
  869. &from);
  870. if (source == NULL) {
  871. // @@protoc_insertion_point(generalized_merge_from_cast_fail:qtprotobuf.examples.Address)
  872. ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  873. } else {
  874. // @@protoc_insertion_point(generalized_merge_from_cast_success:qtprotobuf.examples.Address)
  875. MergeFrom(*source);
  876. }
  877. }
  878. void Address::MergeFrom(const Address& from) {
  879. // @@protoc_insertion_point(class_specific_merge_from_start:qtprotobuf.examples.Address)
  880. GOOGLE_DCHECK_NE(&from, this);
  881. _internal_metadata_.MergeFrom(from._internal_metadata_);
  882. ::google::protobuf::uint32 cached_has_bits = 0;
  883. (void) cached_has_bits;
  884. if (from.streetaddress1().size() > 0) {
  885. streetaddress1_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.streetaddress1_);
  886. }
  887. if (from.streetaddress2().size() > 0) {
  888. streetaddress2_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.streetaddress2_);
  889. }
  890. if (from.state().size() > 0) {
  891. state_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.state_);
  892. }
  893. if (from.zipcode() != 0) {
  894. set_zipcode(from.zipcode());
  895. }
  896. if (from.country() != 0) {
  897. set_country(from.country());
  898. }
  899. }
  900. void Address::CopyFrom(const ::google::protobuf::Message& from) {
  901. // @@protoc_insertion_point(generalized_copy_from_start:qtprotobuf.examples.Address)
  902. if (&from == this) return;
  903. Clear();
  904. MergeFrom(from);
  905. }
  906. void Address::CopyFrom(const Address& from) {
  907. // @@protoc_insertion_point(class_specific_copy_from_start:qtprotobuf.examples.Address)
  908. if (&from == this) return;
  909. Clear();
  910. MergeFrom(from);
  911. }
  912. bool Address::IsInitialized() const {
  913. return true;
  914. }
  915. void Address::Swap(Address* other) {
  916. if (other == this) return;
  917. InternalSwap(other);
  918. }
  919. void Address::InternalSwap(Address* other) {
  920. using std::swap;
  921. streetaddress1_.Swap(&other->streetaddress1_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
  922. GetArenaNoVirtual());
  923. streetaddress2_.Swap(&other->streetaddress2_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
  924. GetArenaNoVirtual());
  925. state_.Swap(&other->state_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
  926. GetArenaNoVirtual());
  927. swap(zipcode_, other->zipcode_);
  928. swap(country_, other->country_);
  929. _internal_metadata_.Swap(&other->_internal_metadata_);
  930. }
  931. ::google::protobuf::Metadata Address::GetMetadata() const {
  932. protobuf_addressbook_2eproto::protobuf_AssignDescriptorsOnce();
  933. return ::protobuf_addressbook_2eproto::file_level_metadata[kIndexInFileMessages];
  934. }
  935. // ===================================================================
  936. void Job::InitAsDefaultInstance() {
  937. ::qtprotobuf::examples::_Job_default_instance_._instance.get_mutable()->officeaddress_ = const_cast< ::qtprotobuf::examples::Address*>(
  938. ::qtprotobuf::examples::Address::internal_default_instance());
  939. }
  940. #if !defined(_MSC_VER) || _MSC_VER >= 1900
  941. const int Job::kTitleFieldNumber;
  942. const int Job::kOfficeAddressFieldNumber;
  943. #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
  944. Job::Job()
  945. : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  946. ::google::protobuf::internal::InitSCC(
  947. &protobuf_addressbook_2eproto::scc_info_Job.base);
  948. SharedCtor();
  949. // @@protoc_insertion_point(constructor:qtprotobuf.examples.Job)
  950. }
  951. Job::Job(const Job& from)
  952. : ::google::protobuf::Message(),
  953. _internal_metadata_(NULL) {
  954. _internal_metadata_.MergeFrom(from._internal_metadata_);
  955. title_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  956. if (from.title().size() > 0) {
  957. title_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.title_);
  958. }
  959. if (from.has_officeaddress()) {
  960. officeaddress_ = new ::qtprotobuf::examples::Address(*from.officeaddress_);
  961. } else {
  962. officeaddress_ = NULL;
  963. }
  964. // @@protoc_insertion_point(copy_constructor:qtprotobuf.examples.Job)
  965. }
  966. void Job::SharedCtor() {
  967. title_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  968. officeaddress_ = NULL;
  969. }
  970. Job::~Job() {
  971. // @@protoc_insertion_point(destructor:qtprotobuf.examples.Job)
  972. SharedDtor();
  973. }
  974. void Job::SharedDtor() {
  975. title_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  976. if (this != internal_default_instance()) delete officeaddress_;
  977. }
  978. void Job::SetCachedSize(int size) const {
  979. _cached_size_.Set(size);
  980. }
  981. const ::google::protobuf::Descriptor* Job::descriptor() {
  982. ::protobuf_addressbook_2eproto::protobuf_AssignDescriptorsOnce();
  983. return ::protobuf_addressbook_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
  984. }
  985. const Job& Job::default_instance() {
  986. ::google::protobuf::internal::InitSCC(&protobuf_addressbook_2eproto::scc_info_Job.base);
  987. return *internal_default_instance();
  988. }
  989. void Job::Clear() {
  990. // @@protoc_insertion_point(message_clear_start:qtprotobuf.examples.Job)
  991. ::google::protobuf::uint32 cached_has_bits = 0;
  992. // Prevent compiler warnings about cached_has_bits being unused
  993. (void) cached_has_bits;
  994. title_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  995. if (GetArenaNoVirtual() == NULL && officeaddress_ != NULL) {
  996. delete officeaddress_;
  997. }
  998. officeaddress_ = NULL;
  999. _internal_metadata_.Clear();
  1000. }
  1001. bool Job::MergePartialFromCodedStream(
  1002. ::google::protobuf::io::CodedInputStream* input) {
  1003. #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  1004. ::google::protobuf::uint32 tag;
  1005. // @@protoc_insertion_point(parse_start:qtprotobuf.examples.Job)
  1006. for (;;) {
  1007. ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
  1008. tag = p.first;
  1009. if (!p.second) goto handle_unusual;
  1010. switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
  1011. // string title = 1;
  1012. case 1: {
  1013. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1014. static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
  1015. DO_(::google::protobuf::internal::WireFormatLite::ReadString(
  1016. input, this->mutable_title()));
  1017. DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  1018. this->title().data(), static_cast<int>(this->title().length()),
  1019. ::google::protobuf::internal::WireFormatLite::PARSE,
  1020. "qtprotobuf.examples.Job.title"));
  1021. } else {
  1022. goto handle_unusual;
  1023. }
  1024. break;
  1025. }
  1026. // .qtprotobuf.examples.Address officeAddress = 2;
  1027. case 2: {
  1028. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1029. static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
  1030. DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
  1031. input, mutable_officeaddress()));
  1032. } else {
  1033. goto handle_unusual;
  1034. }
  1035. break;
  1036. }
  1037. default: {
  1038. handle_unusual:
  1039. if (tag == 0) {
  1040. goto success;
  1041. }
  1042. DO_(::google::protobuf::internal::WireFormat::SkipField(
  1043. input, tag, _internal_metadata_.mutable_unknown_fields()));
  1044. break;
  1045. }
  1046. }
  1047. }
  1048. success:
  1049. // @@protoc_insertion_point(parse_success:qtprotobuf.examples.Job)
  1050. return true;
  1051. failure:
  1052. // @@protoc_insertion_point(parse_failure:qtprotobuf.examples.Job)
  1053. return false;
  1054. #undef DO_
  1055. }
  1056. void Job::SerializeWithCachedSizes(
  1057. ::google::protobuf::io::CodedOutputStream* output) const {
  1058. // @@protoc_insertion_point(serialize_start:qtprotobuf.examples.Job)
  1059. ::google::protobuf::uint32 cached_has_bits = 0;
  1060. (void) cached_has_bits;
  1061. // string title = 1;
  1062. if (this->title().size() > 0) {
  1063. ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  1064. this->title().data(), static_cast<int>(this->title().length()),
  1065. ::google::protobuf::internal::WireFormatLite::SERIALIZE,
  1066. "qtprotobuf.examples.Job.title");
  1067. ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
  1068. 1, this->title(), output);
  1069. }
  1070. // .qtprotobuf.examples.Address officeAddress = 2;
  1071. if (this->has_officeaddress()) {
  1072. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  1073. 2, this->_internal_officeaddress(), output);
  1074. }
  1075. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  1076. ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
  1077. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output);
  1078. }
  1079. // @@protoc_insertion_point(serialize_end:qtprotobuf.examples.Job)
  1080. }
  1081. ::google::protobuf::uint8* Job::InternalSerializeWithCachedSizesToArray(
  1082. bool deterministic, ::google::protobuf::uint8* target) const {
  1083. (void)deterministic; // Unused
  1084. // @@protoc_insertion_point(serialize_to_array_start:qtprotobuf.examples.Job)
  1085. ::google::protobuf::uint32 cached_has_bits = 0;
  1086. (void) cached_has_bits;
  1087. // string title = 1;
  1088. if (this->title().size() > 0) {
  1089. ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  1090. this->title().data(), static_cast<int>(this->title().length()),
  1091. ::google::protobuf::internal::WireFormatLite::SERIALIZE,
  1092. "qtprotobuf.examples.Job.title");
  1093. target =
  1094. ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
  1095. 1, this->title(), target);
  1096. }
  1097. // .qtprotobuf.examples.Address officeAddress = 2;
  1098. if (this->has_officeaddress()) {
  1099. target = ::google::protobuf::internal::WireFormatLite::
  1100. InternalWriteMessageToArray(
  1101. 2, this->_internal_officeaddress(), deterministic, target);
  1102. }
  1103. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  1104. target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
  1105. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target);
  1106. }
  1107. // @@protoc_insertion_point(serialize_to_array_end:qtprotobuf.examples.Job)
  1108. return target;
  1109. }
  1110. size_t Job::ByteSizeLong() const {
  1111. // @@protoc_insertion_point(message_byte_size_start:qtprotobuf.examples.Job)
  1112. size_t total_size = 0;
  1113. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  1114. total_size +=
  1115. ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
  1116. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()));
  1117. }
  1118. // string title = 1;
  1119. if (this->title().size() > 0) {
  1120. total_size += 1 +
  1121. ::google::protobuf::internal::WireFormatLite::StringSize(
  1122. this->title());
  1123. }
  1124. // .qtprotobuf.examples.Address officeAddress = 2;
  1125. if (this->has_officeaddress()) {
  1126. total_size += 1 +
  1127. ::google::protobuf::internal::WireFormatLite::MessageSize(
  1128. *officeaddress_);
  1129. }
  1130. int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  1131. SetCachedSize(cached_size);
  1132. return total_size;
  1133. }
  1134. void Job::MergeFrom(const ::google::protobuf::Message& from) {
  1135. // @@protoc_insertion_point(generalized_merge_from_start:qtprotobuf.examples.Job)
  1136. GOOGLE_DCHECK_NE(&from, this);
  1137. const Job* source =
  1138. ::google::protobuf::internal::DynamicCastToGenerated<const Job>(
  1139. &from);
  1140. if (source == NULL) {
  1141. // @@protoc_insertion_point(generalized_merge_from_cast_fail:qtprotobuf.examples.Job)
  1142. ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  1143. } else {
  1144. // @@protoc_insertion_point(generalized_merge_from_cast_success:qtprotobuf.examples.Job)
  1145. MergeFrom(*source);
  1146. }
  1147. }
  1148. void Job::MergeFrom(const Job& from) {
  1149. // @@protoc_insertion_point(class_specific_merge_from_start:qtprotobuf.examples.Job)
  1150. GOOGLE_DCHECK_NE(&from, this);
  1151. _internal_metadata_.MergeFrom(from._internal_metadata_);
  1152. ::google::protobuf::uint32 cached_has_bits = 0;
  1153. (void) cached_has_bits;
  1154. if (from.title().size() > 0) {
  1155. title_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.title_);
  1156. }
  1157. if (from.has_officeaddress()) {
  1158. mutable_officeaddress()->::qtprotobuf::examples::Address::MergeFrom(from.officeaddress());
  1159. }
  1160. }
  1161. void Job::CopyFrom(const ::google::protobuf::Message& from) {
  1162. // @@protoc_insertion_point(generalized_copy_from_start:qtprotobuf.examples.Job)
  1163. if (&from == this) return;
  1164. Clear();
  1165. MergeFrom(from);
  1166. }
  1167. void Job::CopyFrom(const Job& from) {
  1168. // @@protoc_insertion_point(class_specific_copy_from_start:qtprotobuf.examples.Job)
  1169. if (&from == this) return;
  1170. Clear();
  1171. MergeFrom(from);
  1172. }
  1173. bool Job::IsInitialized() const {
  1174. return true;
  1175. }
  1176. void Job::Swap(Job* other) {
  1177. if (other == this) return;
  1178. InternalSwap(other);
  1179. }
  1180. void Job::InternalSwap(Job* other) {
  1181. using std::swap;
  1182. title_.Swap(&other->title_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
  1183. GetArenaNoVirtual());
  1184. swap(officeaddress_, other->officeaddress_);
  1185. _internal_metadata_.Swap(&other->_internal_metadata_);
  1186. }
  1187. ::google::protobuf::Metadata Job::GetMetadata() const {
  1188. protobuf_addressbook_2eproto::protobuf_AssignDescriptorsOnce();
  1189. return ::protobuf_addressbook_2eproto::file_level_metadata[kIndexInFileMessages];
  1190. }
  1191. // ===================================================================
  1192. void Contact::InitAsDefaultInstance() {
  1193. ::qtprotobuf::examples::_Contact_default_instance_._instance.get_mutable()->address_ = const_cast< ::qtprotobuf::examples::Address*>(
  1194. ::qtprotobuf::examples::Address::internal_default_instance());
  1195. ::qtprotobuf::examples::_Contact_default_instance_._instance.get_mutable()->job_ = const_cast< ::qtprotobuf::examples::Job*>(
  1196. ::qtprotobuf::examples::Job::internal_default_instance());
  1197. }
  1198. #if !defined(_MSC_VER) || _MSC_VER >= 1900
  1199. const int Contact::kFirstNameFieldNumber;
  1200. const int Contact::kLastNameFieldNumber;
  1201. const int Contact::kMiddleNameFieldNumber;
  1202. const int Contact::kPhonesFieldNumber;
  1203. const int Contact::kAddressFieldNumber;
  1204. const int Contact::kJobFieldNumber;
  1205. #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
  1206. Contact::Contact()
  1207. : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  1208. ::google::protobuf::internal::InitSCC(
  1209. &protobuf_addressbook_2eproto::scc_info_Contact.base);
  1210. SharedCtor();
  1211. // @@protoc_insertion_point(constructor:qtprotobuf.examples.Contact)
  1212. }
  1213. Contact::Contact(const Contact& from)
  1214. : ::google::protobuf::Message(),
  1215. _internal_metadata_(NULL),
  1216. phones_(from.phones_) {
  1217. _internal_metadata_.MergeFrom(from._internal_metadata_);
  1218. firstname_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  1219. if (from.firstname().size() > 0) {
  1220. firstname_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.firstname_);
  1221. }
  1222. lastname_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  1223. if (from.lastname().size() > 0) {
  1224. lastname_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.lastname_);
  1225. }
  1226. middlename_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  1227. if (from.middlename().size() > 0) {
  1228. middlename_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.middlename_);
  1229. }
  1230. if (from.has_address()) {
  1231. address_ = new ::qtprotobuf::examples::Address(*from.address_);
  1232. } else {
  1233. address_ = NULL;
  1234. }
  1235. if (from.has_job()) {
  1236. job_ = new ::qtprotobuf::examples::Job(*from.job_);
  1237. } else {
  1238. job_ = NULL;
  1239. }
  1240. // @@protoc_insertion_point(copy_constructor:qtprotobuf.examples.Contact)
  1241. }
  1242. void Contact::SharedCtor() {
  1243. firstname_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  1244. lastname_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  1245. middlename_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  1246. ::memset(&address_, 0, static_cast<size_t>(
  1247. reinterpret_cast<char*>(&job_) -
  1248. reinterpret_cast<char*>(&address_)) + sizeof(job_));
  1249. }
  1250. Contact::~Contact() {
  1251. // @@protoc_insertion_point(destructor:qtprotobuf.examples.Contact)
  1252. SharedDtor();
  1253. }
  1254. void Contact::SharedDtor() {
  1255. firstname_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  1256. lastname_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  1257. middlename_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  1258. if (this != internal_default_instance()) delete address_;
  1259. if (this != internal_default_instance()) delete job_;
  1260. }
  1261. void Contact::SetCachedSize(int size) const {
  1262. _cached_size_.Set(size);
  1263. }
  1264. const ::google::protobuf::Descriptor* Contact::descriptor() {
  1265. ::protobuf_addressbook_2eproto::protobuf_AssignDescriptorsOnce();
  1266. return ::protobuf_addressbook_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
  1267. }
  1268. const Contact& Contact::default_instance() {
  1269. ::google::protobuf::internal::InitSCC(&protobuf_addressbook_2eproto::scc_info_Contact.base);
  1270. return *internal_default_instance();
  1271. }
  1272. void Contact::Clear() {
  1273. // @@protoc_insertion_point(message_clear_start:qtprotobuf.examples.Contact)
  1274. ::google::protobuf::uint32 cached_has_bits = 0;
  1275. // Prevent compiler warnings about cached_has_bits being unused
  1276. (void) cached_has_bits;
  1277. phones_.Clear();
  1278. firstname_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  1279. lastname_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  1280. middlename_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  1281. if (GetArenaNoVirtual() == NULL && address_ != NULL) {
  1282. delete address_;
  1283. }
  1284. address_ = NULL;
  1285. if (GetArenaNoVirtual() == NULL && job_ != NULL) {
  1286. delete job_;
  1287. }
  1288. job_ = NULL;
  1289. _internal_metadata_.Clear();
  1290. }
  1291. bool Contact::MergePartialFromCodedStream(
  1292. ::google::protobuf::io::CodedInputStream* input) {
  1293. #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  1294. ::google::protobuf::uint32 tag;
  1295. // @@protoc_insertion_point(parse_start:qtprotobuf.examples.Contact)
  1296. for (;;) {
  1297. ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
  1298. tag = p.first;
  1299. if (!p.second) goto handle_unusual;
  1300. switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
  1301. // string firstName = 1;
  1302. case 1: {
  1303. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1304. static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
  1305. DO_(::google::protobuf::internal::WireFormatLite::ReadString(
  1306. input, this->mutable_firstname()));
  1307. DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  1308. this->firstname().data(), static_cast<int>(this->firstname().length()),
  1309. ::google::protobuf::internal::WireFormatLite::PARSE,
  1310. "qtprotobuf.examples.Contact.firstName"));
  1311. } else {
  1312. goto handle_unusual;
  1313. }
  1314. break;
  1315. }
  1316. // string lastName = 2;
  1317. case 2: {
  1318. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1319. static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
  1320. DO_(::google::protobuf::internal::WireFormatLite::ReadString(
  1321. input, this->mutable_lastname()));
  1322. DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  1323. this->lastname().data(), static_cast<int>(this->lastname().length()),
  1324. ::google::protobuf::internal::WireFormatLite::PARSE,
  1325. "qtprotobuf.examples.Contact.lastName"));
  1326. } else {
  1327. goto handle_unusual;
  1328. }
  1329. break;
  1330. }
  1331. // string middleName = 3;
  1332. case 3: {
  1333. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1334. static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
  1335. DO_(::google::protobuf::internal::WireFormatLite::ReadString(
  1336. input, this->mutable_middlename()));
  1337. DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  1338. this->middlename().data(), static_cast<int>(this->middlename().length()),
  1339. ::google::protobuf::internal::WireFormatLite::PARSE,
  1340. "qtprotobuf.examples.Contact.middleName"));
  1341. } else {
  1342. goto handle_unusual;
  1343. }
  1344. break;
  1345. }
  1346. // repeated .qtprotobuf.examples.PhoneNumber phones = 4;
  1347. case 4: {
  1348. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1349. static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) {
  1350. DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
  1351. input, add_phones()));
  1352. } else {
  1353. goto handle_unusual;
  1354. }
  1355. break;
  1356. }
  1357. // .qtprotobuf.examples.Address address = 5;
  1358. case 5: {
  1359. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1360. static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) {
  1361. DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
  1362. input, mutable_address()));
  1363. } else {
  1364. goto handle_unusual;
  1365. }
  1366. break;
  1367. }
  1368. // .qtprotobuf.examples.Job job = 6;
  1369. case 6: {
  1370. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1371. static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) {
  1372. DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
  1373. input, mutable_job()));
  1374. } else {
  1375. goto handle_unusual;
  1376. }
  1377. break;
  1378. }
  1379. default: {
  1380. handle_unusual:
  1381. if (tag == 0) {
  1382. goto success;
  1383. }
  1384. DO_(::google::protobuf::internal::WireFormat::SkipField(
  1385. input, tag, _internal_metadata_.mutable_unknown_fields()));
  1386. break;
  1387. }
  1388. }
  1389. }
  1390. success:
  1391. // @@protoc_insertion_point(parse_success:qtprotobuf.examples.Contact)
  1392. return true;
  1393. failure:
  1394. // @@protoc_insertion_point(parse_failure:qtprotobuf.examples.Contact)
  1395. return false;
  1396. #undef DO_
  1397. }
  1398. void Contact::SerializeWithCachedSizes(
  1399. ::google::protobuf::io::CodedOutputStream* output) const {
  1400. // @@protoc_insertion_point(serialize_start:qtprotobuf.examples.Contact)
  1401. ::google::protobuf::uint32 cached_has_bits = 0;
  1402. (void) cached_has_bits;
  1403. // string firstName = 1;
  1404. if (this->firstname().size() > 0) {
  1405. ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  1406. this->firstname().data(), static_cast<int>(this->firstname().length()),
  1407. ::google::protobuf::internal::WireFormatLite::SERIALIZE,
  1408. "qtprotobuf.examples.Contact.firstName");
  1409. ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
  1410. 1, this->firstname(), output);
  1411. }
  1412. // string lastName = 2;
  1413. if (this->lastname().size() > 0) {
  1414. ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  1415. this->lastname().data(), static_cast<int>(this->lastname().length()),
  1416. ::google::protobuf::internal::WireFormatLite::SERIALIZE,
  1417. "qtprotobuf.examples.Contact.lastName");
  1418. ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
  1419. 2, this->lastname(), output);
  1420. }
  1421. // string middleName = 3;
  1422. if (this->middlename().size() > 0) {
  1423. ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  1424. this->middlename().data(), static_cast<int>(this->middlename().length()),
  1425. ::google::protobuf::internal::WireFormatLite::SERIALIZE,
  1426. "qtprotobuf.examples.Contact.middleName");
  1427. ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
  1428. 3, this->middlename(), output);
  1429. }
  1430. // repeated .qtprotobuf.examples.PhoneNumber phones = 4;
  1431. for (unsigned int i = 0,
  1432. n = static_cast<unsigned int>(this->phones_size()); i < n; i++) {
  1433. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  1434. 4,
  1435. this->phones(static_cast<int>(i)),
  1436. output);
  1437. }
  1438. // .qtprotobuf.examples.Address address = 5;
  1439. if (this->has_address()) {
  1440. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  1441. 5, this->_internal_address(), output);
  1442. }
  1443. // .qtprotobuf.examples.Job job = 6;
  1444. if (this->has_job()) {
  1445. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  1446. 6, this->_internal_job(), output);
  1447. }
  1448. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  1449. ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
  1450. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output);
  1451. }
  1452. // @@protoc_insertion_point(serialize_end:qtprotobuf.examples.Contact)
  1453. }
  1454. ::google::protobuf::uint8* Contact::InternalSerializeWithCachedSizesToArray(
  1455. bool deterministic, ::google::protobuf::uint8* target) const {
  1456. (void)deterministic; // Unused
  1457. // @@protoc_insertion_point(serialize_to_array_start:qtprotobuf.examples.Contact)
  1458. ::google::protobuf::uint32 cached_has_bits = 0;
  1459. (void) cached_has_bits;
  1460. // string firstName = 1;
  1461. if (this->firstname().size() > 0) {
  1462. ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  1463. this->firstname().data(), static_cast<int>(this->firstname().length()),
  1464. ::google::protobuf::internal::WireFormatLite::SERIALIZE,
  1465. "qtprotobuf.examples.Contact.firstName");
  1466. target =
  1467. ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
  1468. 1, this->firstname(), target);
  1469. }
  1470. // string lastName = 2;
  1471. if (this->lastname().size() > 0) {
  1472. ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  1473. this->lastname().data(), static_cast<int>(this->lastname().length()),
  1474. ::google::protobuf::internal::WireFormatLite::SERIALIZE,
  1475. "qtprotobuf.examples.Contact.lastName");
  1476. target =
  1477. ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
  1478. 2, this->lastname(), target);
  1479. }
  1480. // string middleName = 3;
  1481. if (this->middlename().size() > 0) {
  1482. ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  1483. this->middlename().data(), static_cast<int>(this->middlename().length()),
  1484. ::google::protobuf::internal::WireFormatLite::SERIALIZE,
  1485. "qtprotobuf.examples.Contact.middleName");
  1486. target =
  1487. ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
  1488. 3, this->middlename(), target);
  1489. }
  1490. // repeated .qtprotobuf.examples.PhoneNumber phones = 4;
  1491. for (unsigned int i = 0,
  1492. n = static_cast<unsigned int>(this->phones_size()); i < n; i++) {
  1493. target = ::google::protobuf::internal::WireFormatLite::
  1494. InternalWriteMessageToArray(
  1495. 4, this->phones(static_cast<int>(i)), deterministic, target);
  1496. }
  1497. // .qtprotobuf.examples.Address address = 5;
  1498. if (this->has_address()) {
  1499. target = ::google::protobuf::internal::WireFormatLite::
  1500. InternalWriteMessageToArray(
  1501. 5, this->_internal_address(), deterministic, target);
  1502. }
  1503. // .qtprotobuf.examples.Job job = 6;
  1504. if (this->has_job()) {
  1505. target = ::google::protobuf::internal::WireFormatLite::
  1506. InternalWriteMessageToArray(
  1507. 6, this->_internal_job(), deterministic, target);
  1508. }
  1509. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  1510. target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
  1511. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target);
  1512. }
  1513. // @@protoc_insertion_point(serialize_to_array_end:qtprotobuf.examples.Contact)
  1514. return target;
  1515. }
  1516. size_t Contact::ByteSizeLong() const {
  1517. // @@protoc_insertion_point(message_byte_size_start:qtprotobuf.examples.Contact)
  1518. size_t total_size = 0;
  1519. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  1520. total_size +=
  1521. ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
  1522. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()));
  1523. }
  1524. // repeated .qtprotobuf.examples.PhoneNumber phones = 4;
  1525. {
  1526. unsigned int count = static_cast<unsigned int>(this->phones_size());
  1527. total_size += 1UL * count;
  1528. for (unsigned int i = 0; i < count; i++) {
  1529. total_size +=
  1530. ::google::protobuf::internal::WireFormatLite::MessageSize(
  1531. this->phones(static_cast<int>(i)));
  1532. }
  1533. }
  1534. // string firstName = 1;
  1535. if (this->firstname().size() > 0) {
  1536. total_size += 1 +
  1537. ::google::protobuf::internal::WireFormatLite::StringSize(
  1538. this->firstname());
  1539. }
  1540. // string lastName = 2;
  1541. if (this->lastname().size() > 0) {
  1542. total_size += 1 +
  1543. ::google::protobuf::internal::WireFormatLite::StringSize(
  1544. this->lastname());
  1545. }
  1546. // string middleName = 3;
  1547. if (this->middlename().size() > 0) {
  1548. total_size += 1 +
  1549. ::google::protobuf::internal::WireFormatLite::StringSize(
  1550. this->middlename());
  1551. }
  1552. // .qtprotobuf.examples.Address address = 5;
  1553. if (this->has_address()) {
  1554. total_size += 1 +
  1555. ::google::protobuf::internal::WireFormatLite::MessageSize(
  1556. *address_);
  1557. }
  1558. // .qtprotobuf.examples.Job job = 6;
  1559. if (this->has_job()) {
  1560. total_size += 1 +
  1561. ::google::protobuf::internal::WireFormatLite::MessageSize(
  1562. *job_);
  1563. }
  1564. int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  1565. SetCachedSize(cached_size);
  1566. return total_size;
  1567. }
  1568. void Contact::MergeFrom(const ::google::protobuf::Message& from) {
  1569. // @@protoc_insertion_point(generalized_merge_from_start:qtprotobuf.examples.Contact)
  1570. GOOGLE_DCHECK_NE(&from, this);
  1571. const Contact* source =
  1572. ::google::protobuf::internal::DynamicCastToGenerated<const Contact>(
  1573. &from);
  1574. if (source == NULL) {
  1575. // @@protoc_insertion_point(generalized_merge_from_cast_fail:qtprotobuf.examples.Contact)
  1576. ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  1577. } else {
  1578. // @@protoc_insertion_point(generalized_merge_from_cast_success:qtprotobuf.examples.Contact)
  1579. MergeFrom(*source);
  1580. }
  1581. }
  1582. void Contact::MergeFrom(const Contact& from) {
  1583. // @@protoc_insertion_point(class_specific_merge_from_start:qtprotobuf.examples.Contact)
  1584. GOOGLE_DCHECK_NE(&from, this);
  1585. _internal_metadata_.MergeFrom(from._internal_metadata_);
  1586. ::google::protobuf::uint32 cached_has_bits = 0;
  1587. (void) cached_has_bits;
  1588. phones_.MergeFrom(from.phones_);
  1589. if (from.firstname().size() > 0) {
  1590. firstname_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.firstname_);
  1591. }
  1592. if (from.lastname().size() > 0) {
  1593. lastname_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.lastname_);
  1594. }
  1595. if (from.middlename().size() > 0) {
  1596. middlename_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.middlename_);
  1597. }
  1598. if (from.has_address()) {
  1599. mutable_address()->::qtprotobuf::examples::Address::MergeFrom(from.address());
  1600. }
  1601. if (from.has_job()) {
  1602. mutable_job()->::qtprotobuf::examples::Job::MergeFrom(from.job());
  1603. }
  1604. }
  1605. void Contact::CopyFrom(const ::google::protobuf::Message& from) {
  1606. // @@protoc_insertion_point(generalized_copy_from_start:qtprotobuf.examples.Contact)
  1607. if (&from == this) return;
  1608. Clear();
  1609. MergeFrom(from);
  1610. }
  1611. void Contact::CopyFrom(const Contact& from) {
  1612. // @@protoc_insertion_point(class_specific_copy_from_start:qtprotobuf.examples.Contact)
  1613. if (&from == this) return;
  1614. Clear();
  1615. MergeFrom(from);
  1616. }
  1617. bool Contact::IsInitialized() const {
  1618. return true;
  1619. }
  1620. void Contact::Swap(Contact* other) {
  1621. if (other == this) return;
  1622. InternalSwap(other);
  1623. }
  1624. void Contact::InternalSwap(Contact* other) {
  1625. using std::swap;
  1626. CastToBase(&phones_)->InternalSwap(CastToBase(&other->phones_));
  1627. firstname_.Swap(&other->firstname_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
  1628. GetArenaNoVirtual());
  1629. lastname_.Swap(&other->lastname_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
  1630. GetArenaNoVirtual());
  1631. middlename_.Swap(&other->middlename_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
  1632. GetArenaNoVirtual());
  1633. swap(address_, other->address_);
  1634. swap(job_, other->job_);
  1635. _internal_metadata_.Swap(&other->_internal_metadata_);
  1636. }
  1637. ::google::protobuf::Metadata Contact::GetMetadata() const {
  1638. protobuf_addressbook_2eproto::protobuf_AssignDescriptorsOnce();
  1639. return ::protobuf_addressbook_2eproto::file_level_metadata[kIndexInFileMessages];
  1640. }
  1641. // ===================================================================
  1642. void Contacts::InitAsDefaultInstance() {
  1643. }
  1644. #if !defined(_MSC_VER) || _MSC_VER >= 1900
  1645. const int Contacts::kListFieldNumber;
  1646. #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
  1647. Contacts::Contacts()
  1648. : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  1649. ::google::protobuf::internal::InitSCC(
  1650. &protobuf_addressbook_2eproto::scc_info_Contacts.base);
  1651. SharedCtor();
  1652. // @@protoc_insertion_point(constructor:qtprotobuf.examples.Contacts)
  1653. }
  1654. Contacts::Contacts(const Contacts& from)
  1655. : ::google::protobuf::Message(),
  1656. _internal_metadata_(NULL),
  1657. list_(from.list_) {
  1658. _internal_metadata_.MergeFrom(from._internal_metadata_);
  1659. // @@protoc_insertion_point(copy_constructor:qtprotobuf.examples.Contacts)
  1660. }
  1661. void Contacts::SharedCtor() {
  1662. }
  1663. Contacts::~Contacts() {
  1664. // @@protoc_insertion_point(destructor:qtprotobuf.examples.Contacts)
  1665. SharedDtor();
  1666. }
  1667. void Contacts::SharedDtor() {
  1668. }
  1669. void Contacts::SetCachedSize(int size) const {
  1670. _cached_size_.Set(size);
  1671. }
  1672. const ::google::protobuf::Descriptor* Contacts::descriptor() {
  1673. ::protobuf_addressbook_2eproto::protobuf_AssignDescriptorsOnce();
  1674. return ::protobuf_addressbook_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
  1675. }
  1676. const Contacts& Contacts::default_instance() {
  1677. ::google::protobuf::internal::InitSCC(&protobuf_addressbook_2eproto::scc_info_Contacts.base);
  1678. return *internal_default_instance();
  1679. }
  1680. void Contacts::Clear() {
  1681. // @@protoc_insertion_point(message_clear_start:qtprotobuf.examples.Contacts)
  1682. ::google::protobuf::uint32 cached_has_bits = 0;
  1683. // Prevent compiler warnings about cached_has_bits being unused
  1684. (void) cached_has_bits;
  1685. list_.Clear();
  1686. _internal_metadata_.Clear();
  1687. }
  1688. bool Contacts::MergePartialFromCodedStream(
  1689. ::google::protobuf::io::CodedInputStream* input) {
  1690. #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  1691. ::google::protobuf::uint32 tag;
  1692. // @@protoc_insertion_point(parse_start:qtprotobuf.examples.Contacts)
  1693. for (;;) {
  1694. ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
  1695. tag = p.first;
  1696. if (!p.second) goto handle_unusual;
  1697. switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
  1698. // repeated .qtprotobuf.examples.Contact list = 1;
  1699. case 1: {
  1700. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1701. static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
  1702. DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
  1703. input, add_list()));
  1704. } else {
  1705. goto handle_unusual;
  1706. }
  1707. break;
  1708. }
  1709. default: {
  1710. handle_unusual:
  1711. if (tag == 0) {
  1712. goto success;
  1713. }
  1714. DO_(::google::protobuf::internal::WireFormat::SkipField(
  1715. input, tag, _internal_metadata_.mutable_unknown_fields()));
  1716. break;
  1717. }
  1718. }
  1719. }
  1720. success:
  1721. // @@protoc_insertion_point(parse_success:qtprotobuf.examples.Contacts)
  1722. return true;
  1723. failure:
  1724. // @@protoc_insertion_point(parse_failure:qtprotobuf.examples.Contacts)
  1725. return false;
  1726. #undef DO_
  1727. }
  1728. void Contacts::SerializeWithCachedSizes(
  1729. ::google::protobuf::io::CodedOutputStream* output) const {
  1730. // @@protoc_insertion_point(serialize_start:qtprotobuf.examples.Contacts)
  1731. ::google::protobuf::uint32 cached_has_bits = 0;
  1732. (void) cached_has_bits;
  1733. // repeated .qtprotobuf.examples.Contact list = 1;
  1734. for (unsigned int i = 0,
  1735. n = static_cast<unsigned int>(this->list_size()); i < n; i++) {
  1736. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  1737. 1,
  1738. this->list(static_cast<int>(i)),
  1739. output);
  1740. }
  1741. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  1742. ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
  1743. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output);
  1744. }
  1745. // @@protoc_insertion_point(serialize_end:qtprotobuf.examples.Contacts)
  1746. }
  1747. ::google::protobuf::uint8* Contacts::InternalSerializeWithCachedSizesToArray(
  1748. bool deterministic, ::google::protobuf::uint8* target) const {
  1749. (void)deterministic; // Unused
  1750. // @@protoc_insertion_point(serialize_to_array_start:qtprotobuf.examples.Contacts)
  1751. ::google::protobuf::uint32 cached_has_bits = 0;
  1752. (void) cached_has_bits;
  1753. // repeated .qtprotobuf.examples.Contact list = 1;
  1754. for (unsigned int i = 0,
  1755. n = static_cast<unsigned int>(this->list_size()); i < n; i++) {
  1756. target = ::google::protobuf::internal::WireFormatLite::
  1757. InternalWriteMessageToArray(
  1758. 1, this->list(static_cast<int>(i)), deterministic, target);
  1759. }
  1760. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  1761. target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
  1762. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target);
  1763. }
  1764. // @@protoc_insertion_point(serialize_to_array_end:qtprotobuf.examples.Contacts)
  1765. return target;
  1766. }
  1767. size_t Contacts::ByteSizeLong() const {
  1768. // @@protoc_insertion_point(message_byte_size_start:qtprotobuf.examples.Contacts)
  1769. size_t total_size = 0;
  1770. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  1771. total_size +=
  1772. ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
  1773. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()));
  1774. }
  1775. // repeated .qtprotobuf.examples.Contact list = 1;
  1776. {
  1777. unsigned int count = static_cast<unsigned int>(this->list_size());
  1778. total_size += 1UL * count;
  1779. for (unsigned int i = 0; i < count; i++) {
  1780. total_size +=
  1781. ::google::protobuf::internal::WireFormatLite::MessageSize(
  1782. this->list(static_cast<int>(i)));
  1783. }
  1784. }
  1785. int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  1786. SetCachedSize(cached_size);
  1787. return total_size;
  1788. }
  1789. void Contacts::MergeFrom(const ::google::protobuf::Message& from) {
  1790. // @@protoc_insertion_point(generalized_merge_from_start:qtprotobuf.examples.Contacts)
  1791. GOOGLE_DCHECK_NE(&from, this);
  1792. const Contacts* source =
  1793. ::google::protobuf::internal::DynamicCastToGenerated<const Contacts>(
  1794. &from);
  1795. if (source == NULL) {
  1796. // @@protoc_insertion_point(generalized_merge_from_cast_fail:qtprotobuf.examples.Contacts)
  1797. ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  1798. } else {
  1799. // @@protoc_insertion_point(generalized_merge_from_cast_success:qtprotobuf.examples.Contacts)
  1800. MergeFrom(*source);
  1801. }
  1802. }
  1803. void Contacts::MergeFrom(const Contacts& from) {
  1804. // @@protoc_insertion_point(class_specific_merge_from_start:qtprotobuf.examples.Contacts)
  1805. GOOGLE_DCHECK_NE(&from, this);
  1806. _internal_metadata_.MergeFrom(from._internal_metadata_);
  1807. ::google::protobuf::uint32 cached_has_bits = 0;
  1808. (void) cached_has_bits;
  1809. list_.MergeFrom(from.list_);
  1810. }
  1811. void Contacts::CopyFrom(const ::google::protobuf::Message& from) {
  1812. // @@protoc_insertion_point(generalized_copy_from_start:qtprotobuf.examples.Contacts)
  1813. if (&from == this) return;
  1814. Clear();
  1815. MergeFrom(from);
  1816. }
  1817. void Contacts::CopyFrom(const Contacts& from) {
  1818. // @@protoc_insertion_point(class_specific_copy_from_start:qtprotobuf.examples.Contacts)
  1819. if (&from == this) return;
  1820. Clear();
  1821. MergeFrom(from);
  1822. }
  1823. bool Contacts::IsInitialized() const {
  1824. return true;
  1825. }
  1826. void Contacts::Swap(Contacts* other) {
  1827. if (other == this) return;
  1828. InternalSwap(other);
  1829. }
  1830. void Contacts::InternalSwap(Contacts* other) {
  1831. using std::swap;
  1832. CastToBase(&list_)->InternalSwap(CastToBase(&other->list_));
  1833. _internal_metadata_.Swap(&other->_internal_metadata_);
  1834. }
  1835. ::google::protobuf::Metadata Contacts::GetMetadata() const {
  1836. protobuf_addressbook_2eproto::protobuf_AssignDescriptorsOnce();
  1837. return ::protobuf_addressbook_2eproto::file_level_metadata[kIndexInFileMessages];
  1838. }
  1839. // ===================================================================
  1840. void SimpleResult::InitAsDefaultInstance() {
  1841. }
  1842. #if !defined(_MSC_VER) || _MSC_VER >= 1900
  1843. const int SimpleResult::kOkFieldNumber;
  1844. #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
  1845. SimpleResult::SimpleResult()
  1846. : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  1847. ::google::protobuf::internal::InitSCC(
  1848. &protobuf_addressbook_2eproto::scc_info_SimpleResult.base);
  1849. SharedCtor();
  1850. // @@protoc_insertion_point(constructor:qtprotobuf.examples.SimpleResult)
  1851. }
  1852. SimpleResult::SimpleResult(const SimpleResult& from)
  1853. : ::google::protobuf::Message(),
  1854. _internal_metadata_(NULL) {
  1855. _internal_metadata_.MergeFrom(from._internal_metadata_);
  1856. ok_ = from.ok_;
  1857. // @@protoc_insertion_point(copy_constructor:qtprotobuf.examples.SimpleResult)
  1858. }
  1859. void SimpleResult::SharedCtor() {
  1860. ok_ = false;
  1861. }
  1862. SimpleResult::~SimpleResult() {
  1863. // @@protoc_insertion_point(destructor:qtprotobuf.examples.SimpleResult)
  1864. SharedDtor();
  1865. }
  1866. void SimpleResult::SharedDtor() {
  1867. }
  1868. void SimpleResult::SetCachedSize(int size) const {
  1869. _cached_size_.Set(size);
  1870. }
  1871. const ::google::protobuf::Descriptor* SimpleResult::descriptor() {
  1872. ::protobuf_addressbook_2eproto::protobuf_AssignDescriptorsOnce();
  1873. return ::protobuf_addressbook_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
  1874. }
  1875. const SimpleResult& SimpleResult::default_instance() {
  1876. ::google::protobuf::internal::InitSCC(&protobuf_addressbook_2eproto::scc_info_SimpleResult.base);
  1877. return *internal_default_instance();
  1878. }
  1879. void SimpleResult::Clear() {
  1880. // @@protoc_insertion_point(message_clear_start:qtprotobuf.examples.SimpleResult)
  1881. ::google::protobuf::uint32 cached_has_bits = 0;
  1882. // Prevent compiler warnings about cached_has_bits being unused
  1883. (void) cached_has_bits;
  1884. ok_ = false;
  1885. _internal_metadata_.Clear();
  1886. }
  1887. bool SimpleResult::MergePartialFromCodedStream(
  1888. ::google::protobuf::io::CodedInputStream* input) {
  1889. #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  1890. ::google::protobuf::uint32 tag;
  1891. // @@protoc_insertion_point(parse_start:qtprotobuf.examples.SimpleResult)
  1892. for (;;) {
  1893. ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
  1894. tag = p.first;
  1895. if (!p.second) goto handle_unusual;
  1896. switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
  1897. // bool ok = 1;
  1898. case 1: {
  1899. if (static_cast< ::google::protobuf::uint8>(tag) ==
  1900. static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
  1901. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  1902. bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
  1903. input, &ok_)));
  1904. } else {
  1905. goto handle_unusual;
  1906. }
  1907. break;
  1908. }
  1909. default: {
  1910. handle_unusual:
  1911. if (tag == 0) {
  1912. goto success;
  1913. }
  1914. DO_(::google::protobuf::internal::WireFormat::SkipField(
  1915. input, tag, _internal_metadata_.mutable_unknown_fields()));
  1916. break;
  1917. }
  1918. }
  1919. }
  1920. success:
  1921. // @@protoc_insertion_point(parse_success:qtprotobuf.examples.SimpleResult)
  1922. return true;
  1923. failure:
  1924. // @@protoc_insertion_point(parse_failure:qtprotobuf.examples.SimpleResult)
  1925. return false;
  1926. #undef DO_
  1927. }
  1928. void SimpleResult::SerializeWithCachedSizes(
  1929. ::google::protobuf::io::CodedOutputStream* output) const {
  1930. // @@protoc_insertion_point(serialize_start:qtprotobuf.examples.SimpleResult)
  1931. ::google::protobuf::uint32 cached_has_bits = 0;
  1932. (void) cached_has_bits;
  1933. // bool ok = 1;
  1934. if (this->ok() != 0) {
  1935. ::google::protobuf::internal::WireFormatLite::WriteBool(1, this->ok(), output);
  1936. }
  1937. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  1938. ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
  1939. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output);
  1940. }
  1941. // @@protoc_insertion_point(serialize_end:qtprotobuf.examples.SimpleResult)
  1942. }
  1943. ::google::protobuf::uint8* SimpleResult::InternalSerializeWithCachedSizesToArray(
  1944. bool deterministic, ::google::protobuf::uint8* target) const {
  1945. (void)deterministic; // Unused
  1946. // @@protoc_insertion_point(serialize_to_array_start:qtprotobuf.examples.SimpleResult)
  1947. ::google::protobuf::uint32 cached_has_bits = 0;
  1948. (void) cached_has_bits;
  1949. // bool ok = 1;
  1950. if (this->ok() != 0) {
  1951. target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(1, this->ok(), target);
  1952. }
  1953. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  1954. target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
  1955. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target);
  1956. }
  1957. // @@protoc_insertion_point(serialize_to_array_end:qtprotobuf.examples.SimpleResult)
  1958. return target;
  1959. }
  1960. size_t SimpleResult::ByteSizeLong() const {
  1961. // @@protoc_insertion_point(message_byte_size_start:qtprotobuf.examples.SimpleResult)
  1962. size_t total_size = 0;
  1963. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  1964. total_size +=
  1965. ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
  1966. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()));
  1967. }
  1968. // bool ok = 1;
  1969. if (this->ok() != 0) {
  1970. total_size += 1 + 1;
  1971. }
  1972. int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  1973. SetCachedSize(cached_size);
  1974. return total_size;
  1975. }
  1976. void SimpleResult::MergeFrom(const ::google::protobuf::Message& from) {
  1977. // @@protoc_insertion_point(generalized_merge_from_start:qtprotobuf.examples.SimpleResult)
  1978. GOOGLE_DCHECK_NE(&from, this);
  1979. const SimpleResult* source =
  1980. ::google::protobuf::internal::DynamicCastToGenerated<const SimpleResult>(
  1981. &from);
  1982. if (source == NULL) {
  1983. // @@protoc_insertion_point(generalized_merge_from_cast_fail:qtprotobuf.examples.SimpleResult)
  1984. ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  1985. } else {
  1986. // @@protoc_insertion_point(generalized_merge_from_cast_success:qtprotobuf.examples.SimpleResult)
  1987. MergeFrom(*source);
  1988. }
  1989. }
  1990. void SimpleResult::MergeFrom(const SimpleResult& from) {
  1991. // @@protoc_insertion_point(class_specific_merge_from_start:qtprotobuf.examples.SimpleResult)
  1992. GOOGLE_DCHECK_NE(&from, this);
  1993. _internal_metadata_.MergeFrom(from._internal_metadata_);
  1994. ::google::protobuf::uint32 cached_has_bits = 0;
  1995. (void) cached_has_bits;
  1996. if (from.ok() != 0) {
  1997. set_ok(from.ok());
  1998. }
  1999. }
  2000. void SimpleResult::CopyFrom(const ::google::protobuf::Message& from) {
  2001. // @@protoc_insertion_point(generalized_copy_from_start:qtprotobuf.examples.SimpleResult)
  2002. if (&from == this) return;
  2003. Clear();
  2004. MergeFrom(from);
  2005. }
  2006. void SimpleResult::CopyFrom(const SimpleResult& from) {
  2007. // @@protoc_insertion_point(class_specific_copy_from_start:qtprotobuf.examples.SimpleResult)
  2008. if (&from == this) return;
  2009. Clear();
  2010. MergeFrom(from);
  2011. }
  2012. bool SimpleResult::IsInitialized() const {
  2013. return true;
  2014. }
  2015. void SimpleResult::Swap(SimpleResult* other) {
  2016. if (other == this) return;
  2017. InternalSwap(other);
  2018. }
  2019. void SimpleResult::InternalSwap(SimpleResult* other) {
  2020. using std::swap;
  2021. swap(ok_, other->ok_);
  2022. _internal_metadata_.Swap(&other->_internal_metadata_);
  2023. }
  2024. ::google::protobuf::Metadata SimpleResult::GetMetadata() const {
  2025. protobuf_addressbook_2eproto::protobuf_AssignDescriptorsOnce();
  2026. return ::protobuf_addressbook_2eproto::file_level_metadata[kIndexInFileMessages];
  2027. }
  2028. // ===================================================================
  2029. void ListFrame::InitAsDefaultInstance() {
  2030. }
  2031. #if !defined(_MSC_VER) || _MSC_VER >= 1900
  2032. const int ListFrame::kStartFieldNumber;
  2033. const int ListFrame::kEndFieldNumber;
  2034. #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
  2035. ListFrame::ListFrame()
  2036. : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  2037. ::google::protobuf::internal::InitSCC(
  2038. &protobuf_addressbook_2eproto::scc_info_ListFrame.base);
  2039. SharedCtor();
  2040. // @@protoc_insertion_point(constructor:qtprotobuf.examples.ListFrame)
  2041. }
  2042. ListFrame::ListFrame(const ListFrame& from)
  2043. : ::google::protobuf::Message(),
  2044. _internal_metadata_(NULL) {
  2045. _internal_metadata_.MergeFrom(from._internal_metadata_);
  2046. ::memcpy(&start_, &from.start_,
  2047. static_cast<size_t>(reinterpret_cast<char*>(&end_) -
  2048. reinterpret_cast<char*>(&start_)) + sizeof(end_));
  2049. // @@protoc_insertion_point(copy_constructor:qtprotobuf.examples.ListFrame)
  2050. }
  2051. void ListFrame::SharedCtor() {
  2052. ::memset(&start_, 0, static_cast<size_t>(
  2053. reinterpret_cast<char*>(&end_) -
  2054. reinterpret_cast<char*>(&start_)) + sizeof(end_));
  2055. }
  2056. ListFrame::~ListFrame() {
  2057. // @@protoc_insertion_point(destructor:qtprotobuf.examples.ListFrame)
  2058. SharedDtor();
  2059. }
  2060. void ListFrame::SharedDtor() {
  2061. }
  2062. void ListFrame::SetCachedSize(int size) const {
  2063. _cached_size_.Set(size);
  2064. }
  2065. const ::google::protobuf::Descriptor* ListFrame::descriptor() {
  2066. ::protobuf_addressbook_2eproto::protobuf_AssignDescriptorsOnce();
  2067. return ::protobuf_addressbook_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
  2068. }
  2069. const ListFrame& ListFrame::default_instance() {
  2070. ::google::protobuf::internal::InitSCC(&protobuf_addressbook_2eproto::scc_info_ListFrame.base);
  2071. return *internal_default_instance();
  2072. }
  2073. void ListFrame::Clear() {
  2074. // @@protoc_insertion_point(message_clear_start:qtprotobuf.examples.ListFrame)
  2075. ::google::protobuf::uint32 cached_has_bits = 0;
  2076. // Prevent compiler warnings about cached_has_bits being unused
  2077. (void) cached_has_bits;
  2078. ::memset(&start_, 0, static_cast<size_t>(
  2079. reinterpret_cast<char*>(&end_) -
  2080. reinterpret_cast<char*>(&start_)) + sizeof(end_));
  2081. _internal_metadata_.Clear();
  2082. }
  2083. bool ListFrame::MergePartialFromCodedStream(
  2084. ::google::protobuf::io::CodedInputStream* input) {
  2085. #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  2086. ::google::protobuf::uint32 tag;
  2087. // @@protoc_insertion_point(parse_start:qtprotobuf.examples.ListFrame)
  2088. for (;;) {
  2089. ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
  2090. tag = p.first;
  2091. if (!p.second) goto handle_unusual;
  2092. switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
  2093. // sint32 start = 1;
  2094. case 1: {
  2095. if (static_cast< ::google::protobuf::uint8>(tag) ==
  2096. static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
  2097. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  2098. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_SINT32>(
  2099. input, &start_)));
  2100. } else {
  2101. goto handle_unusual;
  2102. }
  2103. break;
  2104. }
  2105. // sint32 end = 2;
  2106. case 2: {
  2107. if (static_cast< ::google::protobuf::uint8>(tag) ==
  2108. static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
  2109. DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  2110. ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_SINT32>(
  2111. input, &end_)));
  2112. } else {
  2113. goto handle_unusual;
  2114. }
  2115. break;
  2116. }
  2117. default: {
  2118. handle_unusual:
  2119. if (tag == 0) {
  2120. goto success;
  2121. }
  2122. DO_(::google::protobuf::internal::WireFormat::SkipField(
  2123. input, tag, _internal_metadata_.mutable_unknown_fields()));
  2124. break;
  2125. }
  2126. }
  2127. }
  2128. success:
  2129. // @@protoc_insertion_point(parse_success:qtprotobuf.examples.ListFrame)
  2130. return true;
  2131. failure:
  2132. // @@protoc_insertion_point(parse_failure:qtprotobuf.examples.ListFrame)
  2133. return false;
  2134. #undef DO_
  2135. }
  2136. void ListFrame::SerializeWithCachedSizes(
  2137. ::google::protobuf::io::CodedOutputStream* output) const {
  2138. // @@protoc_insertion_point(serialize_start:qtprotobuf.examples.ListFrame)
  2139. ::google::protobuf::uint32 cached_has_bits = 0;
  2140. (void) cached_has_bits;
  2141. // sint32 start = 1;
  2142. if (this->start() != 0) {
  2143. ::google::protobuf::internal::WireFormatLite::WriteSInt32(1, this->start(), output);
  2144. }
  2145. // sint32 end = 2;
  2146. if (this->end() != 0) {
  2147. ::google::protobuf::internal::WireFormatLite::WriteSInt32(2, this->end(), output);
  2148. }
  2149. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  2150. ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
  2151. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output);
  2152. }
  2153. // @@protoc_insertion_point(serialize_end:qtprotobuf.examples.ListFrame)
  2154. }
  2155. ::google::protobuf::uint8* ListFrame::InternalSerializeWithCachedSizesToArray(
  2156. bool deterministic, ::google::protobuf::uint8* target) const {
  2157. (void)deterministic; // Unused
  2158. // @@protoc_insertion_point(serialize_to_array_start:qtprotobuf.examples.ListFrame)
  2159. ::google::protobuf::uint32 cached_has_bits = 0;
  2160. (void) cached_has_bits;
  2161. // sint32 start = 1;
  2162. if (this->start() != 0) {
  2163. target = ::google::protobuf::internal::WireFormatLite::WriteSInt32ToArray(1, this->start(), target);
  2164. }
  2165. // sint32 end = 2;
  2166. if (this->end() != 0) {
  2167. target = ::google::protobuf::internal::WireFormatLite::WriteSInt32ToArray(2, this->end(), target);
  2168. }
  2169. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  2170. target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
  2171. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target);
  2172. }
  2173. // @@protoc_insertion_point(serialize_to_array_end:qtprotobuf.examples.ListFrame)
  2174. return target;
  2175. }
  2176. size_t ListFrame::ByteSizeLong() const {
  2177. // @@protoc_insertion_point(message_byte_size_start:qtprotobuf.examples.ListFrame)
  2178. size_t total_size = 0;
  2179. if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
  2180. total_size +=
  2181. ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
  2182. (::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()));
  2183. }
  2184. // sint32 start = 1;
  2185. if (this->start() != 0) {
  2186. total_size += 1 +
  2187. ::google::protobuf::internal::WireFormatLite::SInt32Size(
  2188. this->start());
  2189. }
  2190. // sint32 end = 2;
  2191. if (this->end() != 0) {
  2192. total_size += 1 +
  2193. ::google::protobuf::internal::WireFormatLite::SInt32Size(
  2194. this->end());
  2195. }
  2196. int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  2197. SetCachedSize(cached_size);
  2198. return total_size;
  2199. }
  2200. void ListFrame::MergeFrom(const ::google::protobuf::Message& from) {
  2201. // @@protoc_insertion_point(generalized_merge_from_start:qtprotobuf.examples.ListFrame)
  2202. GOOGLE_DCHECK_NE(&from, this);
  2203. const ListFrame* source =
  2204. ::google::protobuf::internal::DynamicCastToGenerated<const ListFrame>(
  2205. &from);
  2206. if (source == NULL) {
  2207. // @@protoc_insertion_point(generalized_merge_from_cast_fail:qtprotobuf.examples.ListFrame)
  2208. ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  2209. } else {
  2210. // @@protoc_insertion_point(generalized_merge_from_cast_success:qtprotobuf.examples.ListFrame)
  2211. MergeFrom(*source);
  2212. }
  2213. }
  2214. void ListFrame::MergeFrom(const ListFrame& from) {
  2215. // @@protoc_insertion_point(class_specific_merge_from_start:qtprotobuf.examples.ListFrame)
  2216. GOOGLE_DCHECK_NE(&from, this);
  2217. _internal_metadata_.MergeFrom(from._internal_metadata_);
  2218. ::google::protobuf::uint32 cached_has_bits = 0;
  2219. (void) cached_has_bits;
  2220. if (from.start() != 0) {
  2221. set_start(from.start());
  2222. }
  2223. if (from.end() != 0) {
  2224. set_end(from.end());
  2225. }
  2226. }
  2227. void ListFrame::CopyFrom(const ::google::protobuf::Message& from) {
  2228. // @@protoc_insertion_point(generalized_copy_from_start:qtprotobuf.examples.ListFrame)
  2229. if (&from == this) return;
  2230. Clear();
  2231. MergeFrom(from);
  2232. }
  2233. void ListFrame::CopyFrom(const ListFrame& from) {
  2234. // @@protoc_insertion_point(class_specific_copy_from_start:qtprotobuf.examples.ListFrame)
  2235. if (&from == this) return;
  2236. Clear();
  2237. MergeFrom(from);
  2238. }
  2239. bool ListFrame::IsInitialized() const {
  2240. return true;
  2241. }
  2242. void ListFrame::Swap(ListFrame* other) {
  2243. if (other == this) return;
  2244. InternalSwap(other);
  2245. }
  2246. void ListFrame::InternalSwap(ListFrame* other) {
  2247. using std::swap;
  2248. swap(start_, other->start_);
  2249. swap(end_, other->end_);
  2250. _internal_metadata_.Swap(&other->_internal_metadata_);
  2251. }
  2252. ::google::protobuf::Metadata ListFrame::GetMetadata() const {
  2253. protobuf_addressbook_2eproto::protobuf_AssignDescriptorsOnce();
  2254. return ::protobuf_addressbook_2eproto::file_level_metadata[kIndexInFileMessages];
  2255. }
  2256. // @@protoc_insertion_point(namespace_scope)
  2257. } // namespace examples
  2258. } // namespace qtprotobuf
  2259. namespace google {
  2260. namespace protobuf {
  2261. template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::qtprotobuf::examples::PhoneNumber* Arena::CreateMaybeMessage< ::qtprotobuf::examples::PhoneNumber >(Arena* arena) {
  2262. return Arena::CreateInternal< ::qtprotobuf::examples::PhoneNumber >(arena);
  2263. }
  2264. template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::qtprotobuf::examples::Address* Arena::CreateMaybeMessage< ::qtprotobuf::examples::Address >(Arena* arena) {
  2265. return Arena::CreateInternal< ::qtprotobuf::examples::Address >(arena);
  2266. }
  2267. template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::qtprotobuf::examples::Job* Arena::CreateMaybeMessage< ::qtprotobuf::examples::Job >(Arena* arena) {
  2268. return Arena::CreateInternal< ::qtprotobuf::examples::Job >(arena);
  2269. }
  2270. template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::qtprotobuf::examples::Contact* Arena::CreateMaybeMessage< ::qtprotobuf::examples::Contact >(Arena* arena) {
  2271. return Arena::CreateInternal< ::qtprotobuf::examples::Contact >(arena);
  2272. }
  2273. template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::qtprotobuf::examples::Contacts* Arena::CreateMaybeMessage< ::qtprotobuf::examples::Contacts >(Arena* arena) {
  2274. return Arena::CreateInternal< ::qtprotobuf::examples::Contacts >(arena);
  2275. }
  2276. template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::qtprotobuf::examples::SimpleResult* Arena::CreateMaybeMessage< ::qtprotobuf::examples::SimpleResult >(Arena* arena) {
  2277. return Arena::CreateInternal< ::qtprotobuf::examples::SimpleResult >(arena);
  2278. }
  2279. template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::qtprotobuf::examples::ListFrame* Arena::CreateMaybeMessage< ::qtprotobuf::examples::ListFrame >(Arena* arena) {
  2280. return Arena::CreateInternal< ::qtprotobuf::examples::ListFrame >(arena);
  2281. }
  2282. } // namespace protobuf
  2283. } // namespace google
  2284. // @@protoc_insertion_point(global_scope)