Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(949)

Side by Side Diff: third_party/protobuf/src/google/protobuf/field_mask.pb.cc

Issue 1842653006: Update //third_party/protobuf to version 3. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update README.chromium Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: google/protobuf/field_mask.proto
3
4 #define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION
5 #include <google/protobuf/field_mask.pb.h>
6
7 #include <algorithm>
8
9 #include <google/protobuf/stubs/common.h>
10 #include <google/protobuf/stubs/port.h>
11 #include <google/protobuf/stubs/once.h>
12 #include <google/protobuf/io/coded_stream.h>
13 #include <google/protobuf/wire_format_lite_inl.h>
14 #include <google/protobuf/descriptor.h>
15 #include <google/protobuf/generated_message_reflection.h>
16 #include <google/protobuf/reflection_ops.h>
17 #include <google/protobuf/wire_format.h>
18 // @@protoc_insertion_point(includes)
19
20 namespace google {
21 namespace protobuf {
22
23 namespace {
24
25 const ::google::protobuf::Descriptor* FieldMask_descriptor_ = NULL;
26 const ::google::protobuf::internal::GeneratedMessageReflection*
27 FieldMask_reflection_ = NULL;
28
29 } // namespace
30
31
32 void protobuf_AssignDesc_google_2fprotobuf_2ffield_5fmask_2eproto() {
33 protobuf_AddDesc_google_2fprotobuf_2ffield_5fmask_2eproto();
34 const ::google::protobuf::FileDescriptor* file =
35 ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName(
36 "google/protobuf/field_mask.proto");
37 GOOGLE_CHECK(file != NULL);
38 FieldMask_descriptor_ = file->message_type(0);
39 static const int FieldMask_offsets_[1] = {
40 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldMask, paths_),
41 };
42 FieldMask_reflection_ =
43 ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessag eReflection(
44 FieldMask_descriptor_,
45 FieldMask::default_instance_,
46 FieldMask_offsets_,
47 -1,
48 -1,
49 -1,
50 sizeof(FieldMask),
51 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldMask, _internal_metada ta_),
52 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldMask, _is_default_inst ance_));
53 }
54
55 namespace {
56
57 GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_);
58 inline void protobuf_AssignDescriptorsOnce() {
59 ::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_,
60 &protobuf_AssignDesc_google_2fprotobuf_2ffield_5fmask_2eproto);
61 }
62
63 void protobuf_RegisterTypes(const ::std::string&) {
64 protobuf_AssignDescriptorsOnce();
65 ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
66 FieldMask_descriptor_, &FieldMask::default_instance());
67 }
68
69 } // namespace
70
71 void protobuf_ShutdownFile_google_2fprotobuf_2ffield_5fmask_2eproto() {
72 delete FieldMask::default_instance_;
73 delete FieldMask_reflection_;
74 }
75
76 void protobuf_AddDesc_google_2fprotobuf_2ffield_5fmask_2eproto() {
77 static bool already_here = false;
78 if (already_here) return;
79 already_here = true;
80 GOOGLE_PROTOBUF_VERIFY_VERSION;
81
82 ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
83 "\n google/protobuf/field_mask.proto\022\017goog"
84 "le.protobuf\"\032\n\tFieldMask\022\r\n\005paths\030\001 \003(\tB"
85 "Q\n\023com.google.protobufB\016FieldMaskProtoP\001"
86 "\240\001\001\242\002\003GPB\252\002\036Google.Protobuf.WellKnownTyp"
87 "esb\006proto3", 170);
88 ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
89 "google/protobuf/field_mask.proto", &protobuf_RegisterTypes);
90 FieldMask::default_instance_ = new FieldMask();
91 FieldMask::default_instance_->InitAsDefaultInstance();
92 ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_google_2fproto buf_2ffield_5fmask_2eproto);
93 }
94
95 // Force AddDescriptors() to be called at static initialization time.
96 struct StaticDescriptorInitializer_google_2fprotobuf_2ffield_5fmask_2eproto {
97 StaticDescriptorInitializer_google_2fprotobuf_2ffield_5fmask_2eproto() {
98 protobuf_AddDesc_google_2fprotobuf_2ffield_5fmask_2eproto();
99 }
100 } static_descriptor_initializer_google_2fprotobuf_2ffield_5fmask_2eproto_;
101
102 namespace {
103
104 static void MergeFromFail(int line) GOOGLE_ATTRIBUTE_COLD;
105 static void MergeFromFail(int line) {
106 GOOGLE_CHECK(false) << __FILE__ << ":" << line;
107 }
108
109 } // namespace
110
111
112 // ===================================================================
113
114 #if !defined(_MSC_VER) || _MSC_VER >= 1900
115 const int FieldMask::kPathsFieldNumber;
116 #endif // !defined(_MSC_VER) || _MSC_VER >= 1900
117
118 FieldMask::FieldMask()
119 : ::google::protobuf::Message(), _internal_metadata_(NULL) {
120 SharedCtor();
121 // @@protoc_insertion_point(constructor:google.protobuf.FieldMask)
122 }
123
124 void FieldMask::InitAsDefaultInstance() {
125 _is_default_instance_ = true;
126 }
127
128 FieldMask::FieldMask(const FieldMask& from)
129 : ::google::protobuf::Message(),
130 _internal_metadata_(NULL) {
131 SharedCtor();
132 MergeFrom(from);
133 // @@protoc_insertion_point(copy_constructor:google.protobuf.FieldMask)
134 }
135
136 void FieldMask::SharedCtor() {
137 _is_default_instance_ = false;
138 ::google::protobuf::internal::GetEmptyString();
139 _cached_size_ = 0;
140 }
141
142 FieldMask::~FieldMask() {
143 // @@protoc_insertion_point(destructor:google.protobuf.FieldMask)
144 SharedDtor();
145 }
146
147 void FieldMask::SharedDtor() {
148 if (this != default_instance_) {
149 }
150 }
151
152 void FieldMask::SetCachedSize(int size) const {
153 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
154 _cached_size_ = size;
155 GOOGLE_SAFE_CONCURRENT_WRITES_END();
156 }
157 const ::google::protobuf::Descriptor* FieldMask::descriptor() {
158 protobuf_AssignDescriptorsOnce();
159 return FieldMask_descriptor_;
160 }
161
162 const FieldMask& FieldMask::default_instance() {
163 if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2ffield_5fma sk_2eproto();
164 return *default_instance_;
165 }
166
167 FieldMask* FieldMask::default_instance_ = NULL;
168
169 FieldMask* FieldMask::New(::google::protobuf::Arena* arena) const {
170 FieldMask* n = new FieldMask;
171 if (arena != NULL) {
172 arena->Own(n);
173 }
174 return n;
175 }
176
177 void FieldMask::Clear() {
178 paths_.Clear();
179 }
180
181 bool FieldMask::MergePartialFromCodedStream(
182 ::google::protobuf::io::CodedInputStream* input) {
183 #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
184 ::google::protobuf::uint32 tag;
185 // @@protoc_insertion_point(parse_start:google.protobuf.FieldMask)
186 for (;;) {
187 ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff( 127);
188 tag = p.first;
189 if (!p.second) goto handle_unusual;
190 switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag) ) {
191 // repeated string paths = 1;
192 case 1: {
193 if (tag == 10) {
194 parse_paths:
195 DO_(::google::protobuf::internal::WireFormatLite::ReadString(
196 input, this->add_paths()));
197 DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
198 this->paths(this->paths_size() - 1).data(),
199 this->paths(this->paths_size() - 1).length(),
200 ::google::protobuf::internal::WireFormatLite::PARSE,
201 "google.protobuf.FieldMask.paths"));
202 } else {
203 goto handle_unusual;
204 }
205 if (input->ExpectTag(10)) goto parse_paths;
206 if (input->ExpectAtEnd()) goto success;
207 break;
208 }
209
210 default: {
211 handle_unusual:
212 if (tag == 0 ||
213 ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
214 ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
215 goto success;
216 }
217 DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag)) ;
218 break;
219 }
220 }
221 }
222 success:
223 // @@protoc_insertion_point(parse_success:google.protobuf.FieldMask)
224 return true;
225 failure:
226 // @@protoc_insertion_point(parse_failure:google.protobuf.FieldMask)
227 return false;
228 #undef DO_
229 }
230
231 void FieldMask::SerializeWithCachedSizes(
232 ::google::protobuf::io::CodedOutputStream* output) const {
233 // @@protoc_insertion_point(serialize_start:google.protobuf.FieldMask)
234 // repeated string paths = 1;
235 for (int i = 0; i < this->paths_size(); i++) {
236 ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
237 this->paths(i).data(), this->paths(i).length(),
238 ::google::protobuf::internal::WireFormatLite::SERIALIZE,
239 "google.protobuf.FieldMask.paths");
240 ::google::protobuf::internal::WireFormatLite::WriteString(
241 1, this->paths(i), output);
242 }
243
244 // @@protoc_insertion_point(serialize_end:google.protobuf.FieldMask)
245 }
246
247 ::google::protobuf::uint8* FieldMask::SerializeWithCachedSizesToArray(
248 ::google::protobuf::uint8* target) const {
249 // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.FieldMask )
250 // repeated string paths = 1;
251 for (int i = 0; i < this->paths_size(); i++) {
252 ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
253 this->paths(i).data(), this->paths(i).length(),
254 ::google::protobuf::internal::WireFormatLite::SERIALIZE,
255 "google.protobuf.FieldMask.paths");
256 target = ::google::protobuf::internal::WireFormatLite::
257 WriteStringToArray(1, this->paths(i), target);
258 }
259
260 // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.FieldMask)
261 return target;
262 }
263
264 int FieldMask::ByteSize() const {
265 int total_size = 0;
266
267 // repeated string paths = 1;
268 total_size += 1 * this->paths_size();
269 for (int i = 0; i < this->paths_size(); i++) {
270 total_size += ::google::protobuf::internal::WireFormatLite::StringSize(
271 this->paths(i));
272 }
273
274 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
275 _cached_size_ = total_size;
276 GOOGLE_SAFE_CONCURRENT_WRITES_END();
277 return total_size;
278 }
279
280 void FieldMask::MergeFrom(const ::google::protobuf::Message& from) {
281 if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__);
282 const FieldMask* source =
283 ::google::protobuf::internal::DynamicCastToGenerated<const FieldMask>(
284 &from);
285 if (source == NULL) {
286 ::google::protobuf::internal::ReflectionOps::Merge(from, this);
287 } else {
288 MergeFrom(*source);
289 }
290 }
291
292 void FieldMask::MergeFrom(const FieldMask& from) {
293 if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__);
294 paths_.MergeFrom(from.paths_);
295 }
296
297 void FieldMask::CopyFrom(const ::google::protobuf::Message& from) {
298 if (&from == this) return;
299 Clear();
300 MergeFrom(from);
301 }
302
303 void FieldMask::CopyFrom(const FieldMask& from) {
304 if (&from == this) return;
305 Clear();
306 MergeFrom(from);
307 }
308
309 bool FieldMask::IsInitialized() const {
310
311 return true;
312 }
313
314 void FieldMask::Swap(FieldMask* other) {
315 if (other == this) return;
316 InternalSwap(other);
317 }
318 void FieldMask::InternalSwap(FieldMask* other) {
319 paths_.UnsafeArenaSwap(&other->paths_);
320 _internal_metadata_.Swap(&other->_internal_metadata_);
321 std::swap(_cached_size_, other->_cached_size_);
322 }
323
324 ::google::protobuf::Metadata FieldMask::GetMetadata() const {
325 protobuf_AssignDescriptorsOnce();
326 ::google::protobuf::Metadata metadata;
327 metadata.descriptor = FieldMask_descriptor_;
328 metadata.reflection = FieldMask_reflection_;
329 return metadata;
330 }
331
332 #if PROTOBUF_INLINE_NOT_IN_HEADERS
333 // FieldMask
334
335 // repeated string paths = 1;
336 int FieldMask::paths_size() const {
337 return paths_.size();
338 }
339 void FieldMask::clear_paths() {
340 paths_.Clear();
341 }
342 const ::std::string& FieldMask::paths(int index) const {
343 // @@protoc_insertion_point(field_get:google.protobuf.FieldMask.paths)
344 return paths_.Get(index);
345 }
346 ::std::string* FieldMask::mutable_paths(int index) {
347 // @@protoc_insertion_point(field_mutable:google.protobuf.FieldMask.paths)
348 return paths_.Mutable(index);
349 }
350 void FieldMask::set_paths(int index, const ::std::string& value) {
351 // @@protoc_insertion_point(field_set:google.protobuf.FieldMask.paths)
352 paths_.Mutable(index)->assign(value);
353 }
354 void FieldMask::set_paths(int index, const char* value) {
355 paths_.Mutable(index)->assign(value);
356 // @@protoc_insertion_point(field_set_char:google.protobuf.FieldMask.paths)
357 }
358 void FieldMask::set_paths(int index, const char* value, size_t size) {
359 paths_.Mutable(index)->assign(
360 reinterpret_cast<const char*>(value), size);
361 // @@protoc_insertion_point(field_set_pointer:google.protobuf.FieldMask.paths)
362 }
363 ::std::string* FieldMask::add_paths() {
364 return paths_.Add();
365 }
366 void FieldMask::add_paths(const ::std::string& value) {
367 paths_.Add()->assign(value);
368 // @@protoc_insertion_point(field_add:google.protobuf.FieldMask.paths)
369 }
370 void FieldMask::add_paths(const char* value) {
371 paths_.Add()->assign(value);
372 // @@protoc_insertion_point(field_add_char:google.protobuf.FieldMask.paths)
373 }
374 void FieldMask::add_paths(const char* value, size_t size) {
375 paths_.Add()->assign(reinterpret_cast<const char*>(value), size);
376 // @@protoc_insertion_point(field_add_pointer:google.protobuf.FieldMask.paths)
377 }
378 const ::google::protobuf::RepeatedPtrField< ::std::string>&
379 FieldMask::paths() const {
380 // @@protoc_insertion_point(field_list:google.protobuf.FieldMask.paths)
381 return paths_;
382 }
383 ::google::protobuf::RepeatedPtrField< ::std::string>*
384 FieldMask::mutable_paths() {
385 // @@protoc_insertion_point(field_mutable_list:google.protobuf.FieldMask.paths )
386 return &paths_;
387 }
388
389 #endif // PROTOBUF_INLINE_NOT_IN_HEADERS
390
391 // @@protoc_insertion_point(namespace_scope)
392
393 } // namespace protobuf
394 } // namespace google
395
396 // @@protoc_insertion_point(global_scope)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698