1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: icing/proto/status.proto
3
4 #ifndef GOOGLE_PROTOBUF_INCLUDED_icing_2fproto_2fstatus_2eproto
5 #define GOOGLE_PROTOBUF_INCLUDED_icing_2fproto_2fstatus_2eproto
6
7 #include <cstdint>
8 #include <limits>
9 #include <string>
10
11 #include <google/protobuf/port_def.inc>
12 #if PROTOBUF_VERSION < 3021000
13 #error This file was generated by a newer version of protoc which is
14 #error incompatible with your Protocol Buffer headers. Please update
15 #error your headers.
16 #endif
17 #if 3021012 < PROTOBUF_MIN_PROTOC_VERSION
18 #error This file was generated by an older version of protoc which is
19 #error incompatible with your Protocol Buffer headers. Please
20 #error regenerate this file with a newer version of protoc.
21 #endif
22
23 #include <google/protobuf/port_undef.inc>
24 #include <google/protobuf/io/coded_stream.h>
25 #include <google/protobuf/arena.h>
26 #include <google/protobuf/arenastring.h>
27 #include <google/protobuf/generated_message_util.h>
28 #include <google/protobuf/metadata_lite.h>
29 #include <google/protobuf/message_lite.h>
30 #include <google/protobuf/repeated_field.h> // IWYU pragma: export
31 #include <google/protobuf/extension_set.h> // IWYU pragma: export
32 #include <google/protobuf/generated_enum_util.h>
33 // @@protoc_insertion_point(includes)
34 #include <google/protobuf/port_def.inc>
35 #define PROTOBUF_INTERNAL_EXPORT_icing_2fproto_2fstatus_2eproto
36 PROTOBUF_NAMESPACE_OPEN
37 namespace internal {
38 class AnyMetadata;
39 } // namespace internal
40 PROTOBUF_NAMESPACE_CLOSE
41
42 // Internal implementation detail -- do not use these members.
43 struct TableStruct_icing_2fproto_2fstatus_2eproto {
44 static const ::uint32_t offsets[];
45 };
46 namespace icing {
47 namespace lib {
48 class StatusProto;
49 struct StatusProtoDefaultTypeInternal;
50 extern StatusProtoDefaultTypeInternal _StatusProto_default_instance_;
51 } // namespace lib
52 } // namespace icing
53 PROTOBUF_NAMESPACE_OPEN
54 template<> ::icing::lib::StatusProto* Arena::CreateMaybeMessage<::icing::lib::StatusProto>(Arena*);
55 PROTOBUF_NAMESPACE_CLOSE
56 namespace icing {
57 namespace lib {
58
59 enum StatusProto_Code : int {
60 StatusProto_Code_UNKNOWN = 0,
61 StatusProto_Code_OK = 1,
62 StatusProto_Code_WARNING_DATA_LOSS = 2,
63 StatusProto_Code_INVALID_ARGUMENT = 3,
64 StatusProto_Code_NOT_FOUND = 4,
65 StatusProto_Code_FAILED_PRECONDITION = 5,
66 StatusProto_Code_ABORTED = 6,
67 StatusProto_Code_INTERNAL = 7,
68 StatusProto_Code_OUT_OF_SPACE = 8,
69 StatusProto_Code_ALREADY_EXISTS = 9
70 };
71 bool StatusProto_Code_IsValid(int value);
72 constexpr StatusProto_Code StatusProto_Code_Code_MIN = StatusProto_Code_UNKNOWN;
73 constexpr StatusProto_Code StatusProto_Code_Code_MAX = StatusProto_Code_ALREADY_EXISTS;
74 constexpr int StatusProto_Code_Code_ARRAYSIZE = StatusProto_Code_Code_MAX + 1;
75
76 const std::string& StatusProto_Code_Name(StatusProto_Code value);
77 template<typename T>
StatusProto_Code_Name(T enum_t_value)78 inline const std::string& StatusProto_Code_Name(T enum_t_value) {
79 static_assert(::std::is_same<T, StatusProto_Code>::value ||
80 ::std::is_integral<T>::value,
81 "Incorrect type passed to function StatusProto_Code_Name.");
82 return StatusProto_Code_Name(static_cast<StatusProto_Code>(enum_t_value));
83 }
84 bool StatusProto_Code_Parse(
85 ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, StatusProto_Code* value);
86 // ===================================================================
87
88 class StatusProto final :
89 public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:icing.lib.StatusProto) */ {
90 public:
StatusProto()91 inline StatusProto() : StatusProto(nullptr) {}
92 ~StatusProto() override;
93 explicit PROTOBUF_CONSTEXPR StatusProto(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
94
95 StatusProto(const StatusProto& from);
StatusProto(StatusProto && from)96 StatusProto(StatusProto&& from) noexcept
97 : StatusProto() {
98 *this = ::std::move(from);
99 }
100
101 inline StatusProto& operator=(const StatusProto& from) {
102 if (this == &from) return *this;
103 CopyFrom(from);
104 return *this;
105 }
106 inline StatusProto& operator=(StatusProto&& from) noexcept {
107 if (this == &from) return *this;
108 if (GetOwningArena() == from.GetOwningArena()
109 #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
110 && GetOwningArena() != nullptr
111 #endif // !PROTOBUF_FORCE_COPY_IN_MOVE
112 ) {
113 InternalSwap(&from);
114 } else {
115 CopyFrom(from);
116 }
117 return *this;
118 }
119
unknown_fields()120 inline const std::string& unknown_fields() const {
121 return _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString);
122 }
mutable_unknown_fields()123 inline std::string* mutable_unknown_fields() {
124 return _internal_metadata_.mutable_unknown_fields<std::string>();
125 }
126
default_instance()127 static const StatusProto& default_instance() {
128 return *internal_default_instance();
129 }
internal_default_instance()130 static inline const StatusProto* internal_default_instance() {
131 return reinterpret_cast<const StatusProto*>(
132 &_StatusProto_default_instance_);
133 }
134 static constexpr int kIndexInFileMessages =
135 0;
136
swap(StatusProto & a,StatusProto & b)137 friend void swap(StatusProto& a, StatusProto& b) {
138 a.Swap(&b);
139 }
Swap(StatusProto * other)140 inline void Swap(StatusProto* other) {
141 if (other == this) return;
142 #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
143 if (GetOwningArena() != nullptr &&
144 GetOwningArena() == other->GetOwningArena()) {
145 #else // PROTOBUF_FORCE_COPY_IN_SWAP
146 if (GetOwningArena() == other->GetOwningArena()) {
147 #endif // !PROTOBUF_FORCE_COPY_IN_SWAP
148 InternalSwap(other);
149 } else {
150 ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
151 }
152 }
153 void UnsafeArenaSwap(StatusProto* other) {
154 if (other == this) return;
155 GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
156 InternalSwap(other);
157 }
158
159 // implements Message ----------------------------------------------
160
161 StatusProto* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final {
162 return CreateMaybeMessage<StatusProto>(arena);
163 }
164 StatusProto* New() const {
165 return New(nullptr);
166 }
167 void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final;
168 void CopyFrom(const StatusProto& from);
169 void MergeFrom(const StatusProto& from);
170 PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
171 bool IsInitialized() const final;
172
173 size_t ByteSizeLong() const final;
174 const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
175 ::uint8_t* _InternalSerialize(
176 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
177 int GetCachedSize() const final { return _impl_._cached_size_.Get(); }
178
179 private:
180 void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned);
181 void SharedDtor();
182 void SetCachedSize(int size) const;
183 void InternalSwap(StatusProto* other);
184
185 private:
186 friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
187 static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
188 return "icing.lib.StatusProto";
189 }
190 protected:
191 explicit StatusProto(::PROTOBUF_NAMESPACE_ID::Arena* arena,
192 bool is_message_owned = false);
193 public:
194
195 std::string GetTypeName() const final;
196
197 // nested types ----------------------------------------------------
198
199 typedef StatusProto_Code Code;
200 static constexpr Code UNKNOWN =
201 StatusProto_Code_UNKNOWN;
202 static constexpr Code OK =
203 StatusProto_Code_OK;
204 static constexpr Code WARNING_DATA_LOSS =
205 StatusProto_Code_WARNING_DATA_LOSS;
206 static constexpr Code INVALID_ARGUMENT =
207 StatusProto_Code_INVALID_ARGUMENT;
208 static constexpr Code NOT_FOUND =
209 StatusProto_Code_NOT_FOUND;
210 static constexpr Code FAILED_PRECONDITION =
211 StatusProto_Code_FAILED_PRECONDITION;
212 static constexpr Code ABORTED =
213 StatusProto_Code_ABORTED;
214 static constexpr Code INTERNAL =
215 StatusProto_Code_INTERNAL;
216 static constexpr Code OUT_OF_SPACE =
217 StatusProto_Code_OUT_OF_SPACE;
218 static constexpr Code ALREADY_EXISTS =
219 StatusProto_Code_ALREADY_EXISTS;
220 static inline bool Code_IsValid(int value) {
221 return StatusProto_Code_IsValid(value);
222 }
223 static constexpr Code Code_MIN =
224 StatusProto_Code_Code_MIN;
225 static constexpr Code Code_MAX =
226 StatusProto_Code_Code_MAX;
227 static constexpr int Code_ARRAYSIZE =
228 StatusProto_Code_Code_ARRAYSIZE;
229 template<typename T>
230 static inline const std::string& Code_Name(T enum_t_value) {
231 static_assert(::std::is_same<T, Code>::value ||
232 ::std::is_integral<T>::value,
233 "Incorrect type passed to function Code_Name.");
234 return StatusProto_Code_Name(enum_t_value);
235 }
236 static inline bool Code_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,
237 Code* value) {
238 return StatusProto_Code_Parse(name, value);
239 }
240
241 // accessors -------------------------------------------------------
242
243 enum : int {
244 kMessageFieldNumber = 2,
245 kCodeFieldNumber = 1,
246 };
247 // optional string message = 2;
248 bool has_message() const;
249 private:
250 bool _internal_has_message() const;
251 public:
252 void clear_message();
253 const std::string& message() const;
254 template <typename ArgT0 = const std::string&, typename... ArgT>
255 void set_message(ArgT0&& arg0, ArgT... args);
256 std::string* mutable_message();
257 PROTOBUF_NODISCARD std::string* release_message();
258 void set_allocated_message(std::string* message);
259 private:
260 const std::string& _internal_message() const;
261 inline PROTOBUF_ALWAYS_INLINE void _internal_set_message(const std::string& value);
262 std::string* _internal_mutable_message();
263 public:
264
265 // optional .icing.lib.StatusProto.Code code = 1;
266 bool has_code() const;
267 private:
268 bool _internal_has_code() const;
269 public:
270 void clear_code();
271 ::icing::lib::StatusProto_Code code() const;
272 void set_code(::icing::lib::StatusProto_Code value);
273 private:
274 ::icing::lib::StatusProto_Code _internal_code() const;
275 void _internal_set_code(::icing::lib::StatusProto_Code value);
276 public:
277
278 // @@protoc_insertion_point(class_scope:icing.lib.StatusProto)
279 private:
280 class _Internal;
281
282 template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
283 typedef void InternalArenaConstructable_;
284 typedef void DestructorSkippable_;
285 struct Impl_ {
286 ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
287 mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
288 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr message_;
289 int code_;
290 };
291 union { Impl_ _impl_; };
292 friend struct ::TableStruct_icing_2fproto_2fstatus_2eproto;
293 };
294 // ===================================================================
295
296
297 // ===================================================================
298
299 #ifdef __GNUC__
300 #pragma GCC diagnostic push
301 #pragma GCC diagnostic ignored "-Wstrict-aliasing"
302 #endif // __GNUC__
303 // StatusProto
304
305 // optional .icing.lib.StatusProto.Code code = 1;
_internal_has_code()306 inline bool StatusProto::_internal_has_code() const {
307 bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0;
308 return value;
309 }
has_code()310 inline bool StatusProto::has_code() const {
311 return _internal_has_code();
312 }
clear_code()313 inline void StatusProto::clear_code() {
314 _impl_.code_ = 0;
315 _impl_._has_bits_[0] &= ~0x00000002u;
316 }
_internal_code()317 inline ::icing::lib::StatusProto_Code StatusProto::_internal_code() const {
318 return static_cast< ::icing::lib::StatusProto_Code >(_impl_.code_);
319 }
code()320 inline ::icing::lib::StatusProto_Code StatusProto::code() const {
321 // @@protoc_insertion_point(field_get:icing.lib.StatusProto.code)
322 return _internal_code();
323 }
_internal_set_code(::icing::lib::StatusProto_Code value)324 inline void StatusProto::_internal_set_code(::icing::lib::StatusProto_Code value) {
325 assert(::icing::lib::StatusProto_Code_IsValid(value));
326 _impl_._has_bits_[0] |= 0x00000002u;
327 _impl_.code_ = value;
328 }
set_code(::icing::lib::StatusProto_Code value)329 inline void StatusProto::set_code(::icing::lib::StatusProto_Code value) {
330 _internal_set_code(value);
331 // @@protoc_insertion_point(field_set:icing.lib.StatusProto.code)
332 }
333
334 // optional string message = 2;
_internal_has_message()335 inline bool StatusProto::_internal_has_message() const {
336 bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0;
337 return value;
338 }
has_message()339 inline bool StatusProto::has_message() const {
340 return _internal_has_message();
341 }
clear_message()342 inline void StatusProto::clear_message() {
343 _impl_.message_.ClearToEmpty();
344 _impl_._has_bits_[0] &= ~0x00000001u;
345 }
message()346 inline const std::string& StatusProto::message() const {
347 // @@protoc_insertion_point(field_get:icing.lib.StatusProto.message)
348 return _internal_message();
349 }
350 template <typename ArgT0, typename... ArgT>
351 inline PROTOBUF_ALWAYS_INLINE
set_message(ArgT0 && arg0,ArgT...args)352 void StatusProto::set_message(ArgT0&& arg0, ArgT... args) {
353 _impl_._has_bits_[0] |= 0x00000001u;
354 _impl_.message_.Set(static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
355 // @@protoc_insertion_point(field_set:icing.lib.StatusProto.message)
356 }
mutable_message()357 inline std::string* StatusProto::mutable_message() {
358 std::string* _s = _internal_mutable_message();
359 // @@protoc_insertion_point(field_mutable:icing.lib.StatusProto.message)
360 return _s;
361 }
_internal_message()362 inline const std::string& StatusProto::_internal_message() const {
363 return _impl_.message_.Get();
364 }
_internal_set_message(const std::string & value)365 inline void StatusProto::_internal_set_message(const std::string& value) {
366 _impl_._has_bits_[0] |= 0x00000001u;
367 _impl_.message_.Set(value, GetArenaForAllocation());
368 }
_internal_mutable_message()369 inline std::string* StatusProto::_internal_mutable_message() {
370 _impl_._has_bits_[0] |= 0x00000001u;
371 return _impl_.message_.Mutable(GetArenaForAllocation());
372 }
release_message()373 inline std::string* StatusProto::release_message() {
374 // @@protoc_insertion_point(field_release:icing.lib.StatusProto.message)
375 if (!_internal_has_message()) {
376 return nullptr;
377 }
378 _impl_._has_bits_[0] &= ~0x00000001u;
379 auto* p = _impl_.message_.Release();
380 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
381 if (_impl_.message_.IsDefault()) {
382 _impl_.message_.Set("", GetArenaForAllocation());
383 }
384 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
385 return p;
386 }
set_allocated_message(std::string * message)387 inline void StatusProto::set_allocated_message(std::string* message) {
388 if (message != nullptr) {
389 _impl_._has_bits_[0] |= 0x00000001u;
390 } else {
391 _impl_._has_bits_[0] &= ~0x00000001u;
392 }
393 _impl_.message_.SetAllocated(message, GetArenaForAllocation());
394 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
395 if (_impl_.message_.IsDefault()) {
396 _impl_.message_.Set("", GetArenaForAllocation());
397 }
398 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
399 // @@protoc_insertion_point(field_set_allocated:icing.lib.StatusProto.message)
400 }
401
402 #ifdef __GNUC__
403 #pragma GCC diagnostic pop
404 #endif // __GNUC__
405
406 // @@protoc_insertion_point(namespace_scope)
407
408 } // namespace lib
409 } // namespace icing
410
411 PROTOBUF_NAMESPACE_OPEN
412
413 template <> struct is_proto_enum< ::icing::lib::StatusProto_Code> : ::std::true_type {};
414
415 PROTOBUF_NAMESPACE_CLOSE
416
417 // @@protoc_insertion_point(global_scope)
418
419 #include <google/protobuf/port_undef.inc>
420 #endif // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_icing_2fproto_2fstatus_2eproto
421