mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-04 12:43:24 +00:00
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>
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user