xref: /aosp_15_r20/external/cronet/third_party/protobuf/src/google/protobuf/source_context.pb.cc (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1 // Generated by the protocol buffer compiler.  DO NOT EDIT!
2 // source: google/protobuf/source_context.proto
3 
4 #include <google/protobuf/source_context.pb.h>
5 
6 #include <algorithm>
7 
8 #include <google/protobuf/io/coded_stream.h>
9 #include <google/protobuf/extension_set.h>
10 #include <google/protobuf/wire_format_lite.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 #include <google/protobuf/port_def.inc>
17 
18 PROTOBUF_PRAGMA_INIT_SEG
19 
20 namespace _pb = ::PROTOBUF_NAMESPACE_ID;
21 namespace _pbi = _pb::internal;
22 
23 PROTOBUF_NAMESPACE_OPEN
SourceContext(::_pbi::ConstantInitialized)24 PROTOBUF_CONSTEXPR SourceContext::SourceContext(
25     ::_pbi::ConstantInitialized): _impl_{
26     /*decltype(_impl_.file_name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
27   , /*decltype(_impl_._cached_size_)*/{}} {}
28 struct SourceContextDefaultTypeInternal {
SourceContextDefaultTypeInternalSourceContextDefaultTypeInternal29   PROTOBUF_CONSTEXPR SourceContextDefaultTypeInternal()
30       : _instance(::_pbi::ConstantInitialized{}) {}
~SourceContextDefaultTypeInternalSourceContextDefaultTypeInternal31   ~SourceContextDefaultTypeInternal() {}
32   union {
33     SourceContext _instance;
34   };
35 };
36 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 SourceContextDefaultTypeInternal _SourceContext_default_instance_;
37 PROTOBUF_NAMESPACE_CLOSE
38 static ::_pb::Metadata file_level_metadata_google_2fprotobuf_2fsource_5fcontext_2eproto[1];
39 static constexpr ::_pb::EnumDescriptor const** file_level_enum_descriptors_google_2fprotobuf_2fsource_5fcontext_2eproto = nullptr;
40 static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_google_2fprotobuf_2fsource_5fcontext_2eproto = nullptr;
41 
42 const uint32_t TableStruct_google_2fprotobuf_2fsource_5fcontext_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
43   ~0u,  // no _has_bits_
44   PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::SourceContext, _internal_metadata_),
45   ~0u,  // no _extensions_
46   ~0u,  // no _oneof_case_
47   ~0u,  // no _weak_field_map_
48   ~0u,  // no _inlined_string_donated_
49   PROTOBUF_FIELD_OFFSET(::PROTOBUF_NAMESPACE_ID::SourceContext, _impl_.file_name_),
50 };
51 static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
52   { 0, -1, -1, sizeof(::PROTOBUF_NAMESPACE_ID::SourceContext)},
53 };
54 
55 static const ::_pb::Message* const file_default_instances[] = {
56   &::PROTOBUF_NAMESPACE_ID::_SourceContext_default_instance_._instance,
57 };
58 
59 const char descriptor_table_protodef_google_2fprotobuf_2fsource_5fcontext_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
60   "\n$google/protobuf/source_context.proto\022\017"
61   "google.protobuf\"\"\n\rSourceContext\022\021\n\tfile"
62   "_name\030\001 \001(\tB\212\001\n\023com.google.protobufB\022Sou"
63   "rceContextProtoP\001Z6google.golang.org/pro"
64   "tobuf/types/known/sourcecontextpb\242\002\003GPB\252"
65   "\002\036Google.Protobuf.WellKnownTypesb\006proto3"
66   ;
67 static ::_pbi::once_flag descriptor_table_google_2fprotobuf_2fsource_5fcontext_2eproto_once;
68 const ::_pbi::DescriptorTable descriptor_table_google_2fprotobuf_2fsource_5fcontext_2eproto = {
69     false, false, 240, descriptor_table_protodef_google_2fprotobuf_2fsource_5fcontext_2eproto,
70     "google/protobuf/source_context.proto",
71     &descriptor_table_google_2fprotobuf_2fsource_5fcontext_2eproto_once, nullptr, 0, 1,
72     schemas, file_default_instances, TableStruct_google_2fprotobuf_2fsource_5fcontext_2eproto::offsets,
73     file_level_metadata_google_2fprotobuf_2fsource_5fcontext_2eproto, file_level_enum_descriptors_google_2fprotobuf_2fsource_5fcontext_2eproto,
74     file_level_service_descriptors_google_2fprotobuf_2fsource_5fcontext_2eproto,
75 };
descriptor_table_google_2fprotobuf_2fsource_5fcontext_2eproto_getter()76 PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_google_2fprotobuf_2fsource_5fcontext_2eproto_getter() {
77   return &descriptor_table_google_2fprotobuf_2fsource_5fcontext_2eproto;
78 }
79 
80 // Force running AddDescriptors() at dynamic initialization time.
81 PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_google_2fprotobuf_2fsource_5fcontext_2eproto(&descriptor_table_google_2fprotobuf_2fsource_5fcontext_2eproto);
82 PROTOBUF_NAMESPACE_OPEN
83 
84 // ===================================================================
85 
86 class SourceContext::_Internal {
87  public:
88 };
89 
SourceContext(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)90 SourceContext::SourceContext(::PROTOBUF_NAMESPACE_ID::Arena* arena,
91                          bool is_message_owned)
92   : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
93   SharedCtor(arena, is_message_owned);
94   // @@protoc_insertion_point(arena_constructor:google.protobuf.SourceContext)
95 }
SourceContext(const SourceContext & from)96 SourceContext::SourceContext(const SourceContext& from)
97   : ::PROTOBUF_NAMESPACE_ID::Message() {
98   SourceContext* const _this = this; (void)_this;
99   new (&_impl_) Impl_{
100       decltype(_impl_.file_name_){}
101     , /*decltype(_impl_._cached_size_)*/{}};
102 
103   _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
104   _impl_.file_name_.InitDefault();
105   #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
106     _impl_.file_name_.Set("", GetArenaForAllocation());
107   #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
108   if (!from._internal_file_name().empty()) {
109     _this->_impl_.file_name_.Set(from._internal_file_name(),
110       _this->GetArenaForAllocation());
111   }
112   // @@protoc_insertion_point(copy_constructor:google.protobuf.SourceContext)
113 }
114 
SharedCtor(::_pb::Arena * arena,bool is_message_owned)115 inline void SourceContext::SharedCtor(
116     ::_pb::Arena* arena, bool is_message_owned) {
117   (void)arena;
118   (void)is_message_owned;
119   new (&_impl_) Impl_{
120       decltype(_impl_.file_name_){}
121     , /*decltype(_impl_._cached_size_)*/{}
122   };
123   _impl_.file_name_.InitDefault();
124   #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
125     _impl_.file_name_.Set("", GetArenaForAllocation());
126   #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
127 }
128 
~SourceContext()129 SourceContext::~SourceContext() {
130   // @@protoc_insertion_point(destructor:google.protobuf.SourceContext)
131   if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) {
132   (void)arena;
133     return;
134   }
135   SharedDtor();
136 }
137 
SharedDtor()138 inline void SourceContext::SharedDtor() {
139   GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
140   _impl_.file_name_.Destroy();
141 }
142 
SetCachedSize(int size) const143 void SourceContext::SetCachedSize(int size) const {
144   _impl_._cached_size_.Set(size);
145 }
146 
Clear()147 void SourceContext::Clear() {
148 // @@protoc_insertion_point(message_clear_start:google.protobuf.SourceContext)
149   uint32_t cached_has_bits = 0;
150   // Prevent compiler warnings about cached_has_bits being unused
151   (void) cached_has_bits;
152 
153   _impl_.file_name_.ClearToEmpty();
154   _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
155 }
156 
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)157 const char* SourceContext::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
158 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
159   while (!ctx->Done(&ptr)) {
160     uint32_t tag;
161     ptr = ::_pbi::ReadTag(ptr, &tag);
162     switch (tag >> 3) {
163       // string file_name = 1;
164       case 1:
165         if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
166           auto str = _internal_mutable_file_name();
167           ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
168           CHK_(ptr);
169           CHK_(::_pbi::VerifyUTF8(str, "google.protobuf.SourceContext.file_name"));
170         } else
171           goto handle_unusual;
172         continue;
173       default:
174         goto handle_unusual;
175     }  // switch
176   handle_unusual:
177     if ((tag == 0) || ((tag & 7) == 4)) {
178       CHK_(ptr);
179       ctx->SetLastTag(tag);
180       goto message_done;
181     }
182     ptr = UnknownFieldParse(
183         tag,
184         _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
185         ptr, ctx);
186     CHK_(ptr != nullptr);
187   }  // while
188 message_done:
189   return ptr;
190 failure:
191   ptr = nullptr;
192   goto message_done;
193 #undef CHK_
194 }
195 
_InternalSerialize(uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const196 uint8_t* SourceContext::_InternalSerialize(
197     uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
198   // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.SourceContext)
199   uint32_t cached_has_bits = 0;
200   (void) cached_has_bits;
201 
202   // string file_name = 1;
203   if (!this->_internal_file_name().empty()) {
204     ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
205       this->_internal_file_name().data(), static_cast<int>(this->_internal_file_name().length()),
206       ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
207       "google.protobuf.SourceContext.file_name");
208     target = stream->WriteStringMaybeAliased(
209         1, this->_internal_file_name(), target);
210   }
211 
212   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
213     target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
214         _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
215   }
216   // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.SourceContext)
217   return target;
218 }
219 
ByteSizeLong() const220 size_t SourceContext::ByteSizeLong() const {
221 // @@protoc_insertion_point(message_byte_size_start:google.protobuf.SourceContext)
222   size_t total_size = 0;
223 
224   uint32_t cached_has_bits = 0;
225   // Prevent compiler warnings about cached_has_bits being unused
226   (void) cached_has_bits;
227 
228   // string file_name = 1;
229   if (!this->_internal_file_name().empty()) {
230     total_size += 1 +
231       ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
232         this->_internal_file_name());
233   }
234 
235   return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
236 }
237 
238 const ::PROTOBUF_NAMESPACE_ID::Message::ClassData SourceContext::_class_data_ = {
239     ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck,
240     SourceContext::MergeImpl
241 };
GetClassData() const242 const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*SourceContext::GetClassData() const { return &_class_data_; }
243 
244 
MergeImpl(::PROTOBUF_NAMESPACE_ID::Message & to_msg,const::PROTOBUF_NAMESPACE_ID::Message & from_msg)245 void SourceContext::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) {
246   auto* const _this = static_cast<SourceContext*>(&to_msg);
247   auto& from = static_cast<const SourceContext&>(from_msg);
248   // @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.SourceContext)
249   GOOGLE_DCHECK_NE(&from, _this);
250   uint32_t cached_has_bits = 0;
251   (void) cached_has_bits;
252 
253   if (!from._internal_file_name().empty()) {
254     _this->_internal_set_file_name(from._internal_file_name());
255   }
256   _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
257 }
258 
CopyFrom(const SourceContext & from)259 void SourceContext::CopyFrom(const SourceContext& from) {
260 // @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.SourceContext)
261   if (&from == this) return;
262   Clear();
263   MergeFrom(from);
264 }
265 
IsInitialized() const266 bool SourceContext::IsInitialized() const {
267   return true;
268 }
269 
InternalSwap(SourceContext * other)270 void SourceContext::InternalSwap(SourceContext* other) {
271   using std::swap;
272   auto* lhs_arena = GetArenaForAllocation();
273   auto* rhs_arena = other->GetArenaForAllocation();
274   _internal_metadata_.InternalSwap(&other->_internal_metadata_);
275   ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
276       &_impl_.file_name_, lhs_arena,
277       &other->_impl_.file_name_, rhs_arena
278   );
279 }
280 
GetMetadata() const281 ::PROTOBUF_NAMESPACE_ID::Metadata SourceContext::GetMetadata() const {
282   return ::_pbi::AssignDescriptors(
283       &descriptor_table_google_2fprotobuf_2fsource_5fcontext_2eproto_getter, &descriptor_table_google_2fprotobuf_2fsource_5fcontext_2eproto_once,
284       file_level_metadata_google_2fprotobuf_2fsource_5fcontext_2eproto[0]);
285 }
286 
287 // @@protoc_insertion_point(namespace_scope)
288 PROTOBUF_NAMESPACE_CLOSE
289 PROTOBUF_NAMESPACE_OPEN
290 template<> PROTOBUF_NOINLINE ::PROTOBUF_NAMESPACE_ID::SourceContext*
CreateMaybeMessage(Arena * arena)291 Arena::CreateMaybeMessage< ::PROTOBUF_NAMESPACE_ID::SourceContext >(Arena* arena) {
292   return Arena::CreateMessageInternal< ::PROTOBUF_NAMESPACE_ID::SourceContext >(arena);
293 }
294 PROTOBUF_NAMESPACE_CLOSE
295 
296 // @@protoc_insertion_point(global_scope)
297 #include <google/protobuf/port_undef.inc>
298