This commit is contained in:
2026-08-17 01:21:55 +02:00
parent 5761d6e67a
commit 4bd1e24e75
265 changed files with 20617 additions and 24457 deletions
+9
View File
@@ -145,6 +145,12 @@ const static FlatCOption flatc_options[] = {
{"", "cpp-str-flex-ctor", "",
"Don't construct custom string types by passing std::string from "
"Flatbuffers, but (char* + length)."},
{"", "cpp-vector-type", "T",
"Set object API vector type (default std::vector). T must be a "
"template taking a single element type argument and support "
"resize(), reserve(), size(), data(), operator[], emplace_back(), and "
"begin()/end(). The custom type also needs its own header to be "
"included via --cpp-include."},
{"", "cpp-field-case-style", "STYLE",
"Generate C++ fields using selected case style. Supported STYLE values: * "
"'unchanged' - leave unchanged (default) * 'upper' - schema snake_case "
@@ -545,6 +551,9 @@ FlatCOptions FlatCompiler::ParseFromCommandLineArguments(int argc,
opts.cpp_object_api_string_type = argv[argi];
} else if (arg == "--cpp-str-flex-ctor") {
opts.cpp_object_api_string_flexible_constructor = true;
} else if (arg == "--cpp-vector-type") {
if (++argi >= argc) Error("missing type following: " + arg, true);
opts.cpp_object_api_vector_type = argv[argi];
} else if (arg == "--no-cpp-direct-copy") {
opts.cpp_direct_copy = false;
} else if (arg == "--cpp-field-case-style") {