mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-04 12:43:24 +00:00
Sorted Vector & binary search functionality.
Bug: 16659276 Tested: on Linux & Windows. Change-Id: Ie7a73810345fad4cf0a3ad03dfaa5464e3ed5ac8
This commit is contained in:
@@ -395,6 +395,17 @@ void Parser::ParseField(StructDef &struct_def) {
|
||||
if (field.required && (struct_def.fixed ||
|
||||
IsScalar(field.value.type.base_type)))
|
||||
Error("only non-scalar fields in tables may be 'required'");
|
||||
field.key = field.attributes.Lookup("key") != nullptr;
|
||||
if (field.key) {
|
||||
if (struct_def.has_key)
|
||||
Error("only one field may be set as 'key'");
|
||||
struct_def.has_key = true;
|
||||
if (!IsScalar(field.value.type.base_type)) {
|
||||
field.required = true;
|
||||
if (field.value.type.base_type != BASE_TYPE_STRING)
|
||||
Error("'key' field must be string or scalar type");
|
||||
}
|
||||
}
|
||||
auto nested = field.attributes.Lookup("nested_flatbuffer");
|
||||
if (nested) {
|
||||
if (nested->type.base_type != BASE_TYPE_STRING)
|
||||
|
||||
Reference in New Issue
Block a user