Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Formatters.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ Swift uses swiftformat as it's formatter. Take a look at [how to install here](h

## Typescript

Typescript uses eslint as it's linter. Take a look at [how to install here](https://eslint.org/docs/user-guide/getting-started). Run the following command `eslint ts/** --ext .ts` in the root directory of the project
Typescript uses eslint as it's linter. Take a look at [how to install here](https://eslint.org/docs/user-guide/getting-started). Run the following command `eslint ts/** --ext .ts` in the root directory of the project
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ maximum memory efficiency. It allows you to directly access serialized data with
```
./flatc --cpp --rust monster.fbs
```

Which generates `monster_generated.h` and `monster_generated.rs` files.

4. Serialize data
Expand All @@ -48,7 +48,7 @@ maximum memory efficiency. It allows you to directly access serialized data with
6. Read the data

Use the generated accessors to read the data from the serialized buffer.

It doesn't need to be the same language/schema version, FlatBuffers ensures the data is readable across languages and schema versions. See the [`Rust` example](https://github.com/google/flatbuffers/blob/master/samples/sample_binary.rs#L92-L106) reading the data written by `C++`.

## Documentation
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/swift/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ To open the benchmarks in xcode use:

or running them directly within terminal using:

`swift package benchmark`
`swift package benchmark`
12 changes: 6 additions & 6 deletions docs/source/annotation.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ The columns are as follows:
The prefix `+` is added to make searching for the offset (compared to some
random value) a bit easier.

2. The raw binary data, expressed in hexadecimal format.
2. The raw binary data, expressed in hexadecimal format.

This is in the little endian format the buffer uses internally and what you
would see with a normal binary text viewer.

Expand Down Expand Up @@ -108,7 +108,7 @@ regions in the flatbuffer itself.

### Binary Regions

Binary regions are contiguous bytes regions that are grouped together to form
Binary regions are contiguous bytes regions that are grouped together to form
some sort of value, e.g. a `scalar` or an array of scalars. A binary region may
be split up over multiple text lines, if the size of the region is large.

Expand All @@ -122,7 +122,7 @@ vtable (AnnotatedBinary.Bar):
```

The first column (`+0x00A0`) is the offset to this region from the beginning of
the buffer.
the buffer.

The second column are the raw bytes (hexadecimal) that make up this region.
These are expressed in the little-endian format that flatbuffers uses for the
Expand All @@ -135,7 +135,7 @@ The fourth column shows the raw bytes as a compacted, big-endian value. The raw
bytes are duplicated in this fashion since it is more intuitive to read the data
in the big-endian format (e.g., `0x0008`). This value is followed by the decimal
representation of the value (e.g., `(8)`). For strings, the raw string value is
shown instead.
shown instead.

The fifth column is a textual comment on what the value is. As much metadata as
known is provided.
Expand All @@ -146,4 +146,4 @@ If the type in the 3rd column is of an absolute offset (`SOffet32` or
`Offset32`), the fourth column also shows an `Loc: +0x025A` value which shows
where in the binary this region is pointing to. These values are absolute from
the beginning of the file, their calculation from the raw value in the 4th
column depends on the context.
column depends on the context.
6 changes: 3 additions & 3 deletions docs/source/building.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,11 @@ add_subdirectory(${FLATBUFFERS_SRC_DIR}
# The flatbuffers target carry header search path automatically if CMake > 2.8.11.
target_link_libraries(own_project_target PRIVATE flatbuffers)
```
When build your project the `flatbuffers` library will be compiled and linked
When build your project the `flatbuffers` library will be compiled and linked
to a target as part of your project.

#### Override default depth limit of nested objects
To override [the depth limit of recursion](languages/cpp.md),
To override [the depth limit of recursion](languages/cpp.md),
add this directive:
```cmake
set(FLATBUFFERS_MAX_PARSING_DEPTH 16)
Expand All @@ -174,4 +174,4 @@ We generate [SLSA3 signatures](http://slsa.dev) using the OpenSSF's [slsa-framew
```shell
$ slsa-verifier -artifact-path <downloaded.zip> -provenance attestation.intoto.jsonl -source github.com/google/flatbuffers -tag <version>
PASSED: Verified SLSA provenance
```
```
10 changes: 5 additions & 5 deletions docs/source/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@ repository.
Before we can use your contributions, you __must__ sign one of the following license agreements. The agreements are self-served at the following links.

Our code review process will automatically check if you have signed the CLA, so
don't fret. Though it may be prudent to check before spending a lot of time on
don't fret. Though it may be prudent to check before spending a lot of time on
contribution.

### Individual Contributions
### Individual Contributions

For individuals, the [Google Individual
Contributor License Agreement
(CLA)](https://cla.developers.google.com/about/google-individual?csw=1) which is
self served at the link. The CLA is required since you own the copyright to your
changes, even after your contribution becomes part of our codebase, so we need
your permission to use and distribute your code.
your permission to use and distribute your code.

### Corporate Contributions

Expand Down Expand Up @@ -67,7 +67,7 @@ pip install mkdocs-material
pip install mkdocs-redirects
```

Then, in the `root` directory of flatbuffers, run
Then, in the `root` directory of flatbuffers, run

```
mkdocs serve -f docs/mkdocs.yml
Expand All @@ -77,4 +77,4 @@ This will continually watch the repo for changes to the documentation and serve
the rendered pages locally.

Submit your documentation changes with your code changes and they will
automatically get published when your code is submitted.
automatically get published when your code is submitted.
2 changes: 1 addition & 1 deletion docs/source/evolution.md
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ a [option](flatc.md#additional-options) to do just that:

```sh
--conform FILE
```
```

Where `FILE` is the base schema the rest of the input schemas must evolve from.
It returns `0` if they are properly evolved, otherwise returns a non-zero value
Expand Down
12 changes: 6 additions & 6 deletions docs/source/flatc.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# FlatBuffers Compiler (`flatc`)

The main compiler for FlatBuffers is called `flatc` and is used to convert
schema definitions into generated code files for a variety of languages.
schema definitions into generated code files for a variety of languages.

After [building](building.md) `flatc`, it is used as follows:

```sh
flatc [ GENERATOR_OPTIONS ] [ -o PATH ] [- I PATH ]
FILES...
flatc [ GENERATOR_OPTIONS ] [ -o PATH ] [- I PATH ]
FILES...
[ -- BINARY_FILES... ]
```

Expand Down Expand Up @@ -65,17 +65,17 @@ list of `FILES...`.
=== "To Binary"

To serialize the JSON data in `mydata.json` using the schema `myschema.fbs`:

```sh
flatc --binary myschema.fbs mydata.json
```

This will generate a `mydata_wire.bin` file containing the serialized
This will generate a `mydata_wire.bin` file containing the serialized
flatbuffer data.

=== "To JSON"

To convert the serialized binary flatbuffer `mydata.bin` using the schema
To convert the serialized binary flatbuffer `mydata.bin` using the schema
`myschema.fbs` to JSON:

```sh
Expand Down
4 changes: 2 additions & 2 deletions docs/source/intermediate_representation.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ errors and stores the resulting data in this IR, outputting `.bfbs` files.
Since this IR is a Flatbuffer, you can load and use it at runtime for runtime
reflection purposes.

There are some quirks:
There are some quirks:
- Tables and Structs are serialized as `Object`s.
- Unions and Enums are serialized as `Enum`s.
- It is the responsibility of the code generator to check the `advanced_features`
Expand All @@ -18,7 +18,7 @@ There are some quirks:
inferred to be the directory containing the first provided schema file.


## Invocation
## Invocation
You can invoke it like so
```{.sh}
flatc -b --schema ${your_fbs_files}
Expand Down
2 changes: 1 addition & 1 deletion docs/source/languages/c.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ unsafe to do so even after verification).

The generated reader interface supports sorting vectors in-place after
casting them to a mutating type because it is not practical to do so
while building a buffer. This is covered in the builder documentation.
while building a buffer. This is covered in the builder documentation.
The reflection example makes use of this feature to look up objects by
name.

Expand Down
2 changes: 1 addition & 1 deletion docs/source/languages/dart.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ significant changes have been made.
goal of this implementation. Support for 16 bit integers was also added.
5. The code generation in this offers an "ObjectBuilder", which generates code
very similar to the SDK classes that consume FlatBuffers, as well as Builder
classes, which produces code which more closely resembles the builders in
classes, which produces code which more closely resembles the builders in
other languages. The ObjectBuilder classes are easier to use, at the cost of
additional references allocated.

Expand Down
4 changes: 2 additions & 2 deletions docs/source/languages/javascript.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ documentation to build `flatc` and should be familiar with

## FlatBuffers JavaScript library code location

The generated code for the FlatBuffers JavaScript library can be found at
The generated code for the FlatBuffers JavaScript library can be found at
https://www.npmjs.com/package/flatbuffers. To use it from sources:

1. Run `npm run compile` from the main folder to generate JS files from TS.
Expand All @@ -36,7 +36,7 @@ transpile your sources to desired JS flavor. The minimal steps to get up and
running with JS are:

1. Generate TS files from `*.fbs` by using the `--ts` option.
1. Transpile resulting TS files to desired JS flavor using `tsc` (see
1. Transpile resulting TS files to desired JS flavor using `tsc` (see
https://www.typescriptlang.org/download for installation instructions).

~~~{.js}
Expand Down
2 changes: 1 addition & 1 deletion docs/source/languages/kotlin.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,4 @@ Kotlin generated code was designed to be as close as possible to the java counte
The most obvious ones are:

* Fields as accessed as Kotlin [properties](https://kotlinlang.org/docs/reference/properties.html)
* Static methods are accessed in [companion object](https://kotlinlang.org/docs/reference/classes.html#companion-objects)
* Static methods are accessed in [companion object](https://kotlinlang.org/docs/reference/classes.html#companion-objects)
2 changes: 1 addition & 1 deletion docs/source/languages/lua.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ file into a `string`, which you pass to the `GetRootAsMonster` function:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.lua}
-- require the library
local flatbuffers = require("flatbuffers")

-- require the generated code
local monster = require("MyGame.Sample.Monster")

Expand Down
2 changes: 1 addition & 1 deletion docs/source/languages/swift.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ In some cases it's necessary to modify values in an existing FlatBuffer in place
fatalError("couldn't mutate")
}
// mutate a struct field using flatbuffers struct
// DONT use monster.pos to mutate since swift copy on write
// DONT use monster.pos to mutate since swift copy on write
// will not mutate the value in the buffer
let vec = monster.mutablePos.mutate(z: 4)

Expand Down
16 changes: 8 additions & 8 deletions docs/source/quick_start.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ See the [Tutorial](tutorial.md) for a more in depth guide.
#include "flatbuffers.h"
#include "monster_generated.h"

int main() {
int main() {
// Used to build the flatbuffer
FlatBufferBuilder builder;

// Auto-generated function emitted from `flatc` and the input
// Auto-generated function emitted from `flatc` and the input
// `monster.fbs` schema.
auto monster = CreateMonsterDirect(builder, "Abominable Snowman", 100);

Expand All @@ -60,7 +60,7 @@ See the [Tutorial](tutorial.md) for a more in depth guide.
See complete [C++ Example](https://github.com/google/flatbuffers/blob/master/samples/sample_binary.cpp#L24-L56).

5. **Transmit/Store the serialized FlatBuffer**

Use your serialized buffer however you want. Send it to someone, save if for
later, etc...

Expand All @@ -73,18 +73,18 @@ See the [Tutorial](tutorial.md) for a more in depth guide.

Use the generated accessors to read the data from the serialized buffer.

It doesn't need to be the same language, or even schema version (see
It doesn't need to be the same language, or even schema version (see
[Evolving](evolution.md)), FlatBuffers ensures the data is readable across
languages and schema versions.
languages and schema versions.

```c++ title="my_monster_factory.cc" linenums="15"
// Get a view of the root monster from the flatbuffer.
const Monster snowman = GetMonster(flatbuffer);

// Access the monster's fields directly.
ASSERT_EQ(snowman->name(), "Abominable Snowman");
ASSERT_EQ(snowman->health(), 100);
```
```

See [`Rust` examples](https://github.com/google/flatbuffers/blob/master/samples/sample_binary.rs#L92-L106)
for reading the data written by `C++`.
Loading