diff options
author | Casper <casperneo@uchicago.edu> | 2020-07-16 13:43:47 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-16 13:43:47 -0700 |
commit | 9ecd2e16c2adb6fe9e3cf2fa8f4e1e310d48a1c2 (patch) | |
tree | ec79c62ad00d6cad36b799e801d5d4293edf8a5c /include | |
parent | 33e2d807919ee70e0b353f776c0ecbccf9cba130 (diff) | |
download | flatbuffers-9ecd2e16c2adb6fe9e3cf2fa8f4e1e310d48a1c2.tar.gz flatbuffers-9ecd2e16c2adb6fe9e3cf2fa8f4e1e310d48a1c2.tar.bz2 flatbuffers-9ecd2e16c2adb6fe9e3cf2fa8f4e1e310d48a1c2.zip |
Flatc parser support for nullable scalars (#6026)
* Parser support for nullable scalars
* Use older C++ features
* use default element
* Add a test for json, flexbuffers, and null
* test comments and names
Co-authored-by: Casper Neo <cneo@google.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/flatbuffers/idl.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/flatbuffers/idl.h b/include/flatbuffers/idl.h index 8c02f282..70a2b787 100644 --- a/include/flatbuffers/idl.h +++ b/include/flatbuffers/idl.h @@ -296,6 +296,7 @@ struct FieldDef : public Definition { shared(false), native_inline(false), flexbuffer(false), + nullable(false), nested_flatbuffer(NULL), padding(0) {} @@ -314,6 +315,8 @@ struct FieldDef : public Definition { bool native_inline; // Field will be defined inline (instead of as a pointer) // for native tables if field is a struct. bool flexbuffer; // This field contains FlexBuffer data. + bool nullable; // If True, this field is Null (as opposed to default + // valued). StructDef *nested_flatbuffer; // This field contains nested FlatBuffer data. size_t padding; // Bytes to always pad after this field. }; @@ -927,6 +930,7 @@ class Parser : public ParserState { bool SupportsAdvancedUnionFeatures() const; bool SupportsAdvancedArrayFeatures() const; + bool SupportsNullableScalars() const; Namespace *UniqueNamespace(Namespace *ns); FLATBUFFERS_CHECKED_ERROR RecurseError(); |