aboutsummaryrefslogtreecommitdiff
path: root/src/google/protobuf/util/internal/default_value_objectwriter.h
diff options
context:
space:
mode:
authorFeng Xiao <xfxyjwf@gmail.com>2015-08-22 18:25:48 -0700
committerFeng Xiao <xfxyjwf@gmail.com>2015-08-22 18:25:48 -0700
commiteee38b0c018b3279f77d03dff796f440f40d3516 (patch)
tree7ff0978e30238d493fc7899b75abeb6d66939f07 /src/google/protobuf/util/internal/default_value_objectwriter.h
parentc3bc155aceda36ecb01cde2367a3b427f2d7ce40 (diff)
downloadprotobuf-eee38b0c018b3279f77d03dff796f440f40d3516.tar.gz
protobuf-eee38b0c018b3279f77d03dff796f440f40d3516.tar.bz2
protobuf-eee38b0c018b3279f77d03dff796f440f40d3516.zip
Down-integrate from google3.
Diffstat (limited to 'src/google/protobuf/util/internal/default_value_objectwriter.h')
-rw-r--r--src/google/protobuf/util/internal/default_value_objectwriter.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/google/protobuf/util/internal/default_value_objectwriter.h b/src/google/protobuf/util/internal/default_value_objectwriter.h
index 759ba91b..2468c8d9 100644
--- a/src/google/protobuf/util/internal/default_value_objectwriter.h
+++ b/src/google/protobuf/util/internal/default_value_objectwriter.h
@@ -57,7 +57,7 @@ namespace converter {
// ObjectWriter when EndObject() is called on the root object. It also writes
// out all non-repeated primitive fields that haven't been explicitly rendered
// with their default values (0 for numbers, "" for strings, etc).
-class LIBPROTOBUF_EXPORT DefaultValueObjectWriter : public ObjectWriter {
+class DefaultValueObjectWriter : public ObjectWriter {
public:
DefaultValueObjectWriter(TypeResolver* type_resolver,
const google::protobuf::Type& type,
@@ -129,7 +129,7 @@ class LIBPROTOBUF_EXPORT DefaultValueObjectWriter : public ObjectWriter {
// Populates children of this Node based on its type. If there are already
// children created, they will be merged to the result. Caller should pass
// in TypeInfo for looking up types of the children.
- void PopulateChildren(TypeInfo* typeinfo);
+ void PopulateChildren(const TypeInfo* typeinfo);
// If this node is a leaf (has data), writes the current node to the
// ObjectWriter; if not, then recursively writes the children to the
@@ -165,7 +165,10 @@ class LIBPROTOBUF_EXPORT DefaultValueObjectWriter : public ObjectWriter {
// Returns the Value Type of a map given the Type of the map entry and a
// TypeInfo instance.
const google::protobuf::Type* GetMapValueType(
- const google::protobuf::Type& entry_type, TypeInfo* typeinfo);
+ const google::protobuf::Type& entry_type, const TypeInfo* typeinfo);
+
+ // Calls WriteTo() on every child in children_.
+ void WriteChildren(ObjectWriter* ow);
// The name of this node.
string name_;
@@ -210,7 +213,9 @@ class LIBPROTOBUF_EXPORT DefaultValueObjectWriter : public ObjectWriter {
// Type information for all the types used in the descriptor. Used to find
// google::protobuf::Type of nested messages/enums.
- google::protobuf::scoped_ptr<TypeInfo> typeinfo_;
+ const TypeInfo* typeinfo_;
+ // Whether the TypeInfo object is owned by this class.
+ bool own_typeinfo_;
// google::protobuf::Type of the root message type.
const google::protobuf::Type& type_;
// Holds copies of strings passed to RenderString.