diff options
author | Lizan Zhou <zlizan@google.com> | 2016-06-22 11:46:10 -0700 |
---|---|---|
committer | Lizan Zhou <zlizan@google.com> | 2016-06-28 00:17:06 -0700 |
commit | 31999a3f95d8ec9f93b56b0966e2895c5205da53 (patch) | |
tree | b6b430749dd1af0444b1de5a90682bf26716341a /src/google/protobuf/util/internal/protostream_objectwriter.h | |
parent | dc0aeaa9030bdac264b44d56d07b6839a1ae94e9 (diff) | |
download | protobuf-31999a3f95d8ec9f93b56b0966e2895c5205da53.tar.gz protobuf-31999a3f95d8ec9f93b56b0966e2895c5205da53.tar.bz2 protobuf-31999a3f95d8ec9f93b56b0966e2895c5205da53.zip |
Add JsonParseOptions to ignore unknown fields
- add JsonParseOptions for JsonToBinaryString allow unknown fields
- rename current JsonOptions to JsonPrintOptions
Diffstat (limited to 'src/google/protobuf/util/internal/protostream_objectwriter.h')
-rw-r--r-- | src/google/protobuf/util/internal/protostream_objectwriter.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/google/protobuf/util/internal/protostream_objectwriter.h b/src/google/protobuf/util/internal/protostream_objectwriter.h index e1162d43..8043bb3b 100644 --- a/src/google/protobuf/util/internal/protostream_objectwriter.h +++ b/src/google/protobuf/util/internal/protostream_objectwriter.h @@ -83,7 +83,12 @@ class LIBPROTOBUF_EXPORT ProtoStreamObjectWriter : public ProtoWriter { // preserve integer precision. bool struct_integers_as_strings; - Options() : struct_integers_as_strings(false) {} + // Not treat unknown fields as an error. If there is an unknown fields, + // just ignore it and continue to process the rest. + bool ignore_unknown_fields; + + Options() + : struct_integers_as_strings(false), ignore_unknown_fields(false) {} // Default instance of Options with all options set to defaults. static const Options& Defaults() { |