~ubuntu-branches/debian/stretch/protobuf/stretch

« back to all changes in this revision

Viewing changes to src/google/protobuf/wire_format_lite.h

  • Committer: Package Import Robot
  • Author(s): Robert S. Edmonds
  • Date: 2014-09-11 22:50:10 UTC
  • mfrom: (10.1.9 experimental)
  • Revision ID: package-import@ubuntu.com-20140911225010-wt4yo9dpc1fzuq5g
Tags: 2.6.0-3
Upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
163
163
  // records to an UnknownFieldSet.
164
164
  static bool SkipField(io::CodedInputStream* input, uint32 tag);
165
165
 
 
166
  // Skips a field value with the given tag.  The input should start
 
167
  // positioned immediately after the tag. Skipped values are recorded to a
 
168
  // CodedOutputStream.
 
169
  static bool SkipField(io::CodedInputStream* input, uint32 tag,
 
170
                        io::CodedOutputStream* output);
 
171
 
166
172
  // Reads and ignores a message from the input.  Skipped values are simply
167
173
  // discarded, not recorded anywhere.  See WireFormat::SkipMessage() for a
168
174
  // version that records to an UnknownFieldSet.
169
175
  static bool SkipMessage(io::CodedInputStream* input);
170
176
 
 
177
  // Reads and ignores a message from the input.  Skipped values are recorded
 
178
  // to a CodedOutputStream.
 
179
  static bool SkipMessage(io::CodedInputStream* input,
 
180
                          io::CodedOutputStream* output);
 
181
 
171
182
// This macro does the same thing as WireFormatLite::MakeTag(), but the
172
183
// result is usable as a compile-time constant, which makes it usable
173
184
// as a switch case or a template input.  WireFormatLite::MakeTag() is more
220
231
  static uint32 ZigZagEncode32(int32 n);
221
232
  static int32  ZigZagDecode32(uint32 n);
222
233
  static uint64 ZigZagEncode64(int64 n);
223
 
  static int64  ZigZagDecode64(uint64 n)
224
 
#ifdef __arm__
225
 
    __attribute__((__optimize__(0)))
226
 
#endif
227
 
  ;
 
234
  static int64  ZigZagDecode64(uint64 n);
228
235
 
229
236
  // =================================================================
230
237
  // Methods for reading/writing individual field.  The implementations
344
351
 
345
352
  static void WriteString(field_number, const string& value, output);
346
353
  static void WriteBytes (field_number, const string& value, output);
 
354
  static void WriteStringMaybeAliased(
 
355
      field_number, const string& value, output);
 
356
  static void WriteBytesMaybeAliased(
 
357
      field_number, const string& value, output);
347
358
 
348
359
  static void WriteGroup(
349
360
    field_number, const MessageLite& value, output);
494
505
      google::protobuf::io::CodedInputStream* input,
495
506
      RepeatedField<CType>* value) GOOGLE_ATTRIBUTE_ALWAYS_INLINE;
496
507
 
 
508
  // Like ReadRepeatedFixedSizePrimitive but for packed primitive fields.
 
509
  template <typename CType, enum FieldType DeclaredType>
 
510
  static inline bool ReadPackedFixedSizePrimitive(
 
511
      google::protobuf::io::CodedInputStream* input,
 
512
      RepeatedField<CType>* value) GOOGLE_ATTRIBUTE_ALWAYS_INLINE;
 
513
 
497
514
  static const CppType kFieldTypeToCppTypeMap[];
498
515
  static const WireFormatLite::WireType kWireTypeForFieldType[];
499
516
 
522
539
  virtual void SkipUnknownEnum(int field_number, int value);
523
540
};
524
541
 
 
542
// Subclass of FieldSkipper which saves skipped fields to a CodedOutputStream.
 
543
 
 
544
class LIBPROTOBUF_EXPORT CodedOutputStreamFieldSkipper : public FieldSkipper {
 
545
 public:
 
546
  explicit CodedOutputStreamFieldSkipper(io::CodedOutputStream* unknown_fields)
 
547
      : unknown_fields_(unknown_fields) {}
 
548
  virtual ~CodedOutputStreamFieldSkipper() {}
 
549
 
 
550
  // implements FieldSkipper -----------------------------------------
 
551
  virtual bool SkipField(io::CodedInputStream* input, uint32 tag);
 
552
  virtual bool SkipMessage(io::CodedInputStream* input);
 
553
  virtual void SkipUnknownEnum(int field_number, int value);
 
554
 
 
555
 protected:
 
556
  io::CodedOutputStream* unknown_fields_;
 
557
};
 
558
 
 
559
 
525
560
// inline methods ====================================================
526
561
 
527
562
inline WireFormatLite::CppType