diff options
author | Feng Xiao <xiaofeng@google.com> | 2016-07-01 15:43:37 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-01 15:43:37 -0700 |
commit | cae3b0cbb689d0ed1e5da73942a5a9705f3411b0 (patch) | |
tree | 855f5c2c2d2dd82715145401ed68d20ff025693c /src/google/protobuf/util/internal/protostream_objectwriter.h | |
parent | 02b55d248f2fa9f24905201d1ba16a79dd20fdc8 (diff) | |
parent | 31999a3f95d8ec9f93b56b0966e2895c5205da53 (diff) | |
download | protobuf-cae3b0cbb689d0ed1e5da73942a5a9705f3411b0.tar.gz protobuf-cae3b0cbb689d0ed1e5da73942a5a9705f3411b0.tar.bz2 protobuf-cae3b0cbb689d0ed1e5da73942a5a9705f3411b0.zip |
Merge pull request #1704 from lizan/json_parse_options
Add JsonParseOptions to ignore unknown fields
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 75e3d67d..2e4d14d1 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() { |