Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
flatbuffers
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
flatbuffers
Commits
0cf04ad9
Commit
0cf04ad9
authored
Nov 17, 2017
by
MikkelFJ
Committed by
Wouter van Oortmerssen
Nov 17, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document type aliases (#4499)
parent
fe483fa3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
5 deletions
+18
-5
Schemas.md
docs/source/Schemas.md
+9
-5
Tutorial.md
docs/source/Tutorial.md
+9
-0
No files found.
docs/source/Schemas.md
View file @
0cf04ad9
...
...
@@ -84,15 +84,19 @@ parent object, and use no virtual table).
### Types
Built-in scalar types are
:
Built-in scalar types are
-
8 bit:
`byte`
,
`ubyte`
,
`bool`
-
8 bit:
`byte`
(
`int8`
),
`ubyte`
(
`uint8`
)
,
`bool`
-
16 bit:
`short`
,
`ushort`
-
16 bit:
`short`
(
`int16`
),
`ushort`
(
`uint16`
)
-
32 bit:
`int`
,
`uint`
,
`float`
-
32 bit:
`int`
(
`int32`
),
`uint`
(
`uint32`
),
`float`
(
`float32`
)
-
64 bit:
`long`
,
`ulong`
,
`double`
-
64 bit:
`long`
(
`int64`
),
`ulong`
(
`uint64`
),
`double`
(
`float64`
)
The type names in parentheses are alias names such that for example
`uint8`
can be used in place of
`ubyte`
, and
`int32`
can be used in
place of
`int`
without affecting code generation.
Built-in non-scalar types:
...
...
docs/source/Tutorial.md
View file @
0cf04ad9
...
...
@@ -216,6 +216,15 @@ The last part of the `schema` is the `root_type`. The root type declares what
will be the root table for the serialized data. In our case, the root type is
our
`Monster`
table.
The scalar types can also use alias type names such as
`int16`
instead
of
`short`
and
`float32`
instead of
`float`
. Thus we could also write
the
`Weapon`
table as:
table Weapon {
name:string;
damage:int16;
}
#### More Information About Schemas
You can find a complete guide to writing
`schema`
files in the
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment