1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: fcp/client/http/http_resource_metadata.proto
3
4 #include "fcp/client/http/http_resource_metadata.pb.h"
5
6 #include <algorithm>
7 #include <cstdint>
8
9 #include <google/protobuf/io/coded_stream.h>
10 #include <google/protobuf/extension_set.h>
11 #include <google/protobuf/wire_format_lite.h>
12 #include <google/protobuf/io/zero_copy_stream_impl_lite.h>
13 // @@protoc_insertion_point(includes)
14 #include <google/protobuf/port_def.inc>
15
16 PROTOBUF_PRAGMA_INIT_SEG
17
18 namespace _pb = ::PROTOBUF_NAMESPACE_ID;
19 namespace _pbi = _pb::internal;
20
21 namespace fcp {
22 namespace client {
23 namespace http {
HttpResourceMetadata(::_pbi::ConstantInitialized)24 PROTOBUF_CONSTEXPR HttpResourceMetadata::HttpResourceMetadata(
25 ::_pbi::ConstantInitialized): _impl_{
26 /*decltype(_impl_.compression_format_)*/0
27 , /*decltype(_impl_._cached_size_)*/{}} {}
28 struct HttpResourceMetadataDefaultTypeInternal {
HttpResourceMetadataDefaultTypeInternalfcp::client::http::HttpResourceMetadataDefaultTypeInternal29 PROTOBUF_CONSTEXPR HttpResourceMetadataDefaultTypeInternal()
30 : _instance(::_pbi::ConstantInitialized{}) {}
~HttpResourceMetadataDefaultTypeInternalfcp::client::http::HttpResourceMetadataDefaultTypeInternal31 ~HttpResourceMetadataDefaultTypeInternal() {}
32 union { // NOLINT(misc-non-private-member-variables-in-classes)
33 HttpResourceMetadata _instance;
34 };
35 };
36 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 HttpResourceMetadataDefaultTypeInternal _HttpResourceMetadata_default_instance_;
37 } // namespace http
38 } // namespace client
39 } // namespace fcp
40 namespace fcp {
41 namespace client {
42 namespace http {
ResourceCompressionFormat_IsValid(int value)43 bool ResourceCompressionFormat_IsValid(int value) {
44 switch (value) {
45 case 0:
46 case 1:
47 return true;
48 default:
49 return false;
50 }
51 }
52
53 static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<std::string> ResourceCompressionFormat_strings[2] = {};
54
55 static const char ResourceCompressionFormat_names[] =
56 "RESOURCE_COMPRESSION_FORMAT_GZIP"
57 "RESOURCE_COMPRESSION_FORMAT_UNSPECIFIED";
58
59 static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry ResourceCompressionFormat_entries[] = {
60 { {ResourceCompressionFormat_names + 0, 32}, 1 },
61 { {ResourceCompressionFormat_names + 32, 39}, 0 },
62 };
63
64 static const int ResourceCompressionFormat_entries_by_number[] = {
65 1, // 0 -> RESOURCE_COMPRESSION_FORMAT_UNSPECIFIED
66 0, // 1 -> RESOURCE_COMPRESSION_FORMAT_GZIP
67 };
68
ResourceCompressionFormat_Name(ResourceCompressionFormat value)69 const std::string& ResourceCompressionFormat_Name(
70 ResourceCompressionFormat value) {
71 static const bool dummy =
72 ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings(
73 ResourceCompressionFormat_entries,
74 ResourceCompressionFormat_entries_by_number,
75 2, ResourceCompressionFormat_strings);
76 (void) dummy;
77 int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName(
78 ResourceCompressionFormat_entries,
79 ResourceCompressionFormat_entries_by_number,
80 2, value);
81 return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() :
82 ResourceCompressionFormat_strings[idx].get();
83 }
ResourceCompressionFormat_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,ResourceCompressionFormat * value)84 bool ResourceCompressionFormat_Parse(
85 ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, ResourceCompressionFormat* value) {
86 int int_value;
87 bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue(
88 ResourceCompressionFormat_entries, 2, name, &int_value);
89 if (success) {
90 *value = static_cast<ResourceCompressionFormat>(int_value);
91 }
92 return success;
93 }
94
95 // ===================================================================
96
97 class HttpResourceMetadata::_Internal {
98 public:
99 };
100
HttpResourceMetadata(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)101 HttpResourceMetadata::HttpResourceMetadata(::PROTOBUF_NAMESPACE_ID::Arena* arena,
102 bool is_message_owned)
103 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
104 SharedCtor(arena, is_message_owned);
105 // @@protoc_insertion_point(arena_constructor:fcp.client.http.HttpResourceMetadata)
106 }
HttpResourceMetadata(const HttpResourceMetadata & from)107 HttpResourceMetadata::HttpResourceMetadata(const HttpResourceMetadata& from)
108 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
109 HttpResourceMetadata* const _this = this; (void)_this;
110 new (&_impl_) Impl_{
111 decltype(_impl_.compression_format_){}
112 , /*decltype(_impl_._cached_size_)*/{}};
113
114 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
115 _this->_impl_.compression_format_ = from._impl_.compression_format_;
116 // @@protoc_insertion_point(copy_constructor:fcp.client.http.HttpResourceMetadata)
117 }
118
SharedCtor(::_pb::Arena * arena,bool is_message_owned)119 inline void HttpResourceMetadata::SharedCtor(
120 ::_pb::Arena* arena, bool is_message_owned) {
121 (void)arena;
122 (void)is_message_owned;
123 new (&_impl_) Impl_{
124 decltype(_impl_.compression_format_){0}
125 , /*decltype(_impl_._cached_size_)*/{}
126 };
127 }
128
~HttpResourceMetadata()129 HttpResourceMetadata::~HttpResourceMetadata() {
130 // @@protoc_insertion_point(destructor:fcp.client.http.HttpResourceMetadata)
131 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
132 (void)arena;
133 return;
134 }
135 SharedDtor();
136 }
137
SharedDtor()138 inline void HttpResourceMetadata::SharedDtor() {
139 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
140 }
141
SetCachedSize(int size) const142 void HttpResourceMetadata::SetCachedSize(int size) const {
143 _impl_._cached_size_.Set(size);
144 }
145
Clear()146 void HttpResourceMetadata::Clear() {
147 // @@protoc_insertion_point(message_clear_start:fcp.client.http.HttpResourceMetadata)
148 ::uint32_t cached_has_bits = 0;
149 // Prevent compiler warnings about cached_has_bits being unused
150 (void) cached_has_bits;
151
152 _impl_.compression_format_ = 0;
153 _internal_metadata_.Clear<std::string>();
154 }
155
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)156 const char* HttpResourceMetadata::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
157 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
158 while (!ctx->Done(&ptr)) {
159 ::uint32_t tag;
160 ptr = ::_pbi::ReadTag(ptr, &tag);
161 switch (tag >> 3) {
162 // .fcp.client.http.ResourceCompressionFormat compression_format = 1;
163 case 1:
164 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
165 ::uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
166 CHK_(ptr);
167 _internal_set_compression_format(static_cast<::fcp::client::http::ResourceCompressionFormat>(val));
168 } else {
169 goto handle_unusual;
170 }
171 continue;
172 default:
173 goto handle_unusual;
174 } // switch
175 handle_unusual:
176 if ((tag == 0) || ((tag & 7) == 4)) {
177 CHK_(ptr);
178 ctx->SetLastTag(tag);
179 goto message_done;
180 }
181 ptr = UnknownFieldParse(
182 tag,
183 _internal_metadata_.mutable_unknown_fields<std::string>(),
184 ptr, ctx);
185 CHK_(ptr != nullptr);
186 } // while
187 message_done:
188 return ptr;
189 failure:
190 ptr = nullptr;
191 goto message_done;
192 #undef CHK_
193 }
194
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const195 ::uint8_t* HttpResourceMetadata::_InternalSerialize(
196 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
197 // @@protoc_insertion_point(serialize_to_array_start:fcp.client.http.HttpResourceMetadata)
198 ::uint32_t cached_has_bits = 0;
199 (void) cached_has_bits;
200
201 // .fcp.client.http.ResourceCompressionFormat compression_format = 1;
202 if (this->_internal_compression_format() != 0) {
203 target = stream->EnsureSpace(target);
204 target = ::_pbi::WireFormatLite::WriteEnumToArray(
205 1, this->_internal_compression_format(), target);
206 }
207
208 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
209 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
210 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
211 }
212 // @@protoc_insertion_point(serialize_to_array_end:fcp.client.http.HttpResourceMetadata)
213 return target;
214 }
215
ByteSizeLong() const216 size_t HttpResourceMetadata::ByteSizeLong() const {
217 // @@protoc_insertion_point(message_byte_size_start:fcp.client.http.HttpResourceMetadata)
218 size_t total_size = 0;
219
220 ::uint32_t cached_has_bits = 0;
221 // Prevent compiler warnings about cached_has_bits being unused
222 (void) cached_has_bits;
223
224 // .fcp.client.http.ResourceCompressionFormat compression_format = 1;
225 if (this->_internal_compression_format() != 0) {
226 total_size += 1 +
227 ::_pbi::WireFormatLite::EnumSize(this->_internal_compression_format());
228 }
229
230 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
231 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
232 }
233 int cached_size = ::_pbi::ToCachedSize(total_size);
234 SetCachedSize(cached_size);
235 return total_size;
236 }
237
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)238 void HttpResourceMetadata::CheckTypeAndMergeFrom(
239 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
240 MergeFrom(*::_pbi::DownCast<const HttpResourceMetadata*>(
241 &from));
242 }
243
MergeFrom(const HttpResourceMetadata & from)244 void HttpResourceMetadata::MergeFrom(const HttpResourceMetadata& from) {
245 HttpResourceMetadata* const _this = this;
246 // @@protoc_insertion_point(class_specific_merge_from_start:fcp.client.http.HttpResourceMetadata)
247 GOOGLE_DCHECK_NE(&from, _this);
248 ::uint32_t cached_has_bits = 0;
249 (void) cached_has_bits;
250
251 if (from._internal_compression_format() != 0) {
252 _this->_internal_set_compression_format(from._internal_compression_format());
253 }
254 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
255 }
256
CopyFrom(const HttpResourceMetadata & from)257 void HttpResourceMetadata::CopyFrom(const HttpResourceMetadata& from) {
258 // @@protoc_insertion_point(class_specific_copy_from_start:fcp.client.http.HttpResourceMetadata)
259 if (&from == this) return;
260 Clear();
261 MergeFrom(from);
262 }
263
IsInitialized() const264 bool HttpResourceMetadata::IsInitialized() const {
265 return true;
266 }
267
InternalSwap(HttpResourceMetadata * other)268 void HttpResourceMetadata::InternalSwap(HttpResourceMetadata* other) {
269 using std::swap;
270 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
271 swap(_impl_.compression_format_, other->_impl_.compression_format_);
272 }
273
GetTypeName() const274 std::string HttpResourceMetadata::GetTypeName() const {
275 return "fcp.client.http.HttpResourceMetadata";
276 }
277
278
279 // @@protoc_insertion_point(namespace_scope)
280 } // namespace http
281 } // namespace client
282 } // namespace fcp
283 PROTOBUF_NAMESPACE_OPEN
284 template<> PROTOBUF_NOINLINE ::fcp::client::http::HttpResourceMetadata*
CreateMaybeMessage(Arena * arena)285 Arena::CreateMaybeMessage< ::fcp::client::http::HttpResourceMetadata >(Arena* arena) {
286 return Arena::CreateMessageInternal< ::fcp::client::http::HttpResourceMetadata >(arena);
287 }
288 PROTOBUF_NAMESPACE_CLOSE
289
290 // @@protoc_insertion_point(global_scope)
291 #include <google/protobuf/port_undef.inc>
292