wire_format_lite.h
Go to the documentation of this file.
1 // Protocol Buffers - Google's data interchange format
2 // Copyright 2008 Google Inc. All rights reserved.
3 // https://developers.google.com/protocol-buffers/
4 //
5 // Redistribution and use in source and binary forms, with or without
6 // modification, are permitted provided that the following conditions are
7 // met:
8 //
9 // * Redistributions of source code must retain the above copyright
10 // notice, this list of conditions and the following disclaimer.
11 // * Redistributions in binary form must reproduce the above
12 // copyright notice, this list of conditions and the following disclaimer
13 // in the documentation and/or other materials provided with the
14 // distribution.
15 // * Neither the name of Google Inc. nor the names of its
16 // contributors may be used to endorse or promote products derived from
17 // this software without specific prior written permission.
18 //
19 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 
31 // Author: kenton@google.com (Kenton Varda)
32 // atenasio@google.com (Chris Atenasio) (ZigZag transform)
33 // wink@google.com (Wink Saville) (refactored from wire_format.h)
34 // Based on original Protocol Buffers design by
35 // Sanjay Ghemawat, Jeff Dean, and others.
36 //
37 // This header is logically internal, but is made public because it is used
38 // from protocol-compiler-generated code, which may reside in other components.
39 
40 #ifndef GOOGLE_PROTOBUF_WIRE_FORMAT_LITE_H__
41 #define GOOGLE_PROTOBUF_WIRE_FORMAT_LITE_H__
42 
43 #include <string>
44 
50 #include <google/protobuf/port.h>
52 
53 // Do UTF-8 validation on string type in Debug build only
54 #ifndef NDEBUG
55 #define GOOGLE_PROTOBUF_UTF8_VALIDATION_ENABLED
56 #endif
57 
58 // Avoid conflict with iOS where <ConditionalMacros.h> #defines TYPE_BOOL.
59 //
60 // If some one needs the macro TYPE_BOOL in a file that includes this header,
61 // it's possible to bring it back using push/pop_macro as follows.
62 //
63 // #pragma push_macro("TYPE_BOOL")
64 // #include this header and/or all headers that need the macro to be undefined.
65 // #pragma pop_macro("TYPE_BOOL")
66 #undef TYPE_BOOL
67 
68 
69 namespace google {
70 namespace protobuf {
71 namespace internal {
72 
73 #include <google/protobuf/port_def.inc>
74 
75 // This class is for internal use by the protocol buffer library and by
76 // protocol-complier-generated message classes. It must not be called
77 // directly by clients.
78 //
79 // This class contains helpers for implementing the binary protocol buffer
80 // wire format without the need for reflection. Use WireFormat when using
81 // reflection.
82 //
83 // This class is really a namespace that contains only static methods.
84 class PROTOBUF_EXPORT WireFormatLite {
85  public:
86  // -----------------------------------------------------------------
87  // Helper constants and functions related to the format. These are
88  // mostly meant for internal and generated code to use.
89 
90  // The wire format is composed of a sequence of tag/value pairs, each
91  // of which contains the value of one field (or one element of a repeated
92  // field). Each tag is encoded as a varint. The lower bits of the tag
93  // identify its wire type, which specifies the format of the data to follow.
94  // The rest of the bits contain the field number. Each type of field (as
95  // declared by FieldDescriptor::Type, in descriptor.h) maps to one of
96  // these wire types. Immediately following each tag is the field's value,
97  // encoded in the format specified by the wire type. Because the tag
98  // identifies the encoding of this data, it is possible to skip
99  // unrecognized fields for forwards compatibility.
100 
101  enum WireType {
108  };
109 
110  // Lite alternative to FieldDescriptor::Type. Must be kept in sync.
111  enum FieldType {
112  TYPE_DOUBLE = 1,
113  TYPE_FLOAT = 2,
114  TYPE_INT64 = 3,
115  TYPE_UINT64 = 4,
116  TYPE_INT32 = 5,
117  TYPE_FIXED64 = 6,
118  TYPE_FIXED32 = 7,
119  TYPE_BOOL = 8,
120  TYPE_STRING = 9,
121  TYPE_GROUP = 10,
122  TYPE_MESSAGE = 11,
123  TYPE_BYTES = 12,
124  TYPE_UINT32 = 13,
125  TYPE_ENUM = 14,
126  TYPE_SFIXED32 = 15,
127  TYPE_SFIXED64 = 16,
128  TYPE_SINT32 = 17,
129  TYPE_SINT64 = 18,
130  MAX_FIELD_TYPE = 18,
131  };
132 
133  // Lite alternative to FieldDescriptor::CppType. Must be kept in sync.
134  enum CppType {
135  CPPTYPE_INT32 = 1,
136  CPPTYPE_INT64 = 2,
137  CPPTYPE_UINT32 = 3,
138  CPPTYPE_UINT64 = 4,
139  CPPTYPE_DOUBLE = 5,
140  CPPTYPE_FLOAT = 6,
141  CPPTYPE_BOOL = 7,
142  CPPTYPE_ENUM = 8,
143  CPPTYPE_STRING = 9,
144  CPPTYPE_MESSAGE = 10,
145  MAX_CPPTYPE = 10,
146  };
147 
148  // Helper method to get the CppType for a particular Type.
149  static CppType FieldTypeToCppType(FieldType type);
150 
151  // Given a FieldDescriptor::Type return its WireType
154  return kWireTypeForFieldType[type];
155  }
156 
157  // Number of bits in a tag which identify the wire type.
158  static const int kTagTypeBits = 3;
159  // Mask for those bits.
160  static const uint32 kTagTypeMask = (1 << kTagTypeBits) - 1;
161 
162  // Helper functions for encoding and decoding tags. (Inlined below and in
163  // _inl.h)
164  //
165  // This is different from MakeTag(field->number(), field->type()) in the
166  // case of packed repeated fields.
167  constexpr static uint32 MakeTag(int field_number, WireType type);
168  static WireType GetTagWireType(uint32 tag);
169  static int GetTagFieldNumber(uint32 tag);
170 
171  // Compute the byte size of a tag. For groups, this includes both the start
172  // and end tags.
173  static inline size_t TagSize(int field_number,
175 
176  // Skips a field value with the given tag. The input should start
177  // positioned immediately after the tag. Skipped values are simply
178  // discarded, not recorded anywhere. See WireFormat::SkipField() for a
179  // version that records to an UnknownFieldSet.
180  static bool SkipField(io::CodedInputStream* input, uint32 tag);
181 
182  // Skips a field value with the given tag. The input should start
183  // positioned immediately after the tag. Skipped values are recorded to a
184  // CodedOutputStream.
185  static bool SkipField(io::CodedInputStream* input, uint32 tag,
187 
188  // Reads and ignores a message from the input. Skipped values are simply
189  // discarded, not recorded anywhere. See WireFormat::SkipMessage() for a
190  // version that records to an UnknownFieldSet.
191  static bool SkipMessage(io::CodedInputStream* input);
192 
193  // Reads and ignores a message from the input. Skipped values are recorded
194  // to a CodedOutputStream.
195  static bool SkipMessage(io::CodedInputStream* input,
197 
198  // This macro does the same thing as WireFormatLite::MakeTag(), but the
199  // result is usable as a compile-time constant, which makes it usable
200  // as a switch case or a template input. WireFormatLite::MakeTag() is more
201  // type-safe, though, so prefer it if possible.
202 #define GOOGLE_PROTOBUF_WIRE_FORMAT_MAKE_TAG(FIELD_NUMBER, TYPE) \
203  static_cast<uint32>((static_cast<uint32>(FIELD_NUMBER) << 3) | (TYPE))
204 
205  // These are the tags for the old MessageSet format, which was defined as:
206  // message MessageSet {
207  // repeated group Item = 1 {
208  // required int32 type_id = 2;
209  // required string message = 3;
210  // }
211  // }
212  static const int kMessageSetItemNumber = 1;
213  static const int kMessageSetTypeIdNumber = 2;
214  static const int kMessageSetMessageNumber = 3;
215  static const int kMessageSetItemStartTag = GOOGLE_PROTOBUF_WIRE_FORMAT_MAKE_TAG(
216  kMessageSetItemNumber, WireFormatLite::WIRETYPE_START_GROUP);
217  static const int kMessageSetItemEndTag = GOOGLE_PROTOBUF_WIRE_FORMAT_MAKE_TAG(
218  kMessageSetItemNumber, WireFormatLite::WIRETYPE_END_GROUP);
219  static const int kMessageSetTypeIdTag = GOOGLE_PROTOBUF_WIRE_FORMAT_MAKE_TAG(
220  kMessageSetTypeIdNumber, WireFormatLite::WIRETYPE_VARINT);
221  static const int kMessageSetMessageTag = GOOGLE_PROTOBUF_WIRE_FORMAT_MAKE_TAG(
222  kMessageSetMessageNumber, WireFormatLite::WIRETYPE_LENGTH_DELIMITED);
223 
224  // Byte size of all tags of a MessageSet::Item combined.
225  static const size_t kMessageSetItemTagsSize;
226 
227  // Helper functions for converting between floats/doubles and IEEE-754
228  // uint32s/uint64s so that they can be written. (Assumes your platform
229  // uses IEEE-754 floats.)
230  static uint32 EncodeFloat(float value);
231  static float DecodeFloat(uint32 value);
232  static uint64 EncodeDouble(double value);
233  static double DecodeDouble(uint64 value);
234 
235  // Helper functions for mapping signed integers to unsigned integers in
236  // such a way that numbers with small magnitudes will encode to smaller
237  // varints. If you simply static_cast a negative number to an unsigned
238  // number and varint-encode it, it will always take 10 bytes, defeating
239  // the purpose of varint. So, for the "sint32" and "sint64" field types,
240  // we ZigZag-encode the values.
241  static uint32 ZigZagEncode32(int32 n);
242  static int32 ZigZagDecode32(uint32 n);
243  static uint64 ZigZagEncode64(int64 n);
244  static int64 ZigZagDecode64(uint64 n);
245 
246  // =================================================================
247  // Methods for reading/writing individual field.
248 
249  // Read fields, not including tags. The assumption is that you already
250  // read the tag to determine what field to read.
251 
252  // For primitive fields, we just use a templatized routine parameterized by
253  // the represented type and the FieldType. These are specialized with the
254  // appropriate definition for each declared type.
255  template <typename CType, enum FieldType DeclaredType>
256  PROTOBUF_ALWAYS_INLINE static bool ReadPrimitive(io::CodedInputStream* input,
257  CType* value);
258 
259  // Reads repeated primitive values, with optimizations for repeats.
260  // tag_size and tag should both be compile-time constants provided by the
261  // protocol compiler.
262  template <typename CType, enum FieldType DeclaredType>
263  PROTOBUF_ALWAYS_INLINE static bool ReadRepeatedPrimitive(
264  int tag_size, uint32 tag, io::CodedInputStream* input,
266 
267  // Identical to ReadRepeatedPrimitive, except will not inline the
268  // implementation.
269  template <typename CType, enum FieldType DeclaredType>
270  static bool ReadRepeatedPrimitiveNoInline(int tag_size, uint32 tag,
273 
274  // Reads a primitive value directly from the provided buffer. It returns a
275  // pointer past the segment of data that was read.
276  //
277  // This is only implemented for the types with fixed wire size, e.g.
278  // float, double, and the (s)fixed* types.
279  template <typename CType, enum FieldType DeclaredType>
280  PROTOBUF_ALWAYS_INLINE static const uint8* ReadPrimitiveFromArray(
281  const uint8* buffer, CType* value);
282 
283  // Reads a primitive packed field.
284  //
285  // This is only implemented for packable types.
286  template <typename CType, enum FieldType DeclaredType>
287  PROTOBUF_ALWAYS_INLINE static bool ReadPackedPrimitive(
289 
290  // Identical to ReadPackedPrimitive, except will not inline the
291  // implementation.
292  template <typename CType, enum FieldType DeclaredType>
293  static bool ReadPackedPrimitiveNoInline(io::CodedInputStream* input,
295 
296  // Read a packed enum field. If the is_valid function is not NULL, values for
297  // which is_valid(value) returns false are silently dropped.
298  static bool ReadPackedEnumNoInline(io::CodedInputStream* input,
299  bool (*is_valid)(int),
301 
302  // Read a packed enum field. If the is_valid function is not NULL, values for
303  // which is_valid(value) returns false are appended to unknown_fields_stream.
304  static bool ReadPackedEnumPreserveUnknowns(
305  io::CodedInputStream* input, int field_number, bool (*is_valid)(int),
306  io::CodedOutputStream* unknown_fields_stream, RepeatedField<int>* values);
307 
308  // Read a string. ReadString(..., std::string* value) requires an
309  // existing std::string.
310  static inline bool ReadString(io::CodedInputStream* input,
311  std::string* value);
312  // ReadString(..., std::string** p) is internal-only, and should only be
313  // called from generated code. It starts by setting *p to "new std::string" if
314  // *p == &GetEmptyStringAlreadyInited(). It then invokes
315  // ReadString(io::CodedInputStream* input, *p). This is useful for reducing
316  // code size.
317  static inline bool ReadString(io::CodedInputStream* input, std::string** p);
318  // Analogous to ReadString().
319  static bool ReadBytes(io::CodedInputStream* input, std::string* value);
320  static bool ReadBytes(io::CodedInputStream* input, std::string** p);
321 
322  enum Operation {
323  PARSE = 0,
324  SERIALIZE = 1,
325  };
326 
327  // Returns true if the data is valid UTF-8.
328  static bool VerifyUtf8String(const char* data, int size, Operation op,
329  const char* field_name);
330 
331  template <typename MessageType>
332  static inline bool ReadGroup(int field_number, io::CodedInputStream* input,
333  MessageType* value);
334 
335  template <typename MessageType>
336  static inline bool ReadMessage(io::CodedInputStream* input,
337  MessageType* value);
338 
339  template <typename MessageType>
341  MessageType* value) {
342  return ReadMessage(input, value);
343  }
344 
345  // Write a tag. The Write*() functions typically include the tag, so
346  // normally there's no need to call this unless using the Write*NoTag()
347  // variants.
348  PROTOBUF_ALWAYS_INLINE static void WriteTag(int field_number, WireType type,
350 
351  // Write fields, without tags.
352  PROTOBUF_ALWAYS_INLINE static void WriteInt32NoTag(
354  PROTOBUF_ALWAYS_INLINE static void WriteInt64NoTag(
356  PROTOBUF_ALWAYS_INLINE static void WriteUInt32NoTag(
358  PROTOBUF_ALWAYS_INLINE static void WriteUInt64NoTag(
360  PROTOBUF_ALWAYS_INLINE static void WriteSInt32NoTag(
362  PROTOBUF_ALWAYS_INLINE static void WriteSInt64NoTag(
364  PROTOBUF_ALWAYS_INLINE static void WriteFixed32NoTag(
366  PROTOBUF_ALWAYS_INLINE static void WriteFixed64NoTag(
368  PROTOBUF_ALWAYS_INLINE static void WriteSFixed32NoTag(
370  PROTOBUF_ALWAYS_INLINE static void WriteSFixed64NoTag(
372  PROTOBUF_ALWAYS_INLINE static void WriteFloatNoTag(
374  PROTOBUF_ALWAYS_INLINE static void WriteDoubleNoTag(
376  PROTOBUF_ALWAYS_INLINE static void WriteBoolNoTag(
378  PROTOBUF_ALWAYS_INLINE static void WriteEnumNoTag(
380 
381  // Write array of primitive fields, without tags
382  static void WriteFloatArray(const float* a, int n,
384  static void WriteDoubleArray(const double* a, int n,
386  static void WriteFixed32Array(const uint32* a, int n,
388  static void WriteFixed64Array(const uint64* a, int n,
390  static void WriteSFixed32Array(const int32* a, int n,
392  static void WriteSFixed64Array(const int64* a, int n,
394  static void WriteBoolArray(const bool* a, int n,
396 
397  // Write fields, including tags.
398  static void WriteInt32(int field_number, int32 value,
400  static void WriteInt64(int field_number, int64 value,
402  static void WriteUInt32(int field_number, uint32 value,
404  static void WriteUInt64(int field_number, uint64 value,
406  static void WriteSInt32(int field_number, int32 value,
408  static void WriteSInt64(int field_number, int64 value,
410  static void WriteFixed32(int field_number, uint32 value,
412  static void WriteFixed64(int field_number, uint64 value,
414  static void WriteSFixed32(int field_number, int32 value,
416  static void WriteSFixed64(int field_number, int64 value,
418  static void WriteFloat(int field_number, float value,
420  static void WriteDouble(int field_number, double value,
422  static void WriteBool(int field_number, bool value,
424  static void WriteEnum(int field_number, int value,
426 
427  static void WriteString(int field_number, const std::string& value,
429  static void WriteBytes(int field_number, const std::string& value,
431  static void WriteStringMaybeAliased(int field_number,
432  const std::string& value,
434  static void WriteBytesMaybeAliased(int field_number, const std::string& value,
436 
437  static void WriteGroup(int field_number, const MessageLite& value,
439  static void WriteMessage(int field_number, const MessageLite& value,
441  // Like above, but these will check if the output stream has enough
442  // space to write directly to a flat array.
443  static void WriteGroupMaybeToArray(int field_number, const MessageLite& value,
445  static void WriteMessageMaybeToArray(int field_number,
446  const MessageLite& value,
448 
449  // Like above, but de-virtualize the call to SerializeWithCachedSizes(). The
450  // pointer must point at an instance of MessageType, *not* a subclass (or
451  // the subclass must not override SerializeWithCachedSizes()).
452  template <typename MessageType>
453  static inline void WriteGroupNoVirtual(int field_number,
454  const MessageType& value,
456  template <typename MessageType>
457  static inline void WriteMessageNoVirtual(int field_number,
458  const MessageType& value,
460 
461  // Like above, but use only *ToArray methods of CodedOutputStream.
462  PROTOBUF_ALWAYS_INLINE static uint8* WriteTagToArray(int field_number,
463  WireType type,
464  uint8* target);
465 
466  // Write fields, without tags.
467  PROTOBUF_ALWAYS_INLINE static uint8* WriteInt32NoTagToArray(int32 value,
468  uint8* target);
469  PROTOBUF_ALWAYS_INLINE static uint8* WriteInt64NoTagToArray(int64 value,
470  uint8* target);
471  PROTOBUF_ALWAYS_INLINE static uint8* WriteUInt32NoTagToArray(uint32 value,
472  uint8* target);
473  PROTOBUF_ALWAYS_INLINE static uint8* WriteUInt64NoTagToArray(uint64 value,
474  uint8* target);
475  PROTOBUF_ALWAYS_INLINE static uint8* WriteSInt32NoTagToArray(int32 value,
476  uint8* target);
477  PROTOBUF_ALWAYS_INLINE static uint8* WriteSInt64NoTagToArray(int64 value,
478  uint8* target);
479  PROTOBUF_ALWAYS_INLINE static uint8* WriteFixed32NoTagToArray(uint32 value,
480  uint8* target);
481  PROTOBUF_ALWAYS_INLINE static uint8* WriteFixed64NoTagToArray(uint64 value,
482  uint8* target);
483  PROTOBUF_ALWAYS_INLINE static uint8* WriteSFixed32NoTagToArray(int32 value,
484  uint8* target);
485  PROTOBUF_ALWAYS_INLINE static uint8* WriteSFixed64NoTagToArray(int64 value,
486  uint8* target);
487  PROTOBUF_ALWAYS_INLINE static uint8* WriteFloatNoTagToArray(float value,
488  uint8* target);
489  PROTOBUF_ALWAYS_INLINE static uint8* WriteDoubleNoTagToArray(double value,
490  uint8* target);
491  PROTOBUF_ALWAYS_INLINE static uint8* WriteBoolNoTagToArray(bool value,
492  uint8* target);
493  PROTOBUF_ALWAYS_INLINE static uint8* WriteEnumNoTagToArray(int value,
494  uint8* target);
495 
496  // Write fields, without tags. These require that value.size() > 0.
497  template <typename T>
498  PROTOBUF_ALWAYS_INLINE static uint8* WritePrimitiveNoTagToArray(
499  const RepeatedField<T>& value, uint8* (*Writer)(T, uint8*),
500  uint8* target);
501  template <typename T>
502  PROTOBUF_ALWAYS_INLINE static uint8* WriteFixedNoTagToArray(
503  const RepeatedField<T>& value, uint8* (*Writer)(T, uint8*),
504  uint8* target);
505 
506  PROTOBUF_ALWAYS_INLINE static uint8* WriteInt32NoTagToArray(
508  PROTOBUF_ALWAYS_INLINE static uint8* WriteInt64NoTagToArray(
510  PROTOBUF_ALWAYS_INLINE static uint8* WriteUInt32NoTagToArray(
512  PROTOBUF_ALWAYS_INLINE static uint8* WriteUInt64NoTagToArray(
514  PROTOBUF_ALWAYS_INLINE static uint8* WriteSInt32NoTagToArray(
516  PROTOBUF_ALWAYS_INLINE static uint8* WriteSInt64NoTagToArray(
518  PROTOBUF_ALWAYS_INLINE static uint8* WriteFixed32NoTagToArray(
520  PROTOBUF_ALWAYS_INLINE static uint8* WriteFixed64NoTagToArray(
522  PROTOBUF_ALWAYS_INLINE static uint8* WriteSFixed32NoTagToArray(
524  PROTOBUF_ALWAYS_INLINE static uint8* WriteSFixed64NoTagToArray(
526  PROTOBUF_ALWAYS_INLINE static uint8* WriteFloatNoTagToArray(
528  PROTOBUF_ALWAYS_INLINE static uint8* WriteDoubleNoTagToArray(
530  PROTOBUF_ALWAYS_INLINE static uint8* WriteBoolNoTagToArray(
532  PROTOBUF_ALWAYS_INLINE static uint8* WriteEnumNoTagToArray(
534 
535  // Write fields, including tags.
536  PROTOBUF_ALWAYS_INLINE static uint8* WriteInt32ToArray(int field_number,
537  int32 value,
538  uint8* target);
539  PROTOBUF_ALWAYS_INLINE static uint8* WriteInt64ToArray(int field_number,
540  int64 value,
541  uint8* target);
542  PROTOBUF_ALWAYS_INLINE static uint8* WriteUInt32ToArray(int field_number,
543  uint32 value,
544  uint8* target);
545  PROTOBUF_ALWAYS_INLINE static uint8* WriteUInt64ToArray(int field_number,
546  uint64 value,
547  uint8* target);
548  PROTOBUF_ALWAYS_INLINE static uint8* WriteSInt32ToArray(int field_number,
549  int32 value,
550  uint8* target);
551  PROTOBUF_ALWAYS_INLINE static uint8* WriteSInt64ToArray(int field_number,
552  int64 value,
553  uint8* target);
554  PROTOBUF_ALWAYS_INLINE static uint8* WriteFixed32ToArray(int field_number,
555  uint32 value,
556  uint8* target);
557  PROTOBUF_ALWAYS_INLINE static uint8* WriteFixed64ToArray(int field_number,
558  uint64 value,
559  uint8* target);
560  PROTOBUF_ALWAYS_INLINE static uint8* WriteSFixed32ToArray(int field_number,
561  int32 value,
562  uint8* target);
563  PROTOBUF_ALWAYS_INLINE static uint8* WriteSFixed64ToArray(int field_number,
564  int64 value,
565  uint8* target);
566  PROTOBUF_ALWAYS_INLINE static uint8* WriteFloatToArray(int field_number,
567  float value,
568  uint8* target);
569  PROTOBUF_ALWAYS_INLINE static uint8* WriteDoubleToArray(int field_number,
570  double value,
571  uint8* target);
572  PROTOBUF_ALWAYS_INLINE static uint8* WriteBoolToArray(int field_number,
573  bool value,
574  uint8* target);
575  PROTOBUF_ALWAYS_INLINE static uint8* WriteEnumToArray(int field_number,
576  int value,
577  uint8* target);
578 
579  template <typename T>
580  PROTOBUF_ALWAYS_INLINE static uint8* WritePrimitiveToArray(
581  int field_number, const RepeatedField<T>& value,
582  uint8* (*Writer)(int, T, uint8*), uint8* target);
583 
584  PROTOBUF_ALWAYS_INLINE static uint8* WriteInt32ToArray(
585  int field_number, const RepeatedField<int32>& value, uint8* output);
586  PROTOBUF_ALWAYS_INLINE static uint8* WriteInt64ToArray(
587  int field_number, const RepeatedField<int64>& value, uint8* output);
588  PROTOBUF_ALWAYS_INLINE static uint8* WriteUInt32ToArray(
589  int field_number, const RepeatedField<uint32>& value, uint8* output);
590  PROTOBUF_ALWAYS_INLINE static uint8* WriteUInt64ToArray(
591  int field_number, const RepeatedField<uint64>& value, uint8* output);
592  PROTOBUF_ALWAYS_INLINE static uint8* WriteSInt32ToArray(
593  int field_number, const RepeatedField<int32>& value, uint8* output);
594  PROTOBUF_ALWAYS_INLINE static uint8* WriteSInt64ToArray(
595  int field_number, const RepeatedField<int64>& value, uint8* output);
596  PROTOBUF_ALWAYS_INLINE static uint8* WriteFixed32ToArray(
597  int field_number, const RepeatedField<uint32>& value, uint8* output);
598  PROTOBUF_ALWAYS_INLINE static uint8* WriteFixed64ToArray(
599  int field_number, const RepeatedField<uint64>& value, uint8* output);
600  PROTOBUF_ALWAYS_INLINE static uint8* WriteSFixed32ToArray(
601  int field_number, const RepeatedField<int32>& value, uint8* output);
602  PROTOBUF_ALWAYS_INLINE static uint8* WriteSFixed64ToArray(
603  int field_number, const RepeatedField<int64>& value, uint8* output);
604  PROTOBUF_ALWAYS_INLINE static uint8* WriteFloatToArray(
605  int field_number, const RepeatedField<float>& value, uint8* output);
606  PROTOBUF_ALWAYS_INLINE static uint8* WriteDoubleToArray(
607  int field_number, const RepeatedField<double>& value, uint8* output);
608  PROTOBUF_ALWAYS_INLINE static uint8* WriteBoolToArray(
609  int field_number, const RepeatedField<bool>& value, uint8* output);
610  PROTOBUF_ALWAYS_INLINE static uint8* WriteEnumToArray(
611  int field_number, const RepeatedField<int>& value, uint8* output);
612 
613  PROTOBUF_ALWAYS_INLINE static uint8* WriteStringToArray(
614  int field_number, const std::string& value, uint8* target);
615  PROTOBUF_ALWAYS_INLINE static uint8* WriteBytesToArray(
616  int field_number, const std::string& value, uint8* target);
617 
618  // Whether to serialize deterministically (e.g., map keys are
619  // sorted) is a property of a CodedOutputStream, and in the process
620  // of serialization, the "ToArray" variants may be invoked. But they don't
621  // have a CodedOutputStream available, so they get an additional parameter
622  // telling them whether to serialize deterministically.
623  template <typename MessageType>
624  PROTOBUF_ALWAYS_INLINE static uint8* InternalWriteGroupToArray(
625  int field_number, const MessageType& value, uint8* target);
626  template <typename MessageType>
627  PROTOBUF_ALWAYS_INLINE static uint8* InternalWriteMessageToArray(
628  int field_number, const MessageType& value, uint8* target);
629 
630  // Like above, but de-virtualize the call to SerializeWithCachedSizes(). The
631  // pointer must point at an instance of MessageType, *not* a subclass (or
632  // the subclass must not override SerializeWithCachedSizes()).
633  template <typename MessageType>
634  PROTOBUF_ALWAYS_INLINE static uint8* InternalWriteGroupNoVirtualToArray(
635  int field_number, const MessageType& value, uint8* target);
636  template <typename MessageType>
637  PROTOBUF_ALWAYS_INLINE static uint8* InternalWriteMessageNoVirtualToArray(
638  int field_number, const MessageType& value, uint8* target);
639 
640  // For backward-compatibility, the last four methods also have versions
641  // that are non-deterministic always.
642  PROTOBUF_ALWAYS_INLINE static uint8* WriteGroupToArray(
643  int field_number, const MessageLite& value, uint8* target) {
644  return InternalWriteGroupToArray(field_number, value, target);
645  }
646  PROTOBUF_ALWAYS_INLINE static uint8* WriteMessageToArray(
647  int field_number, const MessageLite& value, uint8* target) {
648  return InternalWriteMessageToArray(field_number, value, target);
649  }
650 
651  // Compute the byte size of a field. The XxSize() functions do NOT include
652  // the tag, so you must also call TagSize(). (This is because, for repeated
653  // fields, you should only call TagSize() once and multiply it by the element
654  // count, but you may have to call XxSize() for each individual element.)
655  static inline size_t Int32Size(int32 value);
656  static inline size_t Int64Size(int64 value);
657  static inline size_t UInt32Size(uint32 value);
658  static inline size_t UInt64Size(uint64 value);
659  static inline size_t SInt32Size(int32 value);
660  static inline size_t SInt64Size(int64 value);
661  static inline size_t EnumSize(int value);
662 
663  static size_t Int32Size(const RepeatedField<int32>& value);
664  static size_t Int64Size(const RepeatedField<int64>& value);
665  static size_t UInt32Size(const RepeatedField<uint32>& value);
666  static size_t UInt64Size(const RepeatedField<uint64>& value);
667  static size_t SInt32Size(const RepeatedField<int32>& value);
668  static size_t SInt64Size(const RepeatedField<int64>& value);
669  static size_t EnumSize(const RepeatedField<int>& value);
670 
671  // These types always have the same size.
672  static const size_t kFixed32Size = 4;
673  static const size_t kFixed64Size = 8;
674  static const size_t kSFixed32Size = 4;
675  static const size_t kSFixed64Size = 8;
676  static const size_t kFloatSize = 4;
677  static const size_t kDoubleSize = 8;
678  static const size_t kBoolSize = 1;
679 
680  static inline size_t StringSize(const std::string& value);
681  static inline size_t BytesSize(const std::string& value);
682 
683  template <typename MessageType>
684  static inline size_t GroupSize(const MessageType& value);
685  template <typename MessageType>
686  static inline size_t MessageSize(const MessageType& value);
687 
688  // Like above, but de-virtualize the call to ByteSize(). The
689  // pointer must point at an instance of MessageType, *not* a subclass (or
690  // the subclass must not override ByteSize()).
691  template <typename MessageType>
692  static inline size_t GroupSizeNoVirtual(const MessageType& value);
693  template <typename MessageType>
694  static inline size_t MessageSizeNoVirtual(const MessageType& value);
695 
696  // Given the length of data, calculate the byte size of the data on the
697  // wire if we encode the data as a length delimited field.
698  static inline size_t LengthDelimitedSize(size_t length);
699 
700  private:
701  // A helper method for the repeated primitive reader. This method has
702  // optimizations for primitive types that have fixed size on the wire, and
703  // can be read using potentially faster paths.
704  template <typename CType, enum FieldType DeclaredType>
705  PROTOBUF_ALWAYS_INLINE static bool ReadRepeatedFixedSizePrimitive(
706  int tag_size, uint32 tag, io::CodedInputStream* input,
708 
709  // Like ReadRepeatedFixedSizePrimitive but for packed primitive fields.
710  template <typename CType, enum FieldType DeclaredType>
711  PROTOBUF_ALWAYS_INLINE static bool ReadPackedFixedSizePrimitive(
713 
714  static const CppType kFieldTypeToCppTypeMap[];
715  static const WireFormatLite::WireType kWireTypeForFieldType[];
716  static void WriteSubMessageMaybeToArray(int size, const MessageLite& value,
718 
720 };
721 
722 // A class which deals with unknown values. The default implementation just
723 // discards them. WireFormat defines a subclass which writes to an
724 // UnknownFieldSet. This class is used by ExtensionSet::ParseField(), since
725 // ExtensionSet is part of the lite library but UnknownFieldSet is not.
726 class PROTOBUF_EXPORT FieldSkipper {
727  public:
729  virtual ~FieldSkipper() {}
730 
731  // Skip a field whose tag has already been consumed.
732  virtual bool SkipField(io::CodedInputStream* input, uint32 tag);
733 
734  // Skip an entire message or group, up to an end-group tag (which is consumed)
735  // or end-of-stream.
736  virtual bool SkipMessage(io::CodedInputStream* input);
737 
738  // Deal with an already-parsed unrecognized enum value. The default
739  // implementation does nothing, but the UnknownFieldSet-based implementation
740  // saves it as an unknown varint.
741  virtual void SkipUnknownEnum(int field_number, int value);
742 };
743 
744 // Subclass of FieldSkipper which saves skipped fields to a CodedOutputStream.
745 
746 class PROTOBUF_EXPORT CodedOutputStreamFieldSkipper : public FieldSkipper {
747  public:
749  : unknown_fields_(unknown_fields) {}
751 
752  // implements FieldSkipper -----------------------------------------
753  bool SkipField(io::CodedInputStream* input, uint32 tag) override;
754  bool SkipMessage(io::CodedInputStream* input) override;
755  void SkipUnknownEnum(int field_number, int value) override;
756 
757  protected:
759 };
760 
761 // inline methods ====================================================
762 
764  FieldType type) {
766 }
767 
768 constexpr inline uint32 WireFormatLite::MakeTag(int field_number,
769  WireType type) {
770  return GOOGLE_PROTOBUF_WIRE_FORMAT_MAKE_TAG(field_number, type);
771 }
772 
774  return static_cast<WireType>(tag & kTagTypeMask);
775 }
776 
778  return static_cast<int>(tag >> kTagTypeBits);
779 }
780 
781 inline size_t WireFormatLite::TagSize(int field_number,
783  size_t result = io::CodedOutputStream::VarintSize32(
784  static_cast<uint32>(field_number << kTagTypeBits));
785  if (type == TYPE_GROUP) {
786  // Groups have both a start and an end tag.
787  return result * 2;
788  } else {
789  return result;
790  }
791 }
792 
794  union {
795  float f;
796  uint32 i;
797  };
798  f = value;
799  return i;
800 }
801 
803  union {
804  float f;
805  uint32 i;
806  };
807  i = value;
808  return f;
809 }
810 
812  union {
813  double f;
814  uint64 i;
815  };
816  f = value;
817  return i;
818 }
819 
821  union {
822  double f;
823  uint64 i;
824  };
825  i = value;
826  return f;
827 }
828 
829 // ZigZag Transform: Encodes signed integers so that they can be
830 // effectively used with varint encoding.
831 //
832 // varint operates on unsigned integers, encoding smaller numbers into
833 // fewer bytes. If you try to use it on a signed integer, it will treat
834 // this number as a very large unsigned integer, which means that even
835 // small signed numbers like -1 will take the maximum number of bytes
836 // (10) to encode. ZigZagEncode() maps signed integers to unsigned
837 // in such a way that those with a small absolute value will have smaller
838 // encoded values, making them appropriate for encoding using varint.
839 //
840 // int32 -> uint32
841 // -------------------------
842 // 0 -> 0
843 // -1 -> 1
844 // 1 -> 2
845 // -2 -> 3
846 // ... -> ...
847 // 2147483647 -> 4294967294
848 // -2147483648 -> 4294967295
849 //
850 // >> encode >>
851 // << decode <<
852 
854  // Note: the right-shift must be arithmetic
855  // Note: left shift must be unsigned because of overflow
856  return (static_cast<uint32>(n) << 1) ^ static_cast<uint32>(n >> 31);
857 }
858 
860  // Note: Using unsigned types prevent undefined behavior
861  return static_cast<int32>((n >> 1) ^ (~(n & 1) + 1));
862 }
863 
865  // Note: the right-shift must be arithmetic
866  // Note: left shift must be unsigned because of overflow
867  return (static_cast<uint64>(n) << 1) ^ static_cast<uint64>(n >> 63);
868 }
869 
871  // Note: Using unsigned types prevent undefined behavior
872  return static_cast<int64>((n >> 1) ^ (~(n & 1) + 1));
873 }
874 
875 // String is for UTF-8 text only, but, even so, ReadString() can simply
876 // call ReadBytes().
877 
879  std::string* value) {
880  return ReadBytes(input, value);
881 }
882 
884  std::string** p) {
885  return ReadBytes(input, p);
886 }
887 
888 inline void SerializeUnknownMessageSetItems(const std::string& unknown_fields,
890  output->WriteString(unknown_fields);
891 }
892 
894  const std::string& unknown_fields) {
895  return unknown_fields.size();
896 }
897 
898 // Implementation details of ReadPrimitive.
899 
900 template <>
901 inline bool WireFormatLite::ReadPrimitive<int32, WireFormatLite::TYPE_INT32>(
903  uint32 temp;
904  if (!input->ReadVarint32(&temp)) return false;
905  *value = static_cast<int32>(temp);
906  return true;
907 }
908 template <>
909 inline bool WireFormatLite::ReadPrimitive<int64, WireFormatLite::TYPE_INT64>(
911  uint64 temp;
912  if (!input->ReadVarint64(&temp)) return false;
913  *value = static_cast<int64>(temp);
914  return true;
915 }
916 template <>
917 inline bool WireFormatLite::ReadPrimitive<uint32, WireFormatLite::TYPE_UINT32>(
919  return input->ReadVarint32(value);
920 }
921 template <>
922 inline bool WireFormatLite::ReadPrimitive<uint64, WireFormatLite::TYPE_UINT64>(
924  return input->ReadVarint64(value);
925 }
926 template <>
927 inline bool WireFormatLite::ReadPrimitive<int32, WireFormatLite::TYPE_SINT32>(
929  uint32 temp;
930  if (!input->ReadVarint32(&temp)) return false;
931  *value = ZigZagDecode32(temp);
932  return true;
933 }
934 template <>
935 inline bool WireFormatLite::ReadPrimitive<int64, WireFormatLite::TYPE_SINT64>(
937  uint64 temp;
938  if (!input->ReadVarint64(&temp)) return false;
939  *value = ZigZagDecode64(temp);
940  return true;
941 }
942 template <>
943 inline bool WireFormatLite::ReadPrimitive<uint32, WireFormatLite::TYPE_FIXED32>(
945  return input->ReadLittleEndian32(value);
946 }
947 template <>
948 inline bool WireFormatLite::ReadPrimitive<uint64, WireFormatLite::TYPE_FIXED64>(
950  return input->ReadLittleEndian64(value);
951 }
952 template <>
953 inline bool WireFormatLite::ReadPrimitive<int32, WireFormatLite::TYPE_SFIXED32>(
955  uint32 temp;
956  if (!input->ReadLittleEndian32(&temp)) return false;
957  *value = static_cast<int32>(temp);
958  return true;
959 }
960 template <>
961 inline bool WireFormatLite::ReadPrimitive<int64, WireFormatLite::TYPE_SFIXED64>(
963  uint64 temp;
964  if (!input->ReadLittleEndian64(&temp)) return false;
965  *value = static_cast<int64>(temp);
966  return true;
967 }
968 template <>
969 inline bool WireFormatLite::ReadPrimitive<float, WireFormatLite::TYPE_FLOAT>(
970  io::CodedInputStream* input, float* value) {
971  uint32 temp;
972  if (!input->ReadLittleEndian32(&temp)) return false;
973  *value = DecodeFloat(temp);
974  return true;
975 }
976 template <>
977 inline bool WireFormatLite::ReadPrimitive<double, WireFormatLite::TYPE_DOUBLE>(
978  io::CodedInputStream* input, double* value) {
979  uint64 temp;
980  if (!input->ReadLittleEndian64(&temp)) return false;
981  *value = DecodeDouble(temp);
982  return true;
983 }
984 template <>
985 inline bool WireFormatLite::ReadPrimitive<bool, WireFormatLite::TYPE_BOOL>(
986  io::CodedInputStream* input, bool* value) {
987  uint64 temp;
988  if (!input->ReadVarint64(&temp)) return false;
989  *value = temp != 0;
990  return true;
991 }
992 template <>
993 inline bool WireFormatLite::ReadPrimitive<int, WireFormatLite::TYPE_ENUM>(
995  uint32 temp;
996  if (!input->ReadVarint32(&temp)) return false;
997  *value = static_cast<int>(temp);
998  return true;
999 }
1000 
1001 template <>
1002 inline const uint8*
1003 WireFormatLite::ReadPrimitiveFromArray<uint32, WireFormatLite::TYPE_FIXED32>(
1004  const uint8* buffer, uint32* value) {
1006 }
1007 template <>
1008 inline const uint8*
1009 WireFormatLite::ReadPrimitiveFromArray<uint64, WireFormatLite::TYPE_FIXED64>(
1010  const uint8* buffer, uint64* value) {
1012 }
1013 template <>
1014 inline const uint8*
1015 WireFormatLite::ReadPrimitiveFromArray<int32, WireFormatLite::TYPE_SFIXED32>(
1016  const uint8* buffer, int32* value) {
1017  uint32 temp;
1019  *value = static_cast<int32>(temp);
1020  return buffer;
1021 }
1022 template <>
1023 inline const uint8*
1024 WireFormatLite::ReadPrimitiveFromArray<int64, WireFormatLite::TYPE_SFIXED64>(
1025  const uint8* buffer, int64* value) {
1026  uint64 temp;
1028  *value = static_cast<int64>(temp);
1029  return buffer;
1030 }
1031 template <>
1032 inline const uint8*
1033 WireFormatLite::ReadPrimitiveFromArray<float, WireFormatLite::TYPE_FLOAT>(
1034  const uint8* buffer, float* value) {
1035  uint32 temp;
1037  *value = DecodeFloat(temp);
1038  return buffer;
1039 }
1040 template <>
1041 inline const uint8*
1042 WireFormatLite::ReadPrimitiveFromArray<double, WireFormatLite::TYPE_DOUBLE>(
1043  const uint8* buffer, double* value) {
1044  uint64 temp;
1046  *value = DecodeDouble(temp);
1047  return buffer;
1048 }
1049 
1050 template <typename CType, enum WireFormatLite::FieldType DeclaredType>
1052  int, // tag_size, unused.
1054  CType value;
1055  if (!ReadPrimitive<CType, DeclaredType>(input, &value)) return false;
1056  values->Add(value);
1057  int elements_already_reserved = values->Capacity() - values->size();
1058  while (elements_already_reserved > 0 && input->ExpectTag(tag)) {
1059  if (!ReadPrimitive<CType, DeclaredType>(input, &value)) return false;
1060  values->AddAlreadyReserved(value);
1061  elements_already_reserved--;
1062  }
1063  return true;
1064 }
1065 
1066 template <typename CType, enum WireFormatLite::FieldType DeclaredType>
1068  int tag_size, uint32 tag, io::CodedInputStream* input,
1070  GOOGLE_DCHECK_EQ(UInt32Size(tag), static_cast<size_t>(tag_size));
1071  CType value;
1072  if (!ReadPrimitive<CType, DeclaredType>(input, &value)) return false;
1073  values->Add(value);
1074 
1075  // For fixed size values, repeated values can be read more quickly by
1076  // reading directly from a raw array.
1077  //
1078  // We can get a tight loop by only reading as many elements as can be
1079  // added to the RepeatedField without having to do any resizing. Additionally,
1080  // we only try to read as many elements as are available from the current
1081  // buffer space. Doing so avoids having to perform boundary checks when
1082  // reading the value: the maximum number of elements that can be read is
1083  // known outside of the loop.
1084  const void* void_pointer;
1085  int size;
1086  input->GetDirectBufferPointerInline(&void_pointer, &size);
1087  if (size > 0) {
1088  const uint8* buffer = reinterpret_cast<const uint8*>(void_pointer);
1089  // The number of bytes each type occupies on the wire.
1090  const int per_value_size = tag_size + static_cast<int>(sizeof(value));
1091 
1092  // parentheses around (std::min) prevents macro expansion of min(...)
1093  int elements_available =
1094  (std::min)(values->Capacity() - values->size(), size / per_value_size);
1095  int num_read = 0;
1096  while (num_read < elements_available &&
1098  NULL) {
1099  buffer = ReadPrimitiveFromArray<CType, DeclaredType>(buffer, &value);
1100  values->AddAlreadyReserved(value);
1101  ++num_read;
1102  }
1103  const int read_bytes = num_read * per_value_size;
1104  if (read_bytes > 0) {
1105  input->Skip(read_bytes);
1106  }
1107  }
1108  return true;
1109 }
1110 
1111 // Specializations of ReadRepeatedPrimitive for the fixed size types, which use
1112 // the optimized code path.
1113 #define READ_REPEATED_FIXED_SIZE_PRIMITIVE(CPPTYPE, DECLARED_TYPE) \
1114  template <> \
1115  inline bool WireFormatLite::ReadRepeatedPrimitive< \
1116  CPPTYPE, WireFormatLite::DECLARED_TYPE>( \
1117  int tag_size, uint32 tag, io::CodedInputStream* input, \
1118  RepeatedField<CPPTYPE>* values) { \
1119  return ReadRepeatedFixedSizePrimitive<CPPTYPE, \
1120  WireFormatLite::DECLARED_TYPE>( \
1121  tag_size, tag, input, values); \
1122  }
1123 
1128 READ_REPEATED_FIXED_SIZE_PRIMITIVE(float, TYPE_FLOAT)
1129 READ_REPEATED_FIXED_SIZE_PRIMITIVE(double, TYPE_DOUBLE)
1130 
1131 #undef READ_REPEATED_FIXED_SIZE_PRIMITIVE
1132 
1133 template <typename CType, enum WireFormatLite::FieldType DeclaredType>
1135  int tag_size, uint32 tag, io::CodedInputStream* input,
1137  return ReadRepeatedPrimitive<CType, DeclaredType>(tag_size, tag, input,
1138  value);
1139 }
1140 
1141 template <typename CType, enum WireFormatLite::FieldType DeclaredType>
1144  int length;
1145  if (!input->ReadVarintSizeAsInt(&length)) return false;
1146  io::CodedInputStream::Limit limit = input->PushLimit(length);
1147  while (input->BytesUntilLimit() > 0) {
1148  CType value;
1149  if (!ReadPrimitive<CType, DeclaredType>(input, &value)) return false;
1150  values->Add(value);
1151  }
1152  input->PopLimit(limit);
1153  return true;
1154 }
1155 
1156 template <typename CType, enum WireFormatLite::FieldType DeclaredType>
1159  int length;
1160  if (!input->ReadVarintSizeAsInt(&length)) return false;
1161  const int old_entries = values->size();
1162  const int new_entries = length / static_cast<int>(sizeof(CType));
1163  const int new_bytes = new_entries * static_cast<int>(sizeof(CType));
1164  if (new_bytes != length) return false;
1165  // We would *like* to pre-allocate the buffer to write into (for
1166  // speed), but *must* avoid performing a very large allocation due
1167  // to a malicious user-supplied "length" above. So we have a fast
1168  // path that pre-allocates when the "length" is less than a bound.
1169  // We determine the bound by calling BytesUntilTotalBytesLimit() and
1170  // BytesUntilLimit(). These return -1 to mean "no limit set".
1171  // There are four cases:
1172  // TotalBytesLimit Limit
1173  // -1 -1 Use slow path.
1174  // -1 >= 0 Use fast path if length <= Limit.
1175  // >= 0 -1 Use slow path.
1176  // >= 0 >= 0 Use fast path if length <= min(both limits).
1177  int64 bytes_limit = input->BytesUntilTotalBytesLimit();
1178  if (bytes_limit == -1) {
1179  bytes_limit = input->BytesUntilLimit();
1180  } else {
1181  // parentheses around (std::min) prevents macro expansion of min(...)
1182  bytes_limit =
1183  (std::min)(bytes_limit, static_cast<int64>(input->BytesUntilLimit()));
1184  }
1185  if (bytes_limit >= new_bytes) {
1186  // Fast-path that pre-allocates *values to the final size.
1187 #if defined(PROTOBUF_LITTLE_ENDIAN)
1188  values->Resize(old_entries + new_entries, 0);
1189  // values->mutable_data() may change after Resize(), so do this after:
1190  void* dest = reinterpret_cast<void*>(values->mutable_data() + old_entries);
1191  if (!input->ReadRaw(dest, new_bytes)) {
1192  values->Truncate(old_entries);
1193  return false;
1194  }
1195 #else
1196  values->Reserve(old_entries + new_entries);
1197  CType value;
1198  for (int i = 0; i < new_entries; ++i) {
1199  if (!ReadPrimitive<CType, DeclaredType>(input, &value)) return false;
1200  values->AddAlreadyReserved(value);
1201  }
1202 #endif
1203  } else {
1204  // This is the slow-path case where "length" may be too large to
1205  // safely allocate. We read as much as we can into *values
1206  // without pre-allocating "length" bytes.
1207  CType value;
1208  for (int i = 0; i < new_entries; ++i) {
1209  if (!ReadPrimitive<CType, DeclaredType>(input, &value)) return false;
1210  values->Add(value);
1211  }
1212  }
1213  return true;
1214 }
1215 
1216 // Specializations of ReadPackedPrimitive for the fixed size types, which use
1217 // an optimized code path.
1218 #define READ_REPEATED_PACKED_FIXED_SIZE_PRIMITIVE(CPPTYPE, DECLARED_TYPE) \
1219  template <> \
1220  inline bool \
1221  WireFormatLite::ReadPackedPrimitive<CPPTYPE, WireFormatLite::DECLARED_TYPE>( \
1222  io::CodedInputStream * input, RepeatedField<CPPTYPE> * values) { \
1223  return ReadPackedFixedSizePrimitive<CPPTYPE, \
1224  WireFormatLite::DECLARED_TYPE>( \
1225  input, values); \
1226  }
1227 
1233 READ_REPEATED_PACKED_FIXED_SIZE_PRIMITIVE(double, TYPE_DOUBLE)
1234 
1235 #undef READ_REPEATED_PACKED_FIXED_SIZE_PRIMITIVE
1236 
1237 template <typename CType, enum WireFormatLite::FieldType DeclaredType>
1240  return ReadPackedPrimitive<CType, DeclaredType>(input, values);
1241 }
1242 
1243 
1244 template <typename MessageType>
1245 inline bool WireFormatLite::ReadGroup(int field_number,
1247  MessageType* value) {
1248  if (!input->IncrementRecursionDepth()) return false;
1249  if (!value->MergePartialFromCodedStream(input)) return false;
1250  input->UnsafeDecrementRecursionDepth();
1251  // Make sure the last thing read was an end tag for this group.
1252  if (!input->LastTagWas(MakeTag(field_number, WIRETYPE_END_GROUP))) {
1253  return false;
1254  }
1255  return true;
1256 }
1257 template <typename MessageType>
1259  MessageType* value) {
1260  int length;
1261  if (!input->ReadVarintSizeAsInt(&length)) return false;
1262  std::pair<io::CodedInputStream::Limit, int> p =
1263  input->IncrementRecursionDepthAndPushLimit(length);
1264  if (p.second < 0 || !value->MergePartialFromCodedStream(input)) return false;
1265  // Make sure that parsing stopped when the limit was hit, not at an endgroup
1266  // tag.
1267  return input->DecrementRecursionDepthAndPopLimit(p.first);
1268 }
1269 
1270 // ===================================================================
1271 
1272 inline void WireFormatLite::WriteTag(int field_number, WireType type,
1274  output->WriteTag(MakeTag(field_number, type));
1275 }
1276 
1279  output->WriteVarint32SignExtended(value);
1280 }
1283  output->WriteVarint64(static_cast<uint64>(value));
1284 }
1287  output->WriteVarint32(value);
1288 }
1291  output->WriteVarint64(value);
1292 }
1295  output->WriteVarint32(ZigZagEncode32(value));
1296 }
1299  output->WriteVarint64(ZigZagEncode64(value));
1300 }
1303  output->WriteLittleEndian32(value);
1304 }
1307  output->WriteLittleEndian64(value);
1308 }
1311  output->WriteLittleEndian32(static_cast<uint32>(value));
1312 }
1315  output->WriteLittleEndian64(static_cast<uint64>(value));
1316 }
1319  output->WriteLittleEndian32(EncodeFloat(value));
1320 }
1323  output->WriteLittleEndian64(EncodeDouble(value));
1324 }
1327  output->WriteVarint32(value ? 1 : 0);
1328 }
1331  output->WriteVarint32SignExtended(value);
1332 }
1333 
1334 // See comment on ReadGroupNoVirtual to understand the need for this template
1335 // parameter name.
1336 template <typename MessageType_WorkAroundCppLookupDefect>
1338  int field_number, const MessageType_WorkAroundCppLookupDefect& value,
1340  WriteTag(field_number, WIRETYPE_START_GROUP, output);
1341  value.MessageType_WorkAroundCppLookupDefect::SerializeWithCachedSizes(output);
1342  WriteTag(field_number, WIRETYPE_END_GROUP, output);
1343 }
1344 template <typename MessageType_WorkAroundCppLookupDefect>
1346  int field_number, const MessageType_WorkAroundCppLookupDefect& value,
1348  WriteTag(field_number, WIRETYPE_LENGTH_DELIMITED, output);
1349  output->WriteVarint32(
1350  value.MessageType_WorkAroundCppLookupDefect::GetCachedSize());
1351  value.MessageType_WorkAroundCppLookupDefect::SerializeWithCachedSizes(output);
1352 }
1353 
1354 // ===================================================================
1355 
1357  uint8* target) {
1358  return io::CodedOutputStream::WriteTagToArray(MakeTag(field_number, type),
1359  target);
1360 }
1361 
1363  uint8* target) {
1365 }
1367  uint8* target) {
1369  target);
1370 }
1372  uint8* target) {
1374 }
1376  uint8* target) {
1378 }
1380  uint8* target) {
1382  target);
1383 }
1385  uint8* target) {
1387  target);
1388 }
1390  uint8* target) {
1392 }
1394  uint8* target) {
1396 }
1398  uint8* target) {
1400  static_cast<uint32>(value), target);
1401 }
1403  uint8* target) {
1405  static_cast<uint64>(value), target);
1406 }
1408  uint8* target) {
1410  target);
1411 }
1413  uint8* target) {
1415  target);
1416 }
1419 }
1422 }
1423 
1424 template <typename T>
1426  const RepeatedField<T>& value, uint8* (*Writer)(T, uint8*), uint8* target) {
1427  const int n = value.size();
1428  GOOGLE_DCHECK_GT(n, 0);
1429 
1430  const T* ii = value.data();
1431  int i = 0;
1432  do {
1433  target = Writer(ii[i], target);
1434  } while (++i < n);
1435 
1436  return target;
1437 }
1438 
1439 template <typename T>
1441  const RepeatedField<T>& value, uint8* (*Writer)(T, uint8*), uint8* target) {
1442 #if defined(PROTOBUF_LITTLE_ENDIAN)
1443  (void)Writer;
1444 
1445  const int n = value.size();
1446  GOOGLE_DCHECK_GT(n, 0);
1447 
1448  const T* ii = value.data();
1449  const int bytes = n * static_cast<int>(sizeof(ii[0]));
1450  memcpy(target, ii, static_cast<size_t>(bytes));
1451  return target + bytes;
1452 #else
1453  return WritePrimitiveNoTagToArray(value, Writer, target);
1454 #endif
1455 }
1456 
1460 }
1464 }
1468 }
1472 }
1476 }
1480 }
1484 }
1488 }
1492 }
1496 }
1500 }
1504 }
1508 }
1510  const RepeatedField<int>& value, uint8* target) {
1512 }
1513 
1515  uint8* target) {
1516  target = WriteTagToArray(field_number, WIRETYPE_VARINT, target);
1518 }
1520  uint8* target) {
1521  target = WriteTagToArray(field_number, WIRETYPE_VARINT, target);
1523 }
1525  uint8* target) {
1526  target = WriteTagToArray(field_number, WIRETYPE_VARINT, target);
1528 }
1530  uint8* target) {
1531  target = WriteTagToArray(field_number, WIRETYPE_VARINT, target);
1533 }
1535  uint8* target) {
1536  target = WriteTagToArray(field_number, WIRETYPE_VARINT, target);
1538 }
1540  uint8* target) {
1541  target = WriteTagToArray(field_number, WIRETYPE_VARINT, target);
1543 }
1545  uint32 value, uint8* target) {
1546  target = WriteTagToArray(field_number, WIRETYPE_FIXED32, target);
1548 }
1550  uint64 value, uint8* target) {
1551  target = WriteTagToArray(field_number, WIRETYPE_FIXED64, target);
1553 }
1555  int32 value, uint8* target) {
1556  target = WriteTagToArray(field_number, WIRETYPE_FIXED32, target);
1558 }
1560  int64 value, uint8* target) {
1561  target = WriteTagToArray(field_number, WIRETYPE_FIXED64, target);
1563 }
1564 inline uint8* WireFormatLite::WriteFloatToArray(int field_number, float value,
1565  uint8* target) {
1566  target = WriteTagToArray(field_number, WIRETYPE_FIXED32, target);
1568 }
1569 inline uint8* WireFormatLite::WriteDoubleToArray(int field_number, double value,
1570  uint8* target) {
1571  target = WriteTagToArray(field_number, WIRETYPE_FIXED64, target);
1573 }
1574 inline uint8* WireFormatLite::WriteBoolToArray(int field_number, bool value,
1575  uint8* target) {
1576  target = WriteTagToArray(field_number, WIRETYPE_VARINT, target);
1578 }
1579 inline uint8* WireFormatLite::WriteEnumToArray(int field_number, int value,
1580  uint8* target) {
1581  target = WriteTagToArray(field_number, WIRETYPE_VARINT, target);
1583 }
1584 
1585 template <typename T>
1587  int field_number, const RepeatedField<T>& value,
1588  uint8* (*Writer)(int, T, uint8*), uint8* target) {
1589  const int n = value.size();
1590  if (n == 0) {
1591  return target;
1592  }
1593 
1594  const T* ii = value.data();
1595  int i = 0;
1596  do {
1597  target = Writer(field_number, ii[i], target);
1598  } while (++i < n);
1599 
1600  return target;
1601 }
1602 
1604  int field_number, const RepeatedField<int32>& value, uint8* target) {
1605  return WritePrimitiveToArray(field_number, value, WriteInt32ToArray, target);
1606 }
1608  int field_number, const RepeatedField<int64>& value, uint8* target) {
1609  return WritePrimitiveToArray(field_number, value, WriteInt64ToArray, target);
1610 }
1612  int field_number, const RepeatedField<uint32>& value, uint8* target) {
1613  return WritePrimitiveToArray(field_number, value, WriteUInt32ToArray, target);
1614 }
1616  int field_number, const RepeatedField<uint64>& value, uint8* target) {
1617  return WritePrimitiveToArray(field_number, value, WriteUInt64ToArray, target);
1618 }
1620  int field_number, const RepeatedField<int32>& value, uint8* target) {
1621  return WritePrimitiveToArray(field_number, value, WriteSInt32ToArray, target);
1622 }
1624  int field_number, const RepeatedField<int64>& value, uint8* target) {
1625  return WritePrimitiveToArray(field_number, value, WriteSInt64ToArray, target);
1626 }
1628  int field_number, const RepeatedField<uint32>& value, uint8* target) {
1629  return WritePrimitiveToArray(field_number, value, WriteFixed32ToArray,
1630  target);
1631 }
1633  int field_number, const RepeatedField<uint64>& value, uint8* target) {
1634  return WritePrimitiveToArray(field_number, value, WriteFixed64ToArray,
1635  target);
1636 }
1638  int field_number, const RepeatedField<int32>& value, uint8* target) {
1639  return WritePrimitiveToArray(field_number, value, WriteSFixed32ToArray,
1640  target);
1641 }
1643  int field_number, const RepeatedField<int64>& value, uint8* target) {
1644  return WritePrimitiveToArray(field_number, value, WriteSFixed64ToArray,
1645  target);
1646 }
1648  int field_number, const RepeatedField<float>& value, uint8* target) {
1649  return WritePrimitiveToArray(field_number, value, WriteFloatToArray, target);
1650 }
1652  int field_number, const RepeatedField<double>& value, uint8* target) {
1653  return WritePrimitiveToArray(field_number, value, WriteDoubleToArray, target);
1654 }
1655 inline uint8* WireFormatLite::WriteBoolToArray(int field_number,
1656  const RepeatedField<bool>& value,
1657  uint8* target) {
1658  return WritePrimitiveToArray(field_number, value, WriteBoolToArray, target);
1659 }
1660 inline uint8* WireFormatLite::WriteEnumToArray(int field_number,
1661  const RepeatedField<int>& value,
1662  uint8* target) {
1663  return WritePrimitiveToArray(field_number, value, WriteEnumToArray, target);
1664 }
1666  const std::string& value,
1667  uint8* target) {
1668  // String is for UTF-8 text only
1669  // WARNING: In wire_format.cc, both strings and bytes are handled by
1670  // WriteString() to avoid code duplication. If the implementations become
1671  // different, you will need to update that usage.
1674 }
1675 inline uint8* WireFormatLite::WriteBytesToArray(int field_number,
1676  const std::string& value,
1677  uint8* target) {
1680 }
1681 
1682 
1683 template <typename MessageType>
1685  int field_number, const MessageType& value, uint8* target) {
1687  target = value.InternalSerializeWithCachedSizesToArray(target);
1688  return WriteTagToArray(field_number, WIRETYPE_END_GROUP, target);
1689 }
1690 template <typename MessageType>
1692  int field_number, const MessageType& value, uint8* target) {
1695  static_cast<uint32>(value.GetCachedSize()), target);
1696  return value.InternalSerializeWithCachedSizesToArray(target);
1697 }
1698 
1699 // See comment on ReadGroupNoVirtual to understand the need for this template
1700 // parameter name.
1701 template <typename MessageType_WorkAroundCppLookupDefect>
1703  int field_number, const MessageType_WorkAroundCppLookupDefect& value,
1704  uint8* target) {
1706  target = value.MessageType_WorkAroundCppLookupDefect:: InternalSerializeWithCachedSizesToArray(target);
1707  return WriteTagToArray(field_number, WIRETYPE_END_GROUP, target);
1708 }
1709 template <typename MessageType_WorkAroundCppLookupDefect>
1711  int field_number, const MessageType_WorkAroundCppLookupDefect& value,
1712  uint8* target) {
1715  static_cast<uint32>(
1716  value.MessageType_WorkAroundCppLookupDefect::GetCachedSize()),
1717  target);
1718  return value.MessageType_WorkAroundCppLookupDefect:: InternalSerializeWithCachedSizesToArray(target);
1719 }
1720 
1721 // ===================================================================
1722 
1723 inline size_t WireFormatLite::Int32Size(int32 value) {
1726 inline size_t WireFormatLite::Int64Size(int64 value) {
1727  return io::CodedOutputStream::VarintSize64(static_cast<uint64>(value));
1729 inline size_t WireFormatLite::UInt32Size(uint32 value) {
1732 inline size_t WireFormatLite::UInt64Size(uint64 value) {
1735 inline size_t WireFormatLite::SInt32Size(int32 value) {
1738 inline size_t WireFormatLite::SInt64Size(int64 value) {
1741 inline size_t WireFormatLite::EnumSize(int value) {
1744 
1745 inline size_t WireFormatLite::StringSize(const std::string& value) {
1746  return LengthDelimitedSize(value.size());
1748 inline size_t WireFormatLite::BytesSize(const std::string& value) {
1749  return LengthDelimitedSize(value.size());
1751 
1752 
1753 template <typename MessageType>
1754 inline size_t WireFormatLite::GroupSize(const MessageType& value) {
1755  return value.ByteSizeLong();
1757 template <typename MessageType>
1758 inline size_t WireFormatLite::MessageSize(const MessageType& value) {
1759  return LengthDelimitedSize(value.ByteSizeLong());
1761 
1762 // See comment on ReadGroupNoVirtual to understand the need for this template
1763 // parameter name.
1764 template <typename MessageType_WorkAroundCppLookupDefect>
1766  const MessageType_WorkAroundCppLookupDefect& value) {
1767  return value.MessageType_WorkAroundCppLookupDefect::ByteSizeLong();
1768 }
1769 template <typename MessageType_WorkAroundCppLookupDefect>
1771  const MessageType_WorkAroundCppLookupDefect& value) {
1773  value.MessageType_WorkAroundCppLookupDefect::ByteSizeLong());
1774 }
1775 
1776 inline size_t WireFormatLite::LengthDelimitedSize(size_t length) {
1777  // The static_cast here prevents an error in certain compiler configurations
1778  // but is not technically correct--if length is too large to fit in a uint32
1779  // then it will be silently truncated. We will need to fix this if we ever
1780  // decide to start supporting serialized messages greater than 2 GiB in size.
1781  return length +
1783 }
1784 
1785 template <typename MS>
1787  // This method parses a group which should contain two fields:
1788  // required int32 type_id = 2;
1789  // required data message = 3;
1790 
1791  uint32 last_type_id = 0;
1792 
1793  // If we see message data before the type_id, we'll append it to this so
1794  // we can parse it later.
1796 
1797  while (true) {
1798  const uint32 tag = input->ReadTagNoLastTag();
1799  if (tag == 0) return false;
1800 
1801  switch (tag) {
1803  uint32 type_id;
1804  if (!input->ReadVarint32(&type_id)) return false;
1805  last_type_id = type_id;
1806 
1807  if (!message_data.empty()) {
1808  // We saw some message data before the type_id. Have to parse it
1809  // now.
1810  io::CodedInputStream sub_input(
1811  reinterpret_cast<const uint8*>(message_data.data()),
1812  static_cast<int>(message_data.size()));
1813  sub_input.SetRecursionLimit(input->RecursionBudget());
1814  if (!ms.ParseField(last_type_id, &sub_input)) {
1815  return false;
1816  }
1817  message_data.clear();
1818  }
1819 
1820  break;
1821  }
1822 
1824  if (last_type_id == 0) {
1825  // We haven't seen a type_id yet. Append this data to message_data.
1826  uint32 length;
1827  if (!input->ReadVarint32(&length)) return false;
1828  if (static_cast<int32>(length) < 0) return false;
1829  uint32 size = static_cast<uint32>(
1831  message_data.resize(size);
1832  auto ptr = reinterpret_cast<uint8*>(&message_data[0]);
1834  if (!input->ReadRaw(ptr, length)) return false;
1835  } else {
1836  // Already saw type_id, so we can parse this directly.
1837  if (!ms.ParseField(last_type_id, input)) {
1838  return false;
1839  }
1840  }
1841 
1842  break;
1843  }
1844 
1846  return true;
1847  }
1848 
1849  default: {
1850  if (!ms.SkipField(tag, input)) return false;
1851  }
1852  }
1853  }
1854 }
1855 
1856 } // namespace internal
1857 } // namespace protobuf
1858 } // namespace google
1859 
1860 #include <google/protobuf/port_undef.inc>
1861 
1862 #endif // GOOGLE_PROTOBUF_WIRE_FORMAT_LITE_H__
1863 
google::protobuf.internal::WireFormatLite::WriteMessageNoVirtual
static void WriteMessageNoVirtual(int field_number, const MessageType &value, io::CodedOutputStream *output)
google::protobuf.internal::WireFormatLite::EnumSize
static size_t EnumSize(int value)
Definition: wire_format_lite.h:1743
google::protobuf::io::CodedOutputStream::WriteLittleEndian32ToArray
static uint8 * WriteLittleEndian32ToArray(uint32 value, uint8 *target)
Definition: coded_stream.h:1180
google::protobuf.internal::WireFormatLite::WriteUInt64NoTag
static PROTOBUF_ALWAYS_INLINE void WriteUInt64NoTag(uint64 value, io::CodedOutputStream *output)
Definition: wire_format_lite.h:1289
google::protobuf.internal::WireFormatLite::ReadGroup
static bool ReadGroup(int field_number, io::CodedInputStream *input, MessageType *value)
Definition: wire_format_lite.h:1245
google::protobuf.internal::WireFormatLite::WriteSFixed64ToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteSFixed64ToArray(int field_number, int64 value, uint8 *target)
Definition: wire_format_lite.h:1559
google::protobuf.internal::WireFormatLite::WireTypeForFieldType
static WireFormatLite::WireType WireTypeForFieldType(WireFormatLite::FieldType type)
Definition: wire_format_lite.h:152
google::protobuf.internal::WireFormatLite::ReadBytes
static bool ReadBytes(io::CodedInputStream *input, std::string *value)
Definition: wire_format_lite.cc:565
google::protobuf.internal::WireFormatLite::WriteSInt32NoTag
static PROTOBUF_ALWAYS_INLINE void WriteSInt32NoTag(int32 value, io::CodedOutputStream *output)
Definition: wire_format_lite.h:1293
google::protobuf::value
const Descriptor::ReservedRange value
Definition: src/google/protobuf/descriptor.h:1954
google::protobuf.internal::ComputeUnknownMessageSetItemsSize
size_t ComputeUnknownMessageSetItemsSize(const UnknownFieldSet &unknown_fields)
Definition: wire_format.h:336
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS
#define GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(TypeName)
Definition: macros.h:40
arenastring.h
google::protobuf.internal.decoder.SkipField
def SkipField
Definition: decoder.py:1016
google::protobuf.internal::WireFormatLite::WriteSFixed64NoTagToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteSFixed64NoTagToArray(int64 value, uint8 *target)
Definition: wire_format_lite.h:1402
google::protobuf.internal::WireFormatLite::WriteMessageToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteMessageToArray(int field_number, const MessageLite &value, uint8 *target)
Definition: wire_format_lite.h:646
google::protobuf.internal::WireFormatLite::WriteEnumToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteEnumToArray(int field_number, int value, uint8 *target)
Definition: wire_format_lite.h:1579
google::protobuf.internal::WireFormatLite::WIRETYPE_FIXED32
@ WIRETYPE_FIXED32
Definition: wire_format_lite.h:107
google::protobuf.internal::WireFormatLite::WriteUInt32ToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteUInt32ToArray(int field_number, uint32 value, uint8 *target)
Definition: wire_format_lite.h:1524
google::protobuf.internal::WireFormatLite::WIRETYPE_VARINT
@ WIRETYPE_VARINT
Definition: wire_format_lite.h:102
google::protobuf::io::CodedInputStream::SetRecursionLimit
void SetRecursionLimit(int limit)
Definition: coded_stream.h:1302
NULL
NULL
Definition: test_security_zap.cpp:405
google::protobuf::int64
int64_t int64
Definition: protobuf/src/google/protobuf/stubs/port.h:151
google::protobuf.internal::WireFormatLite::WriteGroupToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteGroupToArray(int field_number, const MessageLite &value, uint8 *target)
Definition: wire_format_lite.h:642
google::protobuf.internal::WireFormatLite::InternalWriteMessageToArray
static PROTOBUF_ALWAYS_INLINE uint8 * InternalWriteMessageToArray(int field_number, const MessageType &value, uint8 *target)
google::protobuf.internal::WireFormatLite::WritePrimitiveNoTagToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WritePrimitiveNoTagToArray(const RepeatedField< T > &value, uint8 *(*Writer)(T, uint8 *), uint8 *target)
google::protobuf.internal::WireFormatLite::WriteUInt64NoTagToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteUInt64NoTagToArray(uint64 value, uint8 *target)
Definition: wire_format_lite.h:1375
length
GLenum GLuint GLenum GLsizei length
Definition: glcorearb.h:2695
input
std::string input
Definition: tokenizer_unittest.cc:197
google::protobuf.internal::WireFormatLite::ReadRepeatedFixedSizePrimitive
static PROTOBUF_ALWAYS_INLINE bool ReadRepeatedFixedSizePrimitive(int tag_size, uint32 tag, io::CodedInputStream *input, RepeatedField< CType > *value)
google::protobuf::io::CodedOutputStream::VarintSize64
static size_t VarintSize64(uint64 value)
Definition: coded_stream.h:1255
google::protobuf.internal::WireFormatLite::WriteInt64ToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteInt64ToArray(int field_number, int64 value, uint8 *target)
Definition: wire_format_lite.h:1519
google::protobuf::uint8
uint8_t uint8
Definition: protobuf/src/google/protobuf/stubs/port.h:153
google::protobuf.internal::WireFormatLite::MessageSize
static size_t MessageSize(const MessageType &value)
Definition: wire_format_lite.h:1760
google::protobuf.internal::FieldSkipper::FieldSkipper
FieldSkipper()
Definition: wire_format_lite.h:728
google::protobuf.internal::WireFormatLite::ZigZagEncode64
static uint64 ZigZagEncode64(int64 n)
Definition: wire_format_lite.h:864
google::protobuf.internal::WireFormatLite::BytesSize
static size_t BytesSize(const std::string &value)
Definition: wire_format_lite.h:1750
message_data
void * message_data(MessageHeader *msg)
Definition: php/ext/google/protobuf/message.c:248
google::protobuf.internal::WireFormatLite::TYPE_GROUP
@ TYPE_GROUP
Definition: wire_format_lite.h:121
google::protobuf.internal::WireFormatLite::WriteInt32NoTagToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteInt32NoTagToArray(int32 value, uint8 *target)
Definition: wire_format_lite.h:1362
google::protobuf.internal::WireFormatLite::WriteSInt32NoTagToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteSInt32NoTagToArray(int32 value, uint8 *target)
Definition: wire_format_lite.h:1379
google::protobuf.internal::WireFormatLite::WriteGroupNoVirtual
static void WriteGroupNoVirtual(int field_number, const MessageType &value, io::CodedOutputStream *output)
google::protobuf.internal::WireFormatLite::WriteStringToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteStringToArray(int field_number, const std::string &value, uint8 *target)
Definition: wire_format_lite.h:1665
google::protobuf::uint32
uint32_t uint32
Definition: protobuf/src/google/protobuf/stubs/port.h:155
google::protobuf.internal.wire_format.WIRETYPE_VARINT
int WIRETYPE_VARINT
Definition: wire_format.py:47
GOOGLE_DCHECK_GT
#define GOOGLE_DCHECK_GT
Definition: logging.h:200
google::protobuf.internal::WireFormatLite::WriteDoubleNoTagToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteDoubleNoTagToArray(double value, uint8 *target)
Definition: wire_format_lite.h:1412
google::protobuf.internal::WireFormatLite::ReadPackedFixedSizePrimitive
static PROTOBUF_ALWAYS_INLINE bool ReadPackedFixedSizePrimitive(io::CodedInputStream *input, RepeatedField< CType > *value)
google::protobuf.internal::FieldSkipper
Definition: wire_format_lite.h:726
google::protobuf.internal::WireFormatLite::InternalWriteGroupToArray
static PROTOBUF_ALWAYS_INLINE uint8 * InternalWriteGroupToArray(int field_number, const MessageType &value, uint8 *target)
google::protobuf.internal::WireFormatLite::ZigZagEncode32
static uint32 ZigZagEncode32(int32 n)
Definition: wire_format_lite.h:853
google::protobuf.internal::FieldSkipper::~FieldSkipper
virtual ~FieldSkipper()
Definition: wire_format_lite.h:729
string
GLsizei const GLchar *const * string
Definition: glcorearb.h:3083
google::protobuf.internal::WireFormatLite::kMessageSetItemEndTag
static const int kMessageSetItemEndTag
Definition: wire_format_lite.h:217
google::protobuf::RepeatedField
Definition: src/google/protobuf/message.h:184
google::protobuf.internal::WireFormatLite::WIRETYPE_END_GROUP
@ WIRETYPE_END_GROUP
Definition: wire_format_lite.h:106
google::protobuf.internal::WireFormatLite::WriteBoolNoTag
static PROTOBUF_ALWAYS_INLINE void WriteBoolNoTag(bool value, io::CodedOutputStream *output)
Definition: wire_format_lite.h:1325
google::protobuf::MessageLite
Definition: message_lite.h:183
google::protobuf.internal::WireFormatLite::GroupSize
static size_t GroupSize(const MessageType &value)
Definition: wire_format_lite.h:1756
target
GLenum target
Definition: glcorearb.h:3739
google::protobuf::io::CodedOutputStream::WriteVarint32SignExtendedToArray
static uint8 * WriteVarint32SignExtendedToArray(int32 value, uint8 *target)
Definition: coded_stream.h:1175
port.h
google::protobuf.internal::WireFormatLite::CppType
CppType
Definition: wire_format_lite.h:134
google::protobuf.internal::WireFormatLite::kMessageSetTypeIdTag
static const int kMessageSetTypeIdTag
Definition: wire_format_lite.h:219
google::protobuf::io::CodedOutputStream::WriteVarint32ToArray
static uint8 * WriteVarint32ToArray(uint32 value, uint8 *target)
Definition: coded_stream.h:1149
T
#define T(upbtypeconst, upbtype, ctype, default_value)
google::protobuf.internal.wire_format.WIRETYPE_FIXED32
int WIRETYPE_FIXED32
Definition: wire_format.py:52
bytes
uint8 bytes[10]
Definition: coded_stream_unittest.cc:153
google::protobuf.internal::WireFormatLite::SInt32Size
static size_t SInt32Size(int32 value)
Definition: wire_format_lite.h:1737
google::protobuf.internal::WireFormatLite::ReadMessageNoVirtual
static bool ReadMessageNoVirtual(io::CodedInputStream *input, MessageType *value)
Definition: wire_format_lite.h:340
ZigZagEncode32
#define ZigZagEncode32(x)
google::protobuf.internal::WireFormatLite::kMessageSetMessageTag
static const int kMessageSetMessageTag
Definition: wire_format_lite.h:221
google::protobuf.internal::WireFormatLite::WriteEnumNoTag
static PROTOBUF_ALWAYS_INLINE void WriteEnumNoTag(int value, io::CodedOutputStream *output)
Definition: wire_format_lite.h:1329
google::protobuf.internal::WireFormatLite::WriteSFixed32ToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteSFixed32ToArray(int field_number, int32 value, uint8 *target)
Definition: wire_format_lite.h:1554
values
GLenum GLsizei GLsizei GLint * values
Definition: glcorearb.h:3591
google::protobuf.internal.wire_format.WIRETYPE_FIXED64
int WIRETYPE_FIXED64
Definition: wire_format.py:48
google::protobuf::int32
int32_t int32
Definition: protobuf/src/google/protobuf/stubs/port.h:150
google::protobuf::io::CodedInputStream::ReadLittleEndian32FromArray
static const uint8 * ReadLittleEndian32FromArray(const uint8 *buffer, uint32 *value)
Definition: coded_stream.h:956
google::protobuf.internal::WireFormatLite::WriteTagToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteTagToArray(int field_number, WireType type, uint8 *target)
Definition: wire_format_lite.h:1356
google::protobuf.internal::WireFormatLite::Operation
Operation
Definition: wire_format_lite.h:322
READ_REPEATED_PACKED_FIXED_SIZE_PRIMITIVE
#define READ_REPEATED_PACKED_FIXED_SIZE_PRIMITIVE(CPPTYPE, DECLARED_TYPE)
Definition: wire_format_lite.h:1218
google::protobuf.internal::WireFormatLite::FieldTypeToCppType
static CppType FieldTypeToCppType(FieldType type)
Definition: wire_format_lite.h:763
google::protobuf.internal.wire_format.WIRETYPE_END_GROUP
int WIRETYPE_END_GROUP
Definition: wire_format.py:51
google::protobuf.internal::WireFormatLite::ReadRepeatedPrimitive
static PROTOBUF_ALWAYS_INLINE bool ReadRepeatedPrimitive(int tag_size, uint32 tag, io::CodedInputStream *input, RepeatedField< CType > *value)
coded_stream.h
google::protobuf.internal::WireFormatLite::WriteInt64NoTagToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteInt64NoTagToArray(int64 value, uint8 *target)
Definition: wire_format_lite.h:1366
google::protobuf.internal::WireFormatLite::kTagTypeMask
static const uint32 kTagTypeMask
Definition: wire_format_lite.h:160
google::protobuf.internal::WireFormatLite::EncodeFloat
static uint32 EncodeFloat(float value)
Definition: wire_format_lite.h:793
google::protobuf.internal::WireFormatLite::WriteFixed64ToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteFixed64ToArray(int field_number, uint64 value, uint8 *target)
Definition: wire_format_lite.h:1549
buffer
GLuint buffer
Definition: glcorearb.h:2939
google::protobuf.internal::WireFormatLite::WriteSInt64NoTag
static PROTOBUF_ALWAYS_INLINE void WriteSInt64NoTag(int64 value, io::CodedOutputStream *output)
Definition: wire_format_lite.h:1297
google::protobuf.internal::WireFormatLite::ReadString
static bool ReadString(io::CodedInputStream *input, std::string *value)
Definition: wire_format_lite.h:878
google::protobuf.internal::WireFormatLite::DecodeDouble
static double DecodeDouble(uint64 value)
Definition: wire_format_lite.h:820
google::protobuf.internal::WireFormatLite::WriteInt64NoTag
static PROTOBUF_ALWAYS_INLINE void WriteInt64NoTag(int64 value, io::CodedOutputStream *output)
Definition: wire_format_lite.h:1281
google::protobuf.internal::ParseMessageSetItemImpl
bool ParseMessageSetItemImpl(io::CodedInputStream *input, MS ms)
Definition: wire_format_lite.h:1788
google::protobuf.internal::WireFormatLite::ReadMessage
static bool ReadMessage(io::CodedInputStream *input, MessageType *value)
Definition: wire_format_lite.h:1258
google::protobuf.internal::WireFormatLite::InternalWriteMessageNoVirtualToArray
static PROTOBUF_ALWAYS_INLINE uint8 * InternalWriteMessageNoVirtualToArray(int field_number, const MessageType &value, uint8 *target)
google::protobuf.internal::WireFormatLite::InternalWriteGroupNoVirtualToArray
static PROTOBUF_ALWAYS_INLINE uint8 * InternalWriteGroupNoVirtualToArray(int field_number, const MessageType &value, uint8 *target)
google::protobuf::io::CodedOutputStream::VarintSize32
static size_t VarintSize32(uint32 value)
Definition: coded_stream.h:1245
google::protobuf.internal::WireFormatLite::LengthDelimitedSize
static size_t LengthDelimitedSize(size_t length)
Definition: wire_format_lite.h:1778
google::protobuf::io::CodedOutputStream::VarintSize32SignExtended
static size_t VarintSize32SignExtended(int32 value)
Definition: coded_stream.h:1265
google::protobuf::io::CodedOutputStream::WriteVarint64ToArray
static uint8 * WriteVarint64ToArray(uint64 value, uint8 *target)
Definition: coded_stream.h:1160
google::protobuf.internal::WireFormatLite::Int64Size
static size_t Int64Size(int64 value)
Definition: wire_format_lite.h:1728
google::protobuf.internal::WireFormatLite::WriteFloatToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteFloatToArray(int field_number, float value, uint8 *target)
Definition: wire_format_lite.h:1564
google::protobuf.internal::WireFormatLite::WriteFloatNoTag
static PROTOBUF_ALWAYS_INLINE void WriteFloatNoTag(float value, io::CodedOutputStream *output)
Definition: wire_format_lite.h:1317
p
const char * p
Definition: gmock-matchers_test.cc:3863
google::protobuf.internal::WireFormatLite::WriteFixed32ToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteFixed32ToArray(int field_number, uint32 value, uint8 *target)
Definition: wire_format_lite.h:1544
google::protobuf.internal::WireFormatLite::WIRETYPE_FIXED64
@ WIRETYPE_FIXED64
Definition: wire_format_lite.h:103
google::protobuf.internal::WireFormatLite::ReadPackedPrimitive
static PROTOBUF_ALWAYS_INLINE bool ReadPackedPrimitive(io::CodedInputStream *input, RepeatedField< CType > *value)
google::protobuf.internal::WireFormatLite::ReadRepeatedPrimitiveNoInline
static bool ReadRepeatedPrimitiveNoInline(int tag_size, uint32 tag, io::CodedInputStream *input, RepeatedField< CType > *value)
Definition: wire_format_lite.h:1134
google::protobuf.internal::WireFormatLite::WriteBoolToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteBoolToArray(int field_number, bool value, uint8 *target)
Definition: wire_format_lite.h:1574
google::protobuf::uint64
uint64_t uint64
Definition: protobuf/src/google/protobuf/stubs/port.h:156
size
#define size
Definition: glcorearb.h:2944
google::protobuf.internal::WireFormatLite::SInt64Size
static size_t SInt64Size(int64 value)
Definition: wire_format_lite.h:1740
repeated_field.h
google::protobuf.internal::WireFormatLite::FieldType
FieldType
Definition: wire_format_lite.h:111
google::protobuf.internal::WireFormatLite::WritePrimitiveToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WritePrimitiveToArray(int field_number, const RepeatedField< T > &value, uint8 *(*Writer)(int, T, uint8 *), uint8 *target)
google::protobuf.internal::WireFormatLite::MakeTag
constexpr static uint32 MakeTag(int field_number, WireType type)
Definition: wire_format_lite.h:768
google::protobuf.internal::WireFormatLite::GroupSizeNoVirtual
static size_t GroupSizeNoVirtual(const MessageType &value)
buffer
Definition: buffer_processor.h:43
google::protobuf.internal.wire_format.WIRETYPE_START_GROUP
int WIRETYPE_START_GROUP
Definition: wire_format.py:50
google::protobuf.internal::WireFormatLite::WriteFixed64NoTagToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteFixed64NoTagToArray(uint64 value, uint8 *target)
Definition: wire_format_lite.h:1393
google::protobuf.internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED
@ WIRETYPE_LENGTH_DELIMITED
Definition: wire_format_lite.h:104
google::protobuf.internal::WireFormatLite::EncodeDouble
static uint64 EncodeDouble(double value)
Definition: wire_format_lite.h:811
google::protobuf.internal::WireFormatLite::GetTagFieldNumber
static int GetTagFieldNumber(uint32 tag)
Definition: wire_format_lite.h:777
void
typedef void(APIENTRY *GLDEBUGPROCARB)(GLenum source
n
GLdouble n
Definition: glcorearb.h:4153
google::protobuf::io::CodedOutputStream
Definition: coded_stream.h:693
google::protobuf.internal::WireFormatLite::WriteInt32NoTag
static PROTOBUF_ALWAYS_INLINE void WriteInt32NoTag(int32 value, io::CodedOutputStream *output)
Definition: wire_format_lite.h:1277
i
int i
Definition: gmock-matchers_test.cc:764
ZigZagEncode64
#define ZigZagEncode64(x)
google::protobuf.internal::WireFormatLite::GetTagWireType
static WireType GetTagWireType(uint32 tag)
Definition: wire_format_lite.h:773
google::protobuf.internal::WireFormatLite::MessageSizeNoVirtual
static size_t MessageSizeNoVirtual(const MessageType &value)
type
GLenum type
Definition: glcorearb.h:2695
google::protobuf.internal::WireFormatLite::StringSize
static size_t StringSize(const std::string &value)
Definition: wire_format_lite.h:1747
google::protobuf.internal::WireFormatLite::WriteFixed64NoTag
static PROTOBUF_ALWAYS_INLINE void WriteFixed64NoTag(uint64 value, io::CodedOutputStream *output)
Definition: wire_format_lite.h:1305
google::protobuf.internal.wire_format.WIRETYPE_LENGTH_DELIMITED
int WIRETYPE_LENGTH_DELIMITED
Definition: wire_format.py:49
google::protobuf.internal::WireFormatLite::TagSize
static size_t TagSize(int field_number, WireFormatLite::FieldType type)
Definition: wire_format_lite.h:781
google::protobuf.internal::CodedOutputStreamFieldSkipper::~CodedOutputStreamFieldSkipper
~CodedOutputStreamFieldSkipper() override
Definition: wire_format_lite.h:750
google::protobuf.internal::CodedOutputStreamFieldSkipper
Definition: wire_format_lite.h:746
google::protobuf::io::CodedOutputStream::WriteLittleEndian64ToArray
static uint8 * WriteLittleEndian64ToArray(uint64 value, uint8 *target)
Definition: coded_stream.h:1193
common.h
google::protobuf.internal::WireFormatLite::WriteDoubleNoTag
static PROTOBUF_ALWAYS_INLINE void WriteDoubleNoTag(double value, io::CodedOutputStream *output)
Definition: wire_format_lite.h:1321
google::protobuf.internal::WireFormatLite::WriteFixedNoTagToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteFixedNoTagToArray(const RepeatedField< T > &value, uint8 *(*Writer)(T, uint8 *), uint8 *target)
google::protobuf.internal::WireFormatLite::WriteTag
static PROTOBUF_ALWAYS_INLINE void WriteTag(int field_number, WireType type, io::CodedOutputStream *output)
Definition: wire_format_lite.h:1272
google::protobuf.internal::CodedOutputStreamFieldSkipper::CodedOutputStreamFieldSkipper
CodedOutputStreamFieldSkipper(io::CodedOutputStream *unknown_fields)
Definition: wire_format_lite.h:748
benchmarks.python.py_benchmark.dest
dest
Definition: py_benchmark.py:13
size
GLsizeiptr size
Definition: glcorearb.h:2943
google::protobuf.internal::WireFormatLite::WriteBoolNoTagToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteBoolNoTagToArray(bool value, uint8 *target)
Definition: wire_format_lite.h:1417
message_lite.h
google::protobuf::io::CodedInputStream
Definition: coded_stream.h:173
google::protobuf.internal::WireFormatLite::kMessageSetItemTagsSize
static const size_t kMessageSetItemTagsSize
Definition: wire_format_lite.h:225
logging.h
google::protobuf.internal::WireFormatLite::DecodeFloat
static float DecodeFloat(uint32 value)
Definition: wire_format_lite.h:802
google::protobuf.internal::WireFormatLite::WIRETYPE_START_GROUP
@ WIRETYPE_START_GROUP
Definition: wire_format_lite.h:105
ZigZagDecode32
#define ZigZagDecode32(x)
google::protobuf::io::CodedOutputStream::WriteStringWithSizeToArray
static uint8 * WriteStringWithSizeToArray(const std::string &str, uint8 *target)
Definition: coded_stream.cc:787
google::protobuf::io::CodedInputStream::ReadLittleEndian64FromArray
static const uint8 * ReadLittleEndian64FromArray(const uint8 *buffer, uint64 *value)
Definition: coded_stream.h:970
google::protobuf.internal::WireFormatLite::WireType
WireType
Definition: wire_format_lite.h:101
ZigZagDecode64
#define ZigZagDecode64(x)
google::protobuf.internal::WireFormatLite::WriteSFixed64NoTag
static PROTOBUF_ALWAYS_INLINE void WriteSFixed64NoTag(int64 value, io::CodedOutputStream *output)
Definition: wire_format_lite.h:1313
google::protobuf::io::CodedOutputStream::WriteTagToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteTagToArray(uint32 value, uint8 *target)
Definition: coded_stream.h:1241
google::protobuf.internal::WireFormatLite::WriteUInt64ToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteUInt64ToArray(int field_number, uint64 value, uint8 *target)
Definition: wire_format_lite.h:1529
google::protobuf.internal::WireFormatLite::WriteFixed32NoTag
static PROTOBUF_ALWAYS_INLINE void WriteFixed32NoTag(uint32 value, io::CodedOutputStream *output)
Definition: wire_format_lite.h:1301
data
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: glcorearb.h:2879
google::protobuf.internal::WireFormatLite::WriteEnumNoTagToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteEnumNoTagToArray(int value, uint8 *target)
Definition: wire_format_lite.h:1420
google::protobuf.internal::WireFormatLite::ZigZagDecode64
static int64 ZigZagDecode64(uint64 n)
Definition: wire_format_lite.h:870
GOOGLE_PROTOBUF_WIRE_FORMAT_MAKE_TAG
#define GOOGLE_PROTOBUF_WIRE_FORMAT_MAKE_TAG(FIELD_NUMBER, TYPE)
Definition: wire_format_lite.h:202
internal
Definition: any.pb.h:40
google::protobuf.internal::WireFormatLite::UInt32Size
static size_t UInt32Size(uint32 value)
Definition: wire_format_lite.h:1731
google::protobuf.internal::SerializeUnknownMessageSetItems
void SerializeUnknownMessageSetItems(const UnknownFieldSet &unknown_fields, io::CodedOutputStream *output)
Definition: wire_format.h:331
google::protobuf::io::CodedInputStream::Limit
int Limit
Definition: coded_stream.h:350
google::protobuf.internal::WireFormatLite::WriteSFixed32NoTagToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteSFixed32NoTagToArray(int32 value, uint8 *target)
Definition: wire_format_lite.h:1397
google::protobuf.internal::WireFormatLite::WriteFloatNoTagToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteFloatNoTagToArray(float value, uint8 *target)
Definition: wire_format_lite.h:1407
f
GLfloat f
Definition: glcorearb.h:3964
google::protobuf.internal::WireFormatLite::WriteBytesToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteBytesToArray(int field_number, const std::string &value, uint8 *target)
Definition: wire_format_lite.h:1675
google::protobuf.internal::WireFormatLite::kTagTypeBits
static const int kTagTypeBits
Definition: wire_format_lite.h:158
google::protobuf.internal::WireFormatLite::WriteSInt64NoTagToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteSInt64NoTagToArray(int64 value, uint8 *target)
Definition: wire_format_lite.h:1384
value
GLsizei const GLfloat * value
Definition: glcorearb.h:3093
google::protobuf.internal::WireFormatLite::WriteSFixed32NoTag
static PROTOBUF_ALWAYS_INLINE void WriteSFixed32NoTag(int32 value, io::CodedOutputStream *output)
Definition: wire_format_lite.h:1309
google::protobuf.internal::WireFormatLite::Int32Size
static size_t Int32Size(int32 value)
Definition: wire_format_lite.h:1725
google::protobuf.internal::WireFormatLite::WriteDoubleToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteDoubleToArray(int field_number, double value, uint8 *target)
Definition: wire_format_lite.h:1569
google::protobuf.internal::CodedOutputStreamFieldSkipper::unknown_fields_
io::CodedOutputStream * unknown_fields_
Definition: wire_format_lite.h:758
output
const upb_json_parsermethod const upb_symtab upb_sink * output
Definition: ruby/ext/google/protobuf_c/upb.h:10503
google::protobuf.internal::WireFormatLite
Definition: wire_format_lite.h:84
google::protobuf.internal::WireFormatLite::kFieldTypeToCppTypeMap
static const CppType kFieldTypeToCppTypeMap[]
Definition: wire_format_lite.h:714
google::protobuf.internal::WireFormatLite::WriteSInt64ToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteSInt64ToArray(int field_number, int64 value, uint8 *target)
Definition: wire_format_lite.h:1539
google::protobuf.internal::FieldType
uint8 FieldType
Definition: extension_set.h:87
google::protobuf.internal::WireFormatLite::WriteFixed32NoTagToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteFixed32NoTagToArray(uint32 value, uint8 *target)
Definition: wire_format_lite.h:1389
a
GLboolean GLboolean GLboolean GLboolean a
Definition: glcorearb.h:3228
google::protobuf.internal::WireFormatLite::WriteUInt32NoTag
static PROTOBUF_ALWAYS_INLINE void WriteUInt32NoTag(uint32 value, io::CodedOutputStream *output)
Definition: wire_format_lite.h:1285
google::protobuf.internal::WireFormatLite::WriteUInt32NoTagToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteUInt32NoTagToArray(uint32 value, uint8 *target)
Definition: wire_format_lite.h:1371
google::protobuf.internal::WireFormatLite::WriteSInt32ToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteSInt32ToArray(int field_number, int32 value, uint8 *target)
Definition: wire_format_lite.h:1534
google
Definition: data_proto2_to_proto3_util.h:11
google::protobuf.internal::WireFormatLite::ZigZagDecode32
static int32 ZigZagDecode32(uint32 n)
Definition: wire_format_lite.h:859
google::protobuf.internal::WireFormatLite::ReadPackedPrimitiveNoInline
static bool ReadPackedPrimitiveNoInline(io::CodedInputStream *input, RepeatedField< CType > *value)
Definition: wire_format_lite.h:1238
google::protobuf.internal::WireFormatLite::UInt64Size
static size_t UInt64Size(uint64 value)
Definition: wire_format_lite.h:1734
READ_REPEATED_FIXED_SIZE_PRIMITIVE
#define READ_REPEATED_FIXED_SIZE_PRIMITIVE(CPPTYPE, DECLARED_TYPE)
Definition: wire_format_lite.h:1113
google::protobuf::io::CodedInputStream::ExpectTagFromArray
static const PROTOBUF_ALWAYS_INLINE uint8 * ExpectTagFromArray(const uint8 *buffer, uint32 expected)
Definition: coded_stream.h:1100
google::protobuf.internal::WireFormatLite::WriteInt32ToArray
static PROTOBUF_ALWAYS_INLINE uint8 * WriteInt32ToArray(int field_number, int32 value, uint8 *target)
Definition: wire_format_lite.h:1514
GOOGLE_DCHECK_EQ
#define GOOGLE_DCHECK_EQ
Definition: logging.h:196


libaditof
Author(s):
autogenerated on Wed May 21 2025 02:07:02