diff options
author | shassani <shassani@soe.ucsc.edu> | 2018-07-16 16:05:06 -0700 |
---|---|---|
committer | Wouter van Oortmerssen <aardappel@gmail.com> | 2018-07-16 16:05:06 -0700 |
commit | 51d9641de68c07b06e20a53cabf79ceb447414ef (patch) | |
tree | 2fb995a84cb096688cf073f46f25e9bcc9203440 /include/flatbuffers/idl.h | |
parent | af6c0e68390855e100b187f8e374d1f27f12298a (diff) | |
download | flatbuffers-51d9641de68c07b06e20a53cabf79ceb447414ef.tar.gz |
flatbuffer force-empty option (#4822)
Diffstat (limited to 'include/flatbuffers/idl.h')
-rw-r--r-- | include/flatbuffers/idl.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/include/flatbuffers/idl.h b/include/flatbuffers/idl.h index 55ef89d1..9d50a94e 100644 --- a/include/flatbuffers/idl.h +++ b/include/flatbuffers/idl.h @@ -422,6 +422,10 @@ struct IDLOptions { // for code generation. unsigned long lang_to_generate; + // If set (default behavior), empty string and vector fields will be set to + // nullptr to make the flatbuffer more compact. + bool set_empty_to_null; + IDLOptions() : strict_json(false), skip_js_exports(false), @@ -457,7 +461,8 @@ struct IDLOptions { force_defaults(false), lang(IDLOptions::kJava), mini_reflect(IDLOptions::kNone), - lang_to_generate(0) {} + lang_to_generate(0), + set_empty_to_null(true) {} }; // This encapsulates where the parser is in the current source file. |