mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-02 12:05:50 +00:00
[flac] Add FlexBuffers option for generating data (#5519)
Alongside --binary and --json, an additional switch (--flexbuffers) can be passed to convert data using FlexBuffers
This commit is contained in:
committed by
Wouter van Oortmerssen
parent
a92039687a
commit
cfb4ecf6f0
@@ -2710,7 +2710,13 @@ bool Parser::ParseFlexBuffer(const char *source, const char *source_filename,
|
||||
bool Parser::Parse(const char *source, const char **include_paths,
|
||||
const char *source_filename) {
|
||||
FLATBUFFERS_ASSERT(0 == recurse_protection_counter);
|
||||
auto r = !ParseRoot(source, include_paths, source_filename).Check();
|
||||
bool r;
|
||||
|
||||
if (opts.use_flexbuffers) {
|
||||
r = ParseFlexBuffer(source, source_filename, &flex_builder_);
|
||||
} else {
|
||||
r = !ParseRoot(source, include_paths, source_filename).Check();
|
||||
}
|
||||
FLATBUFFERS_ASSERT(0 == recurse_protection_counter);
|
||||
return r;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user