PageRenderTime 61ms CodeModel.GetById 28ms RepoModel.GetById 0ms app.codeStats 1ms

/src/google/protobuf/compiler/plugin.pb.cc

http://protobuf.googlecode.com/
C++ | 1090 lines | 916 code | 133 blank | 41 comment | 157 complexity | 64ea7eb68af3e41f9752baf02e0b97fc MD5 | raw file
Possible License(s): BSD-3-Clause
  1. // Generated by the protocol buffer compiler. DO NOT EDIT!
  2. // source: google/protobuf/compiler/plugin.proto
  3. #define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION
  4. #include "google/protobuf/compiler/plugin.pb.h"
  5. #include <algorithm>
  6. #include <google/protobuf/stubs/common.h>
  7. #include <google/protobuf/stubs/once.h>
  8. #include <google/protobuf/io/coded_stream.h>
  9. #include <google/protobuf/wire_format_lite_inl.h>
  10. #include <google/protobuf/descriptor.h>
  11. #include <google/protobuf/generated_message_reflection.h>
  12. #include <google/protobuf/reflection_ops.h>
  13. #include <google/protobuf/wire_format.h>
  14. // @@protoc_insertion_point(includes)
  15. namespace google {
  16. namespace protobuf {
  17. namespace compiler {
  18. namespace {
  19. const ::google::protobuf::Descriptor* CodeGeneratorRequest_descriptor_ = NULL;
  20. const ::google::protobuf::internal::GeneratedMessageReflection*
  21. CodeGeneratorRequest_reflection_ = NULL;
  22. const ::google::protobuf::Descriptor* CodeGeneratorResponse_descriptor_ = NULL;
  23. const ::google::protobuf::internal::GeneratedMessageReflection*
  24. CodeGeneratorResponse_reflection_ = NULL;
  25. const ::google::protobuf::Descriptor* CodeGeneratorResponse_File_descriptor_ = NULL;
  26. const ::google::protobuf::internal::GeneratedMessageReflection*
  27. CodeGeneratorResponse_File_reflection_ = NULL;
  28. } // namespace
  29. void protobuf_AssignDesc_google_2fprotobuf_2fcompiler_2fplugin_2eproto() {
  30. protobuf_AddDesc_google_2fprotobuf_2fcompiler_2fplugin_2eproto();
  31. const ::google::protobuf::FileDescriptor* file =
  32. ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName(
  33. "google/protobuf/compiler/plugin.proto");
  34. GOOGLE_CHECK(file != NULL);
  35. CodeGeneratorRequest_descriptor_ = file->message_type(0);
  36. static const int CodeGeneratorRequest_offsets_[3] = {
  37. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CodeGeneratorRequest, file_to_generate_),
  38. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CodeGeneratorRequest, parameter_),
  39. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CodeGeneratorRequest, proto_file_),
  40. };
  41. CodeGeneratorRequest_reflection_ =
  42. new ::google::protobuf::internal::GeneratedMessageReflection(
  43. CodeGeneratorRequest_descriptor_,
  44. CodeGeneratorRequest::default_instance_,
  45. CodeGeneratorRequest_offsets_,
  46. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CodeGeneratorRequest, _has_bits_[0]),
  47. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CodeGeneratorRequest, _unknown_fields_),
  48. -1,
  49. ::google::protobuf::DescriptorPool::generated_pool(),
  50. ::google::protobuf::MessageFactory::generated_factory(),
  51. sizeof(CodeGeneratorRequest));
  52. CodeGeneratorResponse_descriptor_ = file->message_type(1);
  53. static const int CodeGeneratorResponse_offsets_[2] = {
  54. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CodeGeneratorResponse, error_),
  55. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CodeGeneratorResponse, file_),
  56. };
  57. CodeGeneratorResponse_reflection_ =
  58. new ::google::protobuf::internal::GeneratedMessageReflection(
  59. CodeGeneratorResponse_descriptor_,
  60. CodeGeneratorResponse::default_instance_,
  61. CodeGeneratorResponse_offsets_,
  62. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CodeGeneratorResponse, _has_bits_[0]),
  63. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CodeGeneratorResponse, _unknown_fields_),
  64. -1,
  65. ::google::protobuf::DescriptorPool::generated_pool(),
  66. ::google::protobuf::MessageFactory::generated_factory(),
  67. sizeof(CodeGeneratorResponse));
  68. CodeGeneratorResponse_File_descriptor_ = CodeGeneratorResponse_descriptor_->nested_type(0);
  69. static const int CodeGeneratorResponse_File_offsets_[3] = {
  70. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CodeGeneratorResponse_File, name_),
  71. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CodeGeneratorResponse_File, insertion_point_),
  72. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CodeGeneratorResponse_File, content_),
  73. };
  74. CodeGeneratorResponse_File_reflection_ =
  75. new ::google::protobuf::internal::GeneratedMessageReflection(
  76. CodeGeneratorResponse_File_descriptor_,
  77. CodeGeneratorResponse_File::default_instance_,
  78. CodeGeneratorResponse_File_offsets_,
  79. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CodeGeneratorResponse_File, _has_bits_[0]),
  80. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CodeGeneratorResponse_File, _unknown_fields_),
  81. -1,
  82. ::google::protobuf::DescriptorPool::generated_pool(),
  83. ::google::protobuf::MessageFactory::generated_factory(),
  84. sizeof(CodeGeneratorResponse_File));
  85. }
  86. namespace {
  87. GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_);
  88. inline void protobuf_AssignDescriptorsOnce() {
  89. ::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_,
  90. &protobuf_AssignDesc_google_2fprotobuf_2fcompiler_2fplugin_2eproto);
  91. }
  92. void protobuf_RegisterTypes(const ::std::string&) {
  93. protobuf_AssignDescriptorsOnce();
  94. ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
  95. CodeGeneratorRequest_descriptor_, &CodeGeneratorRequest::default_instance());
  96. ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
  97. CodeGeneratorResponse_descriptor_, &CodeGeneratorResponse::default_instance());
  98. ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
  99. CodeGeneratorResponse_File_descriptor_, &CodeGeneratorResponse_File::default_instance());
  100. }
  101. } // namespace
  102. void protobuf_ShutdownFile_google_2fprotobuf_2fcompiler_2fplugin_2eproto() {
  103. delete CodeGeneratorRequest::default_instance_;
  104. delete CodeGeneratorRequest_reflection_;
  105. delete CodeGeneratorResponse::default_instance_;
  106. delete CodeGeneratorResponse_reflection_;
  107. delete CodeGeneratorResponse_File::default_instance_;
  108. delete CodeGeneratorResponse_File_reflection_;
  109. }
  110. void protobuf_AddDesc_google_2fprotobuf_2fcompiler_2fplugin_2eproto() {
  111. static bool already_here = false;
  112. if (already_here) return;
  113. already_here = true;
  114. GOOGLE_PROTOBUF_VERIFY_VERSION;
  115. ::google::protobuf::protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto();
  116. ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
  117. "\n%google/protobuf/compiler/plugin.proto\022"
  118. "\030google.protobuf.compiler\032 google/protob"
  119. "uf/descriptor.proto\"}\n\024CodeGeneratorRequ"
  120. "est\022\030\n\020file_to_generate\030\001 \003(\t\022\021\n\tparamet"
  121. "er\030\002 \001(\t\0228\n\nproto_file\030\017 \003(\0132$.google.pr"
  122. "otobuf.FileDescriptorProto\"\252\001\n\025CodeGener"
  123. "atorResponse\022\r\n\005error\030\001 \001(\t\022B\n\004file\030\017 \003("
  124. "\01324.google.protobuf.compiler.CodeGenerat"
  125. "orResponse.File\032>\n\004File\022\014\n\004name\030\001 \001(\t\022\027\n"
  126. "\017insertion_point\030\002 \001(\t\022\017\n\007content\030\017 \001(\tB"
  127. ",\n\034com.google.protobuf.compilerB\014PluginP"
  128. "rotos", 445);
  129. ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
  130. "google/protobuf/compiler/plugin.proto", &protobuf_RegisterTypes);
  131. CodeGeneratorRequest::default_instance_ = new CodeGeneratorRequest();
  132. CodeGeneratorResponse::default_instance_ = new CodeGeneratorResponse();
  133. CodeGeneratorResponse_File::default_instance_ = new CodeGeneratorResponse_File();
  134. CodeGeneratorRequest::default_instance_->InitAsDefaultInstance();
  135. CodeGeneratorResponse::default_instance_->InitAsDefaultInstance();
  136. CodeGeneratorResponse_File::default_instance_->InitAsDefaultInstance();
  137. ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_google_2fprotobuf_2fcompiler_2fplugin_2eproto);
  138. }
  139. // Force AddDescriptors() to be called at static initialization time.
  140. struct StaticDescriptorInitializer_google_2fprotobuf_2fcompiler_2fplugin_2eproto {
  141. StaticDescriptorInitializer_google_2fprotobuf_2fcompiler_2fplugin_2eproto() {
  142. protobuf_AddDesc_google_2fprotobuf_2fcompiler_2fplugin_2eproto();
  143. }
  144. } static_descriptor_initializer_google_2fprotobuf_2fcompiler_2fplugin_2eproto_;
  145. // ===================================================================
  146. #ifndef _MSC_VER
  147. const int CodeGeneratorRequest::kFileToGenerateFieldNumber;
  148. const int CodeGeneratorRequest::kParameterFieldNumber;
  149. const int CodeGeneratorRequest::kProtoFileFieldNumber;
  150. #endif // !_MSC_VER
  151. CodeGeneratorRequest::CodeGeneratorRequest()
  152. : ::google::protobuf::Message() {
  153. SharedCtor();
  154. }
  155. void CodeGeneratorRequest::InitAsDefaultInstance() {
  156. }
  157. CodeGeneratorRequest::CodeGeneratorRequest(const CodeGeneratorRequest& from)
  158. : ::google::protobuf::Message() {
  159. SharedCtor();
  160. MergeFrom(from);
  161. }
  162. void CodeGeneratorRequest::SharedCtor() {
  163. _cached_size_ = 0;
  164. parameter_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString());
  165. ::memset(_has_bits_, 0, sizeof(_has_bits_));
  166. }
  167. CodeGeneratorRequest::~CodeGeneratorRequest() {
  168. SharedDtor();
  169. }
  170. void CodeGeneratorRequest::SharedDtor() {
  171. if (parameter_ != &::google::protobuf::internal::GetEmptyString()) {
  172. delete parameter_;
  173. }
  174. if (this != default_instance_) {
  175. }
  176. }
  177. void CodeGeneratorRequest::SetCachedSize(int size) const {
  178. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  179. _cached_size_ = size;
  180. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  181. }
  182. const ::google::protobuf::Descriptor* CodeGeneratorRequest::descriptor() {
  183. protobuf_AssignDescriptorsOnce();
  184. return CodeGeneratorRequest_descriptor_;
  185. }
  186. const CodeGeneratorRequest& CodeGeneratorRequest::default_instance() {
  187. if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2fcompiler_2fplugin_2eproto();
  188. return *default_instance_;
  189. }
  190. CodeGeneratorRequest* CodeGeneratorRequest::default_instance_ = NULL;
  191. CodeGeneratorRequest* CodeGeneratorRequest::New() const {
  192. return new CodeGeneratorRequest;
  193. }
  194. void CodeGeneratorRequest::Clear() {
  195. if (_has_bits_[1 / 32] & (0xffu << (1 % 32))) {
  196. if (has_parameter()) {
  197. if (parameter_ != &::google::protobuf::internal::GetEmptyString()) {
  198. parameter_->clear();
  199. }
  200. }
  201. }
  202. file_to_generate_.Clear();
  203. proto_file_.Clear();
  204. ::memset(_has_bits_, 0, sizeof(_has_bits_));
  205. mutable_unknown_fields()->Clear();
  206. }
  207. bool CodeGeneratorRequest::MergePartialFromCodedStream(
  208. ::google::protobuf::io::CodedInputStream* input) {
  209. #define DO_(EXPRESSION) if (!(EXPRESSION)) return false
  210. ::google::protobuf::uint32 tag;
  211. while ((tag = input->ReadTag()) != 0) {
  212. switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
  213. // repeated string file_to_generate = 1;
  214. case 1: {
  215. if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
  216. ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
  217. parse_file_to_generate:
  218. DO_(::google::protobuf::internal::WireFormatLite::ReadString(
  219. input, this->add_file_to_generate()));
  220. ::google::protobuf::internal::WireFormat::VerifyUTF8String(
  221. this->file_to_generate(this->file_to_generate_size() - 1).data(),
  222. this->file_to_generate(this->file_to_generate_size() - 1).length(),
  223. ::google::protobuf::internal::WireFormat::PARSE);
  224. } else {
  225. goto handle_uninterpreted;
  226. }
  227. if (input->ExpectTag(10)) goto parse_file_to_generate;
  228. if (input->ExpectTag(18)) goto parse_parameter;
  229. break;
  230. }
  231. // optional string parameter = 2;
  232. case 2: {
  233. if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
  234. ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
  235. parse_parameter:
  236. DO_(::google::protobuf::internal::WireFormatLite::ReadString(
  237. input, this->mutable_parameter()));
  238. ::google::protobuf::internal::WireFormat::VerifyUTF8String(
  239. this->parameter().data(), this->parameter().length(),
  240. ::google::protobuf::internal::WireFormat::PARSE);
  241. } else {
  242. goto handle_uninterpreted;
  243. }
  244. if (input->ExpectTag(122)) goto parse_proto_file;
  245. break;
  246. }
  247. // repeated .google.protobuf.FileDescriptorProto proto_file = 15;
  248. case 15: {
  249. if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
  250. ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
  251. parse_proto_file:
  252. DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
  253. input, add_proto_file()));
  254. } else {
  255. goto handle_uninterpreted;
  256. }
  257. if (input->ExpectTag(122)) goto parse_proto_file;
  258. if (input->ExpectAtEnd()) return true;
  259. break;
  260. }
  261. default: {
  262. handle_uninterpreted:
  263. if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
  264. ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
  265. return true;
  266. }
  267. DO_(::google::protobuf::internal::WireFormat::SkipField(
  268. input, tag, mutable_unknown_fields()));
  269. break;
  270. }
  271. }
  272. }
  273. return true;
  274. #undef DO_
  275. }
  276. void CodeGeneratorRequest::SerializeWithCachedSizes(
  277. ::google::protobuf::io::CodedOutputStream* output) const {
  278. // repeated string file_to_generate = 1;
  279. for (int i = 0; i < this->file_to_generate_size(); i++) {
  280. ::google::protobuf::internal::WireFormat::VerifyUTF8String(
  281. this->file_to_generate(i).data(), this->file_to_generate(i).length(),
  282. ::google::protobuf::internal::WireFormat::SERIALIZE);
  283. ::google::protobuf::internal::WireFormatLite::WriteString(
  284. 1, this->file_to_generate(i), output);
  285. }
  286. // optional string parameter = 2;
  287. if (has_parameter()) {
  288. ::google::protobuf::internal::WireFormat::VerifyUTF8String(
  289. this->parameter().data(), this->parameter().length(),
  290. ::google::protobuf::internal::WireFormat::SERIALIZE);
  291. ::google::protobuf::internal::WireFormatLite::WriteString(
  292. 2, this->parameter(), output);
  293. }
  294. // repeated .google.protobuf.FileDescriptorProto proto_file = 15;
  295. for (int i = 0; i < this->proto_file_size(); i++) {
  296. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  297. 15, this->proto_file(i), output);
  298. }
  299. if (!unknown_fields().empty()) {
  300. ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
  301. unknown_fields(), output);
  302. }
  303. }
  304. ::google::protobuf::uint8* CodeGeneratorRequest::SerializeWithCachedSizesToArray(
  305. ::google::protobuf::uint8* target) const {
  306. // repeated string file_to_generate = 1;
  307. for (int i = 0; i < this->file_to_generate_size(); i++) {
  308. ::google::protobuf::internal::WireFormat::VerifyUTF8String(
  309. this->file_to_generate(i).data(), this->file_to_generate(i).length(),
  310. ::google::protobuf::internal::WireFormat::SERIALIZE);
  311. target = ::google::protobuf::internal::WireFormatLite::
  312. WriteStringToArray(1, this->file_to_generate(i), target);
  313. }
  314. // optional string parameter = 2;
  315. if (has_parameter()) {
  316. ::google::protobuf::internal::WireFormat::VerifyUTF8String(
  317. this->parameter().data(), this->parameter().length(),
  318. ::google::protobuf::internal::WireFormat::SERIALIZE);
  319. target =
  320. ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
  321. 2, this->parameter(), target);
  322. }
  323. // repeated .google.protobuf.FileDescriptorProto proto_file = 15;
  324. for (int i = 0; i < this->proto_file_size(); i++) {
  325. target = ::google::protobuf::internal::WireFormatLite::
  326. WriteMessageNoVirtualToArray(
  327. 15, this->proto_file(i), target);
  328. }
  329. if (!unknown_fields().empty()) {
  330. target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
  331. unknown_fields(), target);
  332. }
  333. return target;
  334. }
  335. int CodeGeneratorRequest::ByteSize() const {
  336. int total_size = 0;
  337. if (_has_bits_[1 / 32] & (0xffu << (1 % 32))) {
  338. // optional string parameter = 2;
  339. if (has_parameter()) {
  340. total_size += 1 +
  341. ::google::protobuf::internal::WireFormatLite::StringSize(
  342. this->parameter());
  343. }
  344. }
  345. // repeated string file_to_generate = 1;
  346. total_size += 1 * this->file_to_generate_size();
  347. for (int i = 0; i < this->file_to_generate_size(); i++) {
  348. total_size += ::google::protobuf::internal::WireFormatLite::StringSize(
  349. this->file_to_generate(i));
  350. }
  351. // repeated .google.protobuf.FileDescriptorProto proto_file = 15;
  352. total_size += 1 * this->proto_file_size();
  353. for (int i = 0; i < this->proto_file_size(); i++) {
  354. total_size +=
  355. ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
  356. this->proto_file(i));
  357. }
  358. if (!unknown_fields().empty()) {
  359. total_size +=
  360. ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
  361. unknown_fields());
  362. }
  363. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  364. _cached_size_ = total_size;
  365. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  366. return total_size;
  367. }
  368. void CodeGeneratorRequest::MergeFrom(const ::google::protobuf::Message& from) {
  369. GOOGLE_CHECK_NE(&from, this);
  370. const CodeGeneratorRequest* source =
  371. ::google::protobuf::internal::dynamic_cast_if_available<const CodeGeneratorRequest*>(
  372. &from);
  373. if (source == NULL) {
  374. ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  375. } else {
  376. MergeFrom(*source);
  377. }
  378. }
  379. void CodeGeneratorRequest::MergeFrom(const CodeGeneratorRequest& from) {
  380. GOOGLE_CHECK_NE(&from, this);
  381. file_to_generate_.MergeFrom(from.file_to_generate_);
  382. proto_file_.MergeFrom(from.proto_file_);
  383. if (from._has_bits_[1 / 32] & (0xffu << (1 % 32))) {
  384. if (from.has_parameter()) {
  385. set_parameter(from.parameter());
  386. }
  387. }
  388. mutable_unknown_fields()->MergeFrom(from.unknown_fields());
  389. }
  390. void CodeGeneratorRequest::CopyFrom(const ::google::protobuf::Message& from) {
  391. if (&from == this) return;
  392. Clear();
  393. MergeFrom(from);
  394. }
  395. void CodeGeneratorRequest::CopyFrom(const CodeGeneratorRequest& from) {
  396. if (&from == this) return;
  397. Clear();
  398. MergeFrom(from);
  399. }
  400. bool CodeGeneratorRequest::IsInitialized() const {
  401. for (int i = 0; i < proto_file_size(); i++) {
  402. if (!this->proto_file(i).IsInitialized()) return false;
  403. }
  404. return true;
  405. }
  406. void CodeGeneratorRequest::Swap(CodeGeneratorRequest* other) {
  407. if (other != this) {
  408. file_to_generate_.Swap(&other->file_to_generate_);
  409. std::swap(parameter_, other->parameter_);
  410. proto_file_.Swap(&other->proto_file_);
  411. std::swap(_has_bits_[0], other->_has_bits_[0]);
  412. _unknown_fields_.Swap(&other->_unknown_fields_);
  413. std::swap(_cached_size_, other->_cached_size_);
  414. }
  415. }
  416. ::google::protobuf::Metadata CodeGeneratorRequest::GetMetadata() const {
  417. protobuf_AssignDescriptorsOnce();
  418. ::google::protobuf::Metadata metadata;
  419. metadata.descriptor = CodeGeneratorRequest_descriptor_;
  420. metadata.reflection = CodeGeneratorRequest_reflection_;
  421. return metadata;
  422. }
  423. // ===================================================================
  424. #ifndef _MSC_VER
  425. const int CodeGeneratorResponse_File::kNameFieldNumber;
  426. const int CodeGeneratorResponse_File::kInsertionPointFieldNumber;
  427. const int CodeGeneratorResponse_File::kContentFieldNumber;
  428. #endif // !_MSC_VER
  429. CodeGeneratorResponse_File::CodeGeneratorResponse_File()
  430. : ::google::protobuf::Message() {
  431. SharedCtor();
  432. }
  433. void CodeGeneratorResponse_File::InitAsDefaultInstance() {
  434. }
  435. CodeGeneratorResponse_File::CodeGeneratorResponse_File(const CodeGeneratorResponse_File& from)
  436. : ::google::protobuf::Message() {
  437. SharedCtor();
  438. MergeFrom(from);
  439. }
  440. void CodeGeneratorResponse_File::SharedCtor() {
  441. _cached_size_ = 0;
  442. name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString());
  443. insertion_point_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString());
  444. content_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString());
  445. ::memset(_has_bits_, 0, sizeof(_has_bits_));
  446. }
  447. CodeGeneratorResponse_File::~CodeGeneratorResponse_File() {
  448. SharedDtor();
  449. }
  450. void CodeGeneratorResponse_File::SharedDtor() {
  451. if (name_ != &::google::protobuf::internal::GetEmptyString()) {
  452. delete name_;
  453. }
  454. if (insertion_point_ != &::google::protobuf::internal::GetEmptyString()) {
  455. delete insertion_point_;
  456. }
  457. if (content_ != &::google::protobuf::internal::GetEmptyString()) {
  458. delete content_;
  459. }
  460. if (this != default_instance_) {
  461. }
  462. }
  463. void CodeGeneratorResponse_File::SetCachedSize(int size) const {
  464. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  465. _cached_size_ = size;
  466. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  467. }
  468. const ::google::protobuf::Descriptor* CodeGeneratorResponse_File::descriptor() {
  469. protobuf_AssignDescriptorsOnce();
  470. return CodeGeneratorResponse_File_descriptor_;
  471. }
  472. const CodeGeneratorResponse_File& CodeGeneratorResponse_File::default_instance() {
  473. if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2fcompiler_2fplugin_2eproto();
  474. return *default_instance_;
  475. }
  476. CodeGeneratorResponse_File* CodeGeneratorResponse_File::default_instance_ = NULL;
  477. CodeGeneratorResponse_File* CodeGeneratorResponse_File::New() const {
  478. return new CodeGeneratorResponse_File;
  479. }
  480. void CodeGeneratorResponse_File::Clear() {
  481. if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
  482. if (has_name()) {
  483. if (name_ != &::google::protobuf::internal::GetEmptyString()) {
  484. name_->clear();
  485. }
  486. }
  487. if (has_insertion_point()) {
  488. if (insertion_point_ != &::google::protobuf::internal::GetEmptyString()) {
  489. insertion_point_->clear();
  490. }
  491. }
  492. if (has_content()) {
  493. if (content_ != &::google::protobuf::internal::GetEmptyString()) {
  494. content_->clear();
  495. }
  496. }
  497. }
  498. ::memset(_has_bits_, 0, sizeof(_has_bits_));
  499. mutable_unknown_fields()->Clear();
  500. }
  501. bool CodeGeneratorResponse_File::MergePartialFromCodedStream(
  502. ::google::protobuf::io::CodedInputStream* input) {
  503. #define DO_(EXPRESSION) if (!(EXPRESSION)) return false
  504. ::google::protobuf::uint32 tag;
  505. while ((tag = input->ReadTag()) != 0) {
  506. switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
  507. // optional string name = 1;
  508. case 1: {
  509. if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
  510. ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
  511. DO_(::google::protobuf::internal::WireFormatLite::ReadString(
  512. input, this->mutable_name()));
  513. ::google::protobuf::internal::WireFormat::VerifyUTF8String(
  514. this->name().data(), this->name().length(),
  515. ::google::protobuf::internal::WireFormat::PARSE);
  516. } else {
  517. goto handle_uninterpreted;
  518. }
  519. if (input->ExpectTag(18)) goto parse_insertion_point;
  520. break;
  521. }
  522. // optional string insertion_point = 2;
  523. case 2: {
  524. if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
  525. ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
  526. parse_insertion_point:
  527. DO_(::google::protobuf::internal::WireFormatLite::ReadString(
  528. input, this->mutable_insertion_point()));
  529. ::google::protobuf::internal::WireFormat::VerifyUTF8String(
  530. this->insertion_point().data(), this->insertion_point().length(),
  531. ::google::protobuf::internal::WireFormat::PARSE);
  532. } else {
  533. goto handle_uninterpreted;
  534. }
  535. if (input->ExpectTag(122)) goto parse_content;
  536. break;
  537. }
  538. // optional string content = 15;
  539. case 15: {
  540. if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
  541. ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
  542. parse_content:
  543. DO_(::google::protobuf::internal::WireFormatLite::ReadString(
  544. input, this->mutable_content()));
  545. ::google::protobuf::internal::WireFormat::VerifyUTF8String(
  546. this->content().data(), this->content().length(),
  547. ::google::protobuf::internal::WireFormat::PARSE);
  548. } else {
  549. goto handle_uninterpreted;
  550. }
  551. if (input->ExpectAtEnd()) return true;
  552. break;
  553. }
  554. default: {
  555. handle_uninterpreted:
  556. if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
  557. ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
  558. return true;
  559. }
  560. DO_(::google::protobuf::internal::WireFormat::SkipField(
  561. input, tag, mutable_unknown_fields()));
  562. break;
  563. }
  564. }
  565. }
  566. return true;
  567. #undef DO_
  568. }
  569. void CodeGeneratorResponse_File::SerializeWithCachedSizes(
  570. ::google::protobuf::io::CodedOutputStream* output) const {
  571. // optional string name = 1;
  572. if (has_name()) {
  573. ::google::protobuf::internal::WireFormat::VerifyUTF8String(
  574. this->name().data(), this->name().length(),
  575. ::google::protobuf::internal::WireFormat::SERIALIZE);
  576. ::google::protobuf::internal::WireFormatLite::WriteString(
  577. 1, this->name(), output);
  578. }
  579. // optional string insertion_point = 2;
  580. if (has_insertion_point()) {
  581. ::google::protobuf::internal::WireFormat::VerifyUTF8String(
  582. this->insertion_point().data(), this->insertion_point().length(),
  583. ::google::protobuf::internal::WireFormat::SERIALIZE);
  584. ::google::protobuf::internal::WireFormatLite::WriteString(
  585. 2, this->insertion_point(), output);
  586. }
  587. // optional string content = 15;
  588. if (has_content()) {
  589. ::google::protobuf::internal::WireFormat::VerifyUTF8String(
  590. this->content().data(), this->content().length(),
  591. ::google::protobuf::internal::WireFormat::SERIALIZE);
  592. ::google::protobuf::internal::WireFormatLite::WriteString(
  593. 15, this->content(), output);
  594. }
  595. if (!unknown_fields().empty()) {
  596. ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
  597. unknown_fields(), output);
  598. }
  599. }
  600. ::google::protobuf::uint8* CodeGeneratorResponse_File::SerializeWithCachedSizesToArray(
  601. ::google::protobuf::uint8* target) const {
  602. // optional string name = 1;
  603. if (has_name()) {
  604. ::google::protobuf::internal::WireFormat::VerifyUTF8String(
  605. this->name().data(), this->name().length(),
  606. ::google::protobuf::internal::WireFormat::SERIALIZE);
  607. target =
  608. ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
  609. 1, this->name(), target);
  610. }
  611. // optional string insertion_point = 2;
  612. if (has_insertion_point()) {
  613. ::google::protobuf::internal::WireFormat::VerifyUTF8String(
  614. this->insertion_point().data(), this->insertion_point().length(),
  615. ::google::protobuf::internal::WireFormat::SERIALIZE);
  616. target =
  617. ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
  618. 2, this->insertion_point(), target);
  619. }
  620. // optional string content = 15;
  621. if (has_content()) {
  622. ::google::protobuf::internal::WireFormat::VerifyUTF8String(
  623. this->content().data(), this->content().length(),
  624. ::google::protobuf::internal::WireFormat::SERIALIZE);
  625. target =
  626. ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
  627. 15, this->content(), target);
  628. }
  629. if (!unknown_fields().empty()) {
  630. target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
  631. unknown_fields(), target);
  632. }
  633. return target;
  634. }
  635. int CodeGeneratorResponse_File::ByteSize() const {
  636. int total_size = 0;
  637. if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
  638. // optional string name = 1;
  639. if (has_name()) {
  640. total_size += 1 +
  641. ::google::protobuf::internal::WireFormatLite::StringSize(
  642. this->name());
  643. }
  644. // optional string insertion_point = 2;
  645. if (has_insertion_point()) {
  646. total_size += 1 +
  647. ::google::protobuf::internal::WireFormatLite::StringSize(
  648. this->insertion_point());
  649. }
  650. // optional string content = 15;
  651. if (has_content()) {
  652. total_size += 1 +
  653. ::google::protobuf::internal::WireFormatLite::StringSize(
  654. this->content());
  655. }
  656. }
  657. if (!unknown_fields().empty()) {
  658. total_size +=
  659. ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
  660. unknown_fields());
  661. }
  662. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  663. _cached_size_ = total_size;
  664. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  665. return total_size;
  666. }
  667. void CodeGeneratorResponse_File::MergeFrom(const ::google::protobuf::Message& from) {
  668. GOOGLE_CHECK_NE(&from, this);
  669. const CodeGeneratorResponse_File* source =
  670. ::google::protobuf::internal::dynamic_cast_if_available<const CodeGeneratorResponse_File*>(
  671. &from);
  672. if (source == NULL) {
  673. ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  674. } else {
  675. MergeFrom(*source);
  676. }
  677. }
  678. void CodeGeneratorResponse_File::MergeFrom(const CodeGeneratorResponse_File& from) {
  679. GOOGLE_CHECK_NE(&from, this);
  680. if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
  681. if (from.has_name()) {
  682. set_name(from.name());
  683. }
  684. if (from.has_insertion_point()) {
  685. set_insertion_point(from.insertion_point());
  686. }
  687. if (from.has_content()) {
  688. set_content(from.content());
  689. }
  690. }
  691. mutable_unknown_fields()->MergeFrom(from.unknown_fields());
  692. }
  693. void CodeGeneratorResponse_File::CopyFrom(const ::google::protobuf::Message& from) {
  694. if (&from == this) return;
  695. Clear();
  696. MergeFrom(from);
  697. }
  698. void CodeGeneratorResponse_File::CopyFrom(const CodeGeneratorResponse_File& from) {
  699. if (&from == this) return;
  700. Clear();
  701. MergeFrom(from);
  702. }
  703. bool CodeGeneratorResponse_File::IsInitialized() const {
  704. return true;
  705. }
  706. void CodeGeneratorResponse_File::Swap(CodeGeneratorResponse_File* other) {
  707. if (other != this) {
  708. std::swap(name_, other->name_);
  709. std::swap(insertion_point_, other->insertion_point_);
  710. std::swap(content_, other->content_);
  711. std::swap(_has_bits_[0], other->_has_bits_[0]);
  712. _unknown_fields_.Swap(&other->_unknown_fields_);
  713. std::swap(_cached_size_, other->_cached_size_);
  714. }
  715. }
  716. ::google::protobuf::Metadata CodeGeneratorResponse_File::GetMetadata() const {
  717. protobuf_AssignDescriptorsOnce();
  718. ::google::protobuf::Metadata metadata;
  719. metadata.descriptor = CodeGeneratorResponse_File_descriptor_;
  720. metadata.reflection = CodeGeneratorResponse_File_reflection_;
  721. return metadata;
  722. }
  723. // -------------------------------------------------------------------
  724. #ifndef _MSC_VER
  725. const int CodeGeneratorResponse::kErrorFieldNumber;
  726. const int CodeGeneratorResponse::kFileFieldNumber;
  727. #endif // !_MSC_VER
  728. CodeGeneratorResponse::CodeGeneratorResponse()
  729. : ::google::protobuf::Message() {
  730. SharedCtor();
  731. }
  732. void CodeGeneratorResponse::InitAsDefaultInstance() {
  733. }
  734. CodeGeneratorResponse::CodeGeneratorResponse(const CodeGeneratorResponse& from)
  735. : ::google::protobuf::Message() {
  736. SharedCtor();
  737. MergeFrom(from);
  738. }
  739. void CodeGeneratorResponse::SharedCtor() {
  740. _cached_size_ = 0;
  741. error_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyString());
  742. ::memset(_has_bits_, 0, sizeof(_has_bits_));
  743. }
  744. CodeGeneratorResponse::~CodeGeneratorResponse() {
  745. SharedDtor();
  746. }
  747. void CodeGeneratorResponse::SharedDtor() {
  748. if (error_ != &::google::protobuf::internal::GetEmptyString()) {
  749. delete error_;
  750. }
  751. if (this != default_instance_) {
  752. }
  753. }
  754. void CodeGeneratorResponse::SetCachedSize(int size) const {
  755. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  756. _cached_size_ = size;
  757. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  758. }
  759. const ::google::protobuf::Descriptor* CodeGeneratorResponse::descriptor() {
  760. protobuf_AssignDescriptorsOnce();
  761. return CodeGeneratorResponse_descriptor_;
  762. }
  763. const CodeGeneratorResponse& CodeGeneratorResponse::default_instance() {
  764. if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2fcompiler_2fplugin_2eproto();
  765. return *default_instance_;
  766. }
  767. CodeGeneratorResponse* CodeGeneratorResponse::default_instance_ = NULL;
  768. CodeGeneratorResponse* CodeGeneratorResponse::New() const {
  769. return new CodeGeneratorResponse;
  770. }
  771. void CodeGeneratorResponse::Clear() {
  772. if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
  773. if (has_error()) {
  774. if (error_ != &::google::protobuf::internal::GetEmptyString()) {
  775. error_->clear();
  776. }
  777. }
  778. }
  779. file_.Clear();
  780. ::memset(_has_bits_, 0, sizeof(_has_bits_));
  781. mutable_unknown_fields()->Clear();
  782. }
  783. bool CodeGeneratorResponse::MergePartialFromCodedStream(
  784. ::google::protobuf::io::CodedInputStream* input) {
  785. #define DO_(EXPRESSION) if (!(EXPRESSION)) return false
  786. ::google::protobuf::uint32 tag;
  787. while ((tag = input->ReadTag()) != 0) {
  788. switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
  789. // optional string error = 1;
  790. case 1: {
  791. if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
  792. ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
  793. DO_(::google::protobuf::internal::WireFormatLite::ReadString(
  794. input, this->mutable_error()));
  795. ::google::protobuf::internal::WireFormat::VerifyUTF8String(
  796. this->error().data(), this->error().length(),
  797. ::google::protobuf::internal::WireFormat::PARSE);
  798. } else {
  799. goto handle_uninterpreted;
  800. }
  801. if (input->ExpectTag(122)) goto parse_file;
  802. break;
  803. }
  804. // repeated .google.protobuf.compiler.CodeGeneratorResponse.File file = 15;
  805. case 15: {
  806. if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
  807. ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
  808. parse_file:
  809. DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
  810. input, add_file()));
  811. } else {
  812. goto handle_uninterpreted;
  813. }
  814. if (input->ExpectTag(122)) goto parse_file;
  815. if (input->ExpectAtEnd()) return true;
  816. break;
  817. }
  818. default: {
  819. handle_uninterpreted:
  820. if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
  821. ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
  822. return true;
  823. }
  824. DO_(::google::protobuf::internal::WireFormat::SkipField(
  825. input, tag, mutable_unknown_fields()));
  826. break;
  827. }
  828. }
  829. }
  830. return true;
  831. #undef DO_
  832. }
  833. void CodeGeneratorResponse::SerializeWithCachedSizes(
  834. ::google::protobuf::io::CodedOutputStream* output) const {
  835. // optional string error = 1;
  836. if (has_error()) {
  837. ::google::protobuf::internal::WireFormat::VerifyUTF8String(
  838. this->error().data(), this->error().length(),
  839. ::google::protobuf::internal::WireFormat::SERIALIZE);
  840. ::google::protobuf::internal::WireFormatLite::WriteString(
  841. 1, this->error(), output);
  842. }
  843. // repeated .google.protobuf.compiler.CodeGeneratorResponse.File file = 15;
  844. for (int i = 0; i < this->file_size(); i++) {
  845. ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  846. 15, this->file(i), output);
  847. }
  848. if (!unknown_fields().empty()) {
  849. ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
  850. unknown_fields(), output);
  851. }
  852. }
  853. ::google::protobuf::uint8* CodeGeneratorResponse::SerializeWithCachedSizesToArray(
  854. ::google::protobuf::uint8* target) const {
  855. // optional string error = 1;
  856. if (has_error()) {
  857. ::google::protobuf::internal::WireFormat::VerifyUTF8String(
  858. this->error().data(), this->error().length(),
  859. ::google::protobuf::internal::WireFormat::SERIALIZE);
  860. target =
  861. ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
  862. 1, this->error(), target);
  863. }
  864. // repeated .google.protobuf.compiler.CodeGeneratorResponse.File file = 15;
  865. for (int i = 0; i < this->file_size(); i++) {
  866. target = ::google::protobuf::internal::WireFormatLite::
  867. WriteMessageNoVirtualToArray(
  868. 15, this->file(i), target);
  869. }
  870. if (!unknown_fields().empty()) {
  871. target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
  872. unknown_fields(), target);
  873. }
  874. return target;
  875. }
  876. int CodeGeneratorResponse::ByteSize() const {
  877. int total_size = 0;
  878. if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
  879. // optional string error = 1;
  880. if (has_error()) {
  881. total_size += 1 +
  882. ::google::protobuf::internal::WireFormatLite::StringSize(
  883. this->error());
  884. }
  885. }
  886. // repeated .google.protobuf.compiler.CodeGeneratorResponse.File file = 15;
  887. total_size += 1 * this->file_size();
  888. for (int i = 0; i < this->file_size(); i++) {
  889. total_size +=
  890. ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
  891. this->file(i));
  892. }
  893. if (!unknown_fields().empty()) {
  894. total_size +=
  895. ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
  896. unknown_fields());
  897. }
  898. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  899. _cached_size_ = total_size;
  900. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  901. return total_size;
  902. }
  903. void CodeGeneratorResponse::MergeFrom(const ::google::protobuf::Message& from) {
  904. GOOGLE_CHECK_NE(&from, this);
  905. const CodeGeneratorResponse* source =
  906. ::google::protobuf::internal::dynamic_cast_if_available<const CodeGeneratorResponse*>(
  907. &from);
  908. if (source == NULL) {
  909. ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  910. } else {
  911. MergeFrom(*source);
  912. }
  913. }
  914. void CodeGeneratorResponse::MergeFrom(const CodeGeneratorResponse& from) {
  915. GOOGLE_CHECK_NE(&from, this);
  916. file_.MergeFrom(from.file_);
  917. if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
  918. if (from.has_error()) {
  919. set_error(from.error());
  920. }
  921. }
  922. mutable_unknown_fields()->MergeFrom(from.unknown_fields());
  923. }
  924. void CodeGeneratorResponse::CopyFrom(const ::google::protobuf::Message& from) {
  925. if (&from == this) return;
  926. Clear();
  927. MergeFrom(from);
  928. }
  929. void CodeGeneratorResponse::CopyFrom(const CodeGeneratorResponse& from) {
  930. if (&from == this) return;
  931. Clear();
  932. MergeFrom(from);
  933. }
  934. bool CodeGeneratorResponse::IsInitialized() const {
  935. return true;
  936. }
  937. void CodeGeneratorResponse::Swap(CodeGeneratorResponse* other) {
  938. if (other != this) {
  939. std::swap(error_, other->error_);
  940. file_.Swap(&other->file_);
  941. std::swap(_has_bits_[0], other->_has_bits_[0]);
  942. _unknown_fields_.Swap(&other->_unknown_fields_);
  943. std::swap(_cached_size_, other->_cached_size_);
  944. }
  945. }
  946. ::google::protobuf::Metadata CodeGeneratorResponse::GetMetadata() const {
  947. protobuf_AssignDescriptorsOnce();
  948. ::google::protobuf::Metadata metadata;
  949. metadata.descriptor = CodeGeneratorResponse_descriptor_;
  950. metadata.reflection = CodeGeneratorResponse_reflection_;
  951. return metadata;
  952. }
  953. // @@protoc_insertion_point(namespace_scope)
  954. } // namespace compiler
  955. } // namespace protobuf
  956. } // namespace google
  957. // @@protoc_insertion_point(global_scope)