flatbuffer force-empty option (#4822)

This commit is contained in:
shassani
2018-07-16 16:05:06 -07:00
committed by Wouter van Oortmerssen
parent af6c0e6839
commit 51d9641de6
4 changed files with 28 additions and 6 deletions

View File

@@ -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.