Commit 13c9c674 authored by csukuangfj's avatar csukuangfj Committed by Wouter van Oortmerssen

[doc] fix typos in doc. (#5217)

parent 034275c6
...@@ -767,7 +767,7 @@ our `orc` Monster, lets create some `Weapon`s: a `Sword` and an `Axe`. ...@@ -767,7 +767,7 @@ our `orc` Monster, lets create some `Weapon`s: a `Sword` and an `Axe`.
// The genearted ObjectBuilder classes offer an easier to use alternative // The generated ObjectBuilder classes offer an easier to use alternative
// at the cost of requiring some additional reference allocations. If memory // at the cost of requiring some additional reference allocations. If memory
// usage is critical, or if you'll be working with especially large messages // usage is critical, or if you'll be working with especially large messages
// or tables, you should prefer using the generated Builder classes. // or tables, you should prefer using the generated Builder classes.
...@@ -1238,7 +1238,7 @@ for the `path` field above: ...@@ -1238,7 +1238,7 @@ for the `path` field above:
final vec3Builder = new myGame.Vec3Builder(builder); final vec3Builder = new myGame.Vec3Builder(builder);
vec3Builder.finish(4.0, 5.0, 6.0); vec3Builder.finish(4.0, 5.0, 6.0);
vec3Builder.finish(1.0, 2.0, 3.0); vec3Builder.finish(1.0, 2.0, 3.0);
final int path = builder.endStructVector(2); // the lenght of the vector final int path = builder.endStructVector(2); // the length of the vector
// Otherwise, using the ObjectBuilder classes: // Otherwise, using the ObjectBuilder classes:
// The dart implementation provides a simple interface for writing vectors // The dart implementation provides a simple interface for writing vectors
...@@ -1520,7 +1520,7 @@ can serialize the monster itself: ...@@ -1520,7 +1520,7 @@ can serialize the monster itself:
// Create the monster using the `Monster::create` helper function. This // Create the monster using the `Monster::create` helper function. This
// function accepts a `MonsterArgs` struct, which supplies all of the data // function accepts a `MonsterArgs` struct, which supplies all of the data
// needed to build a `Monster`. To supply empty/default fields, just use the // needed to build a `Monster`. To supply empty/default fields, just use the
// Rust built-in `Default::default()` function, as demononstrated below. // Rust built-in `Default::default()` function, as demonstrated below.
let orc = Monster::create(&mut builder, &MonsterArgs{ let orc = Monster::create(&mut builder, &MonsterArgs{
pos: Some(&Vec3::new(1.0f32, 2.0f32, 3.0f32)), pos: Some(&Vec3::new(1.0f32, 2.0f32, 3.0f32)),
mana: 150, mana: 150,
...@@ -1663,7 +1663,7 @@ Here is a repetition these lines, to help highlight them more clearly: ...@@ -1663,7 +1663,7 @@ Here is a repetition these lines, to help highlight them more clearly:
</div> </div>
<div class="language-c"> <div class="language-c">
~~~{.c} ~~~{.c}
// Add union type and data simultanously. // Add union type and data simultaneously.
ns(Monster_equipped_Weapon_add(B, axe)); ns(Monster_equipped_Weapon_add(B, axe));
~~~ ~~~
</div> </div>
...@@ -1906,7 +1906,7 @@ like so: ...@@ -1906,7 +1906,7 @@ like so:
Now you can write the bytes to a file, send them over the network.. Now you can write the bytes to a file, send them over the network..
**Make sure your file mode (or tranfer protocol) is set to BINARY, not text.** **Make sure your file mode (or transfer protocol) is set to BINARY, not text.**
If you transfer a FlatBuffer in text mode, the buffer will be corrupted, If you transfer a FlatBuffer in text mode, the buffer will be corrupted,
which will lead to hard to find problems when you read the buffer. which will lead to hard to find problems when you read the buffer.
...@@ -2207,7 +2207,7 @@ accessors for all non-`deprecated` fields. For example: ...@@ -2207,7 +2207,7 @@ accessors for all non-`deprecated` fields. For example:
<div class="language-csharp"> <div class="language-csharp">
~~~{.cs} ~~~{.cs}
// For C#, unlike most other languages support by FlatBuffers, most values (except for // For C#, unlike most other languages support by FlatBuffers, most values (except for
// vectors and unions) are available as propreties instead of asccessor methods. // vectors and unions) are available as properties instead of accessor methods.
var hp = monster.Hp var hp = monster.Hp
var mana = monster.Mana var mana = monster.Mana
var name = monster.Name var name = monster.Name
...@@ -2258,7 +2258,7 @@ accessors for all non-`deprecated` fields. For example: ...@@ -2258,7 +2258,7 @@ accessors for all non-`deprecated` fields. For example:
<div class="language-dart"> <div class="language-dart">
~~~{.dart} ~~~{.dart}
// For Dart, unlike other languages support by FlatBuffers, most values // For Dart, unlike other languages support by FlatBuffers, most values
// are available as propreties instead of asccessor methods. // are available as properties instead of accessor methods.
var hp = monster.hp; var hp = monster.hp;
var mana = monster.mana; var mana = monster.mana;
var name = monster.name; var name = monster.name;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment