From 3b3c8abb9635eb3ea078a821a99c9ef29d66dff7 Mon Sep 17 00:00:00 2001 From: Jisi Liu Date: Wed, 30 Mar 2016 11:39:59 -0700 Subject: Integrate google internal changes. --- src/google/protobuf/util/internal/proto_writer.h | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'src/google/protobuf/util/internal/proto_writer.h') diff --git a/src/google/protobuf/util/internal/proto_writer.h b/src/google/protobuf/util/internal/proto_writer.h index e631e56f..957565e7 100644 --- a/src/google/protobuf/util/internal/proto_writer.h +++ b/src/google/protobuf/util/internal/proto_writer.h @@ -106,10 +106,12 @@ class LIBPROTOBUF_EXPORT ProtoWriter : public StructuredObjectWriter { return RenderDataPiece(name, DataPiece(value)); } virtual ProtoWriter* RenderString(StringPiece name, StringPiece value) { - return RenderDataPiece(name, DataPiece(value)); + return RenderDataPiece(name, + DataPiece(value, use_strict_base64_decoding())); } virtual ProtoWriter* RenderBytes(StringPiece name, StringPiece value) { - return RenderDataPiece(name, DataPiece(value, false)); + return RenderDataPiece( + name, DataPiece(value, false, use_strict_base64_decoding())); } virtual ProtoWriter* RenderNull(StringPiece name) { return RenderDataPiece(name, DataPiece::NullData()); @@ -126,7 +128,7 @@ class LIBPROTOBUF_EXPORT ProtoWriter : public StructuredObjectWriter { } // When true, we finished writing to output a complete message. - bool done() const { return done_; } + bool done() { return done_; } // Returns the proto stream object. google::protobuf::io::CodedOutputStream* stream() { return stream_.get(); } @@ -266,6 +268,19 @@ class LIBPROTOBUF_EXPORT ProtoWriter : public StructuredObjectWriter { // Returns true if the field is repeated. bool IsRepeated(const google::protobuf::Field& field); + // Starts an object given the field and the enclosing type. + ProtoWriter* StartObjectField(const google::protobuf::Field& field, + const google::protobuf::Type& type); + + // Starts a list given the field and the enclosing type. + ProtoWriter* StartListField(const google::protobuf::Field& field, + const google::protobuf::Type& type); + + // Renders a primitve field given the field and the enclosing type. + ProtoWriter* RenderPrimitiveField(const google::protobuf::Field& field, + const google::protobuf::Type& type, + const DataPiece& value); + private: // Variables for describing the structure of the input tree: // master_type_: descriptor for the whole protobuf message. -- cgit v1.2.3