PageRenderTime 27ms CodeModel.GetById 13ms RepoModel.GetById 0ms app.codeStats 0ms

/src/google/protobuf/source_context.pb.cc

https://gitlab.com/yenny.prathivi/protobuf
C++ | 394 lines | 295 code | 61 blank | 38 comment | 39 complexity | b8ef70de7f35647367ae4ccf32c2f89c MD5 | raw file
  1. // Generated by the protocol buffer compiler. DO NOT EDIT!
  2. // source: google/protobuf/source_context.proto
  3. #define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION
  4. #include <google/protobuf/source_context.pb.h>
  5. #include <algorithm>
  6. #include <google/protobuf/stubs/common.h>
  7. #include <google/protobuf/stubs/port.h>
  8. #include <google/protobuf/stubs/once.h>
  9. #include <google/protobuf/io/coded_stream.h>
  10. #include <google/protobuf/wire_format_lite_inl.h>
  11. #include <google/protobuf/descriptor.h>
  12. #include <google/protobuf/generated_message_reflection.h>
  13. #include <google/protobuf/reflection_ops.h>
  14. #include <google/protobuf/wire_format.h>
  15. // @@protoc_insertion_point(includes)
  16. namespace google {
  17. namespace protobuf {
  18. namespace {
  19. const ::google::protobuf::Descriptor* SourceContext_descriptor_ = NULL;
  20. const ::google::protobuf::internal::GeneratedMessageReflection*
  21. SourceContext_reflection_ = NULL;
  22. } // namespace
  23. void protobuf_AssignDesc_google_2fprotobuf_2fsource_5fcontext_2eproto() GOOGLE_ATTRIBUTE_COLD;
  24. void protobuf_AssignDesc_google_2fprotobuf_2fsource_5fcontext_2eproto() {
  25. protobuf_AddDesc_google_2fprotobuf_2fsource_5fcontext_2eproto();
  26. const ::google::protobuf::FileDescriptor* file =
  27. ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName(
  28. "google/protobuf/source_context.proto");
  29. GOOGLE_CHECK(file != NULL);
  30. SourceContext_descriptor_ = file->message_type(0);
  31. static const int SourceContext_offsets_[1] = {
  32. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SourceContext, file_name_),
  33. };
  34. SourceContext_reflection_ =
  35. ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection(
  36. SourceContext_descriptor_,
  37. SourceContext::default_instance_,
  38. SourceContext_offsets_,
  39. -1,
  40. -1,
  41. -1,
  42. sizeof(SourceContext),
  43. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SourceContext, _internal_metadata_),
  44. GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SourceContext, _is_default_instance_));
  45. }
  46. namespace {
  47. GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_);
  48. inline void protobuf_AssignDescriptorsOnce() {
  49. ::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_,
  50. &protobuf_AssignDesc_google_2fprotobuf_2fsource_5fcontext_2eproto);
  51. }
  52. void protobuf_RegisterTypes(const ::std::string&) GOOGLE_ATTRIBUTE_COLD;
  53. void protobuf_RegisterTypes(const ::std::string&) {
  54. protobuf_AssignDescriptorsOnce();
  55. ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
  56. SourceContext_descriptor_, &SourceContext::default_instance());
  57. }
  58. } // namespace
  59. void protobuf_ShutdownFile_google_2fprotobuf_2fsource_5fcontext_2eproto() {
  60. delete SourceContext::default_instance_;
  61. delete SourceContext_reflection_;
  62. }
  63. void protobuf_AddDesc_google_2fprotobuf_2fsource_5fcontext_2eproto() GOOGLE_ATTRIBUTE_COLD;
  64. void protobuf_AddDesc_google_2fprotobuf_2fsource_5fcontext_2eproto() {
  65. static bool already_here = false;
  66. if (already_here) return;
  67. already_here = true;
  68. GOOGLE_PROTOBUF_VERIFY_VERSION;
  69. ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
  70. "\n$google/protobuf/source_context.proto\022\017"
  71. "google.protobuf\"\"\n\rSourceContext\022\021\n\tfile"
  72. "_name\030\001 \001(\tBU\n\023com.google.protobufB\022Sour"
  73. "ceContextProtoP\001\240\001\001\242\002\003GPB\252\002\036Google.Proto"
  74. "buf.WellKnownTypesb\006proto3", 186);
  75. ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
  76. "google/protobuf/source_context.proto", &protobuf_RegisterTypes);
  77. SourceContext::default_instance_ = new SourceContext();
  78. SourceContext::default_instance_->InitAsDefaultInstance();
  79. ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_google_2fprotobuf_2fsource_5fcontext_2eproto);
  80. }
  81. // Force AddDescriptors() to be called at static initialization time.
  82. struct StaticDescriptorInitializer_google_2fprotobuf_2fsource_5fcontext_2eproto {
  83. StaticDescriptorInitializer_google_2fprotobuf_2fsource_5fcontext_2eproto() {
  84. protobuf_AddDesc_google_2fprotobuf_2fsource_5fcontext_2eproto();
  85. }
  86. } static_descriptor_initializer_google_2fprotobuf_2fsource_5fcontext_2eproto_;
  87. // ===================================================================
  88. #if !defined(_MSC_VER) || _MSC_VER >= 1900
  89. const int SourceContext::kFileNameFieldNumber;
  90. #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
  91. SourceContext::SourceContext()
  92. : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  93. SharedCtor();
  94. // @@protoc_insertion_point(constructor:google.protobuf.SourceContext)
  95. }
  96. void SourceContext::InitAsDefaultInstance() {
  97. _is_default_instance_ = true;
  98. }
  99. SourceContext::SourceContext(const SourceContext& from)
  100. : ::google::protobuf::Message(),
  101. _internal_metadata_(NULL) {
  102. SharedCtor();
  103. MergeFrom(from);
  104. // @@protoc_insertion_point(copy_constructor:google.protobuf.SourceContext)
  105. }
  106. void SourceContext::SharedCtor() {
  107. _is_default_instance_ = false;
  108. ::google::protobuf::internal::GetEmptyString();
  109. _cached_size_ = 0;
  110. file_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  111. }
  112. SourceContext::~SourceContext() {
  113. // @@protoc_insertion_point(destructor:google.protobuf.SourceContext)
  114. SharedDtor();
  115. }
  116. void SourceContext::SharedDtor() {
  117. file_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  118. if (this != default_instance_) {
  119. }
  120. }
  121. void SourceContext::SetCachedSize(int size) const {
  122. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  123. _cached_size_ = size;
  124. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  125. }
  126. const ::google::protobuf::Descriptor* SourceContext::descriptor() {
  127. protobuf_AssignDescriptorsOnce();
  128. return SourceContext_descriptor_;
  129. }
  130. const SourceContext& SourceContext::default_instance() {
  131. if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2fsource_5fcontext_2eproto();
  132. return *default_instance_;
  133. }
  134. SourceContext* SourceContext::default_instance_ = NULL;
  135. SourceContext* SourceContext::New(::google::protobuf::Arena* arena) const {
  136. SourceContext* n = new SourceContext;
  137. if (arena != NULL) {
  138. arena->Own(n);
  139. }
  140. return n;
  141. }
  142. void SourceContext::Clear() {
  143. // @@protoc_insertion_point(message_clear_start:google.protobuf.SourceContext)
  144. file_name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  145. }
  146. bool SourceContext::MergePartialFromCodedStream(
  147. ::google::protobuf::io::CodedInputStream* input) {
  148. #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  149. ::google::protobuf::uint32 tag;
  150. // @@protoc_insertion_point(parse_start:google.protobuf.SourceContext)
  151. for (;;) {
  152. ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
  153. tag = p.first;
  154. if (!p.second) goto handle_unusual;
  155. switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
  156. // optional string file_name = 1;
  157. case 1: {
  158. if (tag == 10) {
  159. DO_(::google::protobuf::internal::WireFormatLite::ReadString(
  160. input, this->mutable_file_name()));
  161. DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  162. this->file_name().data(), this->file_name().length(),
  163. ::google::protobuf::internal::WireFormatLite::PARSE,
  164. "google.protobuf.SourceContext.file_name"));
  165. } else {
  166. goto handle_unusual;
  167. }
  168. if (input->ExpectAtEnd()) goto success;
  169. break;
  170. }
  171. default: {
  172. handle_unusual:
  173. if (tag == 0 ||
  174. ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
  175. ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
  176. goto success;
  177. }
  178. DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
  179. break;
  180. }
  181. }
  182. }
  183. success:
  184. // @@protoc_insertion_point(parse_success:google.protobuf.SourceContext)
  185. return true;
  186. failure:
  187. // @@protoc_insertion_point(parse_failure:google.protobuf.SourceContext)
  188. return false;
  189. #undef DO_
  190. }
  191. void SourceContext::SerializeWithCachedSizes(
  192. ::google::protobuf::io::CodedOutputStream* output) const {
  193. // @@protoc_insertion_point(serialize_start:google.protobuf.SourceContext)
  194. // optional string file_name = 1;
  195. if (this->file_name().size() > 0) {
  196. ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  197. this->file_name().data(), this->file_name().length(),
  198. ::google::protobuf::internal::WireFormatLite::SERIALIZE,
  199. "google.protobuf.SourceContext.file_name");
  200. ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
  201. 1, this->file_name(), output);
  202. }
  203. // @@protoc_insertion_point(serialize_end:google.protobuf.SourceContext)
  204. }
  205. ::google::protobuf::uint8* SourceContext::InternalSerializeWithCachedSizesToArray(
  206. bool deterministic, ::google::protobuf::uint8* target) const {
  207. // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.SourceContext)
  208. // optional string file_name = 1;
  209. if (this->file_name().size() > 0) {
  210. ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
  211. this->file_name().data(), this->file_name().length(),
  212. ::google::protobuf::internal::WireFormatLite::SERIALIZE,
  213. "google.protobuf.SourceContext.file_name");
  214. target =
  215. ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
  216. 1, this->file_name(), target);
  217. }
  218. // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.SourceContext)
  219. return target;
  220. }
  221. int SourceContext::ByteSize() const {
  222. // @@protoc_insertion_point(message_byte_size_start:google.protobuf.SourceContext)
  223. int total_size = 0;
  224. // optional string file_name = 1;
  225. if (this->file_name().size() > 0) {
  226. total_size += 1 +
  227. ::google::protobuf::internal::WireFormatLite::StringSize(
  228. this->file_name());
  229. }
  230. GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  231. _cached_size_ = total_size;
  232. GOOGLE_SAFE_CONCURRENT_WRITES_END();
  233. return total_size;
  234. }
  235. void SourceContext::MergeFrom(const ::google::protobuf::Message& from) {
  236. // @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.SourceContext)
  237. if (GOOGLE_PREDICT_FALSE(&from == this)) {
  238. ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
  239. }
  240. const SourceContext* source =
  241. ::google::protobuf::internal::DynamicCastToGenerated<const SourceContext>(
  242. &from);
  243. if (source == NULL) {
  244. // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.SourceContext)
  245. ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  246. } else {
  247. // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.SourceContext)
  248. MergeFrom(*source);
  249. }
  250. }
  251. void SourceContext::MergeFrom(const SourceContext& from) {
  252. // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.SourceContext)
  253. if (GOOGLE_PREDICT_FALSE(&from == this)) {
  254. ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
  255. }
  256. if (from.file_name().size() > 0) {
  257. file_name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.file_name_);
  258. }
  259. }
  260. void SourceContext::CopyFrom(const ::google::protobuf::Message& from) {
  261. // @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.SourceContext)
  262. if (&from == this) return;
  263. Clear();
  264. MergeFrom(from);
  265. }
  266. void SourceContext::CopyFrom(const SourceContext& from) {
  267. // @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.SourceContext)
  268. if (&from == this) return;
  269. Clear();
  270. MergeFrom(from);
  271. }
  272. bool SourceContext::IsInitialized() const {
  273. return true;
  274. }
  275. void SourceContext::Swap(SourceContext* other) {
  276. if (other == this) return;
  277. InternalSwap(other);
  278. }
  279. void SourceContext::InternalSwap(SourceContext* other) {
  280. file_name_.Swap(&other->file_name_);
  281. _internal_metadata_.Swap(&other->_internal_metadata_);
  282. std::swap(_cached_size_, other->_cached_size_);
  283. }
  284. ::google::protobuf::Metadata SourceContext::GetMetadata() const {
  285. protobuf_AssignDescriptorsOnce();
  286. ::google::protobuf::Metadata metadata;
  287. metadata.descriptor = SourceContext_descriptor_;
  288. metadata.reflection = SourceContext_reflection_;
  289. return metadata;
  290. }
  291. #if PROTOBUF_INLINE_NOT_IN_HEADERS
  292. // SourceContext
  293. // optional string file_name = 1;
  294. void SourceContext::clear_file_name() {
  295. file_name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  296. }
  297. const ::std::string& SourceContext::file_name() const {
  298. // @@protoc_insertion_point(field_get:google.protobuf.SourceContext.file_name)
  299. return file_name_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  300. }
  301. void SourceContext::set_file_name(const ::std::string& value) {
  302. file_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
  303. // @@protoc_insertion_point(field_set:google.protobuf.SourceContext.file_name)
  304. }
  305. void SourceContext::set_file_name(const char* value) {
  306. file_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
  307. // @@protoc_insertion_point(field_set_char:google.protobuf.SourceContext.file_name)
  308. }
  309. void SourceContext::set_file_name(const char* value, size_t size) {
  310. file_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
  311. ::std::string(reinterpret_cast<const char*>(value), size));
  312. // @@protoc_insertion_point(field_set_pointer:google.protobuf.SourceContext.file_name)
  313. }
  314. ::std::string* SourceContext::mutable_file_name() {
  315. // @@protoc_insertion_point(field_mutable:google.protobuf.SourceContext.file_name)
  316. return file_name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  317. }
  318. ::std::string* SourceContext::release_file_name() {
  319. // @@protoc_insertion_point(field_release:google.protobuf.SourceContext.file_name)
  320. return file_name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  321. }
  322. void SourceContext::set_allocated_file_name(::std::string* file_name) {
  323. if (file_name != NULL) {
  324. } else {
  325. }
  326. file_name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), file_name);
  327. // @@protoc_insertion_point(field_set_allocated:google.protobuf.SourceContext.file_name)
  328. }
  329. #endif // PROTOBUF_INLINE_NOT_IN_HEADERS
  330. // @@protoc_insertion_point(namespace_scope)
  331. } // namespace protobuf
  332. } // namespace google
  333. // @@protoc_insertion_point(global_scope)