diff options
author | Derek Bailey <derekbailey@google.com> | 2023-05-10 13:56:13 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-10 13:56:13 -0700 |
commit | 85f71321fd83da1c0a09fdb26c8e50e7d86dfbb2 (patch) | |
tree | a9ccf941f686ca8c1539d2afe2f0952802eb0256 | |
parent | 3e6cd51b6307d680ac8eb6a3f1671fb756228e8b (diff) | |
download | flatbuffers-85f71321fd83da1c0a09fdb26c8e50e7d86dfbb2.tar.gz flatbuffers-85f71321fd83da1c0a09fdb26c8e50e7d86dfbb2.tar.bz2 flatbuffers-85f71321fd83da1c0a09fdb26c8e50e7d86dfbb2.zip |
Update README.md
Added Quick State to the main readme file
-rw-r--r-- | README.md | 41 |
1 files changed, 41 insertions, 0 deletions
@@ -14,6 +14,47 @@ **FlatBuffers** is a cross platform serialization library architected for maximum memory efficiency. It allows you to directly access serialized data without parsing/unpacking it first, while still having great forwards/backwards compatibility. +## Quick Start + +1. Build the compiler for flatbuffers (`flatc`) + + Use `cmake` to create the build files for your platform and then perform the compliation (Linux example). + + ``` + cmake -G "Unix Makefiles" + make -j + ``` + +2. Define your flatbuffer schema (`.fbs`) + + Write the [schema](https://flatbuffers.dev/flatbuffers_guide_writing_schema.html) to define the data you want to serialize. See [monster.fbs](https://github.com/google/flatbuffers/blob/master/samples/monster.fbs) for an example. + +3. Generate code for your language(s) + + Use the `flatc` compiler to take your schema and generate language-specific code: + + ``` + ./flatc --cpp --rust monster.fbs + ``` + + Which generates `monster_generated.h` and `monster_generated.rs` files. + +4. Serialize data + + Use the generated code, as well as the `FlatBufferBuilder` to construct your serialized buffer. ([`C++` example](https://github.com/google/flatbuffers/blob/master/samples/sample_binary.cpp#L24-L56)) + +5. Transmit/store/save Buffer + + Use your serialized buffer however you want. Send it to someone, save it for later, etc... + +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 + **Go to our [landing page][] to browse our documentation.** ## Supported operating systems |