mirror of https://github.com/vee1e/flatbuffers - FlatBuffers: Memory Efficient Serialization Library
Find a file
Mark Spatz bd4e0b30a7
[idl_parser] Track included files by hash (#6434)
* [idl_gen] Delete ts::GenPrefixedImport()

I don't know what this is for, but it's the only piece of code external
to idl_parser.cpp that expects the key of Parser::included_files_ to be
a path. And it appears to be unused.

* [idl_parser] Track included files by hash

Parser::included_files_ is a map whose main purpose is to keep track of
which files have already been parsed in order to protect against
multiple inclusion. Its key is the path that the file was found at
during parsing (or, if it's an in-memory file, just its name).

This commit changes the key to be the 64 bit FNV-1a hash of the file's
name (just the name, not the complete path) xor'd with the hash of the
file's contents (unless it's an in-memory file, then we only hash the
name.)

This allows multiple include protection to function even in the face of
unique per-file include paths (fixes #6425).

* Ran tests/generate_code.sh

CI told me to do it.

* Gracefullt handle case where source_filename == nullptr

I just learned source_filename might also be null. In that case, we
should exclude it from the hash instead of hashing a zero length
string, just like we exclude source when it is null.

Presumably nameless files will never be included (they can't, can they?)
so this doesn't really matter, but I think it's prettier anyways.
2021-03-01 12:34:01 -08:00
.appveyor Add support for fixed-size arrays (#5313) 2019-06-18 00:15:13 +02:00
.bazelci Don't test on Ubuntu 14.04 (#5302) 2019-04-24 10:28:35 -07:00
.github [CI] Adds Code Generation tests on Github Actions (#6482) 2021-02-23 08:51:39 +03:00
.travis [CI] Adds Code Generation tests on Github Actions (#6482) 2021-02-23 08:51:39 +03:00
android Fix multiple fbs code generation failure (#6365) 2021-01-04 13:29:32 -08:00
bazel [CMake] Renames BUILD files (#6457) 2021-02-11 10:16:57 -08:00
CMake [CMake] generate pkg-config flatbuffers.pc file (#6455) 2021-02-22 10:23:38 -08:00
conan
dart dart Builder - expose finished buffer size (#6403) 2021-01-21 16:06:11 -08:00
docs Fixes grammer (#6477) 2021-02-19 12:16:38 -08:00
go GetUOffsetT must get value by GetUint32 not GetInt32 (#6072) 2021-02-18 18:38:25 -08:00
grpc Working on a python example plus fixing python grpc code (#6456) 2021-02-25 14:38:12 -08:00
include/flatbuffers [idl_parser] Track included files by hash (#6434) 2021-03-01 12:34:01 -08:00
java/com/google/flatbuffers [Java] allowing larger buffer sizes when growing a byte buffer (#6118) 2020-09-17 11:55:24 -07:00
js [JS/TS] Rewrite flexbuffers JS to TS (#6148) 2020-10-19 13:11:35 -07:00
kotlin This commit contains the initial implementation of Flexbuffers in Kotlin. The code was ported based (#6387) 2021-01-28 14:49:25 -08:00
lobster [Lobster] optional scalars support 2020-08-18 14:00:02 -07:00
lua Lua cleanup (#5624) 2019-11-14 15:46:46 -08:00
mjs [JS/TS] Modernize TypeScript / JavaScript flatbuffers support (#6095) 2020-09-17 12:21:14 -07:00
net/FlatBuffers Revert "[C#] Fix truncated ArraySegment<byte> if elementSize != 1 (#6462)" (#6488) 2021-02-23 11:30:07 -08:00
php
python Add vectorNumElements attribute to Builder for simpler vector creation. (#6328) 2020-12-14 12:00:28 -08:00
reflection Optional-ness in reflection (#6097) 2020-09-11 14:20:32 -07:00
rust [rust] Remove debug code (#6475) 2021-02-24 13:00:18 -05:00
samples Fixes grammer (#6477) 2021-02-19 12:16:38 -08:00
scripts [CI] Adds Code Generation tests on Github Actions (#6482) 2021-02-23 08:51:39 +03:00
snap + Add removable-media plug to the snapcraft config (#6083) 2020-08-24 09:55:38 -07:00
src [idl_parser] Track included files by hash (#6434) 2021-03-01 12:34:01 -08:00
swift [Swift] Renaming protocols (#6469) 2021-02-16 14:55:47 +03:00
tests [idl_parser] Track included files by hash (#6434) 2021-03-01 12:34:01 -08:00
ts [TS/JS] New gen TS code gen (#6302) 2021-01-19 12:51:13 -08:00
.clang-format
.editorconfig
.eslintrc.js [JS/TS] Modernize TypeScript / JavaScript flatbuffers support (#6095) 2020-09-17 12:21:14 -07:00
.gitattributes
.gitignore fix for noUncheckedIndexedAccess in ts (#6474) 2021-02-25 14:57:10 -08:00
.travis.yml [CI] Adds Code Generation tests on Github Actions (#6482) 2021-02-23 08:51:39 +03:00
appveyor.yml [TS/JS] New gen TS code gen (#6302) 2021-01-19 12:51:13 -08:00
BUILD.bazel [CMake] Renames BUILD files (#6457) 2021-02-11 10:16:57 -08:00
build_defs.bzl [Bazel] Add support for compatible_with and restricted_to (#5681) 2019-12-26 09:58:48 -08:00
CMakeLists.txt Working on a python example plus fixing python grpc code (#6456) 2021-02-25 14:38:12 -08:00
composer.json
conanfile.py
CONTRIBUTING.md
Formatters.md [CI] Adds formatter to CI (#6272) 2020-12-11 10:46:10 -08:00
LICENSE.txt Fixed Apache license not using canonical version. 2019-11-04 17:15:56 -08:00
package.json [TS/JS] New gen TS code gen (#6302) 2021-01-19 12:51:13 -08:00
pom.xml updated maven build files 2020-03-16 11:33:42 -07:00
readme.md Minor doc updates: FlexBuffers C#, Discord, CppUsage. 2019-12-26 12:36:41 -08:00
swift.swiftformat [Swift] Adds a format file and reformats the swift project (#6250) 2020-11-16 19:52:38 +03:00
tsconfig.json [JS/TS] Rewrite flexbuffers JS to TS (#6148) 2020-10-19 13:11:35 -07:00
tsconfig.mjs.json [JS/TS] Rewrite flexbuffers JS to TS (#6148) 2020-10-19 13:11:35 -07:00
WORKSPACE Bump version of rules_go to 0.24.5 (#6234) 2020-11-12 10:04:34 -08:00

logo FlatBuffers

Build Status Build status Join the chat at https://gitter.im/google/flatbuffers Discord Chat Twitter Follow

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.

Go to our landing page to browse our documentation.

Supported operating systems

  • Windows
  • MacOS X
  • Linux
  • Android
  • And any others with a recent C++ compiler.

Supported programming languages

  • C++
  • C#
  • C
  • Dart
  • Go
  • Java
  • JavaScript
  • Lobster
  • Lua
  • PHP
  • Python
  • Rust
  • TypeScript

and more in progress...

Contribution

To contribute to this project, see CONTRIBUTING.

Licensing

Flatbuffers is licensed under the Apache License, Version 2.0. See LICENSE for the full license text.