aboutsummaryrefslogtreecommitdiff
path: root/src/google/protobuf/util/internal/object_writer.h
diff options
context:
space:
mode:
authorJisi Liu <jisi.liu@gmail.com>2016-03-30 11:39:59 -0700
committerJisi Liu <jisi.liu@gmail.com>2016-03-30 11:39:59 -0700
commit3b3c8abb9635eb3ea078a821a99c9ef29d66dff7 (patch)
tree7d2ec154f15c9f9153d890e76b6cf30e471ea488 /src/google/protobuf/util/internal/object_writer.h
parent78105897a8f01c7be9cf8502b6c58d47eb1ccdd7 (diff)
downloadprotobuf-3b3c8abb9635eb3ea078a821a99c9ef29d66dff7.tar.gz
protobuf-3b3c8abb9635eb3ea078a821a99c9ef29d66dff7.tar.bz2
protobuf-3b3c8abb9635eb3ea078a821a99c9ef29d66dff7.zip
Integrate google internal changes.
Diffstat (limited to 'src/google/protobuf/util/internal/object_writer.h')
-rw-r--r--src/google/protobuf/util/internal/object_writer.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/google/protobuf/util/internal/object_writer.h b/src/google/protobuf/util/internal/object_writer.h
index e695f45e..9f07363d 100644
--- a/src/google/protobuf/util/internal/object_writer.h
+++ b/src/google/protobuf/util/internal/object_writer.h
@@ -105,10 +105,27 @@ class LIBPROTOBUF_EXPORT ObjectWriter {
static void RenderDataPieceTo(const DataPiece& data, StringPiece name,
ObjectWriter* ow);
+ // Indicates whether this ObjectWriter has completed writing the root message,
+ // usually this means writing of one complete object. Subclasses must override
+ // this behavior appropriately.
+ virtual bool done() { return false; }
+
+ void set_use_strict_base64_decoding(bool value) {
+ use_strict_base64_decoding_ = value;
+ }
+
+ bool use_strict_base64_decoding() const {
+ return use_strict_base64_decoding_;
+ }
+
protected:
- ObjectWriter() {}
+ ObjectWriter() : use_strict_base64_decoding_(true) {}
private:
+ // If set to true, we use the stricter version of base64 decoding for byte
+ // fields by making sure decoded version encodes back to the original string.
+ bool use_strict_base64_decoding_;
+
// Do not add any data members to this class.
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ObjectWriter);
};