mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-15 16:57:29 +00:00
Default strings and vectors: Parser + Rust support (#6421)
* Fix tests.cpp * Parser support for vector/string defaults * tests and default empty vectors * addressed comments * Default strings and vectors for Rust * Tested Rust more_defaults * git-clang-format * add more_defaults_test * fixed vector default * removed commented out code * more unreachable Co-authored-by: Casper Neo <cneo@google.com>
This commit is contained in:
@@ -337,6 +337,7 @@ struct FieldDef : public Definition {
|
||||
kDefault,
|
||||
};
|
||||
Presence static MakeFieldPresence(bool optional, bool required) {
|
||||
FLATBUFFERS_ASSERT(!(required && optional));
|
||||
// clang-format off
|
||||
return required ? FieldDef::kRequired
|
||||
: optional ? FieldDef::kOptional
|
||||
@@ -973,6 +974,7 @@ class Parser : public ParserState {
|
||||
bool SupportsAdvancedUnionFeatures() const;
|
||||
bool SupportsAdvancedArrayFeatures() const;
|
||||
bool SupportsOptionalScalars() const;
|
||||
bool SupportsDefaultVectorsAndStrings() const;
|
||||
Namespace *UniqueNamespace(Namespace *ns);
|
||||
|
||||
FLATBUFFERS_CHECKED_ERROR RecurseError();
|
||||
|
||||
Reference in New Issue
Block a user