aboutsummaryrefslogtreecommitdiff
path: root/docs/source
diff options
context:
space:
mode:
authorGabriel Nützi <gnuetzi@gmail.com>2019-02-11 21:34:10 +0100
committerWouter van Oortmerssen <aardappel@gmail.com>2019-02-11 21:34:10 +0100
commite1defaae5ea4e18eedde4c51ea82c05b802dc153 (patch)
treea89006761a9bdf9a7a66afb8c455ffcb43d2e9c0 /docs/source
parent78fdce28c7faaa792ea8c7005d0a7a3e8c2de364 (diff)
downloadflatbuffers-e1defaae5ea4e18eedde4c51ea82c05b802dc153.tar.gz
Add flag to make short names in JS/TS. (#5152)
* Add flag to make short names in JS/TS. * Synced all missing docs in Compiler.md <-> flatc.cpp. * Review changes.
Diffstat (limited to 'docs/source')
-rw-r--r--docs/source/Compiler.md52
1 files changed, 46 insertions, 6 deletions
diff --git a/docs/source/Compiler.md b/docs/source/Compiler.md
index 420019cd..d7b44c87 100644
--- a/docs/source/Compiler.md
+++ b/docs/source/Compiler.md
@@ -72,6 +72,12 @@ Additional options:
in quotes, no trailing commas in tables/vectors). By default, no quotes are
required/generated, and trailing commas are allowed.
+- `--allow-non-utf8` : Pass non-UTF-8 input through parser and emit nonstandard
+ \x escapes in JSON. (Default is to raise parse error on non-UTF-8 input.)
+
+- `--natural-utf8` : Output strings with UTF-8 as human-readable strings.
+ By default, UTF-8 characters are printed as \uXXXX escapes."
+
- `--defaults-json` : Output fields whose value is equal to the default value
when writing JSON text.
@@ -91,23 +97,36 @@ Additional options:
- `--gen-mutable` : Generate additional non-const accessors for mutating
FlatBuffers in-place.
- `--gen-object-api` : Generate an additional object-based API. This API is
+- `--gen-onefile` : Generate single output file for C# and Go.
+
+- `--gen-name-strings` : Generate type name functions for C++.
+
+- `--gen-object-api` : Generate an additional object-based API. This API is
more convenient for object construction and mutation than the base API,
at the cost of efficiency (object allocation). Recommended only to be used
if other options are insufficient.
-- `--gen-compare` : Generate operator== for object-based API types.
+- `--gen-compare` : Generate operator== for object-based API types.
+
+- `--gen-nullable` : Add Clang _Nullable for C++ pointer. or @Nullable for Java.
-- `--gen-onefile` : Generate single output file (useful for C#)
+- `--gen-generated` : Add @Generated annotation for Java.
-- `--gen-all`: Generate not just code for the current schema files, but
+- `--gen-all` : Generate not just code for the current schema files, but
for all files it includes as well. If the language uses a single file for
output (by default the case for C++ and JS), all code will end up in
this one file.
-- `--gen-generated`: Add @Generated annotation for Java
+- `--cpp-ptr-type T` : Set object API pointer type (default std::unique_ptr)
-- `--no-js-exports` : Removes Node.js style export lines (useful for JS)
+- `--cpp-str-type T` : Set object API string type (default std::string)
+- T::c_str() and T::length() must be supported.
+
+- `--object-prefix` : Customise class prefix for C++ object-based API.
+
+- `--object-suffix` : Customise class suffix for C++ object-based API.
+
+- `--no-js-exports` : Removes Node.js style export lines (useful for JS)
- `--goog-js-export` : Uses goog.exportsSymbol and goog.exportsProperty
instead of Node.js style exporting. Needed for compatibility with the
@@ -117,9 +136,16 @@ Additional options:
instead of Node.js style exporting. Useful when integrating flatbuffers
with modern Javascript projects.
+- `--go-namespace` : Generate the overrided namespace in Golang.
+
+- `--go-import` : Generate the overrided import for flatbuffers in Golang.
+ (default is "github.com/google/flatbuffers/go").
+
- `--raw-binary` : Allow binaries without a file_indentifier to be read.
This may crash flatc given a mismatched schema.
+- `--size-prefixed` : Input binaries are size prefixed buffers.
+
- `--proto`: Expect input files to be .proto files (protocol buffers).
Output the corresponding .fbs file.
Currently supports: `package`, `message`, `enum`, nested declarations,
@@ -127,6 +153,10 @@ Additional options:
Does not support, but will skip without error: `option`, `service`,
`extensions`, and most everything else.
+- `--oneof-union` : Translate .proto oneofs to flatbuffer unions.
+
+- `--grpc` : Generate GRPC interfaces for the specified languages.
+
- `--schema`: Serialize schemas instead of JSON (use with -b). This will
output a binary version of the specified schema that itself corresponds
to the reflection/reflection.fbs schema. Loading this binary file is the
@@ -138,12 +168,22 @@ Additional options:
an evolution of. Gives errors if not. Useful to check if schema
modifications don't break schema evolution rules.
+- `--conform-includes PATH` : Include path for the schema given with
+ `--conform PATH`.
+
- `--include-prefix PATH` : Prefix this path to any generated include
statements.
- `--keep-prefix` : Keep original prefix of schema include statement.
+- `--no-fb-impor` : Don't include flatbuffers import statement for TypeScript.
+
+- `--no-ts-reexpor` : Don't re-export imported dependencies for TypeScript.
+
+- `--short-name` : Use short function names for JS and TypeScript.
+
- `--reflect-types` : Add minimal type reflection to code generation.
+
- `--reflect-names` : Add minimal type/name reflection.
- `--root-type T` : Select or override the default root_type.