addressbook.pb.cc 105 KB

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