mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-06 21:37:36 +00:00
docs: clean up whitespace and fix typo in tutorial.md (#8695)
* docs: remove trailing whitespace * docs: fix typo in tutorial.md
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# Annotated Flatbuffer Binary
|
||||
|
||||
This directory demonstrates the ability of flatc to annotate binary flatbuffers
|
||||
This directory demonstrates the ability of flatc to annotate binary flatbuffers
|
||||
with helpful annotations. The resulting annotated flatbuffer binary (afb)
|
||||
contains all the binary data with line-by-line annotations.
|
||||
|
||||
@@ -33,7 +33,7 @@ The `annotated_binary.bin` is the flatbufer binary of the data contained within
|
||||
|
||||
Currently there is a built-in text-based format for outputting the annotations.
|
||||
The `annotated_binary.afb` is an example of the text format of a binary
|
||||
`annotated_binary.bin` and the `annotated_binary.fbs` (or
|
||||
`annotated_binary.bin` and the `annotated_binary.fbs` (or
|
||||
`annotated_binary.bfbs`) schema.
|
||||
|
||||
The file is ordered in increasing the offsets from the beginning of the binary.
|
||||
@@ -41,9 +41,9 @@ The offset is the 1st column, expressed in hexadecimal format (e.g. `+0x003c`).
|
||||
|
||||
### Binary Sections
|
||||
|
||||
Binary sections are comprised of contigious [binary regions](#binary-regions)
|
||||
Binary sections are comprised of contigious [binary regions](#binary-regions)
|
||||
that are logically grouped together. For example, a binary section may be a
|
||||
single instance of a flatbuffer `Table` or its `vtable`. The sections may be
|
||||
single instance of a flatbuffer `Table` or its `vtable`. The sections may be
|
||||
labelled with the name of the associated type, as defined in the input schema.
|
||||
|
||||
Example of a `vtable` Binary Section that is associated with the user-defined
|
||||
@@ -59,7 +59,7 @@ vtable (AnnotatedBinary.Bar):
|
||||
|
||||
### Binary Regions
|
||||
|
||||
Binary regions are contigious bytes regions that are grouped together to form
|
||||
Binary regions are contigious 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.
|
||||
|
||||
@@ -71,10 +71,10 @@ 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
|
||||
region. These are expressed in the little-endian format that flatbuffers uses
|
||||
for the wire format.
|
||||
|
||||
The third column is the type to interpret the bytes as. Some types are special
|
||||
@@ -87,15 +87,15 @@ 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 intutive 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).
|
||||
is shown instead).
|
||||
|
||||
The fifth column is a textual comment on what the value is. As much metadata as
|
||||
known is provided.
|
||||
|
||||
#### Offsets
|
||||
|
||||
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
|
||||
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.
|
||||
|
||||
@@ -50,7 +50,7 @@ binary.
|
||||
|
||||
### `invalid_vtable_ref_table_size_short.bin`
|
||||
|
||||
Changed two bytes at 0x000C from `6800` to `0100` which size is smaller than
|
||||
Changed two bytes at 0x000C from `6800` to `0100` which size is smaller than
|
||||
the minimum size of 4 bytes.
|
||||
|
||||
### `invalid_vtable_field_offset.bin`
|
||||
@@ -70,7 +70,7 @@ than the binary.
|
||||
|
||||
### `invalid_string_length_cut_short.bin`
|
||||
|
||||
Truncated the file to 0xAD bytes, as that cuts string length Uint32t value in
|
||||
Truncated the file to 0xAD bytes, as that cuts string length Uint32t value in
|
||||
half.
|
||||
|
||||
### `invalid_string_length.bin`
|
||||
@@ -80,7 +80,7 @@ larger than the binary.
|
||||
|
||||
### `invalid_vector_length_cut_short.bin`
|
||||
|
||||
Truncated the file to 0x0136 bytes, as that cuts vector length Uint32t value in
|
||||
Truncated the file to 0x0136 bytes, as that cuts vector length Uint32t value in
|
||||
half.
|
||||
|
||||
### `invalid_struct_field_cut_short.bin`
|
||||
@@ -106,12 +106,12 @@ offsets.
|
||||
|
||||
### `invalid_vector_scalars_cut_short.bin`
|
||||
|
||||
Truncated the file to 0x01C1 bytes, as that cuts into a vector of scalars
|
||||
Truncated the file to 0x01C1 bytes, as that cuts into a vector of scalars
|
||||
values.
|
||||
|
||||
### `invalid_vector_unions_cut_short.bin`
|
||||
|
||||
Truncated the file to 0x01DE bytes, as that cuts into a vector of union offset
|
||||
Truncated the file to 0x01DE bytes, as that cuts into a vector of union offset
|
||||
values.
|
||||
|
||||
### `invalid_union_type_value.bin`
|
||||
@@ -121,5 +121,5 @@ larger than the enum.
|
||||
|
||||
### `invalid_vector_union_type_value.bin`
|
||||
|
||||
Changed one byte at 0x0131 from `02` to `FF` which is a vector union type value
|
||||
that is larger than the enum.
|
||||
Changed one byte at 0x0131 from `02` to `FF` which is a vector union type value
|
||||
that is larger than the enum.
|
||||
|
||||
Reference in New Issue
Block a user