aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/util/internal/proto_writer.h
diff options
context:
space:
mode:
authorGravatar Jisi Liu <jisi.liu@gmail.com>2016-03-30 11:39:59 -0700
committerGravatar Jisi Liu <jisi.liu@gmail.com>2016-03-30 11:39:59 -0700
commit3b3c8abb9635eb3ea078a821a99c9ef29d66dff7 (patch)
tree7d2ec154f15c9f9153d890e76b6cf30e471ea488 /src/google/protobuf/util/internal/proto_writer.h
parent78105897a8f01c7be9cf8502b6c58d47eb1ccdd7 (diff)
Integrate google internal changes.
Diffstat (limited to 'src/google/protobuf/util/internal/proto_writer.h')
-rw-r--r--src/google/protobuf/util/internal/proto_writer.h21
1 files changed, 18 insertions, 3 deletions
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.