aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/util/json_util.h
diff options
context:
space:
mode:
authorGravatar Sanchay Harneja <sanchay.h@gmail.com>2017-02-18 16:57:26 -0800
committerGravatar Sanchay Harneja <sanchay.h@gmail.com>2017-02-18 17:06:43 -0800
commit172e0a6423742a2a2ca9d64917d63d5352a52e3d (patch)
tree4253ddb58a0c625f34a088fe9a45386c22f5fdf5 /src/google/protobuf/util/json_util.h
parenta9ab38c17178fcedd9b46c09fa33f94d1a6335c3 (diff)
Add an option to always print enums as ints in Json API
Diffstat (limited to 'src/google/protobuf/util/json_util.h')
-rw-r--r--src/google/protobuf/util/json_util.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/google/protobuf/util/json_util.h b/src/google/protobuf/util/json_util.h
index 6d3cee52..8dda70c3 100644
--- a/src/google/protobuf/util/json_util.h
+++ b/src/google/protobuf/util/json_util.h
@@ -61,9 +61,13 @@ struct JsonPrintOptions {
// set to 0 will be omitted. Set this flag to true will override the default
// behavior and print primitive fields regardless of their values.
bool always_print_primitive_fields;
+ // Whether to always print enums as ints. By default they are rendered as
+ // strings.
+ bool always_print_enums_as_ints;
JsonPrintOptions() : add_whitespace(false),
- always_print_primitive_fields(false) {
+ always_print_primitive_fields(false),
+ always_print_enums_as_ints(false) {
}
};