[Python/JS/TS] Codegen SizeOf method for structs (#6136)

* [Python] Codegen SizeOf classmethod for structs

This codegens a `SizeOf()` classmethod for all structs since we can't
determine the size of a FlatBuffer generated struct from Python otherwise.

* [JS/TS] Codegen sizeOf static method for structs

This codegens a `sizeOf()` static method for all structs since we can't
determine the size of a FlatBuffer generated struct from JavaScript or
TypeScript otherwise.
14 files changed
tree: a8e4f5afc32430ba147de9c7dd7aba6517bf3523
  1. .appveyor/
  2. .bazelci/
  3. .github/
  4. .travis/
  5. android/
  6. bazel/
  7. CMake/
  8. conan/
  9. dart/
  10. docs/
  11. go/
  12. grpc/
  13. include/
  14. java/
  15. js/
  16. lobster/
  17. lua/
  18. mjs/
  19. net/
  20. php/
  21. python/
  22. reflection/
  23. rust/
  24. samples/
  25. snap/
  26. src/
  27. swift/
  28. tests/
  29. ts/
  30. .clang-format
  31. .editorconfig
  32. .eslintrc.js
  33. .gitattributes
  34. .gitignore
  35. .travis.yml
  36. appveyor.yml
  37. BUILD
  38. build_defs.bzl
  39. CMakeLists.txt
  40. composer.json
  41. conanfile.py
  42. CONTRIBUTING.md
  43. LICENSE.txt
  44. package.json
  45. pom.xml
  46. readme.md
  47. tsconfig.json
  48. tsconfig.mjs.json
  49. WORKSPACE
  50. yarn.lock
readme.md

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.