Mutable FlatBuffers: in-place updates.

This commit contains the first step in providing mutable FlatBuffers,
non-const accessors and mutation functions for existing fields generated
from --gen-mutable.

Change-Id: Iebee3975f05c1001f8e22824725edeaa6d85fbee
Tested: on Linux.
Bug: 15777024
This commit is contained in:
Wouter van Oortmerssen
2015-04-27 16:25:06 -07:00
parent a8d6962ac2
commit 3ec5dddb00
10 changed files with 225 additions and 22 deletions

View File

@@ -89,6 +89,7 @@ static void Error(const char *err, const char *obj, bool usage,
" --no-prefix Don\'t prefix enum values with the enum type in C++.\n"
" --gen-includes Generate include statements for included schemas the\n"
" generated file depends on (C++).\n"
" --gen-mutable Generate accessors that can mutate buffers in-place.\n"
" --proto Input is a .proto, translate to .fbs.\n"
"FILEs may depend on declarations in earlier files.\n"
"FILEs after the -- must be binary flatbuffer format files.\n"
@@ -128,6 +129,8 @@ int main(int argc, const char *argv[]) {
opts.strict_json = true;
} else if(opt == "--no-prefix") {
opts.prefixed_enums = false;
} else if(opt == "--gen-mutable") {
opts.mutable_buffer = true;
} else if(opt == "--gen-includes") {
opts.include_dependence_headers = true;
} else if(opt == "--") { // Separator between text and binary inputs.