pax_global_header00006660000000000000000000000064147323470530014522gustar00rootroot0000000000000052 comment=a2cd1ea3b6d3fee220106b5fed3f7ce8da9eb757 flatbuffers-24.12.23/000077500000000000000000000000001473234705300142605ustar00rootroot00000000000000flatbuffers-24.12.23/.bazelci/000077500000000000000000000000001473234705300157475ustar00rootroot00000000000000flatbuffers-24.12.23/.bazelci/presubmit.yml000066400000000000000000000024561473234705300205130ustar00rootroot00000000000000--- buildifier: latest bazel: 6.4.0 platforms: ubuntu1804: environment: CC: clang SWIFT_VERSION: "5.8" SWIFT_HOME: "$HOME/swift-$SWIFT_VERSION" PATH: "$PATH:$SWIFT_HOME/usr/bin" shell_commands: - "echo --- Downloading and extracting Swift $SWIFT_VERSION to $SWIFT_HOME" - "mkdir $SWIFT_HOME" - "curl https://download.swift.org/swift-${SWIFT_VERSION}-release/ubuntu1804/swift-${SWIFT_VERSION}-RELEASE/swift-${SWIFT_VERSION}-RELEASE-ubuntu18.04.tar.gz | tar xvz --strip-components=1 -C $SWIFT_HOME" build_targets: - "//..." test_targets: - "//..." ubuntu2004: environment: CC: clang SWIFT_VERSION: "5.8" SWIFT_HOME: "$HOME/swift-$SWIFT_VERSION" PATH: "$PATH:$SWIFT_HOME/usr/bin" shell_commands: - "echo --- Downloading and extracting Swift $SWIFT_VERSION to $SWIFT_HOME" - "mkdir $SWIFT_HOME" - "curl https://download.swift.org/swift-${SWIFT_VERSION}-release/ubuntu2004/swift-${SWIFT_VERSION}-RELEASE/swift-${SWIFT_VERSION}-RELEASE-ubuntu20.04.tar.gz | tar xvz --strip-components=1 -C $SWIFT_HOME" build_targets: - "//..." test_targets: - "//..." macos: xcode_version: "14.3" build_targets: - "//:flatbuffers" - "//:flatc" test_targets: - "//tests:flatbuffers_test" flatbuffers-24.12.23/.bazelignore000066400000000000000000000000201473234705300165520ustar00rootroot00000000000000ts/node_modules flatbuffers-24.12.23/.bazelrc000066400000000000000000000014141473234705300157030ustar00rootroot00000000000000# We cannot use "common" here because the "version" command doesn't support # --deleted_packages. We need to specify it for both build and query instead. build --deleted_packages=tests/bazel_repository_test_dir,tests/ts/bazel_repository_test_dir query --deleted_packages=tests/bazel_repository_test_dir,tests/ts/bazel_repository_test_dir # Point tools such as coursier (used in rules_jvm_external) to Bazel's internal JDK # suggested in https://github.com/bazelbuild/rules_jvm_external/issues/445 common --repo_env=JAVA_HOME=../bazel_tools/jdk common --action_env=JAVA_HOME=../bazel_tools/jdk # Workaround "Error: need --enable_runfiles on Windows for to support rules_js" common:windows --enable_runfiles # Swift is not required on Windows common:windows --deleted_packages=swiftflatbuffers-24.12.23/.clang-format000066400000000000000000000004601473234705300166330ustar00rootroot00000000000000--- Language: Cpp BasedOnStyle: Google DerivePointerAlignment: false PointerAlignment: Right IndentPPDirectives: AfterHash Cpp11BracedListStyle: false AlwaysBreakTemplateDeclarations: false AllowShortCaseLabelsOnASingleLine: true SpaceAfterTemplateKeyword: false AllowShortBlocksOnASingleLine: true ... flatbuffers-24.12.23/.clang-tidy000066400000000000000000000365521473234705300163270ustar00rootroot00000000000000--- FormatStyle: "file" WarningsAsErrors: "*" HeaderFilterRegex: ".*" Checks: "google-build-explicit-make-pair, google-build-namespaces, google-build-using-namespace, google-default-arguments, google-explicit-constructor, google-global-names-in-headers, google-objc-avoid-nsobject-new, google-objc-avoid-throwing-exception, google-objc-function-naming, google-objc-global-variable-declaration, google-readability-avoid-underscore-in-googletest-name, google-readability-braces-around-statements, google-readability-casting, google-readability-function-size, google-readability-namespace-comments, google-runtime-int, google-runtime-operator, google-upgrade-googletest-case, clang-analyzer-apiModeling.StdCLibraryFunctions, clang-analyzer-apiModeling.TrustNonnull, clang-analyzer-apiModeling.google.GTest, clang-analyzer-apiModeling.llvm.CastValue, clang-analyzer-apiModeling.llvm.ReturnValue, clang-analyzer-core.CallAndMessage, clang-analyzer-core.CallAndMessageModeling, clang-analyzer-core.DivideZero, clang-analyzer-core.DynamicTypePropagation, clang-analyzer-core.NonNullParamChecker, clang-analyzer-core.NonnilStringConstants, clang-analyzer-core.NullDereference, clang-analyzer-core.StackAddrEscapeBase, clang-analyzer-core.StackAddressEscape, clang-analyzer-core.UndefinedBinaryOperatorResult, clang-analyzer-core.VLASize, clang-analyzer-core.builtin.BuiltinFunctions, clang-analyzer-core.builtin.NoReturnFunctions, clang-analyzer-core.uninitialized.ArraySubscript, clang-analyzer-core.uninitialized.Assign, clang-analyzer-core.uninitialized.Branch, clang-analyzer-core.uninitialized.CapturedBlockVariable, clang-analyzer-core.uninitialized.UndefReturn, clang-analyzer-cplusplus.InnerPointer, clang-analyzer-cplusplus.Move, clang-analyzer-cplusplus.NewDelete, clang-analyzer-cplusplus.NewDeleteLeaks, clang-analyzer-cplusplus.PlacementNew, clang-analyzer-cplusplus.PureVirtualCall, clang-analyzer-cplusplus.SelfAssignment, clang-analyzer-cplusplus.SmartPtrModeling, clang-analyzer-cplusplus.StringChecker, clang-analyzer-cplusplus.VirtualCallModeling, clang-analyzer-deadcode.DeadStores, clang-analyzer-fuchsia.HandleChecker, clang-analyzer-nullability.NullPassedToNonnull, clang-analyzer-nullability.NullReturnedFromNonnull, clang-analyzer-nullability.NullabilityBase, clang-analyzer-nullability.NullableDereferenced, clang-analyzer-nullability.NullablePassedToNonnull, clang-analyzer-nullability.NullableReturnedFromNonnull, clang-analyzer-optin.cplusplus.UninitializedObject, clang-analyzer-optin.cplusplus.VirtualCall, clang-analyzer-optin.mpi.MPI-Checker, clang-analyzer-optin.osx.OSObjectCStyleCast, clang-analyzer-optin.osx.cocoa.localizability.EmptyLocalizationContextChecker, clang-analyzer-optin.osx.cocoa.localizability.NonLocalizedStringChecker, clang-analyzer-optin.performance.GCDAntipattern, clang-analyzer-optin.performance.Padding, clang-analyzer-optin.portability.UnixAPI, clang-analyzer-osx.API, clang-analyzer-osx.MIG, clang-analyzer-osx.NSOrCFErrorDerefChecker, clang-analyzer-osx.NumberObjectConversion, clang-analyzer-osx.OSObjectRetainCount, clang-analyzer-osx.ObjCProperty, clang-analyzer-osx.SecKeychainAPI, clang-analyzer-osx.cocoa.AtSync, clang-analyzer-osx.cocoa.AutoreleaseWrite, clang-analyzer-osx.cocoa.ClassRelease, clang-analyzer-osx.cocoa.Dealloc, clang-analyzer-osx.cocoa.IncompatibleMethodTypes, clang-analyzer-osx.cocoa.Loops, clang-analyzer-osx.cocoa.MissingSuperCall, clang-analyzer-osx.cocoa.NSAutoreleasePool, clang-analyzer-osx.cocoa.NSError, clang-analyzer-osx.cocoa.NilArg, clang-analyzer-osx.cocoa.NonNilReturnValue, clang-analyzer-osx.cocoa.ObjCGenerics, clang-analyzer-osx.cocoa.RetainCount, clang-analyzer-osx.cocoa.RetainCountBase, clang-analyzer-osx.cocoa.RunLoopAutoreleaseLeak, clang-analyzer-osx.cocoa.SelfInit, clang-analyzer-osx.cocoa.SuperDealloc, clang-analyzer-osx.cocoa.UnusedIvars, clang-analyzer-osx.cocoa.VariadicMethodTypes, clang-analyzer-osx.coreFoundation.CFError, clang-analyzer-osx.coreFoundation.CFNumber, clang-analyzer-osx.coreFoundation.CFRetainRelease, clang-analyzer-osx.coreFoundation.containers.OutOfBounds, clang-analyzer-osx.coreFoundation.containers.PointerSizedValues, clang-analyzer-security.FloatLoopCounter, clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling, clang-analyzer-security.insecureAPI.SecuritySyntaxChecker, clang-analyzer-security.insecureAPI.UncheckedReturn, clang-analyzer-security.insecureAPI.bcmp, clang-analyzer-security.insecureAPI.bcopy, clang-analyzer-security.insecureAPI.bzero, clang-analyzer-security.insecureAPI.decodeValueOfObjCType, clang-analyzer-security.insecureAPI.getpw, clang-analyzer-security.insecureAPI.gets, clang-analyzer-security.insecureAPI.mkstemp, clang-analyzer-security.insecureAPI.mktemp, clang-analyzer-security.insecureAPI.rand, clang-analyzer-security.insecureAPI.strcpy, clang-analyzer-security.insecureAPI.vfork, clang-analyzer-unix.API, clang-analyzer-unix.DynamicMemoryModeling, clang-analyzer-unix.Malloc, clang-analyzer-unix.MallocSizeof, clang-analyzer-unix.MismatchedDeallocator, clang-analyzer-unix.Vfork, clang-analyzer-unix.cstring.BadSizeArg, clang-analyzer-unix.cstring.CStringModeling, clang-analyzer-unix.cstring.NullArg, clang-analyzer-valist.CopyToSelf, clang-analyzer-valist.Uninitialized, clang-analyzer-valist.Unterminated, clang-analyzer-valist.ValistBase, clang-analyzer-webkit.NoUncountedMemberChecker, clang-analyzer-webkit.RefCntblBaseVirtualDtor, clang-analyzer-webkit.UncountedLambdaCapturesChecker, ################################################ Optional checks ################################################ #google-readability-todo, #bugprone-argument-comment, #bugprone-assert-side-effect, #bugprone-bad-signal-to-kill-thread, #bugprone-bool-pointer-implicit-conversion, #bugprone-branch-clone, #bugprone-copy-constructor-init, #bugprone-dangling-handle, #bugprone-dynamic-static-initializers, #bugprone-easily-swappable-parameters, #bugprone-exception-escape, #bugprone-fold-init-type, #bugprone-forward-declaration-namespace, #bugprone-forwarding-reference-overload, #bugprone-implicit-widening-of-multiplication-result, #bugprone-inaccurate-erase, #bugprone-incorrect-roundings, #bugprone-infinite-loop, #bugprone-integer-division, #bugprone-lambda-function-name, #bugprone-macro-parentheses, #bugprone-macro-repeated-side-effects, #bugprone-misplaced-operator-in-strlen-in-alloc, #bugprone-misplaced-pointer-arithmetic-in-alloc, #bugprone-misplaced-widening-cast, #bugprone-move-forwarding-reference, #bugprone-multiple-statement-macro, #bugprone-narrowing-conversions, #bugprone-no-escape, #bugprone-not-null-terminated-result, #bugprone-parent-virtual-call, #bugprone-posix-return, #bugprone-redundant-branch-condition, #bugprone-reserved-identifier, #bugprone-signal-handler, #bugprone-signed-char-misuse, #bugprone-sizeof-container, #bugprone-sizeof-expression, #bugprone-spuriously-wake-up-functions, #bugprone-string-constructor, #bugprone-string-integer-assignment, #bugprone-string-literal-with-embedded-nul, #bugprone-stringview-nullptr, #bugprone-suspicious-enum-usage, #bugprone-suspicious-include, #bugprone-suspicious-memory-comparison, #bugprone-suspicious-memset-usage, #bugprone-suspicious-missing-comma, #bugprone-suspicious-semicolon, #bugprone-suspicious-string-compare, #bugprone-swapped-arguments, #bugprone-terminating-continue, #bugprone-throw-keyword-missing, #bugprone-too-small-loop-variable, #bugprone-undefined-memory-manipulation, #bugprone-undelegated-constructor, #bugprone-unhandled-exception-at-new, #bugprone-unhandled-self-assignment, #bugprone-unused-raii, #bugprone-unused-return-value, #bugprone-use-after-move, #bugprone-virtual-near-miss, #cppcoreguidelines-avoid-c-arrays, #cppcoreguidelines-avoid-goto, #cppcoreguidelines-avoid-magic-numbers, #cppcoreguidelines-avoid-non-const-global-variables, #cppcoreguidelines-c-copy-assignment-signature, #cppcoreguidelines-explicit-virtual-functions, #cppcoreguidelines-init-variables, #cppcoreguidelines-interfaces-global-init, #cppcoreguidelines-macro-usage, #cppcoreguidelines-narrowing-conversions, #cppcoreguidelines-no-malloc, #cppcoreguidelines-non-private-member-variables-in-classes, #cppcoreguidelines-owning-memory, #cppcoreguidelines-prefer-member-initializer, #cppcoreguidelines-pro-bounds-array-to-pointer-decay, #cppcoreguidelines-pro-bounds-constant-array-index, #cppcoreguidelines-pro-bounds-pointer-arithmetic, #cppcoreguidelines-pro-type-const-cast, #cppcoreguidelines-pro-type-cstyle-cast, #cppcoreguidelines-pro-type-member-init, #cppcoreguidelines-pro-type-reinterpret-cast, #cppcoreguidelines-pro-type-static-cast-downcast, #cppcoreguidelines-pro-type-union-access, #cppcoreguidelines-pro-type-vararg, #cppcoreguidelines-slicing, #cppcoreguidelines-special-member-functions, #cppcoreguidelines-virtual-class-destructor, #hicpp-avoid-c-arrays, #hicpp-avoid-goto, #hicpp-braces-around-statements, #hicpp-deprecated-headers, #hicpp-exception-baseclass, #hicpp-explicit-conversions, #hicpp-function-size, #hicpp-invalid-access-moved, #hicpp-member-init, #hicpp-move-const-arg, #hicpp-multiway-paths-covered, #hicpp-named-parameter, #hicpp-new-delete-operators, #hicpp-no-array-decay, #hicpp-no-assembler, #hicpp-no-malloc, #hicpp-noexcept-move, #hicpp-signed-bitwise, #hicpp-special-member-functions, #hicpp-static-assert, #hicpp-undelegated-constructor, #hicpp-uppercase-literal-suffix, #hicpp-use-auto, #hicpp-use-emplace, #hicpp-use-equals-default, #hicpp-use-equals-delete, #hicpp-use-noexcept, #hicpp-use-nullptr, #hicpp-use-override, #hicpp-vararg, #modernize-avoid-bind, #modernize-avoid-c-arrays, #modernize-concat-nested-namespaces, #modernize-deprecated-headers, #modernize-deprecated-ios-base-aliases, #modernize-loop-convert, #modernize-make-shared, #modernize-make-unique, #modernize-pass-by-value, #modernize-raw-string-literal, #modernize-redundant-void-arg, #modernize-replace-auto-ptr, #modernize-replace-disallow-copy-and-assign-macro, #modernize-replace-random-shuffle, #modernize-return-braced-init-list, #modernize-shrink-to-fit, #modernize-unary-static-assert, #modernize-use-auto, #modernize-use-bool-literals, #modernize-use-default-member-init, #modernize-use-emplace, #modernize-use-equals-default, #modernize-use-equals-delete, #modernize-use-nodiscard, #modernize-use-noexcept, #modernize-use-nullptr, #modernize-use-override, #modernize-use-trailing-return-type, #modernize-use-transparent-functors, #modernize-use-uncaught-exceptions, #modernize-use-using, #performance-faster-string-find, #performance-for-range-copy, #performance-implicit-conversion-in-loop, #performance-inefficient-algorithm, #performance-inefficient-string-concatenation, #performance-inefficient-vector-operation, #performance-move-const-arg, #performance-move-constructor-init, #performance-no-automatic-move, #performance-no-int-to-ptr, #performance-noexcept-move-constructor, #performance-trivially-destructible, #performance-type-promotion-in-math-fn, #performance-unnecessary-copy-initialization, #performance-unnecessary-value-param, #portability-restrict-system-includes, #portability-simd-intrinsics, #readability-avoid-const-params-in-decls, #readability-braces-around-statements, #readability-const-return-type, #readability-container-contains, #readability-container-data-pointer, #readability-container-size-empty, #readability-convert-member-functions-to-static, #readability-delete-null-pointer, #readability-duplicate-include, #readability-else-after-return, #readability-function-cognitive-complexity, #readability-function-size, #readability-identifier-length, #readability-identifier-naming, #readability-implicit-bool-conversion, #readability-inconsistent-declaration-parameter-name, #readability-isolate-declaration, #readability-magic-numbers, #readability-make-member-function-const, #readability-misleading-indentation, #readability-misplaced-array-index, #readability-named-parameter, #readability-non-const-parameter, #readability-qualified-auto, #readability-redundant-access-specifiers, #readability-redundant-control-flow, #readability-redundant-declaration, #readability-redundant-function-ptr-dereference, #readability-redundant-member-init, #readability-redundant-preprocessor, #readability-redundant-smartptr-get, #readability-redundant-string-cstr, #readability-redundant-string-init, #readability-simplify-boolean-expr, #readability-simplify-subscript-expr, #readability-static-accessed-through-instance, #readability-static-definition-in-anonymous-namespace, #readability-string-compare, #readability-suspicious-call-argument, #readability-uniqueptr-delete-release, #readability-uppercase-literal-suffix, #readability-use-anyofallof " flatbuffers-24.12.23/.editorconfig000066400000000000000000000003771473234705300167440ustar00rootroot00000000000000root = true # Don't set line endings to avoid conflict with core.autocrlf flag. # Line endings on checkout/checkin are controlled by .gitattributes file. [*] indent_style = space indent_size = 2 insert_final_newline = true trim_trailing_whitespace = true flatbuffers-24.12.23/.eslintrc.js000066400000000000000000000003751473234705300165240ustar00rootroot00000000000000/* eslint-env node */ module.exports = { root: true, parser: '@typescript-eslint/parser', plugins: [ '@typescript-eslint', ], extends: [ 'eslint:recommended', 'plugin:@typescript-eslint/recommended', ] };flatbuffers-24.12.23/.gitattributes000066400000000000000000000001251473234705300171510ustar00rootroot00000000000000# Set the default behavior, in case people don't have core.autocrlf set. * text=auto flatbuffers-24.12.23/.github/000077500000000000000000000000001473234705300156205ustar00rootroot00000000000000flatbuffers-24.12.23/.github/ISSUE_TEMPLATE.md000066400000000000000000000010101473234705300203150ustar00rootroot00000000000000Thank you for submitting an issue! Please make sure you include the names of the affected language(s), compiler version(s), operating system version(s), and FlatBuffers version(s) in your issue title. This helps us get the correct maintainers to look at your issue. Here are examples of good titles: - Crash when accessing FlatBuffer [C++, gcc 4.8, OS X, master] - Flatc converts a protobuf 'bytes' field to 'string' in fbs schema file [all languages, FlatBuffers 1.4] Include other details as appropriate. Thanks! flatbuffers-24.12.23/.github/PULL_REQUEST_TEMPLATE.md000066400000000000000000000015321473234705300214220ustar00rootroot00000000000000Thank you for submitting a PR! Please delete this standard text once you've created your own description. If you make changes to any of the code generators (`src/idl_gen*`) be sure to [build](https://google.github.io/flatbuffers/flatbuffers_guide_building.html) your project, as it will generate code based on the changes. If necessary the code generation script can be directly run (`scripts/generate_code.py`), requires Python3. This allows us to better see the effect of the PR. If your PR includes C++ code, please adhere to the [Google C++ Style Guide](https://google.github.io/styleguide/cppguide.html), and don't forget we try to support older compilers (e.g. VS2010, GCC 4.6.3), so only some C++11 support is available. For any C++ changes, please make sure to run `sh scripts/clang-format-git.sh` Include other details as appropriate. Thanks! flatbuffers-24.12.23/.github/labeler.yml000066400000000000000000000026501473234705300177540ustar00rootroot00000000000000# Configuration for Auto Labeler during pull request # # See https://github.com/actions/labeler for file format # and https://github.com/google/flatbuffers/labels for a list of valid labels # # See .github/workflows/label.yml for Github Action workflow script c#: - '**/*.cs' - net/**/* - tests/FlatBuffers.Test/**/* - tests/FlatBuffers.Benchmarks/**/* - src/idl_gen_csharp.cpp swift: - '**/*.swift' - swift/**/* - tests/swift/** - src/idl_gen_swift.cpp nim: - '**/*.nim' - nim/**/* - src/idl_gen_nim.cpp - src/bfbs_gen_nim.cpp javascript: - '**/*.js' - src/idl_gen_ts.cpp typescript: - '**/*.ts' - src/idl_gen_ts.cpp - grpc/flatbuffers-js-grpc/**/*.ts golang: - '**/*.go' - src/idl_gen_go.cpp python: - '**/*.py' - src/idl_gen_python.cpp java: - '**/*.java' - src/idl_gen_java.cpp kotlin: - '**/*.kt' - src/idl_gen_kotlin.cpp - src/idl_gen_kotlin_kmp.cpp lua: - '**/*.lua' - lua/**/* - src/bfbs_gen_lua.cpp lobster: - '**/*.lobster' - src/idl_gen_lobster.cpp php: - '**/*.php' - src/idl_gen_php.cpp rust: - '**/*.rs' - rust/**/* - src/idl_gen_rust.cpp dart: - '**/*.dart' - src/idl_gen_dart.cpp c++: - '**/*.cc' - '**/*.cpp' - '**/*.h' json: - '**/*.json' - src/idl_gen_json_schema.cpp codegen: - src/**/* documentation: - docs/**/* - '**/*.md' CI: - '.github/**/*' - '.bazelci/**/*' grpc: - grpc/**/* - src/idl_gen_grpc.cpp flatbuffers-24.12.23/.github/workflows/000077500000000000000000000000001473234705300176555ustar00rootroot00000000000000flatbuffers-24.12.23/.github/workflows/build.yml000066400000000000000000000502301473234705300214770ustar00rootroot00000000000000name: CI permissions: read-all on: # For manual tests. workflow_dispatch: push: tags: - "*" # new tag version, like `0.8.4` or else branches: - master pull_request: branches: - master schedule: # Run daily at 4:45 A.M. to catch dependencies that break us. - cron: '45 4 * * *' jobs: build-linux: permissions: contents: write outputs: digests-gcc: ${{ steps.hash-gcc.outputs.hashes }} digests-clang: ${{ steps.hash-clang.outputs.hashes }} name: Build Linux runs-on: ubuntu-24.04 strategy: matrix: cxx: [g++-13, clang++-18] fail-fast: false steps: - uses: actions/checkout@v3 - name: cmake run: CXX=${{ matrix.cxx }} cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_STRICT_MODE=ON -DFLATBUFFERS_STATIC_FLATC=ON . - name: build run: make -j - name: test run: ./flattests - name: make flatc executable run: | chmod +x flatc ./flatc --version - name: upload build artifacts uses: actions/upload-artifact@v4 with: name: Linux flatc binary ${{ matrix.cxx }} path: flatc # Below if only for release. - name: Zip file if: startsWith(github.ref, 'refs/tags/') run: zip Linux.flatc.binary.${{ matrix.cxx }}.zip flatc - name: Release zip file uses: softprops/action-gh-release@v1 if: startsWith(github.ref, 'refs/tags/') with: files: Linux.flatc.binary.${{ matrix.cxx }}.zip - name: Generate SLSA subjects - clang if: matrix.cxx == 'clang++-18' && startsWith(github.ref, 'refs/tags/') id: hash-clang run: echo "hashes=$(sha256sum Linux.flatc.binary.${{ matrix.cxx }}.zip | base64 -w0)" >> $GITHUB_OUTPUT - name: Generate SLSA subjects - gcc if: matrix.cxx == 'g++-13' && startsWith(github.ref, 'refs/tags/') id: hash-gcc run: echo "hashes=$(sha256sum Linux.flatc.binary.${{ matrix.cxx }}.zip | base64 -w0)" >> $GITHUB_OUTPUT build-linux-no-file-tests: name: Build Linux with -DFLATBUFFERS_NO_FILE_TESTS runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v3 - name: cmake run: CXX=clang++-18 cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_STRICT_MODE=ON -DFLATBUFFERS_CXX_FLAGS="-DFLATBUFFERS_NO_FILE_TESTS" . - name: build run: make -j - name: test run: ./flattests build-linux-out-of-source: name: Build Linux with out-of-source build location runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v3 - name: make build directory run: mkdir build - name: cmake working-directory: build run: > CXX=clang++-18 cmake .. -G "Unix Makefiles" -DFLATBUFFERS_STRICT_MODE=ON -DFLATBUFFERS_BUILD_CPP17=ON -DFLATBUFFERS_CPP_STD=17 - name: build working-directory: build run: make -j - name: test working-directory: build run: pwd && ./flattests - name: test C++17 working-directory: build run: ./flattests_cpp17 build-linux-cpp-std: name: Build Linux C++ runs-on: ubuntu-24.04 strategy: fail-fast: false matrix: std: [11, 14, 17, 20, 23] cxx: [g++-13, clang++-18] exclude: # Clang++15 10.3.0 stdlibc++ doesn't fully support std 23 - cxx: clang++-18 std: 23 steps: - uses: actions/checkout@v3 - name: cmake run: > CXX=${{ matrix.cxx }} cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_STRICT_MODE=ON -DFLATBUFFERS_CPP_STD=${{ matrix.std }} -DFLATBUFFERS_BUILD_CPP17=${{ matrix.std >= 17 && 'On' || 'Off'}} - name: build run: make -j - name: test run: ./flattests - name: test C++17 if: matrix.std >= 17 run: ./flattests_cpp17 build-cpp-std: name: Build Windows C++ runs-on: windows-2019 strategy: matrix: std: [11, 14, 17, 20, 23] fail-fast: false steps: - uses: actions/checkout@v3 - name: Add msbuild to PATH uses: microsoft/setup-msbuild@v1.1 - name: cmake run: > cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_STRICT_MODE=ON -DFLATBUFFERS_CPP_STD=${{ matrix.std }} -DFLATBUFFERS_BUILD_CPP17=${{ matrix.std >= 17 && 'On' || 'Off'}} - name: build run: msbuild.exe FlatBuffers.sln /p:Configuration=Release /p:Platform=x64 - name: test run: Release\flattests.exe - name: test C++17 if: matrix.std >= 17 run: Release\flattests_cpp17.exe build-windows: permissions: contents: write outputs: digests: ${{ steps.hash.outputs.hashes }} name: Build Windows 2019 runs-on: windows-2019 steps: - uses: actions/checkout@v3 - name: Add msbuild to PATH uses: microsoft/setup-msbuild@v1.1 - name: cmake run: cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_BUILD_CPP17=ON -DFLATBUFFERS_STRICT_MODE=ON . - name: build run: msbuild.exe FlatBuffers.sln /p:Configuration=Release /p:Platform=x64 - name: test run: Release\flattests.exe - name: upload build artifacts uses: actions/upload-artifact@v4 with: name: Windows flatc binary path: Release\flatc.exe # Below if only for release. - name: Zip file if: startsWith(github.ref, 'refs/tags/') run: move Release/flatc.exe . && Compress-Archive flatc.exe Windows.flatc.binary.zip - name: Release binary uses: softprops/action-gh-release@v1 if: startsWith(github.ref, 'refs/tags/') with: files: Windows.flatc.binary.zip - name: Generate SLSA subjects if: startsWith(github.ref, 'refs/tags/') id: hash shell: bash run: echo "hashes=$(sha256sum Windows.flatc.binary.zip | base64 -w0)" >> $GITHUB_OUTPUT build-dotnet-windows: name: Build .NET Windows runs-on: windows-2022-64core strategy: matrix: configuration: [ '', '-p:UnsafeByteBuffer=true', # Fails two tests currently. #'-p:EnableSpanT=true,UnsafeByteBuffer=true' ] steps: - uses: actions/checkout@v3 - name: Setup .NET Core SDK uses: actions/setup-dotnet@v3 with: dotnet-version: '8.0.x' - name: Build run: | cd tests\FlatBuffers.Test dotnet new sln --force --name FlatBuffers.Test dotnet sln FlatBuffers.Test.sln add FlatBuffers.Test.csproj dotnet build -c Release ${{matrix.configuration}} -o out FlatBuffers.Test.sln - name: Run run: | cd tests\FlatBuffers.Test out\FlatBuffers.Test.exe build-mac-intel: permissions: contents: write outputs: digests: ${{ steps.hash.outputs.hashes }} name: Build Mac (for Intel) runs-on: macos-latest-large steps: - uses: actions/checkout@v3 - name: cmake run: cmake -G "Xcode" -DCMAKE_OSX_ARCHITECTURES="x86_64" -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_STRICT_MODE=ON . - name: build run: xcodebuild -toolchain clang -configuration Release -target flattests - name: check that the binary is x86_64 run: | info=$(file Release/flatc) echo $info echo $info | grep "Mach-O 64-bit executable x86_64" - name: test run: Release/flattests - name: make flatc executable run: | chmod +x Release/flatc Release/flatc --version - name: upload build artifacts uses: actions/upload-artifact@v4 with: name: Mac flatc binary Intel path: Release/flatc # Below if only for release. - name: Zip file if: startsWith(github.ref, 'refs/tags/') run: mv Release/flatc . && zip MacIntel.flatc.binary.zip flatc - name: Release binary uses: softprops/action-gh-release@v1 if: startsWith(github.ref, 'refs/tags/') with: files: MacIntel.flatc.binary.zip - name: Generate SLSA subjects if: startsWith(github.ref, 'refs/tags/') id: hash run: echo "hashes=$(shasum -a 256 MacIntel.flatc.binary.zip | base64)" >> $GITHUB_OUTPUT build-mac-universal: permissions: contents: write outputs: digests: ${{ steps.hash.outputs.hashes }} name: Build Mac (universal build) runs-on: macos-latest steps: - uses: actions/checkout@v3 - name: cmake run: cmake -G "Xcode" -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_STRICT_MODE=ON . - name: build run: xcodebuild -toolchain clang -configuration Release -target flattests - name: check that the binary is "universal" run: | info=$(file Release/flatc) echo $info echo $info | grep "Mach-O universal binary with 2 architectures" - name: test run: Release/flattests - name: make flatc executable run: | chmod +x Release/flatc Release/flatc --version - name: upload build artifacts uses: actions/upload-artifact@v4 with: name: Mac flatc binary Universal path: Release/flatc # Below if only for release. - name: Zip file if: startsWith(github.ref, 'refs/tags/') run: mv Release/flatc . && zip Mac.flatc.binary.zip flatc - name: Release binary uses: softprops/action-gh-release@v1 if: startsWith(github.ref, 'refs/tags/') with: files: Mac.flatc.binary.zip - name: Generate SLSA subjects if: startsWith(github.ref, 'refs/tags/') id: hash run: echo "hashes=$(shasum -a 256 Mac.flatc.binary.zip | base64)" >> $GITHUB_OUTPUT build-android: name: Build Android (on Linux) runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v3 - name: set up Java uses: actions/setup-java@v3 with: distribution: 'temurin' java-version: '11' - name: set up flatc run: | cmake -DFLATBUFFERS_BUILD_TESTS=OFF -DFLATBUFFERS_BUILD_FLATLIB=OFF -DFLATBUFFERS_BUILD_FLATHASH=OFF -DFLATBUFFERS_STRICT_MODE=ON . make -j echo "${PWD}" >> $GITHUB_PATH - name: build working-directory: android run: gradle clean build build-generator: name: Check Generated Code runs-on: ubuntu-24.04 strategy: matrix: cxx: [g++-13, clang++-18] steps: - uses: actions/checkout@v3 - name: cmake run: CXX=${{ matrix.cxx }} cmake -G "Unix Makefiles" -DFLATBUFFERS_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_STRICT_MODE=ON . && make -j - name: Generate run: scripts/check_generate_code.py - name: Generate gRPC run: scripts/check-grpc-generated-code.py build-generator-windows: name: Check Generated Code on Windows runs-on: windows-2019 steps: - uses: actions/checkout@v3 - name: Add msbuild to PATH uses: microsoft/setup-msbuild@v1.1 - name: cmake run: cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_BUILD_CPP17=ON -DFLATBUFFERS_STRICT_MODE=ON . - name: build run: msbuild.exe FlatBuffers.sln /p:Configuration=Release /p:Platform=x64 - name: Generate run: python3 scripts/check_generate_code.py --flatc Release\flatc.exe - name: Generate gRPC run: python3 scripts/check-grpc-generated-code.py --flatc Release\flatc.exe build-benchmarks: name: Build Benchmarks (on Linux) runs-on: ubuntu-24.04 strategy: matrix: cxx: [g++-13] steps: - uses: actions/checkout@v3 - name: cmake run: CXX=${{ matrix.cxx }} cmake -G "Unix Makefiles" -DFLATBUFFERS_CXX_FLAGS="-Wno-unused-parameter -fno-aligned-new" -DFLATBUFFERS_BUILD_BENCHMARKS=ON -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_STRICT_MODE=ON . && make -j - name: Run benchmarks run: ./flatbenchmark --benchmark_repetitions=5 --benchmark_display_aggregates_only=true --benchmark_out_format=console --benchmark_out=benchmarks/results_${{matrix.cxx}} - name: Upload benchmarks results uses: actions/upload-artifact@v4 with: name: Linux flatbenchmark results ${{matrix.cxx}} path: benchmarks/results_${{matrix.cxx}} build-java: name: Build Java runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v3 - name: test working-directory: java run: mvn test build-kotlin-macos: name: Build Kotlin MacOS runs-on: macos-13 steps: - name: Checkout uses: actions/checkout@v3 # Force Xcode 14.3 since Xcode 15 doesnt support older versions of # kotlin. For Xcode 15, kotlin should be bumpped to 1.9.10 # https://stackoverflow.com/a/77150623 # For now, run with macos-13 which has this 14.3 installed: # https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md#xcode - name: Set up Xcode version run: sudo xcode-select -s /Applications/Xcode_14.3.app/Contents/Developer - uses: gradle/wrapper-validation-action@v1.0.5 - uses: actions/setup-java@v3 with: distribution: 'temurin' java-version: '11' - name: Build flatc run: | cmake -DFLATBUFFERS_BUILD_TESTS=OFF -DFLATBUFFERS_BUILD_FLATLIB=OFF -DFLATBUFFERS_BUILD_FLATHASH=OFF . make -j echo "${PWD}" >> $GITHUB_PATH - name: Build working-directory: kotlin run: ./gradlew clean iosSimulatorArm64Test macosX64Test macosArm64Test build-kotlin-linux: name: Build Kotlin Linux runs-on: ubuntu-24.04 steps: - name: Checkout uses: actions/checkout@v3 - uses: actions/setup-java@v3 with: distribution: 'temurin' java-version: '11' - uses: gradle/wrapper-validation-action@v1.0.5 - name: Build flatc run: | cmake -DFLATBUFFERS_BUILD_TESTS=OFF -DFLATBUFFERS_BUILD_FLATLIB=OFF -DFLATBUFFERS_BUILD_FLATHASH=OFF . make -j echo "${PWD}" >> $GITHUB_PATH - name: Build working-directory: kotlin # we are using docker's version of gradle # so no need for wrapper validation or user # gradlew run: gradle jvmMainClasses jvmTest jsTest jsBrowserTest build-rust-linux: name: Build Rust Linux runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v3 - name: test working-directory: tests run: bash RustTest.sh build-rust-windows: name: Build Rust Windows runs-on: windows-2022-64core steps: - uses: actions/checkout@v3 - name: test working-directory: tests run: ./RustTest.bat build-python: name: Build Python runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v3 - name: flatc # FIXME: make test script not rely on flatc run: cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_BUILD_TESTS=OFF -DFLATBUFFERS_INSTALL=OFF -DFLATBUFFERS_BUILD_FLATLIB=OFF -DFLATBUFFERS_BUILD_FLATHASH=OFF -DFLATBUFFERS_STRICT_MODE=ON . && make -j - name: test working-directory: tests run: bash PythonTest.sh build-go: name: Build Go runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v3 - name: flatc # FIXME: make test script not rely on flatc run: cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_BUILD_TESTS=OFF -DFLATBUFFERS_INSTALL=OFF -DFLATBUFFERS_BUILD_FLATLIB=OFF -DFLATBUFFERS_BUILD_FLATHASH=OFF -DFLATBUFFERS_STRICT_MODE=ON . && make -j - name: test working-directory: tests run: bash GoTest.sh build-php: name: Build PHP runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v3 - name: flatc # FIXME: make test script not rely on flatc run: cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_BUILD_TESTS=OFF -DFLATBUFFERS_INSTALL=OFF -DFLATBUFFERS_BUILD_FLATLIB=OFF -DFLATBUFFERS_BUILD_FLATHASH=OFF -DFLATBUFFERS_STRICT_MODE=ON . && make -j - name: test working-directory: tests run: | php phpTest.php sh phpUnionVectorTest.sh build-swift: name: Build Swift strategy: matrix: swift: ["5.8", "5.9", "5.10"] # Only 22.04 has swift at the moment https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2204-Readme.md?plain=1#L30 runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 - uses: swift-actions/setup-swift@v2 with: swift-version: ${{ matrix.swift }} - name: Get swift version run: swift --version - name: test working-directory: tests/swift/tests run: | swift build --build-tests swift test build-swift-wasm: name: Build Swift Wasm runs-on: ubuntu-24.04 container: image: ghcr.io/swiftwasm/carton:0.20.1 steps: - uses: actions/checkout@v3 - uses: bytecodealliance/actions/wasmtime/setup@v1 - uses: swiftwasm/setup-swiftwasm@v1 with: swift-version: "wasm-6.0.2-RELEASE" - name: Test working-directory: tests/swift/Wasm.tests run: swift run carton test build-ts: name: Build TS runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v3 - name: flatc # FIXME: make test script not rely on flatc run: cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_BUILD_TESTS=OFF -DFLATBUFFERS_INSTALL=OFF -DFLATBUFFERS_BUILD_FLATLIB=OFF -DFLATBUFFERS_BUILD_FLATHASH=OFF . && make -j - name: deps run: yarn - name: compile run: yarn compile - name: test working-directory: tests/ts run: | yarn global add esbuild python3 TypeScriptTest.py build-dart: name: Build Dart runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v3 - uses: dart-lang/setup-dart@v1 with: sdk: stable - name: flatc # FIXME: make test script not rely on flatc run: cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_BUILD_TESTS=OFF -DFLATBUFFERS_INSTALL=OFF -DFLATBUFFERS_BUILD_FLATLIB=OFF -DFLATBUFFERS_BUILD_FLATHASH=OFF -DFLATBUFFERS_STRICT_MODE=ON . && make -j - name: test working-directory: tests run: bash DartTest.sh build-nim: name: Build Nim runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v3 - name: flatc # FIXME: make test script not rely on flatc run: cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_BUILD_TESTS=OFF -DFLATBUFFERS_INSTALL=OFF -DFLATBUFFERS_BUILD_FLATLIB=OFF -DFLATBUFFERS_BUILD_FLATHASH=OFF . && make -j - uses: jiro4989/setup-nim-action@v1 - name: install library working-directory: nim run: nimble -y develop && nimble install - name: test working-directory: tests/nim run: python3 testnim.py release-digests: if: startsWith(github.ref, 'refs/tags/') needs: [build-linux, build-windows, build-mac-intel, build-mac-universal] outputs: digests: ${{ steps.hash.outputs.digests }} runs-on: ubuntu-24.04 steps: - name: Merge results id: hash env: LINUXGCC_DIGESTS: "${{ needs.build-linux.outputs.digests-gcc }}" LINUXCLANG_DIGESTS: "${{ needs.build-linux.outputs.digests-clang }}" MAC_DIGESTS: "${{ needs.build-mac-universal.outputs.digests }}" MACINTEL_DIGESTS: "${{ needs.build-mac-intel.outputs.digests }}" WINDOWS_DIGESTS: "${{ needs.build-windows.outputs.digests }}" run: | set -euo pipefail echo "$LINUXGCC_DIGESTS" | base64 -d > checksums.txt echo "$LINUXCLANG_DIGESTS" | base64 -d >> checksums.txt echo "$MAC_DIGESTS" | base64 -d >> checksums.txt echo "$MACINTEL_DIGESTS" | base64 -d >> checksums.txt echo "$WINDOWS_DIGESTS" | base64 -d >> checksums.txt echo "digests=$(cat checksums.txt | base64 -w0)" >> $GITHUB_OUTPUT provenance: if: startsWith(github.ref, 'refs/tags/') needs: [release-digests] permissions: actions: read # To read the workflow path. id-token: write # To sign the provenance. contents: write # To add assets to a release. uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v1.2.1 with: base64-subjects: "${{ needs.release-digests.outputs.digests }}" upload-assets: true # Optional: Upload to a new release compile-generator: true # Workaround for https://github.com/slsa-framework/slsa-github-generator/issues/1163 flatbuffers-24.12.23/.github/workflows/codeql.yml000066400000000000000000000045741473234705300216610ustar00rootroot00000000000000# For most projects, this workflow file will not need changing; you simply need # to commit it to your repository. # # You may wish to alter this file to override the set of languages analyzed, # or to provide custom queries or build logic. # # ******** NOTE ******** # We have attempted to detect the languages in your repository. Please check # the `language` matrix defined below to confirm you have the correct set of # supported CodeQL languages. # name: "CodeQL" permissions: read-all on: push: branches: [ master ] pull_request: # The branches below must be a subset of the branches above branches: [ master ] schedule: - cron: '16 20 * * 0' jobs: analyze: name: Analyze runs-on: ubuntu-latest permissions: actions: read contents: read security-events: write strategy: fail-fast: false matrix: language: [ 'cpp' ] # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] # Learn more about CodeQL language support at https://git.io/codeql-language-support steps: - name: Checkout repository uses: actions/checkout@v3 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL uses: github/codeql-action/init@v2 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. # By default, queries listed here will override any specified in a config file. # Prefix the list here with "+" to use these queries and those in the config file. # queries: ./path/to/local/query, your-org/your-repo/queries@main # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) # - name: Autobuild # uses: github/codeql-action/autobuild@v2 # â„šī¸ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl # âœī¸ If the Autobuild fails above, remove it and uncomment the following three lines # and modify them (or add more) to build your code if your project # uses a compiled language - run: | cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_STRICT_MODE=ON . make -j - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v2 flatbuffers-24.12.23/.github/workflows/extrabuild.yml000066400000000000000000000015051473234705300225440ustar00rootroot00000000000000name: Build and unit tests that are more time consuming permissions: read-all on: # For manual tests. workflow_dispatch: pull_request: types: - closed schedule: - cron: "30 20 * * *" jobs: build-linux-s390x: name: Build Linux on s390x arch and run unit tests runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: uraimo/run-on-arch-action@v2 name: Run commands id: runcmd with: arch: s390x distro: ubuntu_latest install: | apt-get update -q -y apt-get -y install cmake apt-get -y install make apt-get -y install g++ run: | lscpu | grep Endian cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release make -j ./flattests flatbuffers-24.12.23/.github/workflows/label.yml000066400000000000000000000011461473234705300214610ustar00rootroot00000000000000# This workflow will triage pull requests and apply a label based on the # paths that are modified in the pull request. # # To use this workflow, you will need to set up a .github/labeler.yml # file with configuration. For more information, see: # https://github.com/actions/labeler name: Labeler permissions: read-all on: [pull_request_target] jobs: label: permissions: contents: read pull-requests: write runs-on: ubuntu-latest steps: - uses: actions/labeler@ee18d5d34efd9b4f7dafdb0e363cb688eb438044 # 4.1.0 with: repo-token: "${{ secrets.GITHUB_TOKEN }}" flatbuffers-24.12.23/.github/workflows/main.yml000066400000000000000000000014131473234705300213230ustar00rootroot00000000000000name: OSS-Fuzz permissions: read-all on: pull_request: branches: - master paths: - include/** - src/** - tests/**.cpp - tests/**.h jobs: Fuzzing: runs-on: ubuntu-latest steps: - name: Build Fuzzers id: build uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master with: oss-fuzz-project-name: 'flatbuffers' language: c++ - name: Run Fuzzers uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master with: oss-fuzz-project-name: 'flatbuffers' language: c++ fuzz-seconds: 60 - name: Upload Crash uses: actions/upload-artifact@v4 if: failure() && steps.build.outcome == 'success' with: name: artifacts path: ./out/artifacts flatbuffers-24.12.23/.github/workflows/release.yml000066400000000000000000000101231473234705300220150ustar00rootroot00000000000000name: Release permissions: read-all on: # For manual tests. workflow_dispatch: release: types: [published] jobs: publish-npm: name: Publish NPM runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: node-version: '20.x' registry-url: 'https://registry.npmjs.org' - run: npm publish env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} publish-pypi: name: Publish PyPi runs-on: ubuntu-latest defaults: run: working-directory: ./python steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: python-version: '3.10' - name: Install Dependencies run: | python3 -m pip install --upgrade pip python3 -m pip install setuptools wheel twine - name: Build run: | python3 setup.py sdist bdist_wheel - name: Upload to PyPi run: | python3 -m twine upload dist/* env: TWINE_USERNAME: __token__ TWINE_PASSWORD: ${{ secrets.TWINE_TOKEN }} publish-nuget: name: Publish NuGet runs-on: windows-latest defaults: run: working-directory: ./net/flatbuffers steps: - uses: actions/checkout@v3 - uses: actions/setup-dotnet@v3 with: dotnet-version: '8.0.x' - name: Build run: | dotnet build Google.FlatBuffers.csproj -c Release - name: Pack run: | dotnet pack Google.FlatBuffers.csproj -c Release - name: Upload to NuGet run: | dotnet nuget push .\bin\Release\Google.FlatBuffers.*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json publish-maven: name: Publish Maven runs-on: ubuntu-latest defaults: run: working-directory: ./java steps: - uses: actions/checkout@v3 - name: Set up Maven Central Repository uses: actions/setup-java@v3 with: java-version: '11' distribution: 'adopt' cache: 'maven' server-id: ossrh server-username: OSSRH_USERNAME server-password: OSSRH_PASSWORD gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} gpg-passphrase: MAVEN_GPG_PASSPHRASE # this needs to be an env var - name: Publish Maven run: mvn --batch-mode clean deploy env: OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} OSSRH_PASSWORD: ${{ secrets.OSSRH_TOKEN }} MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} publish-maven-kotlin: name: Publish Maven - Kotlin runs-on: ubuntu-latest defaults: run: working-directory: ./kotlin steps: - uses: actions/checkout@v3 - name: Set up Maven Central Repository uses: actions/setup-java@v3 with: java-version: '11' distribution: 'adopt' cache: 'maven' server-id: ossrh server-username: OSSRH_USERNAME server-password: OSSRH_PASSWORD gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} gpg-passphrase: MAVEN_GPG_PASSPHRASE # this needs to be an env var - name: Publish Kotlin Library on Maven run: ./gradlew publishAllPublicationsToSonatypeRepository env: OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} OSSRH_PASSWORD: ${{ secrets.OSSRH_TOKEN }} MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} publish-crates: name: Publish crates.io runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: actions-rs/toolchain@v1 with: toolchain: stable override: true - name: Publish Flatbuffers uses: katyo/publish-crates@v2 with: path: ./rust/flatbuffers registry-token: ${{ secrets.CARGO_TOKEN }} - name: Publish Flexbuffers uses: katyo/publish-crates@v2 with: path: ./rust/flexbuffers registry-token: ${{ secrets.CARGO_TOKEN }} flatbuffers-24.12.23/.github/workflows/scorecards.yml000066400000000000000000000035021473234705300225300ustar00rootroot00000000000000name: Scorecards supply-chain security on: # Only the default branch is supported. branch_protection_rule: schedule: - cron: '21 2 * * 5' push: branches: [ master ] # Declare default permissions as read only. permissions: read-all jobs: analysis: name: Scorecards analysis runs-on: ubuntu-latest permissions: # Needed to upload the results to code-scanning dashboard. security-events: write actions: read contents: read steps: - name: "Checkout code" uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 # v3.0.0 with: persist-credentials: false - name: "Run analysis" uses: ossf/scorecard-action@ce330fde6b1a5c9c75b417e7efc510b822a35564 # v1.1.2 with: results_file: results.sarif results_format: sarif # Read-only PAT token. To create it, # follow the steps in https://github.com/ossf/scorecard-action#pat-token-creation. repo_token: ${{ secrets.SCORECARD_READ_TOKEN }} # Publish the results to enable scorecard badges. For more details, see # https://github.com/ossf/scorecard-action#publishing-results. # For private repositories, `publish_results` will automatically be set to `false`, # regardless of the value entered here. publish_results: true # Upload the results as artifacts (optional). - name: "Upload artifact" uses: actions/upload-artifact@v4 with: name: SARIF file path: results.sarif retention-days: 5 # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" uses: github/codeql-action/upload-sarif@5f532563584d71fdef14ee64d17bafb34f751ce5 # v1.0.26 with: sarif_file: results.sarif flatbuffers-24.12.23/.github/workflows/stale.yml000066400000000000000000000025171473234705300215150ustar00rootroot00000000000000name: Mark stale issues and pull requests permissions: issues: write pull-requests: write on: # For manual tests. workflow_dispatch: schedule: - cron: "30 20 * * *" jobs: stale: runs-on: ubuntu-latest steps: - uses: actions/stale@v7.0.0 with: repo-token: ${{ secrets.GITHUB_TOKEN }} operations-per-run: 500 exempt-all-milestones: true remove-stale-when-updated: true stale-issue-message: 'This issue is stale because it has been open 6 months with no activity. Please comment or label `not-stale`, or this will be closed in 14 days.' close-issue-message: 'This issue was automatically closed due to no activity for 6 months plus the 14 day notice period.' days-before-issue-stale: 182 # 6 months days-before-issue-close: 14 # 2 weeks exempt-issue-labels: not-stale stale-pr-message: 'This pull request is stale because it has been open 6 months with no activity. Please comment or label `not-stale`, or this will be closed in 14 days.' close-pr-message: 'This pull request was automatically closed due to no activity for 6 months plus the 14 day notice period.' days-before-pr-stale: 182 # 6 months days-before-pr-close: 14 # 2 week exempt-pr-labels: not-stale exempt-draft-pr: false flatbuffers-24.12.23/.gitignore000066400000000000000000000047231473234705300162560ustar00rootroot00000000000000*_wire.txt *_wire.bin .DS_Store **/.build build **/Packages /*.xcodeproj **/xcuserdata/ **/xcshareddata/ **/.swiftpm/ *.o *.o.d *.class *.a *.swp *~ *.vcxproj *.vcxproj.filters *.vcxproj.user *.sln *.suo *.opendb *.keystore **/.vs/** **/bin/** !tests/rust_usage_test/bin/** **/gen/** **/libs/** **/obj/** **/*.dir/** **/CMakeFiles/** **/cmake_install.cmake **/install_manifest.txt **/CMakeCache.txt **/CMakeTestfile.cmake **/CPackConfig.cmake **/CPackSourceConfig.cmake **/compile_commands.json **/Debug/** **/Release/** **/RelWithDebInfo/** **/x64/ #build artifacts from VS build.xml local.properties project.properties proguard-project.txt linklint_results Makefile flatbenchmark flatbenchmark.exe flatc flatc.exe flathash flathash.exe flattests flattests.exe flattests_cpp17 flattests_cpp17.exe flatsamplebinary flatsamplebinary.exe flatsampletext flatsampletext.exe flatsamplebfbs flatsamplebfbs.exe grpctest grpctest.exe snapshot.sh tags tests/dart_gen tests/go_gen tests/monsterdata_java_wire.mon tests/monsterdata_java_wire_sp.mon tests/monsterdata_go_wire.mon tests/monsterdata_javascript_wire.mon tests/monsterdata_lobster_wire.mon tests/monsterdata_rust_wire.mon tests/php/ CMakeLists.txt.user CMakeScripts/** CTestTestfile.cmake flatbuffers-config-version.cmake FlatBuffers.cbp build/Xcode/FlatBuffers.xcodeproj/project.xcworkspace/** build/Xcode/FlatBuffers.xcodeproj/xcuserdata/** FlatBuffers.xcodeproj/ java/.idea java/*.iml .idea *.iml target java/target **/*.pyc build/VS2010/FlatBuffers.sdf build/VS2010/FlatBuffers.opensdf build/VS2010/ipch/**/*.ipch *.so Testing/Temporary .cproject .settings/ .project net/**/obj node_modules/ android/.externalNativeBuild/ android/.gradle/ android/build/ samples/android/.externalNativeBuild/ samples/android/.gradle/ samples/android/build/ js/**/*.js js/**/*.d.ts mjs/**/*.js mjs/**/*.d.ts /bazel-bin /bazel-flatbuffers /bazel-genfiles /bazel-out /bazel-testlogs .ninja_deps .ninja_log build.ninja rules.ninja .vscode dart/.pub/ dart/.packages dart/pubspec.lock dart/.dart_tool/ dart/build/ dart/doc/api/ Cargo.lock .corpus** .seed** .crash** grpc/google/ **/Package.resolved .clangd/** package-lock.json /*.ilk /*.pdb .clwb yarn-error.log .cache/ /flatbuffers.lib .cmake/ **/dist **/vendor **/go.sum flatbuffers.pc **/FlatBuffers.Test.Swift.xcodeproj **/html/** **/latex/** # https://cmake.org/cmake/help/latest/module/FetchContent.html#variable:FETCHCONTENT_BASE_DIR cmake-build-debug/ _deps/ **/.gradle/** kotlin/**/generated MODULE.bazel MODULE.bazel.lock flatbuffers-24.12.23/.npmrc000066400000000000000000000000141473234705300153730ustar00rootroot00000000000000hoist=false flatbuffers-24.12.23/BUILD.bazel000066400000000000000000000066211473234705300161430ustar00rootroot00000000000000load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library") licenses(["notice"]) package( default_visibility = ["//visibility:public"], ) exports_files([ "LICENSE", "tsconfig.json", ]) config_setting( name = "platform_freebsd", constraint_values = [ "@platforms//os:freebsd", ], ) config_setting( name = "platform_openbsd", constraint_values = [ "@platforms//os:openbsd", ], ) filegroup( name = "distribution", srcs = [ ".bazelignore", ".npmrc", "BUILD.bazel", "WORKSPACE", "build_defs.bzl", "package.json", "pnpm-lock.yaml", "typescript.bzl", "//grpc/src/compiler:distribution", "//include/codegen:distribution", "//reflection:distribution", "//src:distribution", "//ts:distribution", ] + glob([ "include/flatbuffers/*.h", ]), visibility = ["//visibility:public"], ) # Public flatc library to compile flatbuffer files at runtime. cc_library( name = "flatbuffers", hdrs = ["//:public_headers"], linkstatic = 1, strip_include_prefix = "/include", deps = ["//src:flatbuffers"], ) # Public C++ headers for the Flatbuffers library. filegroup( name = "public_headers", srcs = [ "include/flatbuffers/allocator.h", "include/flatbuffers/array.h", "include/flatbuffers/base.h", "include/flatbuffers/buffer.h", "include/flatbuffers/buffer_ref.h", "include/flatbuffers/code_generator.h", "include/flatbuffers/code_generators.h", "include/flatbuffers/default_allocator.h", "include/flatbuffers/detached_buffer.h", "include/flatbuffers/file_manager.h", "include/flatbuffers/flatbuffer_builder.h", "include/flatbuffers/flatbuffers.h", "include/flatbuffers/flex_flat_util.h", "include/flatbuffers/flexbuffers.h", "include/flatbuffers/grpc.h", "include/flatbuffers/hash.h", "include/flatbuffers/idl.h", "include/flatbuffers/minireflect.h", "include/flatbuffers/reflection.h", "include/flatbuffers/reflection_generated.h", "include/flatbuffers/registry.h", "include/flatbuffers/stl_emulation.h", "include/flatbuffers/string.h", "include/flatbuffers/struct.h", "include/flatbuffers/table.h", "include/flatbuffers/util.h", "include/flatbuffers/vector.h", "include/flatbuffers/vector_downward.h", "include/flatbuffers/verifier.h", ], ) # Public flatc compiler library. cc_library( name = "flatc_library", linkstatic = 1, deps = [ "//src:flatc_library", ], ) # Public flatc compiler. cc_binary( name = "flatc", data = ["//reflection:reflection_fbs_schema"], deps = [ "//src:flatc", ], ) filegroup( name = "flatc_headers", srcs = [ "include/flatbuffers/flatc.h", ], visibility = ["//:__subpackages__"], ) # Library used by flatbuffer_cc_library rules. cc_library( name = "runtime_cc", hdrs = [ "include/flatbuffers/base.h", "include/flatbuffers/flatbuffers.h", "include/flatbuffers/flexbuffers.h", "include/flatbuffers/stl_emulation.h", "include/flatbuffers/util.h", "include/flatbuffers/vector.h", "include/flatbuffers/verifier.h", ], linkstatic = 1, strip_include_prefix = "/include", ) flatbuffers-24.12.23/CHANGELOG.md000066400000000000000000000165541473234705300161040ustar00rootroot00000000000000# Flatbuffers Change Log All major or breaking changes will be documented in this file, as well as any new features that should be highlighted. Minor fixes or improvements are not necessarily listed. ## [24.3.25] (March 25 2024)(https://github.com/google/flatbuffers/releases/tag/v24.3.25) * Fixed license metadata parsing (#8253) * [C++] Allow string_view in `LookUpByKey` in addition to null-terminated c-style strings (#8203) ## [24.3.7] (March 7 2024)(https://github.com/google/flatbuffers/releases/tag/v24.3.7) * Just to fix some of the CI build issues from the 24.3.6 release. ## [24.3.6] (March 6 2024)(https://github.com/google/flatbuffers/releases/tag/v24.3.6) * Fix typescript object API to allow 0 values for null-default scalars (#7864) ## [23.5.26 (May 26 2023)](https://github.com/google/flatbuffers/releases/tag/v23.5.26) * Mostly bug fixing for 64-bit support * Adds support for specifying underling type of unions in C++ and TS/JS (#7954) ## [23.5.9 (May 9 2023)](https://github.com/google/flatbuffers/releases/tag/v23.5.9) * 64-bit support for C++ (#7935) ## [23.5.8 (May 8 2023)](https://github.com/google/flatbuffers/releases/tag/v23.5.8) * add key_field to compiled tests * Add golden language directory * Rework cmake flatc codegeneration (#7938) * remove defining generated files in test srcs * Add binary schema reflection (#7932) * Migrate from rules_nodejs to rules_js/rules_ts (take 2) (#7928) * `flat_buffers.dart`: mark const variable finals for internal Dart linters * fixed some windows warnings (#7929) * inject no long for FBS generation to remove logs in flattests (#7926) * Revert "Migrate from rules_nodejs to rules_js/rules_ts (#7923)" (#7927) * Migrate from rules_nodejs to rules_js/rules_ts (#7923) * Only generate @kotlin.ExperimentalUnsigned annotation on create*Vector methods having an unsigned array type parameter. (#7881) * additional check for absl::string_view availability (#7897) * Optionally generate Python type annotations (#7858) * Replace deprecated command with environment file (#7921) * drop glibc from runtime dependencies (#7906) * Make JSON supporting advanced union features (#7869) * Allow to use functions from `BuildFlatBuffers.cmake` from a flatbuffers installation installed with CMake. (#7912) * TS/JS: Use TypeError instead of Error when appropriate (#7910) * Go: make generated code more compliant to "go fmt" (#7907) * Support file_identifier in Go (#7904) * Optionally generate type prefixes and suffixes for python code (#7857) * Go: add test for FinishWithFileIdentifier (#7905) * Fix go_sample.sh (#7903) * [TS/JS] Upgrade dependencies (#7889) * Add a FileWriter interface (#7821) * TS/JS: Use minvalue from enum if not found (#7888) * [CS] Verifier (#7850) * README.md: PyPI case typo (#7880) * Update go documentation link to point to root module (#7879) * use Bool for flatbuffers bool instead of Byte (#7876) * fix using null string in vector (#7872) * Add `flatbuffers-64` branch to CI for pushes * made changes to the rust docs so they would compile. new_with_capacity is deprecated should use with_capacity, get_root_as_monster should be root_as_monster (#7871) * Adding comment for code clarification (#7856) * ToCamelCase() when kLowerCamel now converts first char to lower. (#7838) * Fix help output for --java-checkerframework (#7854) * Update filename to README.md and improve formatting (#7855) * Update stale.yml * Updated remaining usages of LICENSE.txt ## [23.3.3 (Mar 3 2023)](https://github.com/google/flatbuffers/releases/tag/v23.3.3) * Refactoring of `flatc` generators to use an interface (#7797). * Removed legacy cmake support and set min to 3.8 (#7801). ## [23.1.21 (Jan 21 2023)](https://github.com/google/flatbuffers/releases/tag/v23.1.20) * Reworked entry points for Typescript/Javascript and compatibility for single file build (#7510) ## [23.1.20 (Jan 20 2023)](https://github.com/google/flatbuffers/releases/tag/v23.1.20) * Removed go.mod files after some versioning issues were being report (#7780). ## [23.1.4 (Jan 4 2023)](https://github.com/google/flatbuffers/releases/tag/v23.1.4) * Major release! Just kidding, we are continuing the [versioning scheme](https://github.com/google/flatbuffers/wiki/Versioning) of using a date to signify releases. This results in the first release of the new year to bump the tradition major version field. * Go minimum version is now 1.19 (#7720) with the addition of Go modules. * Added CI support for Big Endian regression testing (#7707). * Fixed `getFullyQualifiedName` in typescript to return name delimited by '.' instead of '_' (#7730). * Fixed the versioning scheme to not include leading zeros which are not consistently handled by every package manager. Only the last release (12.12.06) should have suffered from this. ## [22.12.06 (Dec 06 2022)](https://github.com/google/flatbuffers/releases/tag/v22.12.06) * Bug fixing release, no major changes. ## [22.10.25 (Oct 25 2022)](https://github.com/google/flatbuffers/releases/tag/v22.10.25) * Added Nim language support with generator and runtime libraries (#7534). ## [22.9.29 (Sept 29 2022)](https://github.com/google/flatbuffers/releases/tag/v22.9.29) * Rust soundness fixes to avoid the crate from bing labelled unsafe (#7518). ## [22.9.24 (Sept 24 2022)](https://github.com/google/flatbuffers/releases/tag/v22.9.24) * 20 Major releases in a row? Nope, we switched to a new [versioning scheme](https://github.com/google/flatbuffers/wiki/Versioning) that is based on date. * Python supports fixed size arrays now (#7529). * Behavior change in how C++ object API uses `UnPackTo`. The original intent of this was to reduce allocations by reusing an existing object to pack data into. At some point, this logic started to merge the states of the two objects instead of clearing the state of the packee. This change goes back to the original intention, the packed object is cleared when getting data packed into it (#7527). * Fixed a bug in C++ alignment that was using `sizeof()` instead of the intended `AlignOf()` for structs (#7520). * C# has an [official Nuget package](https://www.nuget.org/packages/Google.FlatBuffers) now (#7496). ## 2.0.8 (Aug 29 2022) * Fix for `--keep-prefix` the was generating the wrong include statements for C++ (#7469). The bug was introduced in 2.0.7. * Added the `Verifier::Options` option struct to allow specifying runtime configuration settings for the verifier (#7489). This allows to skip verifying nested flatbuffers, a on-by-default change that was introduced in 2.0.7. This deprecates the existing `Verifier` constructor, which may be removed in a future version. * Refactor of `tests/test.cpp` that lead to ~10% speedup in compilation of the entire project (#7487). ## 2.0.7 (Aug 22 2022) * This is the first version with an explicit change log, so all the previous features will not be listed. * Verifier now checks that buffers are at least the minimum size required to be a flatbuffers (12 bytes). This includes nested flatbuffers, which previously could be declared valid at size 0. * Annotated binaries. Given a flatbuffer binary and a schema (or binary schema) one can generate an annotated flatbuffer (.afb) to describe each byte in the binary with schema metadata and value. * First binary schema generator (Lua) to generate Lua code via a .bfbs file. This is mostly an implementation detail of flatc internals, but will be slowly applied to the other language generators. flatbuffers-24.12.23/CMake/000077500000000000000000000000001473234705300152405ustar00rootroot00000000000000flatbuffers-24.12.23/CMake/BuildFlatBuffers.cmake000066400000000000000000000412721473234705300214330ustar00rootroot00000000000000# Copyright 2015 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # General function to create FlatBuffer build rules for the given list of # schemas. # # flatbuffers_schemas: A list of flatbuffer schema files to process. # # schema_include_dirs: A list of schema file include directories, which will be # passed to flatc via the -I parameter. # # custom_target_name: The generated files will be added as dependencies for a # new custom target with this name. You should add that target as a dependency # for your main target to ensure these files are built. You can also retrieve # various properties from this target, such as GENERATED_INCLUDES_DIR, # BINARY_SCHEMAS_DIR, and COPY_TEXT_SCHEMAS_DIR. # # additional_dependencies: A list of additional dependencies that you'd like # all generated files to depend on. Pass in a blank string if you have none. # # generated_includes_dir: Where to generate the C++ header files for these # schemas. The generated includes directory will automatically be added to # CMake's include directories, and will be where generated header files are # placed. This parameter is optional; pass in empty string if you don't want to # generate include files for these schemas. # # binary_schemas_dir: If you specify an optional binary schema directory, binary # schemas will be generated for these schemas as well, and placed into the given # directory. # # copy_text_schemas_dir: If you want all text schemas (including schemas from # all schema include directories) copied into a directory (for example, if you # need them within your project to build JSON files), you can specify that # folder here. All text schemas will be copied to that folder. # # IMPORTANT: Make sure you quote all list arguments you pass to this function! # Otherwise CMake will only pass in the first element. # Example: build_flatbuffers("${fb_files}" "${include_dirs}" target_name ...) function(build_flatbuffers flatbuffers_schemas schema_include_dirs custom_target_name additional_dependencies generated_includes_dir binary_schemas_dir copy_text_schemas_dir) # Test if including from FindFlatBuffers if(FLATBUFFERS_FLATC_EXECUTABLE) set(FLATC_TARGET "") set(FLATC ${FLATBUFFERS_FLATC_EXECUTABLE}) elseif(TARGET flatbuffers::flatc) set(FLATC_TARGET flatbuffers::flatc) set(FLATC flatbuffers::flatc) else() set(FLATC_TARGET flatc) set(FLATC flatc) endif() set(FLATC_SCHEMA_ARGS --gen-mutable) if(FLATBUFFERS_FLATC_SCHEMA_EXTRA_ARGS) set(FLATC_SCHEMA_ARGS ${FLATBUFFERS_FLATC_SCHEMA_EXTRA_ARGS} ${FLATC_SCHEMA_ARGS} ) endif() set(working_dir "${CMAKE_CURRENT_SOURCE_DIR}") set(schema_glob "*.fbs") # Generate the include files parameters. set(include_params "") set(all_generated_files "") foreach (include_dir ${schema_include_dirs}) set(include_params -I ${include_dir} ${include_params}) if (NOT ${copy_text_schemas_dir} STREQUAL "") # Copy text schemas from dependent folders. file(GLOB_RECURSE dependent_schemas ${include_dir}/${schema_glob}) foreach (dependent_schema ${dependent_schemas}) file(COPY ${dependent_schema} DESTINATION ${copy_text_schemas_dir}) endforeach() endif() endforeach() foreach(schema ${flatbuffers_schemas}) get_filename_component(filename ${schema} NAME_WE) # For each schema, do the things we requested. if (NOT ${generated_includes_dir} STREQUAL "") set(generated_include ${generated_includes_dir}/${filename}_generated.h) add_custom_command( OUTPUT ${generated_include} COMMAND ${FLATC} ${FLATC_SCHEMA_ARGS} -o ${generated_includes_dir} ${include_params} -c ${schema} DEPENDS ${FLATC_TARGET} ${schema} ${additional_dependencies} WORKING_DIRECTORY "${working_dir}") list(APPEND all_generated_files ${generated_include}) endif() if (NOT ${binary_schemas_dir} STREQUAL "") set(binary_schema ${binary_schemas_dir}/${filename}.bfbs) add_custom_command( OUTPUT ${binary_schema} COMMAND ${FLATC} -b --schema -o ${binary_schemas_dir} ${include_params} ${schema} DEPENDS ${FLATC_TARGET} ${schema} ${additional_dependencies} WORKING_DIRECTORY "${working_dir}") list(APPEND all_generated_files ${binary_schema}) endif() if (NOT ${copy_text_schemas_dir} STREQUAL "") file(COPY ${schema} DESTINATION ${copy_text_schemas_dir}) endif() endforeach() # Create a custom target that depends on all the generated files. # This is the target that you can depend on to trigger all these # to be built. add_custom_target(${custom_target_name} DEPENDS ${all_generated_files} ${additional_dependencies}) # Register the include directory we are using. if (NOT ${generated_includes_dir} STREQUAL "") include_directories(${generated_includes_dir}) set_property(TARGET ${custom_target_name} PROPERTY GENERATED_INCLUDES_DIR ${generated_includes_dir}) endif() # Register the binary schemas dir we are using. if (NOT ${binary_schemas_dir} STREQUAL "") set_property(TARGET ${custom_target_name} PROPERTY BINARY_SCHEMAS_DIR ${binary_schemas_dir}) endif() # Register the text schema copy dir we are using. if (NOT ${copy_text_schemas_dir} STREQUAL "") set_property(TARGET ${custom_target_name} PROPERTY COPY_TEXT_SCHEMAS_DIR ${copy_text_schemas_dir}) endif() endfunction() # Creates a target that can be linked against that generates flatbuffer headers. # # This function takes a target name and a list of schemas. You can also specify # other flagc flags using the FLAGS option to change the behavior of the flatc # tool. # # When the target_link_libraries is done within a different directory than # flatbuffers_generate_headers is called, then the target should also be dependent # the custom generation target called GENERATE_. # # Arguments: # TARGET: The name of the target to generate. # SCHEMAS: The list of schema files to generate code for. # BINARY_SCHEMAS_DIR: Optional. The directory in which to generate binary # schemas. Binary schemas will only be generated if a path is provided. # INCLUDE: Optional. Search for includes in the specified paths. (Use this # instead of "-I " and the FLAGS option so that CMake is aware of # the directories that need to be searched). # INCLUDE_PREFIX: Optional. The directory in which to place the generated # files. Use this instead of the --include-prefix option. # FLAGS: Optional. A list of any additional flags that you would like to pass # to flatc. # # Example: # # flatbuffers_generate_headers( # TARGET my_generated_headers_target # INCLUDE_PREFIX ${MY_INCLUDE_PREFIX}" # SCHEMAS ${MY_SCHEMA_FILES} # BINARY_SCHEMAS_DIR "${MY_BINARY_SCHEMA_DIRECTORY}" # FLAGS --gen-object-api) # # target_link_libraries(MyExecutableTarget # PRIVATE my_generated_headers_target # ) # # Optional (only needed within different directory): # add_dependencies(app GENERATE_my_generated_headers_target) function(flatbuffers_generate_headers) # Parse function arguments. set(options) set(one_value_args "TARGET" "INCLUDE_PREFIX" "BINARY_SCHEMAS_DIR") set(multi_value_args "SCHEMAS" "INCLUDE" "FLAGS") cmake_parse_arguments( PARSE_ARGV 0 FLATBUFFERS_GENERATE_HEADERS "${options}" "${one_value_args}" "${multi_value_args}") # Test if including from FindFlatBuffers if(FLATBUFFERS_FLATC_EXECUTABLE) set(FLATC_TARGET "") set(FLATC ${FLATBUFFERS_FLATC_EXECUTABLE}) elseif(TARGET flatbuffers::flatc) set(FLATC_TARGET flatbuffers::flatc) set(FLATC flatbuffers::flatc) else() set(FLATC_TARGET flatc) set(FLATC flatc) endif() set(working_dir "${CMAKE_CURRENT_SOURCE_DIR}") # Generate the include files parameters. set(include_params "") foreach (include_dir ${FLATBUFFERS_GENERATE_HEADERS_INCLUDE}) set(include_params -I ${include_dir} ${include_params}) endforeach() # Create a directory to place the generated code. set(generated_target_dir "${CMAKE_CURRENT_BINARY_DIR}/${FLATBUFFERS_GENERATE_HEADERS_TARGET}") set(generated_include_dir "${generated_target_dir}") if (NOT ${FLATBUFFERS_GENERATE_HEADERS_INCLUDE_PREFIX} STREQUAL "") set(generated_include_dir "${generated_include_dir}/${FLATBUFFERS_GENERATE_HEADERS_INCLUDE_PREFIX}") list(APPEND FLATBUFFERS_GENERATE_HEADERS_FLAGS "--include-prefix" ${FLATBUFFERS_GENERATE_HEADERS_INCLUDE_PREFIX}) endif() set(generated_custom_commands) # Create rules to generate the code for each schema. foreach(schema ${FLATBUFFERS_GENERATE_HEADERS_SCHEMAS}) get_filename_component(filename ${schema} NAME_WE) set(generated_include "${generated_include_dir}/${filename}_generated.h") # Generate files for grpc if needed set(generated_source_file) if("${FLATBUFFERS_GENERATE_HEADERS_FLAGS}" MATCHES "--grpc") # Check if schema file contain a rpc_service definition file(STRINGS ${schema} has_grpc REGEX "rpc_service") if(has_grpc) list(APPEND generated_include "${generated_include_dir}/${filename}.grpc.fb.h") set(generated_source_file "${generated_include_dir}/${filename}.grpc.fb.cc") endif() endif() add_custom_command( OUTPUT ${generated_include} ${generated_source_file} COMMAND ${FLATC} ${FLATC_ARGS} -o ${generated_include_dir} ${include_params} -c ${schema} ${FLATBUFFERS_GENERATE_HEADERS_FLAGS} DEPENDS ${FLATC_TARGET} ${schema} WORKING_DIRECTORY "${working_dir}" COMMENT "Building ${schema} flatbuffers...") list(APPEND all_generated_header_files ${generated_include}) list(APPEND all_generated_source_files ${generated_source_file}) list(APPEND generated_custom_commands "${generated_include}" "${generated_source_file}") # Geneate the binary flatbuffers schemas if instructed to. if (NOT ${FLATBUFFERS_GENERATE_HEADERS_BINARY_SCHEMAS_DIR} STREQUAL "") set(binary_schema "${FLATBUFFERS_GENERATE_HEADERS_BINARY_SCHEMAS_DIR}/${filename}.bfbs") add_custom_command( OUTPUT ${binary_schema} COMMAND ${FLATC} -b --schema -o ${FLATBUFFERS_GENERATE_HEADERS_BINARY_SCHEMAS_DIR} ${include_params} ${schema} DEPENDS ${FLATC_TARGET} ${schema} WORKING_DIRECTORY "${working_dir}") list(APPEND generated_custom_commands "${binary_schema}") list(APPEND all_generated_binary_files ${binary_schema}) endif() endforeach() # Create an additional target as add_custom_command scope is only within same directory (CMakeFile.txt) set(generate_target GENERATE_${FLATBUFFERS_GENERATE_HEADERS_TARGET}) add_custom_target(${generate_target} ALL DEPENDS ${generated_custom_commands} COMMENT "Generating flatbuffer target ${FLATBUFFERS_GENERATE_HEADERS_TARGET}") # Set up interface library add_library(${FLATBUFFERS_GENERATE_HEADERS_TARGET} INTERFACE) target_sources( ${FLATBUFFERS_GENERATE_HEADERS_TARGET} INTERFACE ${all_generated_header_files} ${all_generated_binary_files} ${all_generated_source_files} ${FLATBUFFERS_GENERATE_HEADERS_SCHEMAS}) add_dependencies( ${FLATBUFFERS_GENERATE_HEADERS_TARGET} ${FLATC} ${FLATBUFFERS_GENERATE_HEADERS_SCHEMAS}) target_include_directories( ${FLATBUFFERS_GENERATE_HEADERS_TARGET} INTERFACE ${generated_target_dir}) # Organize file layout for IDEs. source_group( TREE "${generated_target_dir}" PREFIX "Flatbuffers/Generated/Headers Files" FILES ${all_generated_header_files}) source_group( TREE "${generated_target_dir}" PREFIX "Flatbuffers/Generated/Source Files" FILES ${all_generated_source_files}) source_group( TREE ${working_dir} PREFIX "Flatbuffers/Schemas" FILES ${FLATBUFFERS_GENERATE_HEADERS_SCHEMAS}) if (NOT ${FLATBUFFERS_GENERATE_HEADERS_BINARY_SCHEMAS_DIR} STREQUAL "") source_group( TREE "${FLATBUFFERS_GENERATE_HEADERS_BINARY_SCHEMAS_DIR}" PREFIX "Flatbuffers/Generated/Binary Schemas" FILES ${all_generated_binary_files}) endif() endfunction() # Creates a target that can be linked against that generates flatbuffer binaries # from json files. # # This function takes a target name and a list of schemas and Json files. You # can also specify other flagc flags and options to change the behavior of the # flatc compiler. # # Adding this target to your executable ensurses that the flatbuffer binaries # are compiled before your executable is run. # # Arguments: # TARGET: The name of the target to generate. # JSON_FILES: The list of json files to compile to flatbuffers binaries. # SCHEMA: The flatbuffers schema of the Json files to be compiled. # INCLUDE: Optional. Search for includes in the specified paths. (Use this # instead of "-I " and the FLAGS option so that CMake is aware of # the directories that need to be searched). # OUTPUT_DIR: The directly where the generated flatbuffers binaries should be # placed. # FLAGS: Optional. A list of any additional flags that you would like to pass # to flatc. # # Example: # # flatbuffers_generate_binary_files( # TARGET my_binary_data # SCHEMA "${MY_SCHEMA_DIR}/my_example_schema.fbs" # JSON_FILES ${MY_JSON_FILES} # OUTPUT_DIR "${MY_BINARY_DATA_DIRECTORY}" # FLAGS --strict-json) # # target_link_libraries(MyExecutableTarget # PRIVATE my_binary_data # ) function(flatbuffers_generate_binary_files) # Parse function arguments. set(options) set(one_value_args "TARGET" "SCHEMA" "OUTPUT_DIR") set(multi_value_args "JSON_FILES" "INCLUDE" "FLAGS") cmake_parse_arguments( PARSE_ARGV 0 FLATBUFFERS_GENERATE_BINARY_FILES "${options}" "${one_value_args}" "${multi_value_args}") # Test if including from FindFlatBuffers if(FLATBUFFERS_FLATC_EXECUTABLE) set(FLATC_TARGET "") set(FLATC ${FLATBUFFERS_FLATC_EXECUTABLE}) elseif(TARGET flatbuffers::flatc) set(FLATC_TARGET flatbuffers::flatc) set(FLATC flatbuffers::flatc) else() set(FLATC_TARGET flatc) set(FLATC flatc) endif() set(working_dir "${CMAKE_CURRENT_SOURCE_DIR}") # Generate the include files parameters. set(include_params "") foreach (include_dir ${FLATBUFFERS_GENERATE_BINARY_FILES_INCLUDE}) set(include_params -I ${include_dir} ${include_params}) endforeach() # Create rules to generate the flatbuffers binary for each json file. foreach(json_file ${FLATBUFFERS_GENERATE_BINARY_FILES_JSON_FILES}) get_filename_component(filename ${json_file} NAME_WE) set(generated_binary_file "${FLATBUFFERS_GENERATE_BINARY_FILES_OUTPUT_DIR}/${filename}.bin") add_custom_command( OUTPUT ${generated_binary_file} COMMAND ${FLATC} ${FLATC_ARGS} -o ${FLATBUFFERS_GENERATE_BINARY_FILES_OUTPUT_DIR} ${include_params} -b ${FLATBUFFERS_GENERATE_BINARY_FILES_SCHEMA} ${json_file} ${FLATBUFFERS_GENERATE_BINARY_FILES_FLAGS} DEPENDS ${FLATC_TARGET} ${json_file} WORKING_DIRECTORY "${working_dir}" COMMENT "Building ${json_file} binary flatbuffers...") list(APPEND all_generated_binary_files ${generated_binary_file}) endforeach() # Set up interface library add_library(${FLATBUFFERS_GENERATE_BINARY_FILES_TARGET} INTERFACE) target_sources( ${FLATBUFFERS_GENERATE_BINARY_FILES_TARGET} INTERFACE ${all_generated_binary_files} ${FLATBUFFERS_GENERATE_BINARY_FILES_JSON_FILES} ${FLATBUFFERS_GENERATE_BINARY_FILES_SCHEMA}) add_dependencies( ${FLATBUFFERS_GENERATE_BINARY_FILES_TARGET} ${FLATC}) # Organize file layout for IDEs. source_group( TREE ${working_dir} PREFIX "Flatbuffers/JSON Files" FILES ${FLATBUFFERS_GENERATE_BINARY_FILES_JSON_FILES}) source_group( TREE ${working_dir} PREFIX "Flatbuffers/Schemas" FILES ${FLATBUFFERS_GENERATE_BINARY_FILES_SCHEMA}) source_group( TREE ${FLATBUFFERS_GENERATE_BINARY_FILES_OUTPUT_DIR} PREFIX "Flatbuffers/Generated/Binary Files" FILES ${all_generated_binary_files}) endfunction() flatbuffers-24.12.23/CMake/DESCRIPTION.txt000066400000000000000000000003621473234705300175650ustar00rootroot00000000000000FlatBuffers 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. flatbuffers-24.12.23/CMake/FindFlatBuffers.cmake000066400000000000000000000042201473234705300212440ustar00rootroot00000000000000# Copyright 2014 Stefan.Eilemann@epfl.ch # Copyright 2014 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Find the flatbuffers schema compiler # # Output Variables: # * FLATBUFFERS_FLATC_EXECUTABLE the flatc compiler executable # * FLATBUFFERS_FOUND # # Provides: # * FLATBUFFERS_GENERATE_C_HEADERS(Name ) creates the C++ headers # for the given flatbuffer schema files. # Returns the header files in ${Name}_OUTPUTS set(FLATBUFFERS_CMAKE_DIR ${CMAKE_CURRENT_LIST_DIR}) find_program(FLATBUFFERS_FLATC_EXECUTABLE NAMES flatc) find_path(FLATBUFFERS_INCLUDE_DIR NAMES flatbuffers/flatbuffers.h) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(FlatBuffers DEFAULT_MSG FLATBUFFERS_FLATC_EXECUTABLE FLATBUFFERS_INCLUDE_DIR) if(FLATBUFFERS_FOUND) function(FLATBUFFERS_GENERATE_C_HEADERS Name) set(FLATC_OUTPUTS) foreach(FILE ${ARGN}) get_filename_component(FLATC_OUTPUT ${FILE} NAME_WE) set(FLATC_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${FLATC_OUTPUT}_generated.h") list(APPEND FLATC_OUTPUTS ${FLATC_OUTPUT}) add_custom_command(OUTPUT ${FLATC_OUTPUT} COMMAND ${FLATBUFFERS_FLATC_EXECUTABLE} ARGS -c -o "${CMAKE_CURRENT_BINARY_DIR}/" ${FILE} DEPENDS ${FILE} COMMENT "Building C++ header for ${FILE}" WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) endforeach() set(${Name}_OUTPUTS ${FLATC_OUTPUTS} PARENT_SCOPE) endfunction() set(FLATBUFFERS_INCLUDE_DIRS ${FLATBUFFERS_INCLUDE_DIR}) include_directories(${CMAKE_BINARY_DIR}) else() set(FLATBUFFERS_INCLUDE_DIR) endif() include("${FLATBUFFERS_CMAKE_DIR}/BuildFlatBuffers.cmake") flatbuffers-24.12.23/CMake/PackageDebian.cmake000066400000000000000000000021711473234705300207010ustar00rootroot00000000000000# ------------------- Debianization --------------------- if (UNIX) # Set build environment SET(CPACK_GENERATOR "TGZ;DEB") SET(CPACK_SOURCE_TGZ "ON") # Common package information SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "FlatBuffers is an efficient cross platform serialization library for C++, with support for Java, C# and Go. It was created at Google specifically for game development and other performance-critical applications.") SET(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://github.com/google/flatbuffers") SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Vitaly Isaev ") SET(CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR}) SET(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR}) SET(CPACK_PACKAGE_VERSION_PATCH ${VERSION_PATCH}) SET(CPACK_PACKAGE_VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}-${VERSION_COMMIT}") SET(CPACK_DEBIAN_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION}") # Package name SET(CPACK_DEBIAN_PACKAGE_NAME "flatbuffers") SET(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_SOURCE_DIR}/LICENSE) set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT") endif(UNIX) flatbuffers-24.12.23/CMake/PackageRedhat.cmake000066400000000000000000000040471473234705300207320ustar00rootroot00000000000000if (UNIX) set(CPACK_GENERATOR "RPM") set(CPACK_SOURCE_TGZ "ON") set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "FlatBuffers serialization library and schema compiler.") set(CPACK_RPM_PACKAGE_HOMEPAGE "https://github.com/google/flatbuffers") set(CPACK_RPM_PACKAGE_MAINTAINER "Marc Butler ") set(CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR}) set(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR}) set(CPACK_PACKAGE_VERSION_PATCH ${VERSION_PATCH}) set(CPACK_PACKAGE_VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}-${VERSION_COMMIT}") set(CPACK_RPM_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION}") set(CPACK_RPM_PACKAGE_NAME "flatbuffers") # Assume this is not a cross compilation build. if(NOT CPACK_RPM_PACKAGE_ARCHITECTURE) set(CPACK_RPM_PACKAGE_ARCHITECTURE "${CMAKE_SYSTEM_PROCESSOR}") endif(NOT CPACK_RPM_PACKAGE_ARCHITECTURE) set(CPACK_RPM_PACKAGE_VENDOR "Google, Inc.") set(CPACK_RPM_PACKAGE_LICENSE "Apache 2.0") set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_SOURCE_DIR}/LICENSE) set(CPACK_PACKAGE_DESCRIPTION_FILE ${CMAKE_SOURCE_DIR}/CMake/DESCRIPTION.txt) # This may reduce rpm compatiblity with very old systems. set(CPACK_RPM_COMPRESSION_TYPE lzma) set(CPACK_RPM_PACKAGE_NAME "flatbuffers") set(CPACK_PACKAGE_FILE_NAME "${CPACK_RPM_PACKAGE_NAME}_${CPACK_RPM_PACKAGE_VERSION}_${CPACK_RPM_PACKAGE_ARCHITECTURE}") if(NOT DEFINED ${CPACK_PACKAGING_INSTALL_PREFIX}) # Default packaging install prefix on RedHat systems is /usr. # This is the assumed value when this variable is not defined. # There is currently a conflict with # /usr/${CMAKE_INSTALL_LIBDIR}/cmake which is installed by default # by other packages on RedHat (most notably cmake-filesystem). Ensure # that on these systems, flatbuffers does not package this path. # This patch is required for cmake pre-3.17. list(APPEND CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/${CMAKE_INSTALL_LIBDIR}/cmake") endif() endif(UNIX) flatbuffers-24.12.23/CMake/Version.cmake000066400000000000000000000032301473234705300176650ustar00rootroot00000000000000set(VERSION_MAJOR 24) set(VERSION_MINOR 12) set(VERSION_PATCH 23) set(VERSION_COMMIT 0) if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git") find_program(GIT git) if(GIT) execute_process( COMMAND ${GIT} describe --tags WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} OUTPUT_VARIABLE GIT_DESCRIBE_DIRTY OUTPUT_STRIP_TRAILING_WHITESPACE RESULT_VARIABLE GIT_DESCRIBE_RESULT ) if(GIT_DESCRIBE_RESULT EQUAL 0) # Test if the most recent Git tag matches the pattern "v..*" if(GIT_DESCRIBE_DIRTY MATCHES "^v[0-9]+\\.[0-9]+\\.[0-9]+.*") string(REGEX REPLACE "^v([0-9]+)\\..*" "\\1" VERSION_MAJOR "${GIT_DESCRIBE_DIRTY}") string(REGEX REPLACE "^v[0-9]+\\.([0-9]+).*" "\\1" VERSION_MINOR "${GIT_DESCRIBE_DIRTY}") string(REGEX REPLACE "^v[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" VERSION_PATCH "${GIT_DESCRIBE_DIRTY}") string(REGEX REPLACE "^v[0-9]+\\.[0-9]+\\.[0-9]+\\-([0-9]+).*" "\\1" VERSION_COMMIT "${GIT_DESCRIBE_DIRTY}") # If the tag points to the commit, then only the tag is shown in "git describe" if(VERSION_COMMIT STREQUAL GIT_DESCRIBE_DIRTY) set(VERSION_COMMIT 0) endif() else() message(WARNING "\"${GIT_DESCRIBE_DIRTY}\" does not match pattern v..-") endif() else() message(WARNING "git describe failed with exit code: ${GIT_DESCRIBE_RESULT}\nMake sure you cloned with tags or run 'git fetch --tags'.") endif() else() message(WARNING "git is not found") endif() endif() message(STATUS "Proceeding with version: ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}.${VERSION_COMMIT}") flatbuffers-24.12.23/CMake/flatbuffers-config-version.cmake.in000066400000000000000000000006311473234705300241000ustar00rootroot00000000000000set(PACKAGE_VERSION "@VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@") # Check whether the requested PACKAGE_FIND_VERSION is compatible if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}") set(PACKAGE_VERSION_COMPATIBLE FALSE) else() set(PACKAGE_VERSION_COMPATIBLE TRUE) if ("${PACKAGE_VERSION}" VERSION_EQUAL "${PACKAGE_FIND_VERSION}") set(PACKAGE_VERSION_EXACT TRUE) endif() endif() flatbuffers-24.12.23/CMake/flatbuffers-config.cmake000066400000000000000000000004311473234705300220060ustar00rootroot00000000000000include("${CMAKE_CURRENT_LIST_DIR}/FlatBuffersTargets.cmake" OPTIONAL) include("${CMAKE_CURRENT_LIST_DIR}/FlatcTargets.cmake" OPTIONAL) include("${CMAKE_CURRENT_LIST_DIR}/FlatBuffersSharedTargets.cmake" OPTIONAL) include("${CMAKE_CURRENT_LIST_DIR}/BuildFlatBuffers.cmake" OPTIONAL)flatbuffers-24.12.23/CMake/flatbuffers.pc.in000066400000000000000000000004071473234705300204750ustar00rootroot00000000000000libdir=@CMAKE_INSTALL_FULL_LIBDIR@ includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ Name: FlatBuffers Description: Memory Efficient Serialization Library Version: @VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@ Libs: -L${libdir} -lflatbuffers Cflags: -I${includedir} flatbuffers-24.12.23/CMakeLists.txt000066400000000000000000000566711473234705300170370ustar00rootroot00000000000000# This is the legacy minimum version flatbuffers supported for a while. cmake_minimum_required(VERSION 3.8...3.25.2) # Attempt to read the current version of flatbuffers by looking at the latest tag. include(CMake/Version.cmake) project(FlatBuffers VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH} LANGUAGES CXX) # generate compile_commands.json set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # NOTE: Code coverage only works on Linux & OSX. option(FLATBUFFERS_CODE_COVERAGE "Enable the code coverage build option." OFF) option(FLATBUFFERS_BUILD_TESTS "Enable the build of tests and samples." ON) option(FLATBUFFERS_INSTALL "Enable the installation of targets." ON) option(FLATBUFFERS_BUILD_FLATLIB "Enable the build of the flatbuffers library" ON) option(FLATBUFFERS_BUILD_FLATC "Enable the build of the flatbuffers compiler" ON) option(FLATBUFFERS_STATIC_FLATC "Build flatbuffers compiler with -static flag" OFF) option(FLATBUFFERS_BUILD_FLATHASH "Enable the build of flathash" OFF) option(FLATBUFFERS_BUILD_BENCHMARKS "Enable the build of flatbenchmark." OFF) option(FLATBUFFERS_BUILD_GRPCTEST "Enable the build of grpctest" OFF) option(FLATBUFFERS_BUILD_SHAREDLIB "Enable the build of the flatbuffers shared library" OFF) option(FLATBUFFERS_LIBCXX_WITH_CLANG "Force libc++ when using Clang" ON) # NOTE: Sanitizer check only works on Linux & OSX (gcc & llvm). option(FLATBUFFERS_CODE_SANITIZE "Add '-fsanitize' flags to 'flattests' and 'flatc' targets." OFF) option(FLATBUFFERS_PACKAGE_REDHAT "Build an rpm using the 'package' target." OFF) option(FLATBUFFERS_PACKAGE_DEBIAN "Build an deb using the 'package' target." OFF) option(FLATBUFFERS_BUILD_CPP17 "Enable the build of c++17 test target. \" Requirements: Clang6, GCC7, MSVC2017 (_MSC_VER >= 1914) or higher." OFF) option(FLATBUFFERS_BUILD_LEGACY "Run C++ code generator with '--cpp-std c++0x' switch." OFF) option(FLATBUFFERS_ENABLE_PCH "Enable precompile headers support for 'flatbuffers' and 'flatc'. \" Only work if CMake supports 'target_precompile_headers'. \" This can speed up compilation time." OFF) option(FLATBUFFERS_SKIP_MONSTER_EXTRA "Skip generating monster_extra.fbs that contains non-supported numerical\" types." OFF) option(FLATBUFFERS_STRICT_MODE "Build flatbuffers with all warnings as errors (-Werror or /WX)." OFF) if(NOT DEFINED FLATBUFFERS_CPP_STD) set(FLATBUFFERS_CPP_STD 11) endif() set(MSVC_LIKE OFF) if(MSVC OR CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC") set(MSVC_LIKE ON) endif() if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") set(IS_CLANG ON) else() set(IS_CLANG OFF) endif() if(DEFINED FLATBUFFERS_COMPILATION_TIMINGS) message("Recording Compilation Timings to ${FLATBUFFERS_COMPILATION_TIMINGS}") file(REMOVE ${FLATBUFFERS_COMPILATION_TIMINGS}) set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "time -f 'Wall: %E User: %U Sys: %S | %C' -q -a -o ${FLATBUFFERS_COMPILATION_TIMINGS}") set_property(GLOBAL PROPERTY RULE_LAUNCH_CUSTOM "time -f 'Wall: %E User: %U Sys: %S | %C' -q -a -o ${FLATBUFFERS_COMPILATION_TIMINGS}") set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK "time -f 'Wall: %E User: %U Sys: %S | %C' -q -a -o ${FLATBUFFERS_COMPILATION_TIMINGS}") endif() if(NOT FLATBUFFERS_BUILD_FLATC AND FLATBUFFERS_BUILD_TESTS) message(WARNING "Cannot build tests without building the compiler. Tests will be disabled.") set(FLATBUFFERS_BUILD_TESTS OFF) endif() if(DEFINED FLATBUFFERS_MAX_PARSING_DEPTH) # Override the default recursion depth limit. add_definitions(-DFLATBUFFERS_MAX_PARSING_DEPTH=${FLATBUFFERS_MAX_PARSING_DEPTH}) message(STATUS "FLATBUFFERS_MAX_PARSING_DEPTH: ${FLATBUFFERS_MAX_PARSING_DEPTH}") endif() # Auto-detect locale-narrow 'strtod_l' and 'strtoull_l' functions. if(NOT DEFINED FLATBUFFERS_LOCALE_INDEPENDENT) include(CheckCXXSymbolExists) set(FLATBUFFERS_LOCALE_INDEPENDENT 0) if(MSVC_LIKE) check_cxx_symbol_exists(_strtof_l stdlib.h FLATBUFFERS_HAS_STRTOF_L) check_cxx_symbol_exists(_strtoui64_l stdlib.h FLATBUFFERS_HAS_STRTOULL_L) else() check_cxx_symbol_exists(strtof_l stdlib.h FLATBUFFERS_HAS_STRTOF_L) check_cxx_symbol_exists(strtoull_l stdlib.h FLATBUFFERS_HAS_STRTOULL_L) endif() if(FLATBUFFERS_HAS_STRTOF_L AND FLATBUFFERS_HAS_STRTOULL_L) set(FLATBUFFERS_LOCALE_INDEPENDENT 1) endif() endif() add_definitions(-DFLATBUFFERS_LOCALE_INDEPENDENT=$) if(NOT WIN32) check_symbol_exists(realpath "stdlib.h" HAVE_REALPATH) if(NOT HAVE_REALPATH) add_definitions(-DFLATBUFFERS_NO_ABSOLUTE_PATH_RESOLUTION) endif() endif() set(FlatBuffers_Library_SRCS include/flatbuffers/allocator.h include/flatbuffers/array.h include/flatbuffers/base.h include/flatbuffers/buffer.h include/flatbuffers/buffer_ref.h include/flatbuffers/default_allocator.h include/flatbuffers/detached_buffer.h include/flatbuffers/code_generator.h include/flatbuffers/file_manager.h include/flatbuffers/flatbuffer_builder.h include/flatbuffers/flatbuffers.h include/flatbuffers/flexbuffers.h include/flatbuffers/flex_flat_util.h include/flatbuffers/hash.h include/flatbuffers/idl.h include/flatbuffers/minireflect.h include/flatbuffers/reflection.h include/flatbuffers/reflection_generated.h include/flatbuffers/registry.h include/flatbuffers/stl_emulation.h include/flatbuffers/string.h include/flatbuffers/struct.h include/flatbuffers/table.h include/flatbuffers/util.h include/flatbuffers/vector.h include/flatbuffers/vector_downward.h include/flatbuffers/verifier.h src/idl_parser.cpp src/idl_gen_text.cpp src/reflection.cpp src/util.cpp ) set(FlatBuffers_Compiler_SRCS ${FlatBuffers_Library_SRCS} src/idl_gen_binary.cpp src/idl_gen_text.cpp src/idl_gen_cpp.cpp src/idl_gen_csharp.cpp src/idl_gen_dart.cpp src/idl_gen_kotlin.cpp src/idl_gen_kotlin_kmp.cpp src/idl_gen_go.cpp src/idl_gen_java.cpp src/idl_gen_ts.cpp src/idl_gen_php.cpp src/idl_gen_python.cpp src/idl_gen_lobster.cpp src/idl_gen_rust.cpp src/idl_gen_fbs.cpp src/idl_gen_grpc.cpp src/idl_gen_json_schema.cpp src/idl_gen_swift.cpp src/file_name_saving_file_manager.cpp src/file_binary_writer.cpp src/file_writer.cpp src/idl_namer.h src/namer.h src/flatc.cpp src/flatc_main.cpp src/bfbs_gen.h src/bfbs_gen_lua.h src/bfbs_gen_nim.h src/bfbs_namer.h include/codegen/idl_namer.h include/codegen/namer.h include/codegen/python.h include/codegen/python.cc include/flatbuffers/code_generators.h src/binary_annotator.h src/binary_annotator.cpp src/annotated_binary_text_gen.h src/annotated_binary_text_gen.cpp src/bfbs_gen_lua.cpp src/bfbs_gen_nim.cpp src/code_generators.cpp grpc/src/compiler/schema_interface.h grpc/src/compiler/cpp_generator.h grpc/src/compiler/cpp_generator.cc grpc/src/compiler/go_generator.h grpc/src/compiler/go_generator.cc grpc/src/compiler/java_generator.h grpc/src/compiler/java_generator.cc grpc/src/compiler/python_generator.h grpc/src/compiler/python_generator.cc grpc/src/compiler/swift_generator.h grpc/src/compiler/swift_generator.cc grpc/src/compiler/ts_generator.h grpc/src/compiler/ts_generator.cc ) set(FlatHash_SRCS include/flatbuffers/hash.h src/flathash.cpp ) set(FlatBuffers_Tests_SRCS ${FlatBuffers_Library_SRCS} src/idl_gen_fbs.cpp tests/evolution_test.cpp tests/flexbuffers_test.cpp tests/fuzz_test.cpp tests/json_test.cpp tests/key_field_test.cpp tests/monster_test.cpp tests/optional_scalars_test.cpp tests/parser_test.cpp tests/proto_test.cpp tests/reflection_test.cpp tests/test.cpp tests/test_assert.h tests/test_assert.cpp tests/test_builder.h tests/test_builder.cpp tests/util_test.cpp tests/native_type_test_impl.h tests/native_type_test_impl.cpp tests/alignment_test.h tests/alignment_test.cpp tests/64bit/offset64_test.h tests/64bit/offset64_test.cpp include/flatbuffers/code_generators.h src/code_generators.cpp ) set(FlatBuffers_Tests_CPP17_SRCS ${FlatBuffers_Library_SRCS} tests/test_assert.h tests/test_assert.cpp tests/cpp17/test_cpp17.cpp ) set(FlatBuffers_Sample_Binary_SRCS samples/sample_binary.cpp ) set(FlatBuffers_Sample_Text_SRCS ${FlatBuffers_Library_SRCS} samples/sample_text.cpp ) set(FlatBuffers_Sample_BFBS_SRCS ${FlatBuffers_Library_SRCS} samples/sample_bfbs.cpp ) set(FlatBuffers_GRPCTest_SRCS include/flatbuffers/flatbuffers.h include/flatbuffers/grpc.h include/flatbuffers/util.h src/util.cpp tests/monster_test.grpc.fb.h tests/test_assert.h tests/test_builder.h tests/monster_test.grpc.fb.cc tests/test_assert.cpp tests/test_builder.cpp grpc/tests/grpctest.cpp grpc/tests/message_builder_test.cpp ) # TODO(dbaileychess): Figure out how this would now work. I posted a question on # https://stackoverflow.com/questions/71772330/override-target-compile-options-via-cmake-command-line. # Append FLATBUFFERS_CXX_FLAGS to CMAKE_CXX_FLAGS. if(DEFINED FLATBUFFERS_CXX_FLAGS) message(STATUS "extend CXX_FLAGS with ${FLATBUFFERS_CXX_FLAGS}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${FLATBUFFERS_CXX_FLAGS}") endif() message(STATUS "CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}") function(add_fsanitize_to_target _target _sanitizer) if(WIN32) target_compile_definitions(${_target} PRIVATE FLATBUFFERS_MEMORY_LEAK_TRACKING) message(STATUS "Sanitizer MSVC::_CrtDumpMemoryLeaks added to ${_target}") else() # FLATBUFFERS_CODE_SANITIZE: boolean {ON,OFF,YES,NO} or string with list of sanitizer. # List of sanitizer is string starts with '=': "=address,undefined,thread,memory". if(IS_CLANG OR (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 4.9)) set(_sanitizer_flags "=address,undefined") if(_sanitizer MATCHES "=.*") # override default by user-defined sanitizer list set(_sanitizer_flags ${_sanitizer}) endif() target_compile_options(${_target} PRIVATE -g -fsigned-char -fno-omit-frame-pointer "-fsanitize${_sanitizer_flags}") target_link_libraries(${_target} PRIVATE "-fsanitize${_sanitizer_flags}") set_target_properties(${_target} PROPERTIES POSITION_INDEPENDENT_CODE ON) message(STATUS "Sanitizer ${_sanitizer_flags} added to ${_target}") endif() endif() endfunction() function(add_pch_to_target _target _pch_header) # the command is available since cmake 3.16 if(COMMAND target_precompile_headers) target_precompile_headers(${_target} PRIVATE ${_pch_header}) if(NOT MSVC) set_source_files_properties(src/util.cpp PROPERTIES SKIP_PRECOMPILE_HEADERS ON) endif() endif() endfunction() include_directories(include) include_directories(grpc) # Creates an interface library that stores the configuration settings that each # target links too. This is a compromise between setting configuration globally # with add_compile_options() and the more targetted target_compile_options(). # This way each target in this file can share settings and override them if # needed. add_library(ProjectConfig INTERFACE) target_compile_features(ProjectConfig INTERFACE cxx_std_${FLATBUFFERS_CPP_STD} ) # Force the standard to be met. set(CMAKE_CXX_STANDARD_REQUIRED ON) # We shouldn't rely on any compiler-extensions to make things work. set(CMAKE_CXX_EXTENSIONS OFF) if(MSVC_LIKE) target_compile_options(ProjectConfig INTERFACE /W4 $<$: /WX # Treat all compiler warnings as errors > /wd4512 # C4512: assignment operator could not be generated /wd4316 # C4316: object allocated on the heap may not be aligned /wd4456 # C4456: hides previous local declaration $<$: /D_CRT_SECURE_NO_WARNINGS > ) else() target_compile_options(ProjectConfig INTERFACE -Wall $<$: -Werror # Treat all compiler warnings as errors -fno-rtti # Disable runtime type information $<$: # False positive string overflow # https://github.com/google/flatbuffers/issues/7366 -Wno-error=stringop-overflow > > -pedantic -Wextra -Wno-unused-parameter -Wold-style-cast -fsigned-char -Wnon-virtual-dtor # This isn't working for some reason: $<$: $<$: -Wnewline-eof -Wno-unknown-warning-option -Wmissing-declarations -Wzero-as-null-pointer-constant $<$,3.8>: -Wimplicit-fallthrough -Wextra-semi $<$: -Werror=unused-private-field > > > $<$: $<$,4.4>: -Wunused-result -Wunused-parameter -Werror=unused-parameter -Wmissing-declarations > $<$,4.7>: -Wzero-as-null-pointer-constant > $<$,7.0>: -faligned-new $<$: -Werror=implicit-fallthrough=2 > > $<$,8.0>: -Wextra-semi > > $<$: -g -fprofile-arcs -ftest-coverage > ) if(FLATBUFFERS_CODE_COVERAGE) target_link_options(ProjectConfig INTERFACE -fprofile-arcs -ftest-coverage ) endif() endif() if(FLATBUFFERS_BUILD_FLATLIB) add_library(flatbuffers STATIC ${FlatBuffers_Library_SRCS}) # Attach header directory for when build via add_subdirectory(). target_include_directories(flatbuffers INTERFACE $ ) target_link_libraries(flatbuffers PRIVATE $) if(FLATBUFFERS_ENABLE_PCH) add_pch_to_target(flatbuffers include/flatbuffers/pch/pch.h) endif() endif() if(FLATBUFFERS_BUILD_FLATC) add_executable(flatc ${FlatBuffers_Compiler_SRCS}) if(FLATBUFFERS_ENABLE_PCH) add_pch_to_target(flatc include/flatbuffers/pch/flatc_pch.h) endif() target_link_libraries(flatc PRIVATE $) target_compile_options(flatc PRIVATE $<$,$>: /MT > ) if(FLATBUFFERS_CODE_SANITIZE AND NOT WIN32) add_fsanitize_to_target(flatc ${FLATBUFFERS_CODE_SANITIZE}) endif() if(NOT FLATBUFFERS_FLATC_EXECUTABLE) set(FLATBUFFERS_FLATC_EXECUTABLE $) endif() if(FLATBUFFERS_STATIC_FLATC AND NOT MSVC) target_link_libraries(flatc PRIVATE -static) endif() endif() if(FLATBUFFERS_BUILD_FLATHASH) add_executable(flathash ${FlatHash_SRCS}) target_link_libraries(flathash PRIVATE $) endif() if(FLATBUFFERS_BUILD_SHAREDLIB) add_library(flatbuffers_shared SHARED ${FlatBuffers_Library_SRCS}) target_link_libraries(flatbuffers_shared PRIVATE $) # FlatBuffers use calendar-based versioning and do not provide any ABI # stability guarantees. Therefore, always use the full version as SOVERSION # in order to avoid breaking reverse dependencies on upgrades. set(FlatBuffers_Library_SONAME_FULL "${PROJECT_VERSION}") set_target_properties(flatbuffers_shared PROPERTIES OUTPUT_NAME flatbuffers SOVERSION "${FlatBuffers_Library_SONAME_FULL}" VERSION "${FlatBuffers_Library_SONAME_FULL}") if(FLATBUFFERS_ENABLE_PCH) add_pch_to_target(flatbuffers_shared include/flatbuffers/pch/pch.h) endif() endif() function(compile_schema SRC_FBS OPT OUT_GEN_FILE) get_filename_component(SRC_FBS_DIR ${SRC_FBS} PATH) string(REGEX REPLACE "\\.fbs$" "_generated.h" GEN_HEADER ${SRC_FBS}) add_custom_command( OUTPUT ${GEN_HEADER} COMMAND "${FLATBUFFERS_FLATC_EXECUTABLE}" ${OPT} -o "${SRC_FBS_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/${SRC_FBS}" DEPENDS flatc ${SRC_FBS} COMMENT "flatc generation: `${SRC_FBS}` -> `${GEN_HEADER}`" ) set(${OUT_GEN_FILE} ${GEN_HEADER} PARENT_SCOPE) endfunction() function(compile_schema_for_test SRC_FBS OPT) compile_schema("${SRC_FBS}" "${OPT}" GEN_FILE) target_sources(flattests PRIVATE ${GEN_FILE}) endfunction() function(compile_schema_for_samples SRC_FBS OPT) compile_schema("${SRC_FBS}" "${OPT}" GEN_FILE) target_sources(flatsample PRIVATE ${GEN_FILE}) endfunction() if(FLATBUFFERS_BUILD_TESTS) add_executable(flattests ${FlatBuffers_Tests_SRCS}) target_link_libraries(flattests PRIVATE $) target_include_directories(flattests PUBLIC # Ideally everything is fully qualified from the root directories ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} # TODO(derekbailey): update includes to fully qualify src/ and tests/ src tests ${CMAKE_CURRENT_BINARY_DIR}/tests ) # Have tests load data from the source directory, not the build directory. add_definitions(-DFLATBUFFERS_TEST_PATH_PREFIX=${CMAKE_CURRENT_SOURCE_DIR}/) # The flattest target needs some generated files SET(FLATC_OPT --cpp --gen-mutable --gen-object-api --reflect-names) SET(FLATC_OPT_COMP ${FLATC_OPT};--gen-compare) SET(FLATC_OPT_SCOPED_ENUMS ${FLATC_OPT_COMP};--scoped-enums) compile_schema_for_test(tests/alignment_test.fbs "${FLATC_OPT_COMP}") compile_schema_for_test(tests/arrays_test.fbs "${FLATC_OPT_SCOPED_ENUMS}") compile_schema_for_test(tests/native_inline_table_test.fbs "${FLATC_OPT_COMP}") compile_schema_for_test(tests/native_type_test.fbs "${FLATC_OPT}") compile_schema_for_test(tests/key_field/key_field_sample.fbs "${FLATC_OPT_COMP}") compile_schema_for_test(tests/64bit/test_64bit.fbs "${FLATC_OPT_COMP};--bfbs-gen-embed") compile_schema_for_test(tests/64bit/evolution/v1.fbs "${FLATC_OPT_COMP}") compile_schema_for_test(tests/64bit/evolution/v2.fbs "${FLATC_OPT_COMP}") compile_schema_for_test(tests/union_underlying_type_test.fbs "${FLATC_OPT_SCOPED_ENUMS}") if(FLATBUFFERS_CODE_SANITIZE) add_fsanitize_to_target(flattests ${FLATBUFFERS_CODE_SANITIZE}) endif() include_directories(${CMAKE_CURRENT_BINARY_DIR}/samples) add_executable(flatsamplebinary ${FlatBuffers_Sample_Binary_SRCS}) add_executable(flatsampletext ${FlatBuffers_Sample_Text_SRCS}) add_executable(flatsamplebfbs ${FlatBuffers_Sample_BFBS_SRCS}) # Add a library so there is a single target that the generated samples can # link too. if(MSVC OR ${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.20.0") add_library(flatsample INTERFACE) else() add_library(flatsample STATIC) endif() # Since flatsample has no sources, we have to explicitly set the linker lang. set_target_properties(flatsample PROPERTIES LINKER_LANGUAGE CXX) compile_schema_for_samples(samples/monster.fbs "${FLATC_OPT_COMP}") target_link_libraries(flatsamplebinary PRIVATE $ flatsample) target_link_libraries(flatsampletext PRIVATE $ flatsample) target_link_libraries(flatsamplebfbs PRIVATE $ flatsample) if(FLATBUFFERS_BUILD_CPP17) add_executable(flattests_cpp17 ${FlatBuffers_Tests_CPP17_SRCS}) target_link_libraries(flattests_cpp17 PRIVATE $) target_include_directories(flattests_cpp17 PUBLIC src tests) target_compile_features(flattests_cpp17 PRIVATE cxx_std_17) # requires cmake 3.8 if(FLATBUFFERS_CODE_SANITIZE) add_fsanitize_to_target(flattests_cpp17 ${FLATBUFFERS_CODE_SANITIZE}) endif() endif(FLATBUFFERS_BUILD_CPP17) endif() if(FLATBUFFERS_BUILD_GRPCTEST) if(NOT GRPC_INSTALL_PATH) message(SEND_ERROR "GRPC_INSTALL_PATH variable is not defined. See grpc/README.md") endif() if(NOT PROTOBUF_DOWNLOAD_PATH) message(SEND_ERROR "PROTOBUF_DOWNLOAD_PATH variable is not defined. See grpc/README.md") endif() INCLUDE_DIRECTORIES(${GRPC_INSTALL_PATH}/include) INCLUDE_DIRECTORIES(${PROTOBUF_DOWNLOAD_PATH}/src) find_package(Threads REQUIRED) list(APPEND CMAKE_PREFIX_PATH ${GRPC_INSTALL_PATH}) find_package(absl CONFIG REQUIRED) find_package(protobuf CONFIG REQUIRED) find_package(gRPC CONFIG REQUIRED) add_executable(grpctest ${FlatBuffers_GRPCTest_SRCS}) target_link_libraries(grpctest PRIVATE $ gRPC::grpc++_unsecure gRPC::gpr pthread dl ) endif() if(FLATBUFFERS_INSTALL) include(GNUInstallDirs) install(DIRECTORY include/flatbuffers DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) set(FB_CMAKE_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/flatbuffers") configure_file(CMake/flatbuffers-config-version.cmake.in flatbuffers-config-version.cmake @ONLY) install( FILES "CMake/flatbuffers-config.cmake" "CMake/BuildFlatBuffers.cmake" "${CMAKE_CURRENT_BINARY_DIR}/flatbuffers-config-version.cmake" DESTINATION ${FB_CMAKE_DIR} ) if(FLATBUFFERS_BUILD_FLATLIB) install( TARGETS flatbuffers EXPORT FlatBuffersTargets ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ) install(EXPORT FlatBuffersTargets FILE FlatBuffersTargets.cmake NAMESPACE flatbuffers:: DESTINATION ${FB_CMAKE_DIR} ) endif() if(FLATBUFFERS_BUILD_FLATC) install( TARGETS flatc EXPORT FlatcTargets RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) install( EXPORT FlatcTargets FILE FlatcTargets.cmake NAMESPACE flatbuffers:: DESTINATION ${FB_CMAKE_DIR} ) endif() if(FLATBUFFERS_BUILD_SHAREDLIB) install( TARGETS flatbuffers_shared EXPORT FlatBuffersSharedTargets ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ) install( EXPORT FlatBuffersSharedTargets FILE FlatBuffersSharedTargets.cmake NAMESPACE flatbuffers:: DESTINATION ${FB_CMAKE_DIR} ) endif() if(FLATBUFFERS_BUILD_SHAREDLIB OR FLATBUFFERS_BUILD_FLATLIB) configure_file(CMake/flatbuffers.pc.in flatbuffers.pc @ONLY) install( FILES "${CMAKE_CURRENT_BINARY_DIR}/flatbuffers.pc" DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig ) endif() endif() if(FLATBUFFERS_BUILD_TESTS) enable_testing() add_test(NAME flattests COMMAND flattests) if(FLATBUFFERS_BUILD_CPP17) add_test(NAME flattests_cpp17 COMMAND flattests_cpp17) endif() if(FLATBUFFERS_BUILD_GRPCTEST) add_test(NAME grpctest COMMAND grpctest) endif() endif() include(CMake/BuildFlatBuffers.cmake) if(UNIX) # Use of CPack only supported on Linux systems. if(FLATBUFFERS_PACKAGE_DEBIAN) include(CMake/PackageDebian.cmake) include(CPack) endif() if (FLATBUFFERS_PACKAGE_REDHAT) include(CMake/PackageRedhat.cmake) include(CPack) endif() endif() # Include for running Google Benchmarks. if(FLATBUFFERS_BUILD_BENCHMARKS) add_subdirectory(benchmarks) endif() # Add FlatBuffers::FlatBuffers interface, needed for FetchContent_Declare add_library(FlatBuffers INTERFACE) add_library(FlatBuffers::FlatBuffers ALIAS FlatBuffers) target_include_directories( FlatBuffers INTERFACE $ $) flatbuffers-24.12.23/CONTRIBUTING.md000066400000000000000000000043021473234705300165100ustar00rootroot00000000000000Contributing {#contributing} ============ Want to contribute? Great! First, read this page (including the small print at the end). # Before you contribute Before we can use your code, you must sign the [Google Individual Contributor License Agreement](https://developers.google.com/open-source/cla/individual?csw=1) (CLA), which you can do online. The CLA is necessary mainly because you own the copyright to your changes, even after your contribution becomes part of our codebase, so we need your permission to use and distribute your code. We also need to be sure of various other things—for instance that you'll tell us if you know that your code infringes on other people's patents. You don't have to sign the CLA until after you've submitted your code for review and a member has approved it, but you must do it before we can put your code into our codebase. Before you start working on a larger contribution, you should get in touch with us first through the issue tracker with your idea so that we can help out and possibly guide you. Coordinating up front makes it much easier to avoid frustration later on. # Code reviews All submissions, including submissions by project members, require review. We use Github pull requests for this purpose. Some tips for good pull requests: * Use our code [style guide](https://google.github.io/styleguide/cppguide.html). When in doubt, try to stay true to the existing code of the project. * Write a descriptive commit message. What problem are you solving and what are the consequences? Where and what did you test? Some good tips: [here](http://robots.thoughtbot.com/5-useful-tips-for-a-better-commit-message) and [here](https://www.kernel.org/doc/Documentation/SubmittingPatches). * If your PR consists of multiple commits which are successive improvements / fixes to your first commit, consider squashing them into a single commit (`git rebase -i`) such that your PR is a single commit on top of the current HEAD. This make reviewing the code so much easier, and our history more readable. # The small print Contributions made by corporations are covered by a different agreement than the one above, the Software Grant and Corporate Contributor License Agreement. flatbuffers-24.12.23/FlatBuffers.podspec000066400000000000000000000017511473234705300200460ustar00rootroot00000000000000Pod::Spec.new do |s| s.name = 'FlatBuffers' s.version = '24.12.23' s.summary = 'FlatBuffers: Memory Efficient Serialization Library' s.description = "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." s.homepage = 'https://github.com/google/flatbuffers' s.license = { :type => 'Apache2.0', :file => 'LICENSE' } s.author = { 'mustii' => 'me@mustiikhalil.se' } s.source = { :git => 'https://github.com/google/flatbuffers.git', :tag => "v" + s.version.to_s, :submodules => true } s.ios.deployment_target = '11.0' s.osx.deployment_target = '10.14' s.swift_version = '5.0' s.source_files = 'swift/Sources/Flatbuffers/*.swift' s.pod_target_xcconfig = { 'BUILD_LIBRARY_FOR_DISTRIBUTION' => 'YES' } end flatbuffers-24.12.23/Formatters.md000066400000000000000000000021501473234705300167260ustar00rootroot00000000000000# Format Guidelines If you are interesting in contributing to the flatbuffers project, please take a second to read this document. Each language has it's own set of rules, that are defined in their respective formatter/linter documents. # Notes - Run the linter on the language you are working on before making a Pull Request. - DONT format/lint the generated code. # Languages ## C++ C++ uses `clang-format` as it's formatter. Run the following script `sh scripts/clang-format-git.sh`, and it should style the C++ code according to [google style guide](https://google.github.io/styleguide/cppguide.html). ## Swift Swift uses swiftformat as it's formatter. Take a look at [how to install here](https://github.com/nicklockwood/SwiftFormat/blob/master/README.md#how-do-i-install-it). Run the following command `swiftformat --config swift.swiftformat .` in the root directory of the project ## Typescript Typescript uses eslint as it's linter. Take a look at [how to install here](https://eslint.org/docs/user-guide/getting-started). Run the following command `eslint ts/** --ext .ts` in the root directory of the projectflatbuffers-24.12.23/LICENSE000066400000000000000000000261361473234705300152750ustar00rootroot00000000000000 Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. flatbuffers-24.12.23/MODULE.bazel000066400000000000000000000006171473234705300162700ustar00rootroot00000000000000############################################################################### # Bazel now uses Bzlmod by default to manage external dependencies. # Please consider migrating your external dependencies from WORKSPACE to MODULE.bazel. # # For more details, please check https://github.com/bazelbuild/bazel/issues/18958 ############################################################################### flatbuffers-24.12.23/MODULE.bazel.lock000066400000000000000000004333341473234705300172250ustar00rootroot00000000000000{ "lockFileVersion": 6, "moduleFileHash": "0e3e315145ac7ee7a4e0ac825e1c5e03c068ec1254dd42c3caaecb27e921dc4d", "flags": { "cmdRegistries": [ "https://bcr.bazel.build/" ], "cmdModuleOverrides": {}, "allowedYankedVersions": [], "envVarAllowedYankedVersions": "", "ignoreDevDependency": false, "directDependenciesMode": "WARNING", "compatibilityMode": "ERROR" }, "localOverrideHashes": { "bazel_tools": "1ae69322ac3823527337acf02016e8ee95813d8d356f47060255b8956fa642f0" }, "moduleDepGraph": { "": { "name": "", "version": "", "key": "", "repoName": "", "executionPlatformsToRegister": [], "toolchainsToRegister": [], "extensionUsages": [], "deps": { "bazel_tools": "bazel_tools@_", "local_config_platform": "local_config_platform@_" } }, "bazel_tools@_": { "name": "bazel_tools", "version": "", "key": "bazel_tools@_", "repoName": "bazel_tools", "executionPlatformsToRegister": [], "toolchainsToRegister": [ "@local_config_cc_toolchains//:all", "@local_config_sh//:local_sh_toolchain" ], "extensionUsages": [ { "extensionBzlFile": "@bazel_tools//tools/cpp:cc_configure.bzl", "extensionName": "cc_configure_extension", "usingModule": "bazel_tools@_", "location": { "file": "@@bazel_tools//:MODULE.bazel", "line": 18, "column": 29 }, "imports": { "local_config_cc": "local_config_cc", "local_config_cc_toolchains": "local_config_cc_toolchains" }, "devImports": [], "tags": [], "hasDevUseExtension": false, "hasNonDevUseExtension": true }, { "extensionBzlFile": "@bazel_tools//tools/osx:xcode_configure.bzl", "extensionName": "xcode_configure_extension", "usingModule": "bazel_tools@_", "location": { "file": "@@bazel_tools//:MODULE.bazel", "line": 22, "column": 32 }, "imports": { "local_config_xcode": "local_config_xcode" }, "devImports": [], "tags": [], "hasDevUseExtension": false, "hasNonDevUseExtension": true }, { "extensionBzlFile": "@rules_java//java:extensions.bzl", "extensionName": "toolchains", "usingModule": "bazel_tools@_", "location": { "file": "@@bazel_tools//:MODULE.bazel", "line": 25, "column": 32 }, "imports": { "local_jdk": "local_jdk", "remote_java_tools": "remote_java_tools", "remote_java_tools_linux": "remote_java_tools_linux", "remote_java_tools_windows": "remote_java_tools_windows", "remote_java_tools_darwin_x86_64": "remote_java_tools_darwin_x86_64", "remote_java_tools_darwin_arm64": "remote_java_tools_darwin_arm64" }, "devImports": [], "tags": [], "hasDevUseExtension": false, "hasNonDevUseExtension": true }, { "extensionBzlFile": "@bazel_tools//tools/sh:sh_configure.bzl", "extensionName": "sh_configure_extension", "usingModule": "bazel_tools@_", "location": { "file": "@@bazel_tools//:MODULE.bazel", "line": 36, "column": 39 }, "imports": { "local_config_sh": "local_config_sh" }, "devImports": [], "tags": [], "hasDevUseExtension": false, "hasNonDevUseExtension": true }, { "extensionBzlFile": "@bazel_tools//tools/test:extensions.bzl", "extensionName": "remote_coverage_tools_extension", "usingModule": "bazel_tools@_", "location": { "file": "@@bazel_tools//:MODULE.bazel", "line": 40, "column": 48 }, "imports": { "remote_coverage_tools": "remote_coverage_tools" }, "devImports": [], "tags": [], "hasDevUseExtension": false, "hasNonDevUseExtension": true }, { "extensionBzlFile": "@bazel_tools//tools/android:android_extensions.bzl", "extensionName": "remote_android_tools_extensions", "usingModule": "bazel_tools@_", "location": { "file": "@@bazel_tools//:MODULE.bazel", "line": 43, "column": 42 }, "imports": { "android_gmaven_r8": "android_gmaven_r8", "android_tools": "android_tools" }, "devImports": [], "tags": [], "hasDevUseExtension": false, "hasNonDevUseExtension": true }, { "extensionBzlFile": "@buildozer//:buildozer_binary.bzl", "extensionName": "buildozer_binary", "usingModule": "bazel_tools@_", "location": { "file": "@@bazel_tools//:MODULE.bazel", "line": 47, "column": 33 }, "imports": { "buildozer_binary": "buildozer_binary" }, "devImports": [], "tags": [], "hasDevUseExtension": false, "hasNonDevUseExtension": true } ], "deps": { "rules_cc": "rules_cc@0.0.9", "rules_java": "rules_java@7.4.0", "rules_license": "rules_license@0.0.7", "rules_proto": "rules_proto@5.3.0-21.7", "rules_python": "rules_python@0.22.1", "buildozer": "buildozer@6.4.0.2", "platforms": "platforms@0.0.7", "com_google_protobuf": "protobuf@21.7", "zlib": "zlib@1.3", "build_bazel_apple_support": "apple_support@1.5.0", "local_config_platform": "local_config_platform@_" } }, "local_config_platform@_": { "name": "local_config_platform", "version": "", "key": "local_config_platform@_", "repoName": "local_config_platform", "executionPlatformsToRegister": [], "toolchainsToRegister": [], "extensionUsages": [], "deps": { "platforms": "platforms@0.0.7", "bazel_tools": "bazel_tools@_" } }, "rules_cc@0.0.9": { "name": "rules_cc", "version": "0.0.9", "key": "rules_cc@0.0.9", "repoName": "rules_cc", "executionPlatformsToRegister": [], "toolchainsToRegister": [ "@local_config_cc_toolchains//:all" ], "extensionUsages": [ { "extensionBzlFile": "@bazel_tools//tools/cpp:cc_configure.bzl", "extensionName": "cc_configure_extension", "usingModule": "rules_cc@0.0.9", "location": { "file": "https://bcr.bazel.build/modules/rules_cc/0.0.9/MODULE.bazel", "line": 9, "column": 29 }, "imports": { "local_config_cc_toolchains": "local_config_cc_toolchains" }, "devImports": [], "tags": [], "hasDevUseExtension": false, "hasNonDevUseExtension": true } ], "deps": { "platforms": "platforms@0.0.7", "bazel_tools": "bazel_tools@_", "local_config_platform": "local_config_platform@_" }, "repoSpec": { "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", "ruleClassName": "http_archive", "attributes": { "urls": [ "https://github.com/bazelbuild/rules_cc/releases/download/0.0.9/rules_cc-0.0.9.tar.gz" ], "integrity": "sha256-IDeHW5pEVtzkp50RKorohbvEqtlo5lh9ym5k86CQDN8=", "strip_prefix": "rules_cc-0.0.9", "remote_patches": { "https://bcr.bazel.build/modules/rules_cc/0.0.9/patches/module_dot_bazel_version.patch": "sha256-mM+qzOI0SgAdaJBlWOSMwMPKpaA9b7R37Hj/tp5bb4g=" }, "remote_patch_strip": 0 } } }, "rules_java@7.4.0": { "name": "rules_java", "version": "7.4.0", "key": "rules_java@7.4.0", "repoName": "rules_java", "executionPlatformsToRegister": [], "toolchainsToRegister": [ "//toolchains:all", "@local_jdk//:runtime_toolchain_definition", "@local_jdk//:bootstrap_runtime_toolchain_definition", "@remotejdk11_linux_toolchain_config_repo//:all", "@remotejdk11_linux_aarch64_toolchain_config_repo//:all", "@remotejdk11_linux_ppc64le_toolchain_config_repo//:all", "@remotejdk11_linux_s390x_toolchain_config_repo//:all", "@remotejdk11_macos_toolchain_config_repo//:all", "@remotejdk11_macos_aarch64_toolchain_config_repo//:all", "@remotejdk11_win_toolchain_config_repo//:all", "@remotejdk11_win_arm64_toolchain_config_repo//:all", "@remotejdk17_linux_toolchain_config_repo//:all", "@remotejdk17_linux_aarch64_toolchain_config_repo//:all", "@remotejdk17_linux_ppc64le_toolchain_config_repo//:all", "@remotejdk17_linux_s390x_toolchain_config_repo//:all", "@remotejdk17_macos_toolchain_config_repo//:all", "@remotejdk17_macos_aarch64_toolchain_config_repo//:all", "@remotejdk17_win_toolchain_config_repo//:all", "@remotejdk17_win_arm64_toolchain_config_repo//:all", "@remotejdk21_linux_toolchain_config_repo//:all", "@remotejdk21_linux_aarch64_toolchain_config_repo//:all", "@remotejdk21_macos_toolchain_config_repo//:all", "@remotejdk21_macos_aarch64_toolchain_config_repo//:all", "@remotejdk21_win_toolchain_config_repo//:all" ], "extensionUsages": [ { "extensionBzlFile": "@rules_java//java:extensions.bzl", "extensionName": "toolchains", "usingModule": "rules_java@7.4.0", "location": { "file": "https://bcr.bazel.build/modules/rules_java/7.4.0/MODULE.bazel", "line": 19, "column": 27 }, "imports": { "remote_java_tools": "remote_java_tools", "remote_java_tools_linux": "remote_java_tools_linux", "remote_java_tools_windows": "remote_java_tools_windows", "remote_java_tools_darwin_x86_64": "remote_java_tools_darwin_x86_64", "remote_java_tools_darwin_arm64": "remote_java_tools_darwin_arm64", "local_jdk": "local_jdk", "remotejdk11_linux_toolchain_config_repo": "remotejdk11_linux_toolchain_config_repo", "remotejdk11_linux_aarch64_toolchain_config_repo": "remotejdk11_linux_aarch64_toolchain_config_repo", "remotejdk11_linux_ppc64le_toolchain_config_repo": "remotejdk11_linux_ppc64le_toolchain_config_repo", "remotejdk11_linux_s390x_toolchain_config_repo": "remotejdk11_linux_s390x_toolchain_config_repo", "remotejdk11_macos_toolchain_config_repo": "remotejdk11_macos_toolchain_config_repo", "remotejdk11_macos_aarch64_toolchain_config_repo": "remotejdk11_macos_aarch64_toolchain_config_repo", "remotejdk11_win_toolchain_config_repo": "remotejdk11_win_toolchain_config_repo", "remotejdk11_win_arm64_toolchain_config_repo": "remotejdk11_win_arm64_toolchain_config_repo", "remotejdk17_linux_toolchain_config_repo": "remotejdk17_linux_toolchain_config_repo", "remotejdk17_linux_aarch64_toolchain_config_repo": "remotejdk17_linux_aarch64_toolchain_config_repo", "remotejdk17_linux_ppc64le_toolchain_config_repo": "remotejdk17_linux_ppc64le_toolchain_config_repo", "remotejdk17_linux_s390x_toolchain_config_repo": "remotejdk17_linux_s390x_toolchain_config_repo", "remotejdk17_macos_toolchain_config_repo": "remotejdk17_macos_toolchain_config_repo", "remotejdk17_macos_aarch64_toolchain_config_repo": "remotejdk17_macos_aarch64_toolchain_config_repo", "remotejdk17_win_toolchain_config_repo": "remotejdk17_win_toolchain_config_repo", "remotejdk17_win_arm64_toolchain_config_repo": "remotejdk17_win_arm64_toolchain_config_repo", "remotejdk21_linux_toolchain_config_repo": "remotejdk21_linux_toolchain_config_repo", "remotejdk21_linux_aarch64_toolchain_config_repo": "remotejdk21_linux_aarch64_toolchain_config_repo", "remotejdk21_macos_toolchain_config_repo": "remotejdk21_macos_toolchain_config_repo", "remotejdk21_macos_aarch64_toolchain_config_repo": "remotejdk21_macos_aarch64_toolchain_config_repo", "remotejdk21_win_toolchain_config_repo": "remotejdk21_win_toolchain_config_repo" }, "devImports": [], "tags": [], "hasDevUseExtension": false, "hasNonDevUseExtension": true } ], "deps": { "platforms": "platforms@0.0.7", "rules_cc": "rules_cc@0.0.9", "bazel_skylib": "bazel_skylib@1.3.0", "rules_proto": "rules_proto@5.3.0-21.7", "rules_license": "rules_license@0.0.7", "bazel_tools": "bazel_tools@_", "local_config_platform": "local_config_platform@_" }, "repoSpec": { "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", "ruleClassName": "http_archive", "attributes": { "urls": [ "https://github.com/bazelbuild/rules_java/releases/download/7.4.0/rules_java-7.4.0.tar.gz" ], "integrity": "sha256-l27wi0nJKXQfIBeQ5Z44B8cq2B9CjIvJU82+/1/tFes=", "strip_prefix": "", "remote_patches": {}, "remote_patch_strip": 0 } } }, "rules_license@0.0.7": { "name": "rules_license", "version": "0.0.7", "key": "rules_license@0.0.7", "repoName": "rules_license", "executionPlatformsToRegister": [], "toolchainsToRegister": [], "extensionUsages": [], "deps": { "bazel_tools": "bazel_tools@_", "local_config_platform": "local_config_platform@_" }, "repoSpec": { "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", "ruleClassName": "http_archive", "attributes": { "urls": [ "https://github.com/bazelbuild/rules_license/releases/download/0.0.7/rules_license-0.0.7.tar.gz" ], "integrity": "sha256-RTHezLkTY5ww5cdRKgVNXYdWmNrrddjPkPKEN1/nw2A=", "strip_prefix": "", "remote_patches": {}, "remote_patch_strip": 0 } } }, "rules_proto@5.3.0-21.7": { "name": "rules_proto", "version": "5.3.0-21.7", "key": "rules_proto@5.3.0-21.7", "repoName": "rules_proto", "executionPlatformsToRegister": [], "toolchainsToRegister": [], "extensionUsages": [], "deps": { "bazel_skylib": "bazel_skylib@1.3.0", "com_google_protobuf": "protobuf@21.7", "rules_cc": "rules_cc@0.0.9", "bazel_tools": "bazel_tools@_", "local_config_platform": "local_config_platform@_" }, "repoSpec": { "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", "ruleClassName": "http_archive", "attributes": { "urls": [ "https://github.com/bazelbuild/rules_proto/archive/refs/tags/5.3.0-21.7.tar.gz" ], "integrity": "sha256-3D+yBqLLNEG0heseQjFlsjEjWh6psDG0Qzz3vB+kYN0=", "strip_prefix": "rules_proto-5.3.0-21.7", "remote_patches": {}, "remote_patch_strip": 0 } } }, "rules_python@0.22.1": { "name": "rules_python", "version": "0.22.1", "key": "rules_python@0.22.1", "repoName": "rules_python", "executionPlatformsToRegister": [], "toolchainsToRegister": [ "@bazel_tools//tools/python:autodetecting_toolchain" ], "extensionUsages": [ { "extensionBzlFile": "@rules_python//python/extensions/private:internal_deps.bzl", "extensionName": "internal_deps", "usingModule": "rules_python@0.22.1", "location": { "file": "https://bcr.bazel.build/modules/rules_python/0.22.1/MODULE.bazel", "line": 14, "column": 30 }, "imports": { "pypi__build": "pypi__build", "pypi__click": "pypi__click", "pypi__colorama": "pypi__colorama", "pypi__importlib_metadata": "pypi__importlib_metadata", "pypi__installer": "pypi__installer", "pypi__more_itertools": "pypi__more_itertools", "pypi__packaging": "pypi__packaging", "pypi__pep517": "pypi__pep517", "pypi__pip": "pypi__pip", "pypi__pip_tools": "pypi__pip_tools", "pypi__setuptools": "pypi__setuptools", "pypi__tomli": "pypi__tomli", "pypi__wheel": "pypi__wheel", "pypi__zipp": "pypi__zipp", "pypi__coverage_cp310_aarch64-apple-darwin": "pypi__coverage_cp310_aarch64-apple-darwin", "pypi__coverage_cp310_aarch64-unknown-linux-gnu": "pypi__coverage_cp310_aarch64-unknown-linux-gnu", "pypi__coverage_cp310_x86_64-apple-darwin": "pypi__coverage_cp310_x86_64-apple-darwin", "pypi__coverage_cp310_x86_64-unknown-linux-gnu": "pypi__coverage_cp310_x86_64-unknown-linux-gnu", "pypi__coverage_cp311_aarch64-unknown-linux-gnu": "pypi__coverage_cp311_aarch64-unknown-linux-gnu", "pypi__coverage_cp311_x86_64-apple-darwin": "pypi__coverage_cp311_x86_64-apple-darwin", "pypi__coverage_cp311_x86_64-unknown-linux-gnu": "pypi__coverage_cp311_x86_64-unknown-linux-gnu", "pypi__coverage_cp38_aarch64-apple-darwin": "pypi__coverage_cp38_aarch64-apple-darwin", "pypi__coverage_cp38_aarch64-unknown-linux-gnu": "pypi__coverage_cp38_aarch64-unknown-linux-gnu", "pypi__coverage_cp38_x86_64-apple-darwin": "pypi__coverage_cp38_x86_64-apple-darwin", "pypi__coverage_cp38_x86_64-unknown-linux-gnu": "pypi__coverage_cp38_x86_64-unknown-linux-gnu", "pypi__coverage_cp39_aarch64-apple-darwin": "pypi__coverage_cp39_aarch64-apple-darwin", "pypi__coverage_cp39_aarch64-unknown-linux-gnu": "pypi__coverage_cp39_aarch64-unknown-linux-gnu", "pypi__coverage_cp39_x86_64-apple-darwin": "pypi__coverage_cp39_x86_64-apple-darwin", "pypi__coverage_cp39_x86_64-unknown-linux-gnu": "pypi__coverage_cp39_x86_64-unknown-linux-gnu" }, "devImports": [], "tags": [ { "tagName": "install", "attributeValues": {}, "devDependency": false, "location": { "file": "https://bcr.bazel.build/modules/rules_python/0.22.1/MODULE.bazel", "line": 15, "column": 22 } } ], "hasDevUseExtension": false, "hasNonDevUseExtension": true }, { "extensionBzlFile": "@rules_python//python/extensions:python.bzl", "extensionName": "python", "usingModule": "rules_python@0.22.1", "location": { "file": "https://bcr.bazel.build/modules/rules_python/0.22.1/MODULE.bazel", "line": 50, "column": 23 }, "imports": { "pythons_hub": "pythons_hub" }, "devImports": [], "tags": [], "hasDevUseExtension": false, "hasNonDevUseExtension": true } ], "deps": { "platforms": "platforms@0.0.7", "bazel_skylib": "bazel_skylib@1.3.0", "rules_proto": "rules_proto@5.3.0-21.7", "com_google_protobuf": "protobuf@21.7", "bazel_tools": "bazel_tools@_", "local_config_platform": "local_config_platform@_" }, "repoSpec": { "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", "ruleClassName": "http_archive", "attributes": { "urls": [ "https://github.com/bazelbuild/rules_python/releases/download/0.22.1/rules_python-0.22.1.tar.gz" ], "integrity": "sha256-pWQP3dS+sD6MH95e1xYMC6a9R359BIZhwwwGk2om/WM=", "strip_prefix": "rules_python-0.22.1", "remote_patches": { "https://bcr.bazel.build/modules/rules_python/0.22.1/patches/module_dot_bazel_version.patch": "sha256-3+VLDH9gYDzNI4eOW7mABC/LKxh1xqF6NhacLbNTucs=" }, "remote_patch_strip": 1 } } }, "buildozer@6.4.0.2": { "name": "buildozer", "version": "6.4.0.2", "key": "buildozer@6.4.0.2", "repoName": "buildozer", "executionPlatformsToRegister": [], "toolchainsToRegister": [], "extensionUsages": [ { "extensionBzlFile": "@buildozer//:buildozer_binary.bzl", "extensionName": "buildozer_binary", "usingModule": "buildozer@6.4.0.2", "location": { "file": "https://bcr.bazel.build/modules/buildozer/6.4.0.2/MODULE.bazel", "line": 7, "column": 33 }, "imports": { "buildozer_binary": "buildozer_binary" }, "devImports": [], "tags": [ { "tagName": "buildozer", "attributeValues": { "sha256": { "darwin-amd64": "d29e347ecd6b5673d72cb1a8de05bf1b06178dd229ff5eb67fad5100c840cc8e", "darwin-arm64": "9b9e71bdbec5e7223871e913b65d12f6d8fa026684daf991f00e52ed36a6978d", "linux-amd64": "8dfd6345da4e9042daa738d7fdf34f699c5dfce4632f7207956fceedd8494119", "linux-arm64": "6559558fded658c8fa7432a9d011f7c4dcbac6b738feae73d2d5c352e5f605fa", "windows-amd64": "e7f05bf847f7c3689dd28926460ce6e1097ae97380ac8e6ae7147b7b706ba19b" }, "version": "6.4.0" }, "devDependency": false, "location": { "file": "https://bcr.bazel.build/modules/buildozer/6.4.0.2/MODULE.bazel", "line": 8, "column": 27 } } ], "hasDevUseExtension": false, "hasNonDevUseExtension": true } ], "deps": { "bazel_tools": "bazel_tools@_", "local_config_platform": "local_config_platform@_" }, "repoSpec": { "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", "ruleClassName": "http_archive", "attributes": { "urls": [ "https://github.com/fmeum/buildozer/releases/download/v6.4.0.2/buildozer-v6.4.0.2.tar.gz" ], "integrity": "sha256-k7tFKQMR2AygxpmZfH0yEPnQmF3efFgD9rBPkj+Yz/8=", "strip_prefix": "buildozer-6.4.0.2", "remote_patches": { "https://bcr.bazel.build/modules/buildozer/6.4.0.2/patches/module_dot_bazel_version.patch": "sha256-gKANF2HMilj7bWmuXs4lbBIAAansuWC4IhWGB/CerjU=" }, "remote_patch_strip": 1 } } }, "platforms@0.0.7": { "name": "platforms", "version": "0.0.7", "key": "platforms@0.0.7", "repoName": "platforms", "executionPlatformsToRegister": [], "toolchainsToRegister": [], "extensionUsages": [], "deps": { "rules_license": "rules_license@0.0.7", "bazel_tools": "bazel_tools@_", "local_config_platform": "local_config_platform@_" }, "repoSpec": { "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", "ruleClassName": "http_archive", "attributes": { "urls": [ "https://github.com/bazelbuild/platforms/releases/download/0.0.7/platforms-0.0.7.tar.gz" ], "integrity": "sha256-OlYcmee9vpFzqmU/1Xn+hJ8djWc5V4CrR3Cx84FDHVE=", "strip_prefix": "", "remote_patches": {}, "remote_patch_strip": 0 } } }, "protobuf@21.7": { "name": "protobuf", "version": "21.7", "key": "protobuf@21.7", "repoName": "protobuf", "executionPlatformsToRegister": [], "toolchainsToRegister": [], "extensionUsages": [ { "extensionBzlFile": "@rules_jvm_external//:extensions.bzl", "extensionName": "maven", "usingModule": "protobuf@21.7", "location": { "file": "https://bcr.bazel.build/modules/protobuf/21.7/MODULE.bazel", "line": 22, "column": 22 }, "imports": { "maven": "maven" }, "devImports": [], "tags": [ { "tagName": "install", "attributeValues": { "name": "maven", "artifacts": [ "com.google.code.findbugs:jsr305:3.0.2", "com.google.code.gson:gson:2.8.9", "com.google.errorprone:error_prone_annotations:2.3.2", "com.google.j2objc:j2objc-annotations:1.3", "com.google.guava:guava:31.1-jre", "com.google.guava:guava-testlib:31.1-jre", "com.google.truth:truth:1.1.2", "junit:junit:4.13.2", "org.mockito:mockito-core:4.3.1" ] }, "devDependency": false, "location": { "file": "https://bcr.bazel.build/modules/protobuf/21.7/MODULE.bazel", "line": 24, "column": 14 } } ], "hasDevUseExtension": false, "hasNonDevUseExtension": true } ], "deps": { "bazel_skylib": "bazel_skylib@1.3.0", "rules_python": "rules_python@0.22.1", "rules_cc": "rules_cc@0.0.9", "rules_proto": "rules_proto@5.3.0-21.7", "rules_java": "rules_java@7.4.0", "rules_pkg": "rules_pkg@0.7.0", "com_google_abseil": "abseil-cpp@20211102.0", "zlib": "zlib@1.3", "upb": "upb@0.0.0-20220923-a547704", "rules_jvm_external": "rules_jvm_external@4.4.2", "com_google_googletest": "googletest@1.11.0", "bazel_tools": "bazel_tools@_", "local_config_platform": "local_config_platform@_" }, "repoSpec": { "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", "ruleClassName": "http_archive", "attributes": { "urls": [ "https://github.com/protocolbuffers/protobuf/releases/download/v21.7/protobuf-all-21.7.zip" ], "integrity": "sha256-VJOiH17T/FAuZv7GuUScBqVRztYwAvpIkDxA36jeeko=", "strip_prefix": "protobuf-21.7", "remote_patches": { "https://bcr.bazel.build/modules/protobuf/21.7/patches/add_module_dot_bazel.patch": "sha256-q3V2+eq0v2XF0z8z+V+QF4cynD6JvHI1y3kI/+rzl5s=", "https://bcr.bazel.build/modules/protobuf/21.7/patches/add_module_dot_bazel_for_examples.patch": "sha256-O7YP6s3lo/1opUiO0jqXYORNHdZ/2q3hjz1QGy8QdIU=", "https://bcr.bazel.build/modules/protobuf/21.7/patches/relative_repo_names.patch": "sha256-RK9RjW8T5UJNG7flIrnFiNE9vKwWB+8uWWtJqXYT0w4=", "https://bcr.bazel.build/modules/protobuf/21.7/patches/add_missing_files.patch": "sha256-Hyne4DG2u5bXcWHNxNMirA2QFAe/2Cl8oMm1XJdkQIY=" }, "remote_patch_strip": 1 } } }, "zlib@1.3": { "name": "zlib", "version": "1.3", "key": "zlib@1.3", "repoName": "zlib", "executionPlatformsToRegister": [], "toolchainsToRegister": [], "extensionUsages": [], "deps": { "platforms": "platforms@0.0.7", "rules_cc": "rules_cc@0.0.9", "bazel_tools": "bazel_tools@_", "local_config_platform": "local_config_platform@_" }, "repoSpec": { "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", "ruleClassName": "http_archive", "attributes": { "urls": [ "https://github.com/madler/zlib/releases/download/v1.3/zlib-1.3.tar.gz" ], "integrity": "sha256-/wukwpIBPbwnUws6geH5qBPNOd4Byl4Pi/NVcC76WT4=", "strip_prefix": "zlib-1.3", "remote_patches": { "https://bcr.bazel.build/modules/zlib/1.3/patches/add_build_file.patch": "sha256-Ei+FYaaOo7A3jTKunMEodTI0Uw5NXQyZEcboMC8JskY=", "https://bcr.bazel.build/modules/zlib/1.3/patches/module_dot_bazel.patch": "sha256-fPWLM+2xaF/kuy+kZc1YTfW6hNjrkG400Ho7gckuyJk=" }, "remote_patch_strip": 0 } } }, "apple_support@1.5.0": { "name": "apple_support", "version": "1.5.0", "key": "apple_support@1.5.0", "repoName": "build_bazel_apple_support", "executionPlatformsToRegister": [], "toolchainsToRegister": [ "@local_config_apple_cc_toolchains//:all" ], "extensionUsages": [ { "extensionBzlFile": "@build_bazel_apple_support//crosstool:setup.bzl", "extensionName": "apple_cc_configure_extension", "usingModule": "apple_support@1.5.0", "location": { "file": "https://bcr.bazel.build/modules/apple_support/1.5.0/MODULE.bazel", "line": 17, "column": 35 }, "imports": { "local_config_apple_cc": "local_config_apple_cc", "local_config_apple_cc_toolchains": "local_config_apple_cc_toolchains" }, "devImports": [], "tags": [], "hasDevUseExtension": false, "hasNonDevUseExtension": true } ], "deps": { "bazel_skylib": "bazel_skylib@1.3.0", "platforms": "platforms@0.0.7", "bazel_tools": "bazel_tools@_", "local_config_platform": "local_config_platform@_" }, "repoSpec": { "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", "ruleClassName": "http_archive", "attributes": { "urls": [ "https://github.com/bazelbuild/apple_support/releases/download/1.5.0/apple_support.1.5.0.tar.gz" ], "integrity": "sha256-miM41vja0yRPgj8txghKA+TQ+7J8qJLclw5okNW0gYQ=", "strip_prefix": "", "remote_patches": {}, "remote_patch_strip": 0 } } }, "bazel_skylib@1.3.0": { "name": "bazel_skylib", "version": "1.3.0", "key": "bazel_skylib@1.3.0", "repoName": "bazel_skylib", "executionPlatformsToRegister": [], "toolchainsToRegister": [ "//toolchains/unittest:cmd_toolchain", "//toolchains/unittest:bash_toolchain" ], "extensionUsages": [], "deps": { "platforms": "platforms@0.0.7", "bazel_tools": "bazel_tools@_", "local_config_platform": "local_config_platform@_" }, "repoSpec": { "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", "ruleClassName": "http_archive", "attributes": { "urls": [ "https://github.com/bazelbuild/bazel-skylib/releases/download/1.3.0/bazel-skylib-1.3.0.tar.gz" ], "integrity": "sha256-dNVE2W9KW7Yw1GXKi7z+Ix41lOWq5X4e2/F6brPKJQY=", "strip_prefix": "", "remote_patches": {}, "remote_patch_strip": 0 } } }, "rules_pkg@0.7.0": { "name": "rules_pkg", "version": "0.7.0", "key": "rules_pkg@0.7.0", "repoName": "rules_pkg", "executionPlatformsToRegister": [], "toolchainsToRegister": [], "extensionUsages": [], "deps": { "rules_python": "rules_python@0.22.1", "bazel_skylib": "bazel_skylib@1.3.0", "rules_license": "rules_license@0.0.7", "bazel_tools": "bazel_tools@_", "local_config_platform": "local_config_platform@_" }, "repoSpec": { "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", "ruleClassName": "http_archive", "attributes": { "urls": [ "https://github.com/bazelbuild/rules_pkg/releases/download/0.7.0/rules_pkg-0.7.0.tar.gz" ], "integrity": "sha256-iimOgydi7aGDBZfWT+fbWBeKqEzVkm121bdE1lWJQcI=", "strip_prefix": "", "remote_patches": { "https://bcr.bazel.build/modules/rules_pkg/0.7.0/patches/module_dot_bazel.patch": "sha256-4OaEPZwYF6iC71ZTDg6MJ7LLqX7ZA0/kK4mT+4xKqiE=" }, "remote_patch_strip": 0 } } }, "abseil-cpp@20211102.0": { "name": "abseil-cpp", "version": "20211102.0", "key": "abseil-cpp@20211102.0", "repoName": "abseil-cpp", "executionPlatformsToRegister": [], "toolchainsToRegister": [], "extensionUsages": [], "deps": { "rules_cc": "rules_cc@0.0.9", "platforms": "platforms@0.0.7", "bazel_tools": "bazel_tools@_", "local_config_platform": "local_config_platform@_" }, "repoSpec": { "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", "ruleClassName": "http_archive", "attributes": { "urls": [ "https://github.com/abseil/abseil-cpp/archive/refs/tags/20211102.0.tar.gz" ], "integrity": "sha256-3PcbnLqNwMqZQMSzFqDHlr6Pq0KwcLtrfKtitI8OZsQ=", "strip_prefix": "abseil-cpp-20211102.0", "remote_patches": { "https://bcr.bazel.build/modules/abseil-cpp/20211102.0/patches/module_dot_bazel.patch": "sha256-4izqopgGCey4jVZzl/w3M2GVPNohjh2B5TmbThZNvPY=" }, "remote_patch_strip": 0 } } }, "upb@0.0.0-20220923-a547704": { "name": "upb", "version": "0.0.0-20220923-a547704", "key": "upb@0.0.0-20220923-a547704", "repoName": "upb", "executionPlatformsToRegister": [], "toolchainsToRegister": [], "extensionUsages": [], "deps": { "bazel_skylib": "bazel_skylib@1.3.0", "rules_proto": "rules_proto@5.3.0-21.7", "com_google_protobuf": "protobuf@21.7", "com_google_absl": "abseil-cpp@20211102.0", "platforms": "platforms@0.0.7", "bazel_tools": "bazel_tools@_", "local_config_platform": "local_config_platform@_" }, "repoSpec": { "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", "ruleClassName": "http_archive", "attributes": { "urls": [ "https://github.com/protocolbuffers/upb/archive/a5477045acaa34586420942098f5fecd3570f577.tar.gz" ], "integrity": "sha256-z39x6v+QskwaKLSWRan/A6mmwecTQpHOcJActj5zZLU=", "strip_prefix": "upb-a5477045acaa34586420942098f5fecd3570f577", "remote_patches": { "https://bcr.bazel.build/modules/upb/0.0.0-20220923-a547704/patches/module_dot_bazel.patch": "sha256-wH4mNS6ZYy+8uC0HoAft/c7SDsq2Kxf+J8dUakXhaB0=" }, "remote_patch_strip": 0 } } }, "rules_jvm_external@4.4.2": { "name": "rules_jvm_external", "version": "4.4.2", "key": "rules_jvm_external@4.4.2", "repoName": "rules_jvm_external", "executionPlatformsToRegister": [], "toolchainsToRegister": [], "extensionUsages": [ { "extensionBzlFile": "@rules_jvm_external//:non-module-deps.bzl", "extensionName": "non_module_deps", "usingModule": "rules_jvm_external@4.4.2", "location": { "file": "https://bcr.bazel.build/modules/rules_jvm_external/4.4.2/MODULE.bazel", "line": 9, "column": 32 }, "imports": { "io_bazel_rules_kotlin": "io_bazel_rules_kotlin" }, "devImports": [], "tags": [], "hasDevUseExtension": false, "hasNonDevUseExtension": true }, { "extensionBzlFile": "@rules_jvm_external//:extensions.bzl", "extensionName": "maven", "usingModule": "rules_jvm_external@4.4.2", "location": { "file": "https://bcr.bazel.build/modules/rules_jvm_external/4.4.2/MODULE.bazel", "line": 16, "column": 22 }, "imports": { "rules_jvm_external_deps": "rules_jvm_external_deps" }, "devImports": [], "tags": [ { "tagName": "install", "attributeValues": { "name": "rules_jvm_external_deps", "artifacts": [ "com.google.cloud:google-cloud-core:1.93.10", "com.google.cloud:google-cloud-storage:1.113.4", "com.google.code.gson:gson:2.9.0", "org.apache.maven:maven-artifact:3.8.6", "software.amazon.awssdk:s3:2.17.183" ], "lock_file": "@rules_jvm_external//:rules_jvm_external_deps_install.json" }, "devDependency": false, "location": { "file": "https://bcr.bazel.build/modules/rules_jvm_external/4.4.2/MODULE.bazel", "line": 18, "column": 14 } } ], "hasDevUseExtension": false, "hasNonDevUseExtension": true } ], "deps": { "bazel_skylib": "bazel_skylib@1.3.0", "io_bazel_stardoc": "stardoc@0.5.1", "bazel_tools": "bazel_tools@_", "local_config_platform": "local_config_platform@_" }, "repoSpec": { "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", "ruleClassName": "http_archive", "attributes": { "urls": [ "https://github.com/bazelbuild/rules_jvm_external/archive/refs/tags/4.4.2.zip" ], "integrity": "sha256-c1YC9QgT6y6pPKP15DsZWb2AshO4NqB6YqKddXZwt3s=", "strip_prefix": "rules_jvm_external-4.4.2", "remote_patches": {}, "remote_patch_strip": 0 } } }, "googletest@1.11.0": { "name": "googletest", "version": "1.11.0", "key": "googletest@1.11.0", "repoName": "googletest", "executionPlatformsToRegister": [], "toolchainsToRegister": [], "extensionUsages": [], "deps": { "com_google_absl": "abseil-cpp@20211102.0", "platforms": "platforms@0.0.7", "rules_cc": "rules_cc@0.0.9", "bazel_tools": "bazel_tools@_", "local_config_platform": "local_config_platform@_" }, "repoSpec": { "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", "ruleClassName": "http_archive", "attributes": { "urls": [ "https://github.com/google/googletest/archive/refs/tags/release-1.11.0.tar.gz" ], "integrity": "sha256-tIcL8SH/d5W6INILzdhie44Ijy0dqymaAxwQNO3ck9U=", "strip_prefix": "googletest-release-1.11.0", "remote_patches": { "https://bcr.bazel.build/modules/googletest/1.11.0/patches/module_dot_bazel.patch": "sha256-HuahEdI/n8KCI071sN3CEziX+7qP/Ec77IWayYunLP0=" }, "remote_patch_strip": 0 } } }, "stardoc@0.5.1": { "name": "stardoc", "version": "0.5.1", "key": "stardoc@0.5.1", "repoName": "stardoc", "executionPlatformsToRegister": [], "toolchainsToRegister": [], "extensionUsages": [], "deps": { "bazel_skylib": "bazel_skylib@1.3.0", "rules_java": "rules_java@7.4.0", "bazel_tools": "bazel_tools@_", "local_config_platform": "local_config_platform@_" }, "repoSpec": { "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", "ruleClassName": "http_archive", "attributes": { "urls": [ "https://github.com/bazelbuild/stardoc/releases/download/0.5.1/stardoc-0.5.1.tar.gz" ], "integrity": "sha256-qoFNrgrEALurLoiB+ZFcb0fElmS/CHxAmhX5BDjSwj4=", "strip_prefix": "", "remote_patches": { "https://bcr.bazel.build/modules/stardoc/0.5.1/patches/module_dot_bazel.patch": "sha256-UAULCuTpJE7SG0YrR9XLjMfxMRmbP+za3uW9ONZ5rjI=" }, "remote_patch_strip": 0 } } } }, "moduleExtensions": { "@@apple_support~//crosstool:setup.bzl%apple_cc_configure_extension": { "general": { "bzlTransitiveDigest": "pMLFCYaRPkgXPQ8vtuNkMfiHfPmRBy6QJfnid4sWfv0=", "recordedFileInputs": {}, "recordedDirentsInputs": {}, "envVariables": {}, "generatedRepoSpecs": { "local_config_apple_cc": { "bzlFile": "@@apple_support~//crosstool:setup.bzl", "ruleClassName": "_apple_cc_autoconf", "attributes": {} }, "local_config_apple_cc_toolchains": { "bzlFile": "@@apple_support~//crosstool:setup.bzl", "ruleClassName": "_apple_cc_autoconf_toolchains", "attributes": {} } }, "recordedRepoMappingEntries": [ [ "apple_support~", "bazel_tools", "bazel_tools" ] ] } }, "@@bazel_tools//tools/cpp:cc_configure.bzl%cc_configure_extension": { "general": { "bzlTransitiveDigest": "PHpT2yqMGms2U4L3E/aZ+WcQalmZWm+ILdP3yiLsDhA=", "recordedFileInputs": {}, "recordedDirentsInputs": {}, "envVariables": {}, "generatedRepoSpecs": { "local_config_cc": { "bzlFile": "@@bazel_tools//tools/cpp:cc_configure.bzl", "ruleClassName": "cc_autoconf", "attributes": {} }, "local_config_cc_toolchains": { "bzlFile": "@@bazel_tools//tools/cpp:cc_configure.bzl", "ruleClassName": "cc_autoconf_toolchains", "attributes": {} } }, "recordedRepoMappingEntries": [ [ "bazel_tools", "bazel_tools", "bazel_tools" ] ] } }, "@@bazel_tools//tools/osx:xcode_configure.bzl%xcode_configure_extension": { "general": { "bzlTransitiveDigest": "Qh2bWTU6QW6wkrd87qrU4YeY+SG37Nvw3A0PR4Y0L2Y=", "recordedFileInputs": {}, "recordedDirentsInputs": {}, "envVariables": {}, "generatedRepoSpecs": { "local_config_xcode": { "bzlFile": "@@bazel_tools//tools/osx:xcode_configure.bzl", "ruleClassName": "xcode_autoconf", "attributes": { "xcode_locator": "@bazel_tools//tools/osx:xcode_locator.m", "remote_xcode": "" } } }, "recordedRepoMappingEntries": [] } }, "@@bazel_tools//tools/sh:sh_configure.bzl%sh_configure_extension": { "general": { "bzlTransitiveDigest": "hp4NgmNjEg5+xgvzfh6L83bt9/aiiWETuNpwNuF1MSU=", "recordedFileInputs": {}, "recordedDirentsInputs": {}, "envVariables": {}, "generatedRepoSpecs": { "local_config_sh": { "bzlFile": "@@bazel_tools//tools/sh:sh_configure.bzl", "ruleClassName": "sh_config", "attributes": {} } }, "recordedRepoMappingEntries": [] } }, "@@rules_java~//java:extensions.bzl%toolchains": { "general": { "bzlTransitiveDigest": "0N5b5J9fUzo0sgvH4F3kIEaeXunz4Wy2/UtSFV/eXUY=", "recordedFileInputs": {}, "recordedDirentsInputs": {}, "envVariables": {}, "generatedRepoSpecs": { "remotejdk21_linux_toolchain_config_repo": { "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", "ruleClassName": "_toolchain_config", "attributes": { "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_21\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"21\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk21_linux//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk21_linux//:jdk\",\n)\n" } }, "remotejdk17_linux_s390x_toolchain_config_repo": { "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", "ruleClassName": "_toolchain_config", "attributes": { "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_17\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"17\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:s390x\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk17_linux_s390x//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:s390x\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk17_linux_s390x//:jdk\",\n)\n" } }, "remotejdk17_macos_toolchain_config_repo": { "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", "ruleClassName": "_toolchain_config", "attributes": { "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_17\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"17\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk17_macos//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk17_macos//:jdk\",\n)\n" } }, "remotejdk21_macos_aarch64_toolchain_config_repo": { "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", "ruleClassName": "_toolchain_config", "attributes": { "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_21\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"21\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk21_macos_aarch64//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk21_macos_aarch64//:jdk\",\n)\n" } }, "remotejdk17_linux_aarch64_toolchain_config_repo": { "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", "ruleClassName": "_toolchain_config", "attributes": { "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_17\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"17\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk17_linux_aarch64//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk17_linux_aarch64//:jdk\",\n)\n" } }, "remotejdk21_macos_aarch64": { "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", "ruleClassName": "http_archive", "attributes": { "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 21,\n)\n", "sha256": "e8260516de8b60661422a725f1df2c36ef888f6fb35393566b00e7325db3d04e", "strip_prefix": "zulu21.32.17-ca-jdk21.0.2-macosx_aarch64", "urls": [ "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu21.32.17-ca-jdk21.0.2-macosx_aarch64.tar.gz", "https://cdn.azul.com/zulu/bin/zulu21.32.17-ca-jdk21.0.2-macosx_aarch64.tar.gz" ] } }, "remotejdk17_linux_toolchain_config_repo": { "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", "ruleClassName": "_toolchain_config", "attributes": { "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_17\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"17\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk17_linux//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk17_linux//:jdk\",\n)\n" } }, "remotejdk17_macos_aarch64": { "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", "ruleClassName": "http_archive", "attributes": { "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 17,\n)\n", "sha256": "314b04568ec0ae9b36ba03c9cbd42adc9e1265f74678923b19297d66eb84dcca", "strip_prefix": "zulu17.44.53-ca-jdk17.0.8.1-macosx_aarch64", "urls": [ "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-macosx_aarch64.tar.gz", "https://cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-macosx_aarch64.tar.gz" ] } }, "remote_java_tools_windows": { "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", "ruleClassName": "http_archive", "attributes": { "sha256": "fe2f88169696d6c6fc6e90ba61bb46be7d0ae3693cbafdf336041bf56679e8d1", "urls": [ "https://mirror.bazel.build/bazel_java_tools/releases/java/v13.4/java_tools_windows-v13.4.zip", "https://github.com/bazelbuild/java_tools/releases/download/java_v13.4/java_tools_windows-v13.4.zip" ] } }, "remotejdk11_win": { "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", "ruleClassName": "http_archive", "attributes": { "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 11,\n)\n", "sha256": "43408193ce2fa0862819495b5ae8541085b95660153f2adcf91a52d3a1710e83", "strip_prefix": "zulu11.66.15-ca-jdk11.0.20-win_x64", "urls": [ "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-win_x64.zip", "https://cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-win_x64.zip" ] } }, "remotejdk11_win_toolchain_config_repo": { "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", "ruleClassName": "_toolchain_config", "attributes": { "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_11\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"11\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:windows\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk11_win//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:windows\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk11_win//:jdk\",\n)\n" } }, "remotejdk11_linux_aarch64": { "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", "ruleClassName": "http_archive", "attributes": { "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 11,\n)\n", "sha256": "54174439f2b3fddd11f1048c397fe7bb45d4c9d66d452d6889b013d04d21c4de", "strip_prefix": "zulu11.66.15-ca-jdk11.0.20-linux_aarch64", "urls": [ "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-linux_aarch64.tar.gz", "https://cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-linux_aarch64.tar.gz" ] } }, "remotejdk17_linux": { "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", "ruleClassName": "http_archive", "attributes": { "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 17,\n)\n", "sha256": "b9482f2304a1a68a614dfacddcf29569a72f0fac32e6c74f83dc1b9a157b8340", "strip_prefix": "zulu17.44.53-ca-jdk17.0.8.1-linux_x64", "urls": [ "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-linux_x64.tar.gz", "https://cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-linux_x64.tar.gz" ] } }, "remotejdk11_linux_s390x_toolchain_config_repo": { "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", "ruleClassName": "_toolchain_config", "attributes": { "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_11\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"11\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:s390x\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk11_linux_s390x//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:s390x\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk11_linux_s390x//:jdk\",\n)\n" } }, "remotejdk11_linux_toolchain_config_repo": { "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", "ruleClassName": "_toolchain_config", "attributes": { "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_11\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"11\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk11_linux//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk11_linux//:jdk\",\n)\n" } }, "remotejdk11_macos": { "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", "ruleClassName": "http_archive", "attributes": { "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 11,\n)\n", "sha256": "bcaab11cfe586fae7583c6d9d311c64384354fb2638eb9a012eca4c3f1a1d9fd", "strip_prefix": "zulu11.66.15-ca-jdk11.0.20-macosx_x64", "urls": [ "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-macosx_x64.tar.gz", "https://cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-macosx_x64.tar.gz" ] } }, "remotejdk11_win_arm64": { "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", "ruleClassName": "http_archive", "attributes": { "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 11,\n)\n", "sha256": "b8a28e6e767d90acf793ea6f5bed0bb595ba0ba5ebdf8b99f395266161e53ec2", "strip_prefix": "jdk-11.0.13+8", "urls": [ "https://mirror.bazel.build/aka.ms/download-jdk/microsoft-jdk-11.0.13.8.1-windows-aarch64.zip" ] } }, "remotejdk17_macos": { "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", "ruleClassName": "http_archive", "attributes": { "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 17,\n)\n", "sha256": "640453e8afe8ffe0fb4dceb4535fb50db9c283c64665eebb0ba68b19e65f4b1f", "strip_prefix": "zulu17.44.53-ca-jdk17.0.8.1-macosx_x64", "urls": [ "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-macosx_x64.tar.gz", "https://cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-macosx_x64.tar.gz" ] } }, "remotejdk21_macos": { "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", "ruleClassName": "http_archive", "attributes": { "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 21,\n)\n", "sha256": "3ad8fe288eb57d975c2786ae453a036aa46e47ab2ac3d81538ebae2a54d3c025", "strip_prefix": "zulu21.32.17-ca-jdk21.0.2-macosx_x64", "urls": [ "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu21.32.17-ca-jdk21.0.2-macosx_x64.tar.gz", "https://cdn.azul.com/zulu/bin/zulu21.32.17-ca-jdk21.0.2-macosx_x64.tar.gz" ] } }, "remotejdk21_macos_toolchain_config_repo": { "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", "ruleClassName": "_toolchain_config", "attributes": { "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_21\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"21\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk21_macos//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk21_macos//:jdk\",\n)\n" } }, "remotejdk17_macos_aarch64_toolchain_config_repo": { "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", "ruleClassName": "_toolchain_config", "attributes": { "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_17\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"17\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk17_macos_aarch64//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk17_macos_aarch64//:jdk\",\n)\n" } }, "remotejdk17_win": { "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", "ruleClassName": "http_archive", "attributes": { "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 17,\n)\n", "sha256": "192f2afca57701de6ec496234f7e45d971bf623ff66b8ee4a5c81582054e5637", "strip_prefix": "zulu17.44.53-ca-jdk17.0.8.1-win_x64", "urls": [ "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-win_x64.zip", "https://cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-win_x64.zip" ] } }, "remotejdk11_macos_aarch64_toolchain_config_repo": { "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", "ruleClassName": "_toolchain_config", "attributes": { "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_11\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"11\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk11_macos_aarch64//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk11_macos_aarch64//:jdk\",\n)\n" } }, "remotejdk11_linux_ppc64le_toolchain_config_repo": { "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", "ruleClassName": "_toolchain_config", "attributes": { "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_11\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"11\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:ppc\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk11_linux_ppc64le//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:ppc\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk11_linux_ppc64le//:jdk\",\n)\n" } }, "remotejdk21_linux": { "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", "ruleClassName": "http_archive", "attributes": { "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 21,\n)\n", "sha256": "5ad730fbee6bb49bfff10bf39e84392e728d89103d3474a7e5def0fd134b300a", "strip_prefix": "zulu21.32.17-ca-jdk21.0.2-linux_x64", "urls": [ "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu21.32.17-ca-jdk21.0.2-linux_x64.tar.gz", "https://cdn.azul.com/zulu/bin/zulu21.32.17-ca-jdk21.0.2-linux_x64.tar.gz" ] } }, "remote_java_tools_linux": { "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", "ruleClassName": "http_archive", "attributes": { "sha256": "ba10f09a138cf185d04cbc807d67a3da42ab13d618c5d1ce20d776e199c33a39", "urls": [ "https://mirror.bazel.build/bazel_java_tools/releases/java/v13.4/java_tools_linux-v13.4.zip", "https://github.com/bazelbuild/java_tools/releases/download/java_v13.4/java_tools_linux-v13.4.zip" ] } }, "remotejdk21_win": { "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", "ruleClassName": "http_archive", "attributes": { "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 21,\n)\n", "sha256": "f7cc15ca17295e69c907402dfe8db240db446e75d3b150da7bf67243cded93de", "strip_prefix": "zulu21.32.17-ca-jdk21.0.2-win_x64", "urls": [ "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu21.32.17-ca-jdk21.0.2-win_x64.zip", "https://cdn.azul.com/zulu/bin/zulu21.32.17-ca-jdk21.0.2-win_x64.zip" ] } }, "remotejdk21_linux_aarch64": { "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", "ruleClassName": "http_archive", "attributes": { "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 21,\n)\n", "sha256": "ce7df1af5d44a9f455617c4b8891443fbe3e4b269c777d8b82ed66f77167cfe0", "strip_prefix": "zulu21.32.17-ca-jdk21.0.2-linux_aarch64", "urls": [ "https://cdn.azul.com/zulu/bin/zulu21.32.17-ca-jdk21.0.2-linux_aarch64.tar.gz", "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu21.32.17-ca-jdk21.0.2-linux_aarch64.tar.gz" ] } }, "remotejdk11_linux_aarch64_toolchain_config_repo": { "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", "ruleClassName": "_toolchain_config", "attributes": { "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_11\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"11\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk11_linux_aarch64//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk11_linux_aarch64//:jdk\",\n)\n" } }, "remotejdk11_linux_s390x": { "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", "ruleClassName": "http_archive", "attributes": { "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 11,\n)\n", "sha256": "a58fc0361966af0a5d5a31a2d8a208e3c9bb0f54f345596fd80b99ea9a39788b", "strip_prefix": "jdk-11.0.15+10", "urls": [ "https://mirror.bazel.build/github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.15+10/OpenJDK11U-jdk_s390x_linux_hotspot_11.0.15_10.tar.gz", "https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.15+10/OpenJDK11U-jdk_s390x_linux_hotspot_11.0.15_10.tar.gz" ] } }, "remotejdk17_linux_aarch64": { "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", "ruleClassName": "http_archive", "attributes": { "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 17,\n)\n", "sha256": "6531cef61e416d5a7b691555c8cf2bdff689201b8a001ff45ab6740062b44313", "strip_prefix": "zulu17.44.53-ca-jdk17.0.8.1-linux_aarch64", "urls": [ "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-linux_aarch64.tar.gz", "https://cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-linux_aarch64.tar.gz" ] } }, "remotejdk17_win_arm64_toolchain_config_repo": { "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", "ruleClassName": "_toolchain_config", "attributes": { "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_17\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"17\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:windows\", \"@platforms//cpu:arm64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk17_win_arm64//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:windows\", \"@platforms//cpu:arm64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk17_win_arm64//:jdk\",\n)\n" } }, "remotejdk11_linux": { "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", "ruleClassName": "http_archive", "attributes": { "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 11,\n)\n", "sha256": "a34b404f87a08a61148b38e1416d837189e1df7a040d949e743633daf4695a3c", "strip_prefix": "zulu11.66.15-ca-jdk11.0.20-linux_x64", "urls": [ "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-linux_x64.tar.gz", "https://cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-linux_x64.tar.gz" ] } }, "remotejdk11_macos_toolchain_config_repo": { "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", "ruleClassName": "_toolchain_config", "attributes": { "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_11\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"11\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk11_macos//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk11_macos//:jdk\",\n)\n" } }, "remotejdk17_linux_ppc64le_toolchain_config_repo": { "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", "ruleClassName": "_toolchain_config", "attributes": { "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_17\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"17\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:ppc\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk17_linux_ppc64le//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:ppc\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk17_linux_ppc64le//:jdk\",\n)\n" } }, "remotejdk17_win_arm64": { "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", "ruleClassName": "http_archive", "attributes": { "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 17,\n)\n", "sha256": "6802c99eae0d788e21f52d03cab2e2b3bf42bc334ca03cbf19f71eb70ee19f85", "strip_prefix": "zulu17.44.53-ca-jdk17.0.8.1-win_aarch64", "urls": [ "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-win_aarch64.zip", "https://cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-win_aarch64.zip" ] } }, "remote_java_tools_darwin_arm64": { "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", "ruleClassName": "http_archive", "attributes": { "sha256": "076a7e198ad077f8c7d997986ef5102427fae6bbfce7a7852d2e080ed8767528", "urls": [ "https://mirror.bazel.build/bazel_java_tools/releases/java/v13.4/java_tools_darwin_arm64-v13.4.zip", "https://github.com/bazelbuild/java_tools/releases/download/java_v13.4/java_tools_darwin_arm64-v13.4.zip" ] } }, "remotejdk17_linux_ppc64le": { "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", "ruleClassName": "http_archive", "attributes": { "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 17,\n)\n", "sha256": "00a4c07603d0218cd678461b5b3b7e25b3253102da4022d31fc35907f21a2efd", "strip_prefix": "jdk-17.0.8.1+1", "urls": [ "https://mirror.bazel.build/github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.8.1%2B1/OpenJDK17U-jdk_ppc64le_linux_hotspot_17.0.8.1_1.tar.gz", "https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.8.1%2B1/OpenJDK17U-jdk_ppc64le_linux_hotspot_17.0.8.1_1.tar.gz" ] } }, "remotejdk21_linux_aarch64_toolchain_config_repo": { "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", "ruleClassName": "_toolchain_config", "attributes": { "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_21\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"21\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk21_linux_aarch64//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk21_linux_aarch64//:jdk\",\n)\n" } }, "remotejdk11_win_arm64_toolchain_config_repo": { "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", "ruleClassName": "_toolchain_config", "attributes": { "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_11\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"11\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:windows\", \"@platforms//cpu:arm64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk11_win_arm64//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:windows\", \"@platforms//cpu:arm64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk11_win_arm64//:jdk\",\n)\n" } }, "local_jdk": { "bzlFile": "@@rules_java~//toolchains:local_java_repository.bzl", "ruleClassName": "_local_java_repository_rule", "attributes": { "java_home": "", "version": "", "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = {RUNTIME_VERSION},\n)\n" } }, "remote_java_tools_darwin_x86_64": { "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", "ruleClassName": "http_archive", "attributes": { "sha256": "4523aec4d09c587091a2dae6f5c9bc6922c220f3b6030e5aba9c8f015913cc65", "urls": [ "https://mirror.bazel.build/bazel_java_tools/releases/java/v13.4/java_tools_darwin_x86_64-v13.4.zip", "https://github.com/bazelbuild/java_tools/releases/download/java_v13.4/java_tools_darwin_x86_64-v13.4.zip" ] } }, "remote_java_tools": { "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", "ruleClassName": "http_archive", "attributes": { "sha256": "e025fd260ac39b47c111f5212d64ec0d00d85dec16e49368aae82fc626a940cf", "urls": [ "https://mirror.bazel.build/bazel_java_tools/releases/java/v13.4/java_tools-v13.4.zip", "https://github.com/bazelbuild/java_tools/releases/download/java_v13.4/java_tools-v13.4.zip" ] } }, "remotejdk17_linux_s390x": { "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", "ruleClassName": "http_archive", "attributes": { "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 17,\n)\n", "sha256": "ffacba69c6843d7ca70d572489d6cc7ab7ae52c60f0852cedf4cf0d248b6fc37", "strip_prefix": "jdk-17.0.8.1+1", "urls": [ "https://mirror.bazel.build/github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.8.1%2B1/OpenJDK17U-jdk_s390x_linux_hotspot_17.0.8.1_1.tar.gz", "https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.8.1%2B1/OpenJDK17U-jdk_s390x_linux_hotspot_17.0.8.1_1.tar.gz" ] } }, "remotejdk17_win_toolchain_config_repo": { "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", "ruleClassName": "_toolchain_config", "attributes": { "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_17\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"17\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:windows\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk17_win//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:windows\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk17_win//:jdk\",\n)\n" } }, "remotejdk11_linux_ppc64le": { "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", "ruleClassName": "http_archive", "attributes": { "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 11,\n)\n", "sha256": "a8fba686f6eb8ae1d1a9566821dbd5a85a1108b96ad857fdbac5c1e4649fc56f", "strip_prefix": "jdk-11.0.15+10", "urls": [ "https://mirror.bazel.build/github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.15+10/OpenJDK11U-jdk_ppc64le_linux_hotspot_11.0.15_10.tar.gz", "https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.15+10/OpenJDK11U-jdk_ppc64le_linux_hotspot_11.0.15_10.tar.gz" ] } }, "remotejdk11_macos_aarch64": { "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", "ruleClassName": "http_archive", "attributes": { "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 11,\n)\n", "sha256": "7632bc29f8a4b7d492b93f3bc75a7b61630894db85d136456035ab2a24d38885", "strip_prefix": "zulu11.66.15-ca-jdk11.0.20-macosx_aarch64", "urls": [ "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-macosx_aarch64.tar.gz", "https://cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-macosx_aarch64.tar.gz" ] } }, "remotejdk21_win_toolchain_config_repo": { "bzlFile": "@@rules_java~//toolchains:remote_java_repository.bzl", "ruleClassName": "_toolchain_config", "attributes": { "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_21\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"21\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:windows\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk21_win//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:windows\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk21_win//:jdk\",\n)\n" } } }, "recordedRepoMappingEntries": [ [ "rules_java~", "bazel_tools", "bazel_tools" ], [ "rules_java~", "remote_java_tools", "rules_java~~toolchains~remote_java_tools" ] ] } } } } flatbuffers-24.12.23/Package.swift000066400000000000000000000017231473234705300166740ustar00rootroot00000000000000// swift-tools-version:5.8 /* * Copyright 2020 Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import PackageDescription let package = Package( name: "FlatBuffers", platforms: [ .iOS(.v11), .macOS(.v10_14), ], products: [ .library( name: "FlatBuffers", targets: ["FlatBuffers"]), ], targets: [ .target( name: "FlatBuffers", dependencies: [], path: "swift/Sources"), ]) flatbuffers-24.12.23/README.md000066400000000000000000000122271473234705300155430ustar00rootroot00000000000000![logo](http://google.github.io/flatbuffers/fpl_logo_small.png) FlatBuffers =========== ![Build status](https://github.com/google/flatbuffers/actions/workflows/build.yml/badge.svg?branch=master) [![BuildKite status](https://badge.buildkite.com/7979d93bc6279aa539971f271253c65d5e8fe2fe43c90bbb25.svg)](https://buildkite.com/bazel/flatbuffers) [![Fuzzing Status](https://oss-fuzz-build-logs.storage.googleapis.com/badges/flatbuffers.svg)](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:flatbuffers) [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/google/flatbuffers/badge)](https://api.securityscorecards.dev/projects/github.com/google/flatbuffers) [![Join the chat at https://gitter.im/google/flatbuffers](https://badges.gitter.im/google/flatbuffers.svg)](https://gitter.im/google/flatbuffers?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Discord Chat](https://img.shields.io/discord/656202785926152206.svg)](https:///discord.gg/6qgKs3R) [![Twitter Follow](https://img.shields.io/twitter/follow/wvo.svg?style=social)](https://twitter.com/wvo) [![Twitter Follow](https://img.shields.io/twitter/follow/dbaileychess.svg?style=social)](https://twitter.com/dbaileychess) **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 compilation (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 - Windows - macOS - Linux - Android - And any others with a recent C++ compiler (C++ 11 and newer) ## Supported programming languages Code generation and runtime libraries for many popular languages. 1. C 1. C++ - [snapcraft.io](https://snapcraft.io/flatbuffers) 1. C# - [nuget.org](https://www.nuget.org/packages/Google.FlatBuffers) 1. Dart - [pub.dev](https://pub.dev/packages/flat_buffers) 1. Go - [go.dev](https://pkg.go.dev/github.com/google/flatbuffers) 1. Java - [Maven](https://search.maven.org/artifact/com.google.flatbuffers/flatbuffers-java) 1. JavaScript - [NPM](https://www.npmjs.com/package/flatbuffers) 1. Kotlin 1. Lobster 1. Lua 1. PHP 1. Python - [PyPI](https://pypi.org/project/flatbuffers/) 1. Rust - [crates.io](https://crates.io/crates/flatbuffers) 1. Swift - [swiftpackageindex](https://swiftpackageindex.com/google/flatbuffers) 1. TypeScript - [NPM](https://www.npmjs.com/package/flatbuffers) 1. Nim ## Versioning FlatBuffers does not follow traditional SemVer versioning (see [rationale](https://github.com/google/flatbuffers/wiki/Versioning)) but rather uses a format of the date of the release. ## Contribution * [FlatBuffers Issues Tracker][] to submit an issue. * [stackoverflow.com][] with [`flatbuffers` tag][] for any questions regarding FlatBuffers. *To contribute to this project,* see [CONTRIBUTING][]. ## Community * [Discord Server](https:///discord.gg/6qgKs3R) ## Security Please see our [Security Policy](SECURITY.md) for reporting vulnerabilities. ## Licensing *Flatbuffers* is licensed under the Apache License, Version 2.0. See [LICENSE][] for the full license text.
[CONTRIBUTING]: http://github.com/google/flatbuffers/blob/master/CONTRIBUTING.md [`flatbuffers` tag]: https://stackoverflow.com/questions/tagged/flatbuffers [FlatBuffers Google Group]: https://groups.google.com/forum/#!forum/flatbuffers [FlatBuffers Issues Tracker]: http://github.com/google/flatbuffers/issues [stackoverflow.com]: http://stackoverflow.com/search?q=flatbuffers [landing page]: https://google.github.io/flatbuffers [LICENSE]: https://github.com/google/flatbuffers/blob/master/LICENSE flatbuffers-24.12.23/SECURITY.md000066400000000000000000000007411473234705300160530ustar00rootroot00000000000000# Security Policy ## Reporting a Vulnerability To report a security issue, please use http://g.co/vulnz. We use http://g.co/vulnz for our intake, and do coordination and disclosure here on GitHub (including using GitHub Security Advisory). The Google Security Team will respond within 5 working days of your report on g.co/vulnz. Select the `I want to report a technical security or an abuse risk related bug in a Google product (SQLi, XSS, etc.)` option and complete the form. flatbuffers-24.12.23/WORKSPACE000066400000000000000000000155551473234705300155540ustar00rootroot00000000000000workspace(name = "com_github_google_flatbuffers") load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file") http_archive( name = "platforms", sha256 = "3a561c99e7bdbe9173aa653fd579fe849f1d8d67395780ab4770b1f381431d51", urls = [ "https://mirror.bazel.build/github.com/bazelbuild/platforms/releases/download/0.0.7/platforms-0.0.7.tar.gz", "https://github.com/bazelbuild/platforms/releases/download/0.0.7/platforms-0.0.7.tar.gz", ], ) # Import our own version of skylib before other rule sets (e.g. rules_swift) # has a chance to import an old version. http_archive( name = "bazel_skylib", sha256 = "66ffd9315665bfaafc96b52278f57c7e2dd09f5ede279ea6d39b2be471e7e3aa", urls = [ "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.4.2/bazel-skylib-1.4.2.tar.gz", "https://github.com/bazelbuild/bazel-skylib/releases/download/1.4.2/bazel-skylib-1.4.2.tar.gz", ], ) load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace") bazel_skylib_workspace() http_archive( name = "build_bazel_rules_apple", sha256 = "34c41bfb59cdaea29ac2df5a2fa79e5add609c71bb303b2ebb10985f93fa20e7", url = "https://github.com/bazelbuild/rules_apple/releases/download/3.1.1/rules_apple.3.1.1.tar.gz", ) load( "@build_bazel_rules_apple//apple:repositories.bzl", "apple_rules_dependencies", ) apple_rules_dependencies() http_archive( name = "build_bazel_rules_swift", sha256 = "a2fd565e527f83fb3f9eb07eb9737240e668c9242d3bc318712efa54a7deda97", url = "https://github.com/bazelbuild/rules_swift/releases/download/0.27.0/rules_swift.0.27.0.tar.gz", ) load( "@build_bazel_rules_swift//swift:repositories.bzl", "swift_rules_dependencies", ) swift_rules_dependencies() load( "@build_bazel_rules_swift//swift:extras.bzl", "swift_rules_extra_dependencies", ) swift_rules_extra_dependencies() http_archive( name = "io_bazel_rules_go", sha256 = "278b7ff5a826f3dc10f04feaf0b70d48b68748ccd512d7f98bf442077f043fe3", urls = [ "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.41.0/rules_go-v0.41.0.zip", "https://github.com/bazelbuild/rules_go/releases/download/v0.41.0/rules_go-v0.41.0.zip", ], ) load("@io_bazel_rules_go//go:deps.bzl", "go_rules_dependencies") go_rules_dependencies() ##### Protobuf _PROTOBUF_VERSION = "3.15.2" http_archive( name = "com_google_protobuf", strip_prefix = "protobuf-" + _PROTOBUF_VERSION, urls = [ "https://github.com/protocolbuffers/protobuf/archive/v" + _PROTOBUF_VERSION + ".tar.gz", ], ) #### Building boring ssl # Fetching boringssl within the flatbuffers repository, to patch the issue # of not being able to upgrade to Xcode 14.3 due to buildkite throwing errors # which was patched in the following below. # https://github.com/google/flatbuffers/commit/67eb95de9281087ccbba9aafd6e8ab1958d12045 # The patch was copied from the following comment on the same issue within tensorflow # and fixed to adapt the already existing patch for boringssl. # https://github.com/tensorflow/tensorflow/issues/60191#issuecomment-1496073147 http_archive( name = "boringssl", patch_args = ["-p1"], patches = ["//grpc:boringssl.patch"], # Use github mirror instead of https://boringssl.googlesource.com/boringssl # to obtain a boringssl archive with consistent sha256 sha256 = "534fa658bd845fd974b50b10f444d392dfd0d93768c4a51b61263fd37d851c40", strip_prefix = "boringssl-b9232f9e27e5668bc0414879dcdedb2a59ea75f2", urls = [ "https://storage.googleapis.com/grpc-bazel-mirror/github.com/google/boringssl/archive/b9232f9e27e5668bc0414879dcdedb2a59ea75f2.tar.gz", "https://github.com/google/boringssl/archive/b9232f9e27e5668bc0414879dcdedb2a59ea75f2.tar.gz", ], ) ##### GRPC _GRPC_VERSION = "1.49.0" # https://github.com/grpc/grpc/releases/tag/v1.48.0 http_archive( name = "com_github_grpc_grpc", patch_args = ["-p1"], patches = ["//grpc:build_grpc_with_cxx14.patch"], sha256 = "15715e1847cc9e42014f02c727dbcb48e39dbdb90f79ad3d66fe4361709ff935", strip_prefix = "grpc-" + _GRPC_VERSION, urls = ["https://github.com/grpc/grpc/archive/refs/tags/v" + _GRPC_VERSION + ".tar.gz"], ) load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps") grpc_deps() load("@com_github_grpc_grpc//bazel:grpc_extra_deps.bzl", "grpc_extra_deps") grpc_extra_deps() # rules_go from https://github.com/bazelbuild/rules_go/releases/tag/v0.34.0 http_archive( name = "aspect_rules_js", sha256 = "76a04ef2120ee00231d85d1ff012ede23963733339ad8db81f590791a031f643", strip_prefix = "rules_js-1.34.1", url = "https://github.com/aspect-build/rules_js/releases/download/v1.34.1/rules_js-v1.34.1.tar.gz", ) load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies") rules_js_dependencies() load("@aspect_rules_js//npm:npm_import.bzl", "pnpm_repository") pnpm_repository(name = "pnpm") http_archive( name = "aspect_rules_ts", sha256 = "4c3f34fff9f96ffc9c26635d8235a32a23a6797324486c7d23c1dfa477e8b451", strip_prefix = "rules_ts-1.4.5", url = "https://github.com/aspect-build/rules_ts/releases/download/v1.4.5/rules_ts-v1.4.5.tar.gz", ) load("@aspect_rules_ts//ts:repositories.bzl", "rules_ts_dependencies") rules_ts_dependencies( # Since rules_ts doesn't always have the newest integrity hashes, we # compute it manually here. # $ curl --silent https://registry.npmjs.org/typescript/5.3.3 | jq ._integrity ts_integrity = "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", ts_version_from = "//:package.json", ) load("@rules_nodejs//nodejs:repositories.bzl", "DEFAULT_NODE_VERSION", "nodejs_register_toolchains") nodejs_register_toolchains( name = "nodejs", node_version = DEFAULT_NODE_VERSION, ) load("@com_github_google_flatbuffers//ts:repositories.bzl", "flatbuffers_npm") flatbuffers_npm( name = "flatbuffers_npm", ) load("@flatbuffers_npm//:repositories.bzl", "npm_repositories") npm_repositories() http_archive( name = "aspect_rules_esbuild", sha256 = "098e38e5ee868c14a6484ba263b79e57d48afacfc361ba30137c757a9c4716d6", strip_prefix = "rules_esbuild-0.15.0", url = "https://github.com/aspect-build/rules_esbuild/releases/download/v0.15.0/rules_esbuild-v0.15.0.tar.gz", ) # Register a toolchain containing esbuild npm package and native bindings load("@aspect_rules_esbuild//esbuild:repositories.bzl", "LATEST_ESBUILD_VERSION", "esbuild_register_toolchains") esbuild_register_toolchains( name = "esbuild", esbuild_version = LATEST_ESBUILD_VERSION, ) http_file( name = "bazel_linux_x86_64", downloaded_file_path = "bazel", executable = True, sha256 = "e78fc3394deae5408d6f49a15c7b1e615901969ecf6e50d55ef899996b0b8458", urls = [ "https://github.com/bazelbuild/bazel/releases/download/6.3.2/bazel-6.3.2-linux-x86_64", ], ) flatbuffers-24.12.23/android/000077500000000000000000000000001473234705300157005ustar00rootroot00000000000000flatbuffers-24.12.23/android/.project000066400000000000000000000007671473234705300173610ustar00rootroot00000000000000 FlatBufferTest 1672434305228 30 org.eclipse.core.resources.regexFilterMatcher node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ flatbuffers-24.12.23/android/AndroidManifest.xml000066400000000000000000000026171473234705300214770ustar00rootroot00000000000000 flatbuffers-24.12.23/android/app/000077500000000000000000000000001473234705300164605ustar00rootroot00000000000000flatbuffers-24.12.23/android/app/.gitignore000066400000000000000000000000071473234705300204450ustar00rootroot00000000000000/build flatbuffers-24.12.23/android/app/build.gradle000066400000000000000000000062371473234705300207470ustar00rootroot00000000000000apply plugin: 'com.android.application' apply plugin: 'kotlin-android' android { compileSdk 33 defaultConfig { applicationId "com.flatbuffers.app" minSdkVersion 26 targetSdkVersion 33 versionCode 1 versionName "1.0" compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } sourceSets { main { java { srcDir '../../java/src/main/java/' } } } ndk { abiFilters 'arm64-v8a', 'armeabi-v7a' } testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" externalNativeBuild { cmake { arguments "-DFLATBUFFERS_SRC=${rootProject.projectDir}/.." } } } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } externalNativeBuild { cmake { path "src/main/cpp/CMakeLists.txt" } } task generateFbsCpp(type: Exec) { def inputDir = file("$projectDir/src/main/fbs") def outputCppDir = file("$projectDir/src/main/cpp/generated/") def fbsFiles = layout.files { file(inputDir).listFiles() }.filter { File f -> f.name.endsWith(".fbs") }.toList() ignoreExitValue(true) standardOutput = new ByteArrayOutputStream() errorOutput = new ByteArrayOutputStream() def commandLineArgs = ['flatc', '-o', outputCppDir, '--cpp'] fbsFiles.forEach{ commandLineArgs.add(it.path) } commandLine commandLineArgs doFirst { delete "$outputCppDir/" mkdir "$outputCppDir/" } doLast { if (executionResult.get().exitValue != 0) { throw new GradleException("flatc failed with: ${executionResult.get().toString()}") } } } task generateFbsKotlin(type: Exec) { def inputDir = file("$projectDir/src/main/fbs") def outputKotlinDir = file("$projectDir/src/main/java/generated/") def fbsFiles = layout.files { file(inputDir).listFiles() }.filter { File f -> f.name.endsWith(".fbs") }.toList() ignoreExitValue(true) standardOutput = new ByteArrayOutputStream() errorOutput = new ByteArrayOutputStream() setErrorOutput(errorOutput) setStandardOutput(standardOutput) def commandLineArgs = ['flatc', '-o', outputKotlinDir, '--kotlin'] fbsFiles.forEach{ commandLineArgs.add(it.path) } commandLine commandLineArgs doFirst { delete "$outputKotlinDir/" mkdir "$outputKotlinDir/" } doLast { if (executionResult.get().exitValue != 0) { throw new GradleException("flatc failed with: ${executionResult.get().toString()}") } } } afterEvaluate { tasks.named("preBuild") { dependsOn(generateFbsKotlin) dependsOn(generateFbsCpp) } } namespace 'com.flatbuffers.app' } dependencies { implementation fileTree(dir: "libs", include: ["*.jar"]) implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" implementation 'androidx.appcompat:appcompat:1.6.1' // If you using java runtime you can add its dependency as the example below // implementation 'com.google.flatbuffers:flatbuffers-java:$latest_version' } flatbuffers-24.12.23/android/app/proguard-rules.pro000066400000000000000000000013571473234705300221630ustar00rootroot00000000000000# Add project specific ProGuard rules here. # You can control the set of applied configuration files using the # proguardFiles setting in build.gradle. # # For more details, see # http://developer.android.com/guide/developing/tools/proguard.html # If your project uses WebView with JS, uncomment the following # and specify the fully qualified class name to the JavaScript interface # class: #-keepclassmembers class fqcn.of.javascript.interface.for.webview { # public *; #} # Uncomment this to preserve the line number information for # debugging stack traces. #-keepattributes SourceFile,LineNumberTable # If you keep the line number information, uncomment this to # hide the original source file name. #-renamesourcefileattribute SourceFile flatbuffers-24.12.23/android/app/src/000077500000000000000000000000001473234705300172475ustar00rootroot00000000000000flatbuffers-24.12.23/android/app/src/main/000077500000000000000000000000001473234705300201735ustar00rootroot00000000000000flatbuffers-24.12.23/android/app/src/main/AndroidManifest.xml000066400000000000000000000012061473234705300237630ustar00rootroot00000000000000 flatbuffers-24.12.23/android/app/src/main/cpp/000077500000000000000000000000001473234705300207555ustar00rootroot00000000000000flatbuffers-24.12.23/android/app/src/main/cpp/CMakeLists.txt000066400000000000000000000035371473234705300235250ustar00rootroot00000000000000# For more information about using CMake with Android Studio, read the # documentation: https://d.android.com/studio/projects/add-native-code.html # Sets the minimum version of CMake required to build the native library. cmake_minimum_required(VERSION 3.4.1) # Creates and names a library, sets it as either STATIC # or SHARED, and provides the relative paths to its source code. # You can define multiple libraries, and CMake builds them for you. # Gradle automatically packages shared libraries with your APK. include_directories(${FLATBUFFERS_SRC}/include) add_subdirectory(flatbuffers) FILE(GLOB Generated_SRCS generated/*.h) add_library( # Sets the name of the library. native-lib # Sets the library as a shared library. SHARED # Provides a relative path to your source file(s). animals.cpp ${Generated_SRCS} ) # Searches for a specified prebuilt library and stores the path as a # variable. Because CMake includes system libraries in the search path by # default, you only need to specify the name of the public NDK library # you want to add. CMake verifies that the library exists before # completing its build. find_library( # Sets the name of the path variable. log-lib # Specifies the name of the NDK library that # you want CMake to locate. log ) # Specifies libraries CMake should link to your target library. You # can link multiple libraries, such as libraries you define in this # build script, prebuilt third-party libraries, or system libraries. target_link_libraries( # Specifies the target library. native-lib flatbuffers # Links the target library to the log library # included in the NDK. ${log-lib} ) flatbuffers-24.12.23/android/app/src/main/cpp/animals.cpp000066400000000000000000000024651473234705300231140ustar00rootroot00000000000000/* * Copyright 2014 Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include #include #include #include "generated/animal_generated.h" using namespace com::fbs::app; using namespace flatbuffers; extern "C" JNIEXPORT jbyteArray JNICALL Java_com_flatbuffers_app_MainActivity_createAnimalFromJNI( JNIEnv* env, jobject /* this */) { // create a new animal flatbuffers auto fb = FlatBufferBuilder(1024); auto tiger = CreateAnimalDirect(fb, "Tiger", "Roar", 300); fb.Finish(tiger); // copies it to a Java byte array. auto buf = reinterpret_cast(fb.GetBufferPointer()); int size = fb.GetSize(); auto ret = env->NewByteArray(size); env->SetByteArrayRegion (ret, 0, fb.GetSize(), buf); return ret; } flatbuffers-24.12.23/android/app/src/main/cpp/flatbuffers/000077500000000000000000000000001473234705300232605ustar00rootroot00000000000000flatbuffers-24.12.23/android/app/src/main/cpp/flatbuffers/CMakeLists.txt000066400000000000000000000047741473234705300260340ustar00rootroot00000000000000# For more information about using CMake with Android Studio, read the # documentation: https://d.android.com/studio/projects/add-native-code.html # Sets the minimum version of CMake required to build the native library. cmake_minimum_required(VERSION 3.4.1) include_directories(${FLATBUFFERS_SRC}/include) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11 -fexceptions -Wall -DFLATBUFFERS_TRACK_VERIFIER_BUFFER_SIZE") # Certain platforms such as ARM do not use signed chars by default # which causes issues with certain bounds checks. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsigned-char") set(FlatBuffers_Library_SRCS ${FLATBUFFERS_SRC}/include/flatbuffers/allocator.h ${FLATBUFFERS_SRC}/include/flatbuffers/array.h ${FLATBUFFERS_SRC}/include/flatbuffers/base.h ${FLATBUFFERS_SRC}/include/flatbuffers/buffer.h ${FLATBUFFERS_SRC}/include/flatbuffers/buffer_ref.h ${FLATBUFFERS_SRC}/include/flatbuffers/default_allocator.h ${FLATBUFFERS_SRC}/include/flatbuffers/detached_buffer.h ${FLATBUFFERS_SRC}/include/flatbuffers/flatbuffer_builder.h ${FLATBUFFERS_SRC}/include/flatbuffers/flatbuffers.h ${FLATBUFFERS_SRC}/include/flatbuffers/flexbuffers.h ${FLATBUFFERS_SRC}/include/flatbuffers/flex_flat_util.h ${FLATBUFFERS_SRC}/include/flatbuffers/hash.h ${FLATBUFFERS_SRC}/include/flatbuffers/idl.h ${FLATBUFFERS_SRC}/include/flatbuffers/minireflect.h ${FLATBUFFERS_SRC}/include/flatbuffers/reflection.h ${FLATBUFFERS_SRC}/include/flatbuffers/reflection_generated.h ${FLATBUFFERS_SRC}/include/flatbuffers/registry.h ${FLATBUFFERS_SRC}/include/flatbuffers/stl_emulation.h ${FLATBUFFERS_SRC}/include/flatbuffers/string.h ${FLATBUFFERS_SRC}/include/flatbuffers/struct.h ${FLATBUFFERS_SRC}/include/flatbuffers/table.h ${FLATBUFFERS_SRC}/include/flatbuffers/util.h ${FLATBUFFERS_SRC}/include/flatbuffers/vector.h ${FLATBUFFERS_SRC}/include/flatbuffers/vector_downward.h ${FLATBUFFERS_SRC}/include/flatbuffers/verifier.h ${FLATBUFFERS_SRC}/src/idl_parser.cpp ${FLATBUFFERS_SRC}/src/idl_gen_text.cpp ${FLATBUFFERS_SRC}/src/reflection.cpp ${FLATBUFFERS_SRC}/src/util.cpp ${FLATBUFFERS_SRC}/src/idl_gen_fbs.cpp ${FLATBUFFERS_SRC}/src/code_generators.cpp ) add_library( # Sets the name of the library. flatbuffers ${FlatBuffers_Library_SRCS} ${Generated_SRCS} ) flatbuffers-24.12.23/android/app/src/main/cpp/generated/000077500000000000000000000000001473234705300227135ustar00rootroot00000000000000flatbuffers-24.12.23/android/app/src/main/cpp/generated/animal_generated.h000066400000000000000000000100341473234705300263410ustar00rootroot00000000000000// automatically generated by the FlatBuffers compiler, do not modify #ifndef FLATBUFFERS_GENERATED_ANIMAL_COM_FBS_APP_H_ #define FLATBUFFERS_GENERATED_ANIMAL_COM_FBS_APP_H_ #include "flatbuffers/flatbuffers.h" // Ensure the included flatbuffers.h is the same version as when this file was // generated, otherwise it may not be compatible. static_assert(FLATBUFFERS_VERSION_MAJOR == 24 && FLATBUFFERS_VERSION_MINOR == 12 && FLATBUFFERS_VERSION_REVISION == 23, "Non-compatible flatbuffers version included"); namespace com { namespace fbs { namespace app { struct Animal; struct AnimalBuilder; struct Animal FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { typedef AnimalBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_NAME = 4, VT_SOUND = 6, VT_WEIGHT = 8 }; const ::flatbuffers::String *name() const { return GetPointer(VT_NAME); } const ::flatbuffers::String *sound() const { return GetPointer(VT_SOUND); } uint16_t weight() const { return GetField(VT_WEIGHT, 0); } bool Verify(::flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyOffset(verifier, VT_NAME) && verifier.VerifyString(name()) && VerifyOffset(verifier, VT_SOUND) && verifier.VerifyString(sound()) && VerifyField(verifier, VT_WEIGHT, 2) && verifier.EndTable(); } }; struct AnimalBuilder { typedef Animal Table; ::flatbuffers::FlatBufferBuilder &fbb_; ::flatbuffers::uoffset_t start_; void add_name(::flatbuffers::Offset<::flatbuffers::String> name) { fbb_.AddOffset(Animal::VT_NAME, name); } void add_sound(::flatbuffers::Offset<::flatbuffers::String> sound) { fbb_.AddOffset(Animal::VT_SOUND, sound); } void add_weight(uint16_t weight) { fbb_.AddElement(Animal::VT_WEIGHT, weight, 0); } explicit AnimalBuilder(::flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } ::flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); auto o = ::flatbuffers::Offset(end); return o; } }; inline ::flatbuffers::Offset CreateAnimal( ::flatbuffers::FlatBufferBuilder &_fbb, ::flatbuffers::Offset<::flatbuffers::String> name = 0, ::flatbuffers::Offset<::flatbuffers::String> sound = 0, uint16_t weight = 0) { AnimalBuilder builder_(_fbb); builder_.add_sound(sound); builder_.add_name(name); builder_.add_weight(weight); return builder_.Finish(); } inline ::flatbuffers::Offset CreateAnimalDirect( ::flatbuffers::FlatBufferBuilder &_fbb, const char *name = nullptr, const char *sound = nullptr, uint16_t weight = 0) { auto name__ = name ? _fbb.CreateString(name) : 0; auto sound__ = sound ? _fbb.CreateString(sound) : 0; return com::fbs::app::CreateAnimal( _fbb, name__, sound__, weight); } inline const com::fbs::app::Animal *GetAnimal(const void *buf) { return ::flatbuffers::GetRoot(buf); } inline const com::fbs::app::Animal *GetSizePrefixedAnimal(const void *buf) { return ::flatbuffers::GetSizePrefixedRoot(buf); } inline bool VerifyAnimalBuffer( ::flatbuffers::Verifier &verifier) { return verifier.VerifyBuffer(nullptr); } inline bool VerifySizePrefixedAnimalBuffer( ::flatbuffers::Verifier &verifier) { return verifier.VerifySizePrefixedBuffer(nullptr); } inline void FinishAnimalBuffer( ::flatbuffers::FlatBufferBuilder &fbb, ::flatbuffers::Offset root) { fbb.Finish(root); } inline void FinishSizePrefixedAnimalBuffer( ::flatbuffers::FlatBufferBuilder &fbb, ::flatbuffers::Offset root) { fbb.FinishSizePrefixed(root); } } // namespace app } // namespace fbs } // namespace com #endif // FLATBUFFERS_GENERATED_ANIMAL_COM_FBS_APP_H_ flatbuffers-24.12.23/android/app/src/main/fbs/000077500000000000000000000000001473234705300207455ustar00rootroot00000000000000flatbuffers-24.12.23/android/app/src/main/fbs/animal.fbs000066400000000000000000000013171473234705300227040ustar00rootroot00000000000000// Copyright 2015 Google Inc. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. namespace com.fbs.app; table Animal { name:string; sound:string; weight: uint16; } root_type Animal; flatbuffers-24.12.23/android/app/src/main/java/000077500000000000000000000000001473234705300211145ustar00rootroot00000000000000flatbuffers-24.12.23/android/app/src/main/java/com/000077500000000000000000000000001473234705300216725ustar00rootroot00000000000000flatbuffers-24.12.23/android/app/src/main/java/com/flatbuffers/000077500000000000000000000000001473234705300241755ustar00rootroot00000000000000flatbuffers-24.12.23/android/app/src/main/java/com/flatbuffers/app/000077500000000000000000000000001473234705300247555ustar00rootroot00000000000000flatbuffers-24.12.23/android/app/src/main/java/com/flatbuffers/app/MainActivity.kt000066400000000000000000000031571473234705300277240ustar00rootroot00000000000000package com.flatbuffers.app import android.annotation.SuppressLint import androidx.appcompat.app.AppCompatActivity import android.os.Bundle import android.widget.TextView import com.fbs.app.Animal import com.google.flatbuffers.FlatBufferBuilder import java.nio.ByteBuffer @ExperimentalUnsignedTypes class MainActivity : AppCompatActivity() { @SuppressLint("SetTextI18n") override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) val tiger = Animal.getRootAsAnimal(ByteBuffer.wrap(createAnimalFromJNI())) findViewById(R.id.tv_animal_one).text = animalInfo(tiger) findViewById(R.id.tv_animal_two).text = animalInfo(createAnimalFromKotlin()) } // This function is a sample of communicating FlatBuffers between JNI (native C++) and Java. // Implementation can be found on animals.cpp file. private external fun createAnimalFromJNI(): ByteArray // Create a "Cow" Animal flatbuffers from Kotlin private fun createAnimalFromKotlin():Animal { val fb = FlatBufferBuilder(100) val cowOffset = Animal.createAnimal( builder = fb, nameOffset = fb.createString("Cow"), soundOffset = fb.createString("Moo"), weight = 720u ) fb.finish(cowOffset) return Animal.getRootAsAnimal(fb.dataBuffer()) } private fun animalInfo(animal: Animal): String = "The ${animal.name} sound is ${animal.sound} and it weights ${animal.weight}kg." companion object { // Used to load the 'native-lib' library on application startup. init { System.loadLibrary("native-lib") } } } flatbuffers-24.12.23/android/app/src/main/java/generated/000077500000000000000000000000001473234705300230525ustar00rootroot00000000000000flatbuffers-24.12.23/android/app/src/main/java/generated/com/000077500000000000000000000000001473234705300236305ustar00rootroot00000000000000flatbuffers-24.12.23/android/app/src/main/java/generated/com/fbs/000077500000000000000000000000001473234705300244025ustar00rootroot00000000000000flatbuffers-24.12.23/android/app/src/main/java/generated/com/fbs/app/000077500000000000000000000000001473234705300251625ustar00rootroot00000000000000flatbuffers-24.12.23/android/app/src/main/java/generated/com/fbs/app/Animal.kt000066400000000000000000000062671473234705300267360ustar00rootroot00000000000000// automatically generated by the FlatBuffers compiler, do not modify package com.fbs.app import com.google.flatbuffers.BaseVector import com.google.flatbuffers.BooleanVector import com.google.flatbuffers.ByteVector import com.google.flatbuffers.Constants import com.google.flatbuffers.DoubleVector import com.google.flatbuffers.FlatBufferBuilder import com.google.flatbuffers.FloatVector import com.google.flatbuffers.LongVector import com.google.flatbuffers.StringVector import com.google.flatbuffers.Struct import com.google.flatbuffers.Table import com.google.flatbuffers.UnionVector import java.nio.ByteBuffer import java.nio.ByteOrder import kotlin.math.sign @Suppress("unused") @kotlin.ExperimentalUnsignedTypes class Animal : Table() { fun __init(_i: Int, _bb: ByteBuffer) { __reset(_i, _bb) } fun __assign(_i: Int, _bb: ByteBuffer) : Animal { __init(_i, _bb) return this } val name : String? get() { val o = __offset(4) return if (o != 0) { __string(o + bb_pos) } else { null } } val nameAsByteBuffer : ByteBuffer get() = __vector_as_bytebuffer(4, 1) fun nameInByteBuffer(_bb: ByteBuffer) : ByteBuffer = __vector_in_bytebuffer(_bb, 4, 1) val sound : String? get() { val o = __offset(6) return if (o != 0) { __string(o + bb_pos) } else { null } } val soundAsByteBuffer : ByteBuffer get() = __vector_as_bytebuffer(6, 1) fun soundInByteBuffer(_bb: ByteBuffer) : ByteBuffer = __vector_in_bytebuffer(_bb, 6, 1) val weight : UShort get() { val o = __offset(8) return if(o != 0) bb.getShort(o + bb_pos).toUShort() else 0u } companion object { fun validateVersion() = Constants.FLATBUFFERS_24_12_23() fun getRootAsAnimal(_bb: ByteBuffer): Animal = getRootAsAnimal(_bb, Animal()) fun getRootAsAnimal(_bb: ByteBuffer, obj: Animal): Animal { _bb.order(ByteOrder.LITTLE_ENDIAN) return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)) } fun createAnimal(builder: FlatBufferBuilder, nameOffset: Int, soundOffset: Int, weight: UShort) : Int { builder.startTable(3) addSound(builder, soundOffset) addName(builder, nameOffset) addWeight(builder, weight) return endAnimal(builder) } fun startAnimal(builder: FlatBufferBuilder) = builder.startTable(3) fun addName(builder: FlatBufferBuilder, name: Int) = builder.addOffset(0, name, 0) fun addSound(builder: FlatBufferBuilder, sound: Int) = builder.addOffset(1, sound, 0) fun addWeight(builder: FlatBufferBuilder, weight: UShort) = builder.addShort(2, weight.toShort(), 0) fun endAnimal(builder: FlatBufferBuilder) : Int { val o = builder.endTable() return o } fun finishAnimalBuffer(builder: FlatBufferBuilder, offset: Int) = builder.finish(offset) fun finishSizePrefixedAnimalBuffer(builder: FlatBufferBuilder, offset: Int) = builder.finishSizePrefixed(offset) } } flatbuffers-24.12.23/android/app/src/main/res/000077500000000000000000000000001473234705300207645ustar00rootroot00000000000000flatbuffers-24.12.23/android/app/src/main/res/drawable-v24/000077500000000000000000000000001473234705300231565ustar00rootroot00000000000000flatbuffers-24.12.23/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml000066400000000000000000000032471473234705300304140ustar00rootroot00000000000000 flatbuffers-24.12.23/android/app/src/main/res/drawable/000077500000000000000000000000001473234705300225455ustar00rootroot00000000000000flatbuffers-24.12.23/android/app/src/main/res/drawable/ic_launcher_background.xml000066400000000000000000000127461473234705300277540ustar00rootroot00000000000000 flatbuffers-24.12.23/android/app/src/main/res/layout/000077500000000000000000000000001473234705300223015ustar00rootroot00000000000000flatbuffers-24.12.23/android/app/src/main/res/layout/activity_main.xml000066400000000000000000000013261473234705300256650ustar00rootroot00000000000000 flatbuffers-24.12.23/android/app/src/main/res/mipmap-anydpi-v26/000077500000000000000000000000001473234705300241445ustar00rootroot00000000000000flatbuffers-24.12.23/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml000066400000000000000000000004211473234705300271370ustar00rootroot00000000000000 flatbuffers-24.12.23/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml000066400000000000000000000004211473234705300303460ustar00rootroot00000000000000 flatbuffers-24.12.23/android/app/src/main/res/mipmap-hdpi/000077500000000000000000000000001473234705300231715ustar00rootroot00000000000000flatbuffers-24.12.23/android/app/src/main/res/mipmap-hdpi/ic_launcher.png000066400000000000000000000070111473234705300261520ustar00rootroot00000000000000‰PNG  IHDRHHUíŗG ĐIDATxÚí\iPTWM2IÕŦUų‘šĖdü‘ĒŠÉŸ¤T\Qöfé÷-$’q‰ ˛5tŗī¨I\0‰:q‰Š QÁY”}_D@ ĐTŒILâDŸÖ™ī{HÄæ=A)^ÕŠnŪy}īũ÷~ßš¯—įž=FŅcô=žņxŪ:WûâHĮôD´ŅBûÂHũŋ8ļŪ ØčŖ†č…>&YŅ“hŖMr2$%šˇoNâįRPR’Ü ›dyWâg<‚gޝ‘ãšmõŖx‘Ÿķ˜ÅąS ˀEęyáŧoļŋĸnKÎU’ĀpÖ?ĀÜļđNĮĮëųm[ņvûY~QÛ6,iß.Ë3Į×ČņÜ6÷!ĮķØxŒÆįģcIΝw!ņ•ū‰Ôk}ē’ķ,Z"`q!\0†sKĸ0§ũAŠc¸´& žyŪ­5E˜iØ$Ë3Į×ČņÜ6÷!ĮķØxŒ’<ÅäTs–B|Á8æß<Ä$F‡mc„ÚՐÜ-N3‰dįÖîY$Å1\õ)˜møP–ŸĄßˆY†Í˛Áʋģeų÷.îÄō‹ģdyæø9žÛæ>äxQŠķčØ,ŧŨ– ۓú/UYHęH_bĶNŦhT QFhD äP‘Ę>Ú5ApÖ'ÂĖq™•âŪŸâøĪU˜ĪmHđėsØËČŊžšÅâ퐞ÜÛd?Nū\ûČū™›'͎ZŸ ĖĶĢLŋū äX™Ęƒt7lä[0sĢȋHqŒäcÚģžĮ1‰gƒ1Īŧ׹SöõĖņ5Æį=¨­œë bÛ܇Üëylúî4ŽŪšEí۞Ø[ui7Ž Ø|åÔŗŸƒX˜3×qöz,eâķ–Í‘°ē~.'sÕŋ´‹mrÛ#"Iķ­ĶÂ-Ŧ˙z߯œĸ%ž_īĮöīrpāĮbœøšĨ7ZQtŖ™žWaīÕBlû.khģ`ŨõëëÂ/§ã&ĩÅmŽ˜*fE~N"čo]EÉøŠWî\ÃíģîŪģ‹{÷îI‚šÛwīāÛÛ?ãā%đ!/ßūIÛ9Ҟųæ|woË ō[čŧÛ%>S[ÜæˆˆĢĐįW‹pMøĨ߃Ûâ6ší!HI>haÛV¨[“Ę|¯†oGHqŒĩ—öā|įĨG.Ŗū‚ÛŦũĨCėCŽQŠS듄…ú-õAŠlÔÜ ) ÃFƒ9žg#ÅqBžØõÃÆÜį&Š1đØxŒRœ[{Š°Ø°|ßĶ_b\žšļ8=¨ŧiôSÃ2qųΞV˙ÔÄéAöĩsbßÃ^ ”+Ybų6ā‡Îk8Ō|ßŪŧÚožžų=ŌÛ qõÖĩ>÷™ümÖđˆ÷H?ÜšŪgđ7owbáÉ(ŒŨã…ŲY:\īzüŠöS× 8ŸÖ`Â+á]´ wēú\ķ}×5ˏ4|ÚOĨWĒbą ŗŽ‡bė^/ØĨûâĮ[×[ hÖXeųaÂą•Xp67ītJVļŨí90;6üRļÆãGڔʕä˛ËĐ–ėBŪĨKđˇ ÜŊ‹üoë^ģ5Wõĸé”Ōúl(Ō  ô8e>éJĻ렟&øŸ}ū  ÂāŨ˛ƒÆ¸mđĘüī5ŠÜaūĻ!į׊všg4XTšŒš><Ŗø{—˜mKŦ¸‰.}ĶygāZÛĸ0˜Õk‡6Í2l6âôĀąP ×ÂH(ō5˜Z¸æįĩC'Đʎ]øåέ>āRːâúō]}đ€—€@Ü#ā]Ŋ…Š‚m ”īĶ"c‘žĸ@æ:ąü˛ĪáR>vß;"ĖŧEšÆX†q—aü!oŒO{¯‡˙ ëôõP|á“ôå0ÉXAg…čs¸­ ĮWÁîd lŋ ĀÄŦ÷1ņäj“ž\ƒI§_­…Snls‚19gÁGĔÜõ˜’G8ã ˇ"¨0S üE˜ĀŧA;4e^‰‚ęgÜūwaqh5‡}$Å19B}ąļĮü$řpbėŋ$NJŠ3é4 ”GåKŠ3åŦ܊Ŗ)Ũˆ–ŲTšEĶJI$ŨĐEîxbæû÷ųģ"DŽøHŠcrt9lŽųÂö¸ŋ¤8܎ũŠ Ø~()Îäėup:Ŗ…m^ˆ¤8ŧŦÜJĸaGIēGžAĻ%˜VD˙Pí“đA˙ļ{s ”§ƒa}xÔG13C›Ŗ>°ĄåÄPdøBAÂ(ŽûÁ=+ ŗNę`›šļYhIĀŽ–”Íû¯‚0;' ž‡ė`8䄈Pæj ĖĶ@u& 0ģ ŽųZ8 up, ‡S1Ą$oWlƜōD8—EÁš< ę Be4ÔU1P×Ä‹[ļ ėmŸūžq¨jŠƒÕi(Ķũá’A˙­#k`~t ,Ō×Â"ƒplÁęŦ¸fi`yb=,3}a™å Ģ“~°:Åđ‡{N8Ürt°ĘŪëėXįĀ&'6š„ŧ Qœ\ŠB  dŦ(Ԉ9‡—•mq”'ÃŊ<ve:ؕë`_.ÂĄ’œU¸āY—ķc>Cs˕+†Mv íŊüZVŊ˛â„?ėhöô^VŊ˛ÃéØŅėéŊŦz'dį| :?ôĄeՓyYÍ(‹…}ŠN\VĻ”{LË1­,H\bĶ*BUu&Y1t÷¤ÕM pÎ “‡sŽ"“Ę ‡sŽ2›ĸ*%%įuÍÚRH‰Ã9ĮŊ‚ĸŲĶWœ`LĢ kĸ0åЊĄŊiīŲŧI Î$Ŗo)Wˆy'PRNČĘ ė)īH‰Ã Y]ûÂ0Iq8!ģWÆÁž<\Bœ`L¯ŌŽĩҘrdÅĐŋíÀƒ4ŽVŠ“ÄR.įsT,PnˆŦĪQEŗ”8ŧŦX Ę9}Å Áôj¨.fx$ūŨ.Øģ”ŗ äR.įsTšĄp Š%įs\Š#áP¤•‡—ÕĖĒx(BBBM¨ātn8 ĉ›Dâ {rŽ­X΃e}Ž*/TܕËų—¨X')/Ģ™Õ bÅę+ŽĶkŸ€@ƒņ1`ÖMbî`¯Ä>gnN TŲq99æ„‘f ;d§3aĸĪ™Op.ĐÁš0\/+uq„(û.å.eŅp­ˆk%#ŽUąpĢŽƒ÷šmXXˇ3jã1Ŗ.îõ‰Ũ8Ÿ÷†DaqĶGäÍđ9éÁú šÃ…XXÃ%[+úKōL–äuŦr°Ę%äŅ (ˆ}ß!´Î'ķY›BB‘FĜōŅį(Jà(#”kĄ¨ w]AæŗR'Šã^›ģšØÕFžŽp.J„˛>JđhLYúÚáųĮ‘––’ļr>Įĩ<ĘōŸC‘SVQ)—fõ$PcL3V÷˙ģVĄƒū!Ι-)`ÉRîDFPÅe\ÆįpŪQQ•’ö9!đ¨O†Ē.ZJ˜ŗ@Mņ˜rlÍ@fPČÆ§ņ…:Žn´qĩrĸ¤Ŧĸe(įsÜ(!Ģ*"e|Î}¨Rõ‡ļAæ ŨMN[‘ÚoČ†/gPs¸`~!|p?L"qāŊKšU,UąNÖį¸UÅAU)ãs4đ8ŸŌ-‘8fįéąI':éˇRæ,įX'n÷~éqŋÔûÂ?íΆT‰â´D,To¨[…9ö9ßWđä/ũĘđnúafûĻį.čĶ’@aĘYajžŋ .‹uÂÔÂajQ€`Z(ōĻĨA‚iY@å\pNJxãÉ{+Ū>°CfČ>ĮŖ!EpĒ8!sÎ1?O ™Ãâ˜5haųÅēZŠqŒëãūЀįAOčå1ö&V–YžĩĘÚ(85“'iMüsõÂĢmĮCįzcžžĘŧ!U–_¤ß ~oęĄķԇíŸėŠBáYŌ8ؕ„ŅŽ\KOBšŽx¸…XPC{ŊĒTÕäĢj")!GQÎ!œ‹†#aIĶx6n„cC,œ Mq"”Õ‘°H_W÷/ś ŽŅZkũâsũ9^ˇ~ũôđaü— ņ;—ßû°Éžw™ėķN3Ũˇ<ÍâĀę4~n˛wY÷cĪs‚éž•iûV=āŒŽ™NŧķÜØÔ%i“ˇ.%xĨŨē¨Û Š‹Dnėö%iϟx§Mūø´qŸ,Ŋ%ŨØé•6n—WšŲŽåi“˙Gííz'Íä3ķžwũxé^Ž…câØÆLķ§üøÂķ¯M|íĪôøÂoŪzÆņæũX^}uėĢáū#'žôōø×_ūÛ¯Ŋō×ŋú÷gĮÂ1 ÆīĢÄī× +w Ë˙0ÁĪFå×ņxĨEuX–MMø>ŖŠ Wú-Õ!]gG­ņŠoĻ@wöĄĖŠÚöŽ]ÍGģę/Žãūš]uĖ¨Š€ĩ{`Q͡ė3ŸĐy*'ų¸ŽĮ¨NĒ[Ú}ŲĩŸe‹‘6ųĨõ?ęM¨ ŨVp͍\LĘ€"ÂĪBûš¯„S+ÃEt˰Lpŋ…ā1ƒ˛Ņ”Ē­Bûę¯Xy:Nu0ĄúXŨģÍËÃô¤Ũ(iW†™U'.­û&Tl–4FÜ@‚#i 6ĻTnéc­…ÎS9ÉwiĀ’cteĩ{MņÚ˛tzĒXb5Æ%‚÷Œ*ƒ~Æģ Æå°äŌnRŧå]o%$-Ŧnõqųfv=ē.é@ē´Öī‰o…ß(J>W Ö ˜ģdö¤4**D…ī“âí5žĢ€$‚ךŋøŌn´¨@ņͨl"déúDļ%Ü?ŽÜü*#‰/FĨÍ´7.[Đ$ļ ŧŽDN§XŌņ‰B’\Č´"č#ŧS5LTJ:žģ‹ŨęÂĨĩ?€,Ásr5VÕíž2$›ŽõÛ-CįŠ\{eč:tŊe<į—ÔîލÛĄWĸaá¯Û?éVw“˜¤ū?Š9M&x—ŗ ž;úLY'ĻåA ÆŖ&­Wĩîq7.‡Đ)÷ëKÁŽbŽ váË1õŪ‘žėÆbޤÎ÷Ōč˜åoHˇąK€ŒĘb$™,čyÄô.°Ā­wÚë$6­G§IĖΰ$`ĩtoõÜbe0-šč:™n.r5É`O÷ĸßP 6>Č-ū%€X[pH¤_ėÛ¨Ŋú}é6waiĀĄÖšÎŋ¸äļ4ts܏ĢÉ H2§‚Ŋ–1Qn=Øü׏Ųîüļ ´OŽ™$ˇĢųqA é&pķ8ÂÎZYģfU}ŅRĄĮȤ<æT Îĩ?v×6\ˇdšļÄĖKŋŌvĒû/}GrŸÛ3Y|é{–”Ņ^ú¸´8Ąŧ‘%—aãåƒŧåŧ/†õõxĪ“Đy*Įwž’ČÚĻëpāFģ._9ŊīS;–~ 6ą~ƏŒE3-|gV (BĶō`–ņå!°3Wsܡ>'3WĖ€oŪģ ąŸeŋ‘UnAÍ70Ŋ*‚ˇ:Oåd#×Jm¸×ī5°ë™ĩS9§wk]XŅēt3ŨöI‡ۜĮōLđ[hĒ×Ĩ{ŽÎÆ Ŋ×3˜ō”îwˇ‹Ŗx\Ž„[͍°įĪ´ÎÅ I1Öęņž1&Ô~oō(ąÛķ[hfŽæƒe_H~@31ģS ŲˇË`BEhˇ˛¨ƒsĩŦ~ēNg‘P[ ÎûfôjgŪ`Íų^Ĩ[˛ŠKž‘zG{1Ë‡āް ü0VH—!S__wÜęī•(Øzí$ėšžQ7ķāģ?S ŋ{ĸ…Đų5uû™;H×ŋũZ<ÜūÃęīt/Ö:X§šœ@2&ũšĮ4Ē‘ŽJv•ŋK’ŠnD–“yģÎ7ÖÃŦę/`jÕ6„É įYpŊŨ|D"¯4  Ußũ’nƒĐĢ10šr ˝ų*ī^ƒŒÛ%ŦūŽzāfų×4<§õ—fŌĸ÷2Čõ4›YŊĖív úNå˙nūƒÔˆÖԐG ģˆŊã­æ;4Ņĩ‡ZÆĄ‡KL^°* Ë YšŲÕ;…ŗĒw‚,ĄŦ•‚ę\Üķ•™‡1âāl¸'j~Ŧp$ԈÁšŽG×åĶi.§÷~Ŋ…sjP÷ŧđdņŌC.\0j:ô?KCĘÖėëĘ-" †˛Äē2œ%e6ØũĘ:o[ĩ~ƞ¨ģ]J—ŖëR' K/Ō—ô&ũeˇës‘uõV˜UøyĨōHå>5— ŗ}Û¸Tp\ˍJ ¸˛vRŖ˙i#Åß*!Ÿ;4aƛ´ÔŽöĄeS•Ũ%@QÕ ģ4cVÁÚüoāö=Ųésŧ>ŒNû0Hō˛9Ŋų~ŗu‡JõbܘCYšŅy˙r„æ&7 Ęd5|¨šõ;|{.ŽUd2—ëj ŠŽÍŨåņP˙ŋ?Û-wįŪ]˜’ÅÆX`RÚ> Ņ Éš‚*…ž}•ZCęũņ9A&åA“Ģ…ōæA?\O{ĒŊÖŖdWEŒOõ‹3AāR÷o4šj‹Đē*ĻĨæ!‹ž-Öhsiõ+“ ˙íH&ípé[øõNí3 ¨đzĖČ )āVēõßɛIĪŽúėâü‹SÜĀė%­ÄuŪŦ’ĩũūĪ_Ī4 +7`Nūį ›âķsˇ€AĄ7ī`Õđŧ?íu&˛Ģ/~´įS+¨ŨAßC@ęđæ"Ί~̊v^Š+¤›žôĪz?čŨX€Ļ΁`Pä ęA3g‹–ŗŠb_ëŲ˙“qCĻ—nŊ"ī„Ų–k'ži8 *‰ŊTÎéd$Š(€M˜édē]hūÁbŅæ•ŽØkօÁŅĖ‚ä˜r ŦŽ‚¸š<ˆĢæ¤F,ņ5ų^[ — ūRūCŠ-h!ŠõE\wâëđ{]!$Ôˇ•äËEvåWH¸|ŽČßĪ@Ōīg!ûÚyHÄΉWĨå,$^; %A/m#,ČÛ zb@:Yœ%qSdEã~qN@¯Ëœ“æö2?枚É3iOO%5NŦ‚1˙uËG&cr›(Đ:´ÆF.fĸöķP;ŧT,Q˘Xw“ã`ÜŅå0îØ P?NâĖ’@õ˜•LĖâÜ`r‚hœ\qĢ™hƯÍNׂA’+ĖNß ÚÉëA+yĘzĐNŲ –T”4ĐKįe牑dģAą/KkôĪųÂÛgšo–(Ę~5IAAqˆ•ú‡†ü˙÷ą–C’‚Ŗvp1Øņ­Čå2áŒ;"Ë0ŪĀ G=v%Œ'@‰žŧp4Oq€2$€ÚÂŅNwEËqƒųR€˛Ü \wMĩâ÷ë¯ëŋO Ģyß(Rõŗ{ wJZI.û¤gû5Ô0ŧāĮ”{Љ‰ÚĄÅ0åôķ ^8d5 PŒ /?>Á&ŸÚÄ G+i$o„Ų™ĄH Œ WĐG0 ļ! ÷ptsÜA7×Mˆ`ôžOĻļĢF2í>zîõžŸõdĶŌ@zęHC‰ûō˛ō! Vp(æ|rØČ ‡bŽų)Oä/ÎÃŪĘ(Õ ææ„NšĢL8sôŗ9@š(%ßŗ™b΍oæŅĶÔ4'/˙ŧH;ŠE}Ū˛k¨wÚ́YQ—ā-Žų ąw÷ËC0­{+Ģ8o0;š‘Yy’'ؤøË´I@6Js‡ššŸƒ%2ā°îãÎÂŗ;@?Ītō=Dd=1Ģ”MFšQ[üL;ļN‘ŗĸ~ŖžšëGų{°ÖÁįbã/ą†Č‚CVcīÍō>8$'c K  G(Ũėi‘ąQ&ę­ 0(/*Úzųž [ā!ÔFwTņŗĄ6˛Ķ{Ĩ3 ]{(Œ¤ĮÃÔŖWÆ–øŗÕĄ}ôLĢIŠA˛ērĢx–į´—2@Šŧp(æ0@yˆÅ´œEÅhAŪÍēčfĒģæ'ŅÃîO'ߤ›ŨŠoŋ>V+mCĨøAsGŸÍ$jPë<‡2dĘsÚK Д4Aˇ’ÎsŒ2<Á>ŸšÉ„C1Į ß Šw4`ˇ>6rI•ĸr/ j›‚ŧ™o`­Ņ wīô›ĻfĨ“ãŪ`RÔŠW(™¤FIĖĄ Yˆ/ œ‚ŠAē€7CϘcœI€ÂŀdĀŅÍ÷ :ūö%Ígß~sŌ¨)Ô&Žm]ߔ,uúânаõ;čxŠčmz÷ĄŖĢ\ÉMŠq’˜CōxėÆųā[MHâƒCcŒI }ÁVĐÍr— G7Ī]hXčs’ƒEƒ—/ÅļŧĢdŠŌˇķŽ%# 5U{bˇžŋũĒM0HËę÷4/EōŋíŗWĪÜafr08§íĮ´p˜•žPĖN aƒÎ9ĄbÁáÃԜX“˙5Øc7n=ãyyœ ÕĖG0˜!S¸āĖvąœŨŸE§Ÿš8ĸyŅo;œ‰æŽŖ6 6ũFw‘l=_=˜*Ļģvš“^–û-nŧÆdwd4 péî['ųą-Ú.2ŋ$vŊŠ@{Ŧ‚°¤g¤×I“õQ€mNĘB@šb@ڙŽ÷ĩŗÜDhqBŒ5"ēˊ]E–?ŽM0Wۑt ]8ž™?;aÖÔûŊˇéßX†ĄŒeo>O}ˇC$ēÍUũ"ŸV8’ĐŸ–ĐŸ›”úŗ oPâ/ĸ)P­4‘fēĢH+ĶUd‘å/œž*$(h14EĘ h!DĩŖÎW?Œ˜Ųš&MWВ•aŊßîũÎŗ`5|Û J:*}9ˇ#PǝŽėgöž¯ĪčŸã1×Sœ  rJɂĻVo“ĮŦI—bI–xRŨ"×],˜] ėíÔĸ–׏Úe7Üe’ĪĢÃû™q3Ŧ—˛r%%Jūž‹˙zēŊ?bõ.-?ĸ€ŲįŨˇŒ>tī¤ļ Ėx˙ʨ™'ũsϧ–Yeú_™œxÃē ø‰UŽāƄ8+ã¯-ŗØŋ.Įâë•Q~3ÃTæ9QœĩPƒÉj•G˛Aõķķ'KŌ)‚ŠĘ˔`rîGk˙†Ķ‚6ęũĮĄhQŖ•4Ū›ø–îpKúLĮđœ&•Ą˛Üo跃ȍXŌĒĸđō“ėē?,U՗Ȟ(›}uø;o÷~Ģw?š æĀQÂÉ`îX*Ceé7ljBUáĨ”ö;5ÔÔôE EK•—hړ„>Ķ1S6ŨŌķiÜ˙“uĐ[“9‡IENDŽB`‚flatbuffers-24.12.23/android/app/src/main/res/mipmap-mdpi/000077500000000000000000000000001473234705300231765ustar00rootroot00000000000000flatbuffers-24.12.23/android/app/src/main/res/mipmap-mdpi/ic_launcher.png000066400000000000000000000051141473234705300261610ustar00rootroot00000000000000‰PNG  IHDR00Wų‡ IDATxÚíY{PTįˇĩí4ÍLgZ;“ŠĶ8ĶLë´ĩa—]‘ˇ¸<”újĩß/Ūuy-oã3mš¤v2Ņø6*¨,A^ ‹Ôņtvfũī}ôŲ=|l2/}:ŗ Yˆ0C,dY•ë3ítĄĻB>ģbɤëȎė‡ĪI~ČŨķ(€–ôŪé{–˙IĖõąŧũé;“ũ ęî—1€ˇ ˙:ÅĄüõš=sŒų ĮH‚ŒyXdŪ A°´}7üYŠu‘æíP0˛bɤëȎė‡ĪI~ČŨcZÔŊNyK˙¯ųˇNáto:žíBOžčĮq¸?đŨũ_ķúc=ZŪ>jöÔČî…e܌ ÷ŋâÉ: Ovd?ĻĐNŦ0ôP†™ˇqĄæ""ųö_dB¸šŨŠ`ŲíydGö4x^ōCūčž8„ĩaūÕĮšØ= }^ßéLÍL ŗŒpö'˛ŗĘŽŽŗļ2yZ=ÍCķ s“ÅĐRLMĖŋ.glKh {üũÜC‘‡ā"Mãhŧ ÷<äįûŪz€2sãÅF īÁ7HĢũ^>mGėq ī?h+EVķ~ôõߡéoÜŋ }Î퀖ÁŊlÉ“ę´ŪFĀŅŦ8—Ëķ]ôõƒU….Sâfß]ģīv]/WkÚŗ6ņw÷mXæûˇíK‚eĩŊ÷KÜęŗ8TB_ũ¯÷n=Rrú{71ˇ.KŒ;ŸžFZ…hcr´ÖG šwíĨ=Xĸ-D„ąøéVĄ‘JhûíŌįB^@žūæTĒ ģ˜ikęØ÷ĀΛĨhŧ­‚ē.3ģ ƒ¸C0Bw׌æģ&4Ū5ÚĐb1CgiG“Å4ˆnšģ͸ŌsM=fļŽ!¸*ŌĒxÔ%ÂķZęØ iQbúąUpúäī<|>Ûį˙Ā´ĪVbÚAv=ô.äĮ6Ãķø6n5œOŦķįk!=ĩŗKãāR˛3J7`ƙ p?ˇÁå[áĒŲİn_l[E4‚ĢĶāU÷ę8¸7$qŌļ´Ņ0ŌiTv9ŽĮ×Ây˙JøÚ׃Ģārˆáđj¸YŲ'ĸáu‚‘:ąޟ¯‡ëŠõ—FÃīlÜJ7Âũė&žŧ§&!ИY /bāq>žUqŠÍ€ŧ&žĩė)\L䤍Jø6gŒíīH}1N'`Áq%ŽÅÂīx,üOÄÁ˙d<"JT-Q"°4g’t.áš4D•ĢŦQ˛ŦĢˈ‡œOĮßj Ą¨N‡ĸ&!2zQåÚbD4ä"Ŧ!ķŗšyMšX¨Íûõ’+*–$°Ė¯Âô# GWķeã}2’“Ŧ´NŽ…Ëéu|Ųx‰†oYfœÛײM|ŲPæŦŪŠlÜ+cā^˗ĸ.ƒoâ™ŲĢOā<´IÕ&ö:e.ûĶhd[ÜK6ÚČSÍ{ŸŠák^ O5/;_Mĸ<Õ<•‚Õģ˜üĖÚx(ęY™Ö%cfëm"įq)rĀŸG|_\IÌŗm ë}:Ō’-v ++ceĻI$_>ذąŠIˇ#?ķB".ĸ‰ ŲŨOûߨ÷Õ žäė˛xx–ą,kb )OE2‚Ų+=ĪoR^ՉŦŽ“QŸÃ6™Õ| _6ō%"šķá×Ä~;7§BĻSqŪ—Ķāß@îūeä?w§\ų‡gũ_Hq-ŗ*E ËĘF^‘˙*Ĩ]ÃŌ:VŸÅ— 5,Õ<•Mhs#¯‚g3띒“\Ū īUīÔÂÅSŸ€đŌĀiûâßø^Sßõ3>Û Ž€V5įZÚh6s3*ļp˛ĘD.°FÉšVĮrŽ5qœ[m°3‘ŧ.Å2ySđ[O @ô‚ī§Ō˛¸žmjx3@įēú˜˛Ų‰tû N„¨Ž˜eTÛéÂÚŲQܜ:¸×ÆÁeŨ›íŦR™LÍ:˜q‰6™mT9|Ö=ŲÎ۔OvTĄš÷žÂö–y"/Ņ)ávxíaÆíĩqŧ#˙K×ßMņ:ēņ˜\ĢęönJŗ2ôúˇ¤[č ­C˛ ‹tEVßĻt;Ũü–|kp‹zPž¤˛J4qV߲DëŌ*)‹ŗJ™,­ˆˇĘĪ'Xį×dZŊĒ­˛j†š$ĢŦ6Ų:_›eõŠSõĘë•Vų…än×Ģ˙Âå-*ŸņŽžŠ|áˇŧ&ûL\āǘęĖcŌĐU ĮtNЉAƒx#hŠ į:)&ÍuVŧÁŽ„‰ŽqyĒīÔ,.{WūøEâÉ ûęķr|ūi0`ī]é:IENDŽB`‚flatbuffers-24.12.23/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png000066400000000000000000000064741473234705300274020ustar00rootroot00000000000000‰PNG  IHDR00Wų‡ IDATxÚÅZ XSWÖVĻSë´vž™ŽS?;ļŖV[ATļ`ÂVAąĩVũčįž!@!!‰l"¸Vk;]ĻZkUTE1\ĢB6ĐÖĨÕ-ĩ*đræžKŧ°ˇ:Ę÷/Éy÷ķŸ{˙sŪš÷1`ƒū Œ€O:ęļØág_Ãmƒ{<Ž?ȞËuwMpN6ÄŊAõōäZÅë(øuŨŽ%6ĐÖc`ĘúWPũššõŲ›gÔo<6ŨŧÁdZũSyM#ōux ĮāXŧį‘‚KßN…Ÿ7 6gĪâV ŒĒ&"Ā7¨ Ė”!Ļlú+¨ÃkėoŧīEŗŽe>Ķ‡÷gå9ûŨŨ¤\fZ[`ĘwŊ‚ O¯°¸éS˜PSlĖdđ;WP‡×đ;Žeīķ7fÚB›lNĐ~XųÁMLž>ÅÉŨ Đid6IŒ{]J Ī `X@!Ļ5d\Ũ+¨Ãkíã=ä^´ļÚô)ZôŅīOfh…ģQŲĘ:ŸfÎiÅŲë ´ŋpWmĩOú0¤Ŧxā ¸7ú26áŦS8ã„8k-b‹ŌŠØfõžĩi›˙pÜj°ä‡/ˇÍž¸"ë70‘æõĖôú €˛đŌį0÷â'ĀūfeŪÅĪ ęâ§]ô¨ÃkõhmąŋŅúú a ,Ē˙÷vaāī ‚“<>Æôg7l†PĶFhJg|éĀĘĖúMfÎŽe†yD˜×uŅŖ¯uÖŖ ´ÅÕĄ/ôųAũfđ:§ÚÂҝÄfk'¸ŧ'QkŲ„ŽtxL o6ą]N&VhOtÆÚ…:näķiÔ¤ŦaexÜ ŠĨV“4ĸ%ŨR‰(øĘ–ÁaæĩuĶęבVüÄ 1ŗác°ęÚ%ųĘnØqŗ"ę×ÛčąÚĖmø¤ËxÔá5ŽŽTØyS ŌËģēŒGŸč›ÅŪ°Ļ|ŸĄwúzéŗ]V(ā|úŦs&aüI›€2—”3°ŋYYzé+ĐßŊ ‹øŌFeÖy<ęđW'ēŧ ÄÆŌK_v>Ņ7û1ųéĶÁK“eģ œŌ4ųŧĸå>ģ”=Sh-d^Ëõ/įĀCĨūR(ȔšĻ:jmõ˜úŽ(~ēVKŠØ\ ØŲ„ĪIśü:eS{ŸŌg9äųMAH < ĢČī\Ū ˙šQûuPŲd ×÷4VÃ×Kčĩ)$›qíT4銍^“˜Û;•ā~FÖäļkņ˜ö‡[–üN+ĸ¤ÍåvŠ}€ ķãv¸đÛeØßXכ†az•īũ—ŽEúáŊ}V!ŽŪ ´Lž "Ņĸö’ĘŽ€ßYÕVž^Øîö/€ĩ41ß>÷Z›ûŪYđŧ—&|(Dą–€WŠä |:sۋĩ9e˜8Ąæl&„<ŪYÁū…ė¤€Ģ %’r% ŋ]…VĻõwƒgīEh+”c}ĸo[ŋŲ bœz<ĩ‚`î(Ĩcv.Q—m1gC0Ųta"Z%Ēa+écÖW—xe\ģëī,h mr} OôÍÕ!ļĐúl˜z*Ũ4,>đųöÆå-x5°.ũZ(N~_ģßøĐĀwŅHm÷E!ĖSŋĶƟFĨÎŪŅåÎhȸŲW˜pX6šŽoŨm‚ĒĢįáNķŨ~ƒŊ}˙čŽ×AųäęÕˇžoē÷€˙YUãÛëßÕ€ũļ9oö'€ÔĢyĐĖ´Ø8]­ûÆm‹ĸŸÍ­-}‚Į1kÎîĮŧ%°æÜž.×T—rąæ÷Ā[iĶÆtäĀ–†ų×füÔ[žÆ Z.;ÚQ̆)yúŲŌpĖv“ĻĒS ˇAĶåúšÛÁķ„|ôi= <ĨüųÄĐí [Č{>ŧnM¯IŦ¸ē~méJ“û-ÍpũNcŋfŸ;Ķ×īŪ‚ûŨ”ßĻæß@|æ+=Ņc‡Ö¤š^œúÎ Ü~ŗYšžĘč{ › ī։‡ž¸=ÉŽKŅ(aÎŲ ô<Šs ŠPh æÁÜFnVöyO 2fÁé;Y57ā]šAårp=™HrÂöA&8û5ÁlGą[[‰‚‚˜%íŋ9í€ŗĐØüë# āÆŨÛ Ô$“RĀŠLާ’ÚZl%Χ€ëWķV"f›Vb\Ö ŌgÜ’$(•ĪŪđļJxžĻ€Ož|āo~<ø$@xĄÂË@xX ~‡%āw„HQ"„ĢÉö´˜Tbi›K†€’d/[īWvY#‡@8°‚He đËÄTĄ'œĘãĀåTmæx'“~-ōwî`OG;=ÄĩJŦ杗Á„ÂeđÎ7Q0î›AđŨrpųn1Ø7ėwÍûŨ ĀaĪāÉyÁøũ‹ˆ,†ņ–Āøü%Ā? ž‡ãĀņĐ2bg9L8LäČ āĢã@XœÕŅ0Šx%L:F¤$ø1WZ¨ˆįĘøˇ3R˜T]B°>gŗ`ķĀuĮ˛Ĩū¤\’ „Å*6ŋēt¨(p˙="đÜ Ž{–kîrpÛKd˙ đĪO!Y ÷ühp/ rp%L.Œ€#„ĶERāŋHDķÕņāOV!ŦŒđēD ‚R xhÁŖ< Č*DVg€gU2xU'[ŧur‹§V Žg!}Ųl+ŲíŲ_ĮžōZčŲ }o[Ę0cø'Bč~ øī‹}1āšŸH^,xåĮÂԃR9$īCņā]>‡§HL꾜ĐH žęDĒ“@xL Â)¯‚wË3ĀO#’´<@Ģ€°ę4˜]“:_Õ|"| ã CGŊ4ŧۍŊ5ĸ?ŨöĄĪb0azÚÔķÎËɲ'ŌŲGÚ8ä.‡}‹(m<ōÉōÄPÚ8,Ĩ”Aņ8ŪG(m&ũˆPæ#JAIø•%SÚ8•ÅļQ†ŋ2ĻWSUŧÅY'ļLĒÁ¨ėđdÄØíų'ĸ— įt}Ģ„˛Áƒ,šÃŪđãķƒGA,đÆØ€GÎ{‘ÔbđČyAŠüÉėsÁ#įÚ$Ņ­įĒ„—j1Øį.8A°ũƒîÄvF<ŲÛŠÜS#ƒC]ÎHīãņ  ĩ§æÄDS! ëq0–&,<&ŦĮQB)ĩÄ<&ŦG™u¸āI‚ ŠPÚJf&[yØB~bsÜ2ĪŽ?G‹CĮ~6GåF*OdÃz‹ĐÖãŅ"ī‚œ.?[m<‰@P(˛­6E+Ā“$ŋOą¤KĩÁ¤ Ĩ“ ŪYĮĨLčÉ4‹SšFŽžžŽ˜ú ‚*•t|äņLZmĻčR!¤&đ>ŊšČšÕōMÜ‚ៈĨGŪ÷ņ‚ã)"#œž]´Ũíûd ĮŊŧāāÕĻ€P+' OiÃMX¯ ø–%uŠ6XÛĢ•ā¤ŗ`Â"į‘6[įāĖŋ2Á ?ô–†Mj"ÃG<3Ũõ„äžõ5%˘ŨB°t95do•Ė ŧ#aŊHÅōÕHģT¯Ē$K`ĩ[°ÚL,Žž72sZú| đ6t3æOČÃ׿ķßu,\ŽÃÕ'ü0¯ļ´­HĮ›Gz2§Ī¤‰ČMX/2ûÂōd |RšˆÔõ8Æš"žÅ[—l ŽQĄv/ĐŊ<Ûy&å<ņųģiĶ[b‘E`x0zôÚ)ĨÉzášT°Ž›×ŦĩrÆé¸˜™P˛’™PÃøTHŋĘdf"îD‚#tiĢ6$ųŊķEú‘ĘPąũú žū˙†`­ÁHŠ—ėū>ØÁ>c†xâe%<äÖäsrāë•ôe6Ųx€Ā´ čI_M¸V§mĨŒ´)āR.š8lĘnŲoŸ_2V&ļ:ØmöĢÎ?ŒÕ°:yšČ‹DFž:Å>Đ1ëŊ$×]Kw¨“´ÁZĨ4_W…'”7|k7<Ž%\õ)ˆ7xī^Š°5jĮÛŠđ¤—„öäŪQVOS›˛Įķ?ĖŗV ˜xŖíūöœãP—áü|ÆúĸāwÔá5똭÷Ø=ōöčnEʝ˛?Yķ„]ü˙‡ŋXåĢÎĮ8ęæŲŅę˜į˙‡k:ĮžIENDŽB`‚flatbuffers-24.12.23/android/app/src/main/res/mipmap-xhdpi/000077500000000000000000000000001473234705300233615ustar00rootroot00000000000000flatbuffers-24.12.23/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png000066400000000000000000000114761473234705300263540ustar00rootroot00000000000000‰PNG  IHDR``â˜w8IDATxÚí] XTGļ6“ĖËdûæÍ{'Éä{ãĮų˛ŒD¸°4 ĸė.AÁ5ĸ‰Æf_šE5*‚$fŒûD@öUvMVˇ5*tĸ@ĪyįTw;­6÷2ĪÖšõ}˙×Đ}¨ēõ˙U§ÎŠēÜ2D(BŠP„"ĄE(B@üc _pđEââšņū°QĄ<^ŒŌũ_Rũ<ŽxĮoü˙¤_öŋ†ĩA#ÔáÔ˛e„aËŖīi‚iKä[˛­åˇ%;˛˙%ꤞ8i¨“úNš8ŌēÂô:ŗYúŸ—ĸ,.mŧ`Ņ´ņâ.âŽō•aY{Â]›fé]õ÷4 ¸ģ m¯aq[ÜŨY-›xíȆlûR'ĩM×ĀgG}Ą>=öžĒĪ7Č qŖÎ•ÖGūüÖØ÷­›Ĩĩ°nŠĢKšáuå |Ō´š×ĪUXØ˛žhßÍkGØpyĖkŪĘkG6dۗ:Šmē>;ę õ‰Ë†ø°n’ÖÚÕlúPĢ3AĨæôj˙˙˛iŠŽ3hũú uŨøs&ŦnßŨ3­QŌĶÛį*ĖlŠéqnįĩ#¸´}ŨƒŖŒ×ŽlČļ/uRÛt |vÔęS¯6ČãšąŦ–Ô\5Lk3AU‰y}DNEĐ¯ ęÂÆūiPŊauÛn˜Ú .ÂĖK1āÜĪkGpiũĖŖxíȆlûR'ĩM×ĀgG}Ą>qŲ(8 î˛Ē‹“ īHí  ¯Fn^õ˛yCd)Î`Šķ\đ¯QäÆŨ‘IŽoå0[Ŗ×Õ9|Ēҝ›üų‹ÆČ›Tš^} \@3ˆō͊üo}eûūSĪåŋ0zŋˇQ‚}ĀôBP፰Ųã‰;mđ›ŋŊčī‚˙Æ (ėågŠKÜiC€?ˆuÔøˇčém6‘¸xjô–ë,m‹īđÄlpuÛ.ųęö6ß8 ë/ī>;ŸĢ‡ âú)^;Bô÷gĀãĘ^;˛!ÛžÔImĶ5đŲQ_¨Oŧu"7^ׁSš´sŦßl-΀G›KŅ”’Ok“Ķˆā†ö}€)đŲŲ5ÉF+ŸjÎjŠáĩ#Õ äĩM×ĀgG}Ą>ņŲ7ļ-[ĀėBpįH?Á k€ € € € € € € € € € ĀS0&ÁY“°:?Õ-ŸŲ$.ˆ¯†š˜āđŲ­lÛ•˛6ˆŧžČkë~ų8ļlįĩ#˛å?¤AIg3|ÚöoÔęŸqŗ¨-ŦJÂ:ßķŗŌžē ËuœZc;čÛš%NîÜ\ ßĨíkāŗsģ˛.ßŋ×üČŊšlCއĪ1ŨįĢ“lȖË&đÚ1øąĢ“ĩízyoÔęŸqŗæĘˇ0ˇlcįh­nE™ųķe­ °m4š môtąļ¨MAĩ0”ļ…¯>¸ ?_ƒé8REõ!`Ûŧ…‘F.ęNw'Čåō>ᇮ{pîn%;°Áč„ČžyI W°~jƒÚō y‘Ũ-;e×ŅĀFk_Iī TGÚŊjæķéwEHÄ4 jt?=-éŊęĻ6¨-A5č¤íԝ\<3ōU 6¨-jS;/ũ> ž=čzž5ų*P[Ô&ĩ=`åˇîč Ûž]Zä.¯süė*ĖHšl(ĸŲ}+ WŲs#ūqüˆ ;%‚t-\×ēJyS_ŋ‰×ĢûÁĄ,Zģ‡ō´4Ģ)Ļc^ķ6°¸)7ŋ\đ¸|€Ž÷ö9roŊq:1!úĨČWŽŽÅ‚Ŗ?Ôę_ŋ‰‡Öí`QĒŨŊ mģ Ākßąlô—&_ēŋĢGk€SK,›úũ…|uwD×6¨0kŒd[ũ|čÚčĨ{ĶĸËE@ûŊ_q Ž5dBWwˇÖˆíęé†#ÍYP—×dˇ8mwßĖbYø `qkÜëūŠ×Ž_īŧÖ'ŧaôˇÎ ŗg l*=ĸ•Đ”ę/?cO|Æā˜7žÛĢũŊ2Xذ}p @?ĶvQÕ7›AįÛ%0z3ŒŪģœS#ŲČÕÆčwˈPpō3˜pú ¨ŊĶÎų7g¯—€QYĀā`iëNŪ-†˛Á!)˜‘¯ŗw)ÄVœĐÚ ˆŊ˜ãN}c‹˛Ŗ9g‹Šē~§Âh˜\â3đ ČÃˇ úD­˙¨9 ‰MšĐų@{aęO]÷át{ėkJ‡öÎúô7û[3`BÚz˜\ęĶ?å˙ŋ‰Ø‚–Đ~˙fŋ|zCkį ˜›+Ŗ /°Ŧ ˙eą§ŲŠØ†Yf÷sÜįŅē{z ĸę08dGĀâ|)HšŽą#Ķ_d+âi\X 4ō†¤­i0>mč§ģĄ1 W.XkĀ´FIŋNŧøPöcfx€ÁywXœ'ŨĖ  Wá;p˜Ķ´Zī˙0`héüŦrąOîlčflŨ,WĐĢô,ÁđķNWį€āÖũ{0ŋ8 2=Āš`ÎW˜€LČqĶ(Bŋ`vƒÂJ÷AhÁˇ ö<„´øl/ųB‹öBhņ^ģ Â>JûąŽũ°ŗ"ĸ˃¤l?HĘ<‰Šƒ Š<ŌĒŖđÕÅ$T‚pBõc¨9ŦĀÅÐPŸ_֝„ˆÚ# ÔŠã(DÔËü`Ā“ ĀČĪvS Įũ úe0ŠĐ t,{˜áĒ ŗo)\ GÜŲį:øčЧđŅáå qasÔæœōũãk`Ėw+`Ėņ•˜ŲŽ|¸Ŋ@îXeĸexfĖ= ãÎŦ‚qIĢâãä/āãŗJ¤ŦĪ­O2B`Zē.´kŲbĢ‚núzĐ=¯ēƒ,OXR¸é_ä+˜įņˆũ6žTäňU'_g? ph5Xõā%Ėą0'ŅôOŦá$l" ´ėHō ļ™Ą0íŧ'ųäv ŗQ€ĸ͏’ŸĢĀÄ|·"ôëÍ8•*ō ĸC_€å1^ō ŸœFNŽå$ÜéU JFRCxÉŸēCĜä“Û1ĖņBļ΀‰ųœåzU~ũ˙<€‰€3Đ툓žŧä“ÛųäL0z'ŸÜŽ(ŲėŌBxÉ'ˇc›…dˆ9É'ŌI€ĨÅ[äįí ÆgÜL’ÜÁ$q‘âSVŠ~°,#ϤzÂÔT/˜šFđ†ŠéŪ¸āz3Ÿ?-Ǎü%š1`‹ä›fų‚i6"ĮáĶsy„˜°.…ĩe;aFa˜ŠÅÁôņˆ0'”„€EYˆÜĄzX†ôīCy掊ŊA„$ĶČīÍí¨/¸ļɁ`¸NŖÛQ_pE)n`ŸÖĢÛQ_pį*É×ävÔ\Ã_#ųjĄĻ¨@ ËĘļq’O˜Xę#7¯B2Õ8h;0îŽ&Æáčî-Ο›Ė’,ž W”æ™áŧä“ÛąÃh‡\.ōÉíˆ ÅđiųvNōéú'–ųČ-P“,Ÿ'ĀCp„kŠķi{Á“,ž — ÎK>šûüHåp‘OŖ^TčËā"ŸŽ.'–‹åÕáW&v„FųãŅm/P’Å—áĨyÂüŦ^ōÉíØ¨ Ā‘d‰ŠP€ŠíœäO.ÃÄ  æ1âĘSgˆdõ—ļDg]y3\ŖôGāĘpí ŖP€@î ˇP!ĀōĘXNō'—Ģˆ€)Ųb- đœY6a\zg×ä¤ĩ0)y8Ļ…ÃÔO˜ŒīMNQâÜĐKU"ÍôĻįŰ('š#ęŸwg‡)´ŸO;š Ųžlk° (†%YįS¨IŅŽ¨Ā‡ų|Q‘ žô Vøŧj'ˆ.ø¨QęĪîbĀë4Ēd0Š ĪŽĶ\ßÁņĐ>—Ú8pʈĮt xdĮa†+eŋ3dFĀ‚ŦHD,Ȏ‚…„œā’ˇ|ŠvÁĸŧhX”/…ERX\Ãā\´ œ‹ ›a ‚ļ֖ÅÃŌŌ/–•!ʡ²Šm TnƒOĢļÃgÕņŪp–WĮÂōšār1Nŧžuņ ÔĮÃʆxš[Ëp(Œęë={p<ŦƒĻ7šû´PŒņŨx3\Ŗķ^ā˜ÕĢÛQ_pįmŗ‚ Ū —FžKõn‡ WîËΊ'UúĘ-k#aJžxp=-…:9CKJ˛ø2\L‚Ā17Š—|&@q4˜ķf¸ĸ Ž“|•ôøúŠųžƒīq5KkcqõâÍp1 Įŧ(nō•ĄĻà(˜7Ã5BVÔÄq’O‡2´mU?H ÅzzeŒO_Į™d1ō7ō’On‡ PĖ›á•(⠟d&WûÉ­0øČ÷ëĐŽq‹>ę/lĸŅŊÅųÆY>ā”ÍK>š‡) ›áR´ŗâb<'ųúÕū0šF)@ÎņŒIÚ`ŗíûæ ‘ˇúËŗ˜čb4ÅųÆŲbp*ˆæ%ŸFŊCi ÛĪįËp)Ô\Yģ““|ũ…Ö Á$G|û/ëĮ=ĩƝßxņõ1#‡Í¨‘Tõ§¯0Q‰đx´ƒ§BŠÆ]ÍĮŖ‡˛v˜Â—áRŒOp‘ĪPĐc3@”â^÷ʨ?ŊCÜ yš­*ãv|J_Rö{QŠë6ëÆ(@pŋų"HW_pMrÅė‘|r;ķI€’PŪ — Pˇ““|Ŋŋę×v™—‡îWKwgJî†hC€×ß2˙đcĶlqĒĖD0¨ė&w¤WđVˇ~#ŸVĒņ3uĖlŒ–;7īāĩ#¸´$Č-"žxR…¯||ļ›||–+{’ë+_P-ŸãŽ@Žģ\7ĪCŽ›(đT ĐS>ĄĐK>ŋ\*ˇ( –O(ö–Ķiab‰œļ•'–‰å´šF0А¯Ŧ‹gm1`¸9#žÉÕt;(@7‘"€čäúËÃõŪŖøüm˙cˆĘ ÃŒ> ozįŊåĻvÆ)—Í*Â_^F_čĻŪ×=EŧˇĪU ÜŅ3ÖøėėļīÖm?ŗŦ€é…`ZāŗŠ$°˛,–ũ>Ŋ(ĻŒ⠘qQŦ@i0;—^Yíŧ*\*BĖ1Ę2¯"HĀŧQ´šFÛ îÍ{X;–į[b¨iŲ ´āĒ`V†'Ö_ųÛBŖųÄÕPŊŋŊAÜ ŅRyéQoĨo´Ž?ję¸í ÷ę'Žo4Éöž3%ĪW65Ύ“^Up(Ū(›žī/SO, ‚dŸ…ķÚėŠ"dfŊ~Ž ˜L?qlJĸ›Ė&I,Ķ?ŊąAfp‘äĒ@˛†Én 6Оįŧečŗeĸs ¤zĘDi/™1áŧ—l*Öm—#‘™āĢI&"Ë[fœåŨ9%›ũ~W˙ÔēÆ1[î{sÂHSâčõ‘¤/rĶęwJ’’/ŋúîСŠÄčWŪüƒŪ[æĖ>ëcûˇmÆÚŠã/ŗ'ÚŊ=ûŅ÷4böxģ?“­ ŋ-ŗC{^[3ģwÍÆÚ ÃW°ųŪĩQÕ§ÃlßæÉë>kŒ=qđʰ?č'č’Ŗ—ĩ9úU…"ĸßŊ6âÍáŋūûøķ_ī!Ū˙•ƒ8ø+qBÜGJŽžI!UiQ~mČ;oü÷köĮW˙gč[¤zŋÃĐWû€ĄJôō9_Øw‸`œ(¸yaČs(/°Wáį~û+ĮKJ.ž ņBŠP„"ĄE(ƒŖübÍ9æiŒ}xIENDŽB`‚flatbuffers-24.12.23/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png000066400000000000000000000164601473234705300275610ustar00rootroot00000000000000‰PNG  IHDR``â˜w8÷IDATxÚí]XTĮFÆŽúlĪc!҈ŊĐl(ŠÆ Ø’X)ŠA¤ƒK ØĐøÔD1ģĸ HībŊcėc‰˛ËysæŪģ,¸å‹ÁÄũž˙ƒŨ{īĖ˙Μ9įĖÜģ**^^ _ hŦB`GšČ–aĘBŖÄ՚pAcÃ(ÁGJj-_x,w<įbåôp$kxZhSy„ŋ#hŠ“ģļŗNžĪgēųŪ}usŧÔ)Č˙ø~‡eä "žÆ‡RŲCĢ“avKĐlraĀ—ķ6˜NĖßāömņŽ}3 ˇ^2Î_cbūú‚ĮĪ ^˛xÎ~VŒe°,ƒĮâ9đ\xÎęĸ×u„Ŋˇ/DŊÕđŲÅ!ŨĖ BfÍ,ÚēĶŦ0$ƒāO0+†5e‡`YÉ>˜‘Ė ÖÅûč1x,sŽ+ôÜäx­ęëô¯čņ’Äëf´•į3}TŽĪ!Ŋ\Ÿģä/ŒĘņfÍ"Į[hQŧģ|váÖrōžß#ôrŧE’ā>Į2XaßKž‹‚ŊÖ!ŧ6ÖAVũūąÄÛŪ;ØÛ¤ H@HČz‹tI‚ŗŊ+đ3ķĸīavÁ6¨BĻ`Y<˙ĮsT¨ŠXŦ ÖéŸ'kgšˇ:9Ū}HƒClË>1)ØČôF$(Ûû$áÕQǃ„^“ŊžI~`°nXGŽžŌæ§÷æ%Iŧ^‘{ũ\oŌ§ØãmK`ŖŠšEz} P] ŦÖeUÉnD<ÅēbĨĩåŊčõčęqoGåúÎ&Ę›ŌāUĨ„“ķ‚xZ_pĀē`č“-6Myzy>sÄ.0ļŠÁ6RÅĮæûv!8ĖĪ™l öļ'ŽŦyĸßaŨI°-ÜÜĐ`:ÉIK?Ī{éų%´L#Ë%ܐ€äh(Æ6IkkƒņëÅ&'ÛÛŊJ¯—bãßÄ‚ØcĘōō MlTŊÍ b˛Å^A*ųƒØÖgy•Ëjđû"€\[°]™^?rmūÛ'gn˛uxp˛AŽß$_Éiđ{'770ņč˙æsŅ2-TU’ƒŋ­įO+ØÔΚôH’qūŸPNPAōāPz˜Ļ •ã°Ŧx?Ė/ å]Ëâ1|Ëc]°N<ĘbÛʍķփCÁĄä ‚ËHāėßĸĖ=m\Ę~NÜõ( ėK•Û•>Øņā¸ß9 |Ëoŧwüîžâ]Ëâ1|Ëc]°N|Ëc[CF‚cū¤iĮíŪéœĀy4“™ë†=MéOåcrüÁ Į—ėJÂÔŧŧË[ũælį]Ëâ1|Ëc]°N|Ëc[ąÍs׃ū ÁÅᡖMߍw$á{¸m>ÉÕ%‡*°b|mîû8Hۊm6Ę (×Ëō­ ˇœwT¯q§°^Ļ—7áĸ]$•ĄtN “sĻ'h%ēęupŗŊ^Ļ÷DąŸĪ˙b€ķŒtoŽ…‘vSëÅ3âfyÍ.]ČŊ%ũüģ)tĐÎp+tĖŧģr=#L@1I¨FÄŪũD{ŋDõAîs/:h&:%\5–āM9Ŋ_÷ļį,.ˇ#™^ø €Dj›đŖ{ƒ˜ĸ0›yJ܄2<ÍQuTŽO›ОĖ÷A€Ē˧ÔĨšæ}:§c'eöāFē™ž^ėÄ+Ŧ^™Tû>×G¨{[@&äՁČ]­ģœ×ŊIīLgúl/Ņä @9"U;ŨõɰÃÖ_ÖÚą5">îfYŊŋļl¸{ļߏ#i=č 0…DÁĄ"Áī÷SĘŖ@#Ęn'rXc¸ŧƒŒ=mJ|¸ĒôG°)Ū/˛)!ĢÁĄė'šGą-=Ōž—†äįšđ—đ œx’Fׇ•ßpīx˙~‚÷ųą,Ŗ¨ÜjRį¨gˇá°būü÷ųmŲ|ļ]jÂrfusįŖé{W÷C.-kpļß83ĀŨ¤ Lō7ˆ&įmi˜ž eĮh>EV™ęØy?žŧy÷ßü–Å˙SX̓yŅŪįĮ˛Œ™S|ŪåŅē`øžۊmÆļË*Cx˙ļ .:øÕh.°š õ#Ö­õ˛ŊnIķ|ęj‚lKBØĶk ‰ā×')`˜ã÷ÎMQn D?ûÖáĖ“+´NJ3AŲ•œi$8dvˇĐA’[^ļ_ûēÛ4i~ŋ˛&á…EģĄø¯‡đč͟4ÅûŽ@3õBø­ÃÂÂ]Ęķ‚ĒÅ:×ÜaČ Ëšüæ‚Ęč­ąî-ÁEK‹u'ŋā{á5™ ŌžįƒAļī;`"éũ9¯îŌkc°.Ę@gzˆÛ_§MGĮė™%čJ,•åz*Ë ›ã×_"ĘŠĸŸí#S€¤—Î*ØJ'9ˇ;GaíctŅ=*ō?~†›rÍōCāģ‚20$õÜMŧžr‘^ë Ô8@ŠKĒ™ätGËAOĘņŗ&Š2žžē0ƒųQFā\vū, ™/ËčŌ ~†Bā÷ ‹vÁĻ{aú<J_?‚ß_?§å/¨éxI€$"đ=â11gw^?†’ŋAÜŗ,*ę‚ÂP0Î]/žöw…;ĄŒ”Ákâĩ•ˆÉ0C†ŋÚÎGnՏTÛ&/ÅûilššqŸŪ¯ đøČgˇčdˆ=sjŪ&# éĪIøy]€‚%ū™›‰¸‚uúi:ũ<üëbëKnčũæ Â]˙‡ÜĘö†¸zøđĻ3r7§ž+8›î ú㯄¯ëLē,āšņx-É9Ĩž ×ˆ÷ĖPéÖ­ĨL3Äy?ē‘}‰}"yp} `V?>ŠĨY}_x-ŧ&^û@ĖĐWéëžŲ6wrĖ­!K`L˛Į×3 ˇŠ÷ÂԗĖ`$‰ļ˙]_xmŦÃÔzķ‚X‰_ßܚ—|'Ķåė˙Ø oᙤgČÛ¯_WœKĀ‘ĮIī´×Ë XŦSŊĀLÄĸ陛@ëÄ*éķ@ĨúŅėÛ[öؗ‚EEß WNĐõCwĐĸxđ)ŋ˛äČx^Ø Č—cŦŸ6`[ąÍØv>åīÚũ&ÜŽ›žH„ČÍLÛtoˆ#>ˇũnEĀ]hčîá^Ee—ī…Ģ/Š@Ø@ˆ—Ö ë†uTÔl+ļÛ·#2á ­‹ö‚q¤ĮeÂqˡĶĖ›F Õ[OČôŋŠÁŒŧüOmLiūˆy–IũvQuÃ:NËßŦ4Ä児SÃXį›mÕģw {ˆ$=!.ûŲËwj— ŲųĘĶ ū¸F]†J>Ŧãš§WåĻFj#:6ŖãŨ‹ēÍĶëņVv”`@čŦ>Æ9wQ>.(0ôēwŽÁ_XgCmĒŠČ% 0.Åã~{Ŗ˛h<āķ/sŸ(StīîŊ~úŪ €u–åšÖZ€TÁS5Á”aoyBbvĪdœøLY`æĘ‹…-}v6§ĨČ{RqAöĶRØ|ķ8ß: ÷_>QX>xF’y¤ē 06Mđįįî“4e ĐD}ᎃ•%€AļlģŽĐŨ,ū㘞q‡AQŗ…û/ž(ü;΁îY[vjł¸ øũÅcųîiųk)9úYĘ@ÍÕX š–*@˙­sԕe‚pš3“Šˆ‰/ģCš3$8´ĸK¯)]€°’T1ųÃN/­sĢ ų~ĻÂãĘ^<„Šë@/ĶK)&¨ˇÃø2čį÷õ˛×)eÆĖ&b2îå€Ū/+Ää#n>ĖWēi˛Åä;ŗŒ"\á֓"^Į†dŸ­D'\œĒ“ŖŨî÷˛=Xϟ˜v'q@A]ŨPĖëgžŧÃĢq¯ËßĀĪY‘đõY0=ˇBŽū BĄōc…rrÎ]™į`æe?Š_ bčŠŸco?-“8/ĐJrĸ#ĄÖnhŦKQ§ŠÃԐëĒų &kŒA‚Ņ-ŋ:b¸ZU“T^ôĮ](~v^•×c:šœģäų} a ÂŋH'qžžFFڂVŠ dųÔL€\ˆD:ŪlÕŗSWēyˇJJš]&h;íÆúđēĻ"p1å}s;!éa&˜D Ā$ÆL¯‚ī“5NE]pÁTDĘĩ J* qH´žž¸ˇ.É8ûŌCđøÍķœ^ũ–IÁ03nˉ'dūK Š 9*Ü-NÆM8åp˜p܆r]}qž]$hI†‰MG3w‰×8íTö3]Ÿũ§ đüÍ+°Ŋö=1Cv eD ÃtxbVŽŽ0ŊŊFė5Į ģ-Ĩ.Ȱ6×øŲzÎLvĨ¨Ļ 2˜?9ø(ŽAf;ëž-ÂūÂK”|­¨5TũgĐNu!"đXšžÔ×Í´@ŽÕfÍd­ˆ5ëį>m¸YŪ–GĩY’›ŗNŧĀūODÄŊ Џví˕hÄŦÁĐ2Gˇ$9%ŲûI/sƒQČąÔĀÚ$üĸ“éí ÔÚ€a;_÷ķ}觅0&΍ `™úą.TÍØ5 sÅMęHā8œîzpû åX c‹ĸÚ ãÉŸöSŧBkŗ+Â$7˛Ÿ•ÁŊįåâŅ‹§4Ũ@ßŋ…'b<|ųĖ đËr^ä=ž”āŒ#/ō‡Ÿ[ÆŨ`:-|ČGŒŽt†…qy‘Oˆ%¤mĢ@‚|Ė!´Q„l¯r4?.>A8íÂr+˙ÅēHíÔw~;OOr(Õ0GE¸@F!],ĀaŗNŦŨŖ+x‘O8‹8ņ"_,Ā%o^äŧd ŖŖ\X“O'Ü8)$HäšÉNxËĒVŠ3¨šOļFNåÚqbŽ1C-?îŦÚG+Íõ–äÍ5]Á=‘Ø`Žx bvfdāC>š¯ĪyĀ„ŗNŧČGŗc^Uyäc¯¯.€<ōédįKŌˇƒA‚›Tō)’„HūācVYÍūĶoÖki¨Čüˆƒ2Ëá¸uĸŗî ˙ÉÄĩdoQǍÍ-J“˛a i šŨŖË)ņķOû‚Ņq{Đûu% Đ;NpÂFXŖNœ˛epږ™°É$­֎`5…Á9{į ÂÖ0¸°o ‚dRžá`áČā’#ĩõĐėŒŽb0%Æ –%nƒŅŅ.0&ÚÆÄÄ"܈ÛécâŨa,"ÁƒÂ(QvßÃäd—$€qÉŸâÉ • ÍĢÂ芎Ī18pV0rÉrĘīŚĄļũÍFiXgīž[כôVí‡yҁ0ķÔZ û°`˜ÆfĀė3ž Îzœs^ Î{Ü0s/ø€íĨXvi|îË ÂžåpÉž‹\W‰¨XŗâBaŪå@zŨy1ë)æĮn€ųq pElArÉËüHŧč!ōˇÛĐÖ;q.å ņŨ„æ‡7šŲ„xėõōĖŽä„kJz˙ÄsÎr͎¤ŊŸáNF\ŗ#9áŽžė ‹6Ë5;U\ÍxgXze$šW3;ΠIĖŽfš‹íˇiÆ~äå˛fĪā‚˛Î_ ŅŅžâ~O7jãČ ÆOāA>Ú{*Āy^äS.y€Y”/ōhv%næE> AB ōŅæk¤:‹Đī'mzĐŅ Īhä°§aĪæĩšYžQGŨžøh÷îƒ-•q§<ŽôšõޝâE>€hÃ\x‘îäHĀ—ų8ᎉqƒEI›å“/áíč$ˆų1Hv¯B>ö~⸈F’s~îgēšëØˇc›÷ūJ—Hį‚Íē´ į)-.¨Íîh›Â`\Œ;!]1ųhv0*žæĘ‹|ėõT€Ë~ŧČĮ^,NÚĸ°įsžŽnĸ ,ŊJHņ“ĐNqjĨēĀā‹sšvSF_øøūšŨd°ž †Šœ. æ"Ô Į÷ ™ušb9SĘSŗu›B}ØŽ-ÕģŽmŸĪDČĘydô¨”ˇâH@Ē{;˜×1&Áß܎I4 vīÜθ„ĩ`‘ļUŽŲ‘ôvôRɸšģbL†'u9ŋØ0ãrĸŌJĨĢJ7zLŊũŌFãjÚ˛Kk‡[rŅčĻ>ÆW8&ĮŋB).ÎōĄ įm„Ų€‰jM"<@ãÂ*[ĐŧHްÍ‚K ´"WSLņ‚9qėē=]BԎf *ąŽ˜ÕԉwĸšĢôí4Āĸ ~>z:dÂÅO‘Ę@?ÍŊbÅí=BÃx7PßöM$ábå„áĻŪaŖ 7¨4m:dáy˙ÜAl_vHh[r Bīļ-ūŦŽlƒQNqģĀ6v;,ˆŪ cX`nQÜF1Įob°Ö¤ė÷Ô}`N|{ķdd’ĩ va™†ųœ­VéÛĀ6c7Íí,ÉØÎāęXzÅõ°ôF(…õMō÷ÖŽŠåŋ}/ ¸qĖö;$†×§Ũ—nŠˆ{ÕZ­k'ōˇgĶ–M‡/8ëŸ8ū†/5G8'(ãņõã˛üÁ ‘ô¸‹Ģan¤?L‹ôŊp{Ћ ¸´†AäéP‰(GŠéą~0/!ˆî`ЏqĸģpũV?΅.#bŸ"Á•Ļ”1Ģš<#”Ļ0ēĨ >žAj% ĶÖÂhbķGgDØķÍö9Ļ4mŅT9`šø¨>M4¸IšÁĐ!‡-š‰™>AΆ%žíͰšqkhbm‰nųævĻÄzÁėøÅšvŌŔ˛å•í2m>皜ˇƒ6ŋ˙Öšhvp›y/‰I÷˙Â^°YĢ^ņ†đWč÷˙ūģ#XqæI+Ė“dëúÔDanúFš^ā›Û™į ŗx%ÖpÂÅ|ž%1=˛ČG?ŸņvVÁë鄋čÍļŊŲßA~Ø!ˆ#a`ŋĀFÆØŋAˇ#fzĮ}5!júØĘEųģāëÔu0âŋÜ 1ųˆņɞ•H&Ö0Ŋ@"\ ˛†ž\ūĻË$t5ŌžĪ´ųo%ŋŠ9jķI›˙¨¨6GÔ?[jh>ôÔ˛|ĢîRGCmž:+/´Y|Ō SãQ€õŧs;¸’eE&^IōĩS˜^ąÉĀ|ō­6Y괍ØÖŋÉėČAĨ}{Õæ]ÛᓡžlĶģ“žúîīN`#q4p?¨‰BÔöÁ­hސ$EîÔ˜´^aV“ŗų¸ŒhE<Úëq-7ÍU„Ŋ㐞ĖNĩū´Žj}IÛÖNĨ]C#_RtÃZĩčÖáSō÷sô{ۍˇrbiĻVš‹ø7V˙ "TÔTnN@ŌFFɲĻ&øÂœäõ2ķųÕ#ÜņŠ^V×wˆp% SF’˜B}˙ĸŦĪŦ íY˙sļM­Ø66čŸ4Ä@¤9NP¸ŗ‚üßŋE‡ļZũ‚fl%Qė]ô”čylŦ s„IęCûؑ +šˆlkv4“(DØãŽxW,!>žÆe{ÜĩqWm­Éöm[āŨŒũ?Vũ¸OĢέp˛mū.‚,åš$•6-ēĩīÁކ4zNč<{īŧȀßIŖĪ<™ūø2Ŋ'AŠŌžšˆ#ˇ†Ks5ŋJ"¤lx›|$>ŅąB+ŅQH¤L4;¸-eÖIÁī_øMÛ×~hwcvĸũœ­{›†jrøš¤æ*][wjŪE'čž8¤?Ŧf48`ö–!ŋ.šE—ønxpŋŲČlf%Ŗ‚Æė3‹Ė wÃėü­Ō~ᎠÕŧ`.@#nM…F‚Ŗhd"éíšÉÎ"ÎŊÄÜ=.ž øaá­Ķā˙ę9‘57}i]IŲ^ßä}$˙­Č™ÚO2”›÷čŌ›b`ĶĻM5z.7´éúíņag–aÅU7ņČ`aQüŊhNáv!]â~›€ •å)ŌNujÆØ ‰B¸ §Ĩø ŋIiVšÚûq¤ éƒ~2/ėdvŧĮb}RMļĮ÷mŪCĩˇ cnZŊëČö]Í 8”[áüĐŽ'õ–Đ4ЎëĶut˙U“ėtv˜ķĢmúÄËĻĻųŠĻ]„Uyû`IÁ˜‘ˇĖ ‚ÁŦ0¤*ōƒaڍ@ŧ L’ŧ`~ĘF°LãËî01ÂU4î¤ũũQ{­ĶG~{ ŸÕXģvŸu×¤n%Šz7lPՊ­cc•đ‹ĸ%Æ->éĐŊšjsnT @bFvŅS›ōųōą6Ė‚FīąūŲđ'›(“6ēaĢsGE8”D;ß3ŒqyˆĀ˙GEŦ)Ķ:ē‹ Ũ]Q:›îī>-¨ĪBƒ•ĩzMÁs˛¤ Ŋ\ŗE‡ŨÛ0>}Ëņ˛æzOÚ\œôXĪIæ×˛â† GsŅüŋíôUôßQKmĘÆõũ ˙ãgÍ˙Û~–aËamúö\jxn:ą2öŊ5{í&˙4SS!ŗ6÷cjTUÛã Íč{Ŗy`GHÖdõe E|)~ėwXĻƒĮâ9ZujÕUEUĨ=kb>f¯ÕøßN<AšŅ›8eĶŨÚtD{UÚpō-ƒe˛[°įø@xáDi˚Œ&,Š’ā>o,Avƒ'ü˙š¤ÍkŪ^IENDŽB`‚flatbuffers-24.12.23/android/app/src/main/res/mipmap-xxhdpi/000077500000000000000000000000001473234705300235515ustar00rootroot00000000000000flatbuffers-24.12.23/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png000066400000000000000000000173451473234705300265450ustar00rootroot00000000000000‰PNG  IHDRįFâ¸ŦIDATxÚíXUGڀIQ“Íîŋ›d7›Í>Éî&Ų×$Ƙ¨( ŠŊw+ˆ("H/J¤#EcÍ5{Ĩ÷^)¤Zĸ&&ąŽŪīŸoæ\š”{NÖ ÂĖķŧšjîw÷Ιsæ;įjhđ /ŧđ /ŧđ /ŧđ /ŧđ /ŧđ /ŧđ /â Ā āúâ\8ô§ëĀ> }ņŧHŖëú2­4/ŨŦo\_d}ĶMeĸ•kū÷J×WtĘ=˙ĒSâņ7ŨĘMīĩ‡Aeä{3*ƒŪëč=ąäWĮī~o‚ÄØ BŧÔĪÆzcũMŧAņØöØØõU—:T Ķ.÷Zĸ]îy†PĄ]áyŸŧ6ęÛB§ÜĢŪ :Ŧ~VUH}{ī鈑$~QÍÖú)W$Æ{×/ĢŨQ?ļÂWR<ÆaĒ ‡™ųF]*‘r(D›Q2 ƒŽĖĢA§ĖTe¤Ė Ėk˙ËĢw€˜8%ŖdŪ`{í0¨ “?FæŽ7ŽÁ”ŠIņ‡ņ¸)ņXoŦ?xl7l?lGUc´Ë<Č!´ ]aJ˛Į¸Ž™ 3ųÁÛLúĖŦ .1¨§ōh—y€F’ZCÚbc]ŌpØú¤#¤ÄëÉ6ÁÆëGar…ŋ¤xŒÃx܎”x}A Ü)ņØnØ~#ŠĒĮi•yĐ/úôĖM˛w,5_mŪ§ę}^Đ*r]F&rä°&ך\ Ž!Ŗ|ÖeĐ;cģûĩ^S ˙}IĢÔã¨j čyHæ)ŸWc.9Ēž|YãĐܗÔyøz៾Ķ^Ķ.s¯DČąü čųH[æųÄ * ÆĮģÔž5wĐ›Ø§ę9Œ ŖĪ§‡W~ Uîņ`Ve06„‚ ôœ TæŠĀšëÄT÷‡ēOˆ}Ē–QH˜˙ŧĘÆGkëöŌiķĩ,꾆[Q°ųæ™Ļ¯íäĩ–uû`ëíp#Øægt˛-Ģēũ°ûN8\;Ôa=ÛÛÆa$imí^>ližHTEŌo06ā| ņ ĢļÂWwāÁã_ā1錄{%`HļŠjŧŠ;Ž˜Ë$åķ1ãq;ĒÆ,ŽūŠÖQy°ŪXÜ)Ÿí†íˇ@Ä>+1ŦŒPX\ûæĻûôî| üöĄ8Ø!÷äÁŦfOˇžyŨ8 õh}ąŪX>‰îâI´uŨ~¸^—vJÖũĢ4įˇ; „sĨēúīi=¯×˙@ëÍĪÂē@ø¤¯­d2‡1ų“ĮtBŨŨÂöŲ}'žÖ '“h~ß}Nã'•ûCņÃkôÛ}|ģĮ‘o{wëøčq=­Öë˯uŗë@väĪ8a'áä´ŗ†U—@ø Ɵ iŊ°~XO~¨ „˙s1í¨ŸÉ„Ú¨j[§}wžžÍx’ÃJwáĮ|HŊ'ƒËj đA-Üjø‰žâߓî•™saįX*Îaüŋ;׊@øž†'rZ/ŦŸōũ\ nx%zŲžcgEũTĐĸsuĶ+‚ĀĒn‘ Ž^€ü‰ˆö@ūKãČĨ* åôZÎ]ųHŋ_N/hŽŽų &–ûĩ¨ã$2Jå?¨nļ„aŠös".P;á­É‰Âũî!%öf> ‹Y_ DiDĸR÷į[ gšwPāãZ¸8Í. <ē Kԃ@/Ή2.Ķ,jö>ŋĢņæŠH{ų@Įīfu윿îSŊŋ<ÖĻE€EZ$X¤GB@)iŋÛq-ķTĨĢķžeF"Ļ{riž&ņVhÅځ6g Sü`Õåm0Næûüe$>Ģ9>t@y/§ÕJũÃīat‚3|cE™—ė‹Sax†#ņI4a ™˙<īiĒĪ,ũĩá!g‡Qy†ÄŽũ"PZ ‹ˇMŅõP6ß<-jéĸ7—<ŠRy˜@ž°$-ˆdCPĸLĮv—=z@x˙:—Ĩ}ÔÆ3âˆ@Šžôˌ ”@H´aŠ4õPRŸŗûģÔMüíB*O lŠ@C‰@C“ˆDYN*HÔC*¸W ÷ę´ÃçxP˙îˇņīĒō°AB|{Ŋ߀ņŋ°ŋKā>ųląņų?V2Č!K?u3,Ɇa‰ļL*-Ĩs‰z¨@ËsļĀŌ‹ž°4ʗŊ6įŌæŦˆö„=`Ëĸũ`YLK–Įú 0â”RL‚Á/í˜'†ÁŠ„@X‘ˆ5‘¤$˜‘,BY› 9ßÂĒ´00N ã4$ŒĶ[b’ž…‘!FąËŨ ū‡aUvŦĖ ƒ•Ų9á­ ˙?—íƒō i¤ˆ@šJy%ĘîHĸ*.~eÁVŌÛXUW2đĀ øė0<îz‡­`āAcÆ!Ƨߚ0¯lÉSĘ ŖĻ0äØj0>īÚ'ÖÁ ãĢ'Ė(,—ĮŦ͔ ʙ50ōœ5ŦŠ%#Āšu0øœ9ãüÚ|~Á‚%pqãŌ:˜ģŒ“C@—(b,ŦZ œ0+[JyđÕB Vō MļŖhæ´'Q^ k!Q;ōP ą-čø0š@:i)Z*Đy"P\3DȃLŽk-ęō´(ÉŽMy0žëL$ęeĢņT"ŌØíÉ3đA îL ‘ō :ļŠ %$RžÁǵˆį-E˃‹ĸ“ã\Á$E)8yđeîK3CZ ÔJ\ŊGž–¨$”ĄDØĐmÉC:´4HŒú']aÜqwÂˆŒWrĘƟfL8ƒ8Ā”ŗN` ŗÎģ„sŽ”‰į'˜xq†‰QŒIČEÆ%Bô˜ã NI;azŒLŽŲ(āJ™‚ÄâÜņn0IpodiJ ØgI^0-ÉĻ%{ĀôdO˜ž‚x1RoĖÛa¤#›(æšÛĀ&7ĖĘô™H–/#[ Įfålfä"~0+ĪfįųÃŧ+Á ‹ē.üĩžŽøŊ0›Ú4=tá)‚;"ĩVŸ €Eg< ^ŖŗJŧÁč˛ Ÿ¸° –\đ%Q>°üĸxĮ}Ļҁ°ô’p)ņc4^SōgÄļŧŽ´&a øĨ}Ļ !°"!ˆL1N$$ƒIR# …•)ŠČ°ËÜ ~š‡Ā,#LĶÃ`UĢ2‘ŠYVdŲ‘°:›ėoÃãō7ā[tĖķž„5ųÍ(`˜_ŪÎ(ÜAY[´ŗ‰+ģÕG`YFp×ü^XWũbá¨R/:ä~„‚ŽŦ†Å§Ŋ`Âq[ōw3ÆŅÕđrL€L”œīPNš3N™ÃˆSëĀ,:F!‡ˆĶka(rƂqV€œĸãiú°ķäpĨDī’ŦM ‹6 yҊqi=#ą†á1­ˆĩidF’'˜Ĩ“øx{oËH°c$ÚS´’ĐJnEŠ#,Ę “\ŸF&ĮiNŒt„ü=C “Ą“é:YJ6€Nļ‹Bŋ0&Ämč}Īĸggd΀-<í cŽ[Ģ4įi}Ē>ôÔZX:gÖĢ4įi}ĒŽ{ŅV'náDUæ<­OÕ§$ēÁĘt‹Ą*ĖyZŸĒĪĪ €e9$>ÕĄÃ9ĻzP2˛œÅŦBsŅQūļ™nī{Č&J„#Ņ"r¨ĸ‰”'ËL @Đ9ģ^´<8Yf…1Dʃ“å)Iî`J[ÃÉČ#Vœ,f“Ãi.‰Os+.s4 dĸÛKŸŌZę Æd>1愍hy¨@äe#•‰‡ t‰”D:˛ÄʃLm-y˜@-R]*Đl"иKŊY ™™Xī§g0båÁCV Dʃ‡,hR ‘ōā!kj2ˆL˜‡ ébäÁC–a(OHœ<0<‡T@rjhî€ŪųœčyĄô,Fd™,SÎY‹–‡ mæÉ¤Ŗ×‹–‡ ä!d'ZžĨ;Š”Įá5R=Ή°ÄŦĒ7HŦ0Hô‘hÖų@šĄËT…7˜ÕîÁįÍ(ÖÖíą`BæĄDRâ-ëöŅ|"ü•UŪo^CFģœ0XëKYįŪŠ_ƒIé("Ņĸx?ŠQ‚@ĸ?,F’Ɍ%)ŧĖ?÷[X‘BīQ_šĖČĄ,Ŗ„²LÆō,d ,Īf`2Øæĸ#`’+rÃaEž@>Ã8?‚N’ "éHcry+˜6ōøČŽ‚é•í°ōʗ`Z,P˛˛ĒdŦ*(c˜ÉvRV•īR¸Ô‚I›åēB <„éČŧfW†ĀüĘp>–N,ē2oús•+Ēw‚”xü]vLd#Ÿ¯z\Š'MøâÂ:ĩžŪT8ú’= ‰ZC.Z2. D[ÁP$FÉúŒ‰wËĖm4ŸgXœ5ŊG’`KÁûĩ(Iv-!sdfÆ&X“GâSčzÖđ4GFē9=W‚§ę#2éáJ‰Ņå-°˛hhįl­ĐĘ%¯yJ6‚V>C[I+ã2ĄĐMĄ_ 6Ę˙Îį@aâbņŠuĒ ˛ĸų<¸(*%ŸgtŧXdn­x;Ių<Ķ3ŧa5H‹H#!Ÿ]“ĸ­TžÎį<„ËÅ\YŒOØĀ-0ąÖ&ß|\M§IČįāëČD’Ī3=ĶÖä ‰Īįa]!åēˆ•F*â#4ŖËŧÁē`7]’’ĪƒO [—EH°“”Ī3#s(ŨQJ>,*Dļ5 ¤ē3j•{<č1 kMŌ‰Ē.Œę%šP´•‰Lɘ‘íCÚŪ(Ø” #Ĩ@ųDĘãŠwûļā•č‡īë Į>Õ0ÜįŲ 4wîKøaoŒũįÛZ%n5(Aeؓ!Pu´<Ņ(P’ƒ¤|ž9Jœ%ä폀Q1¨” $J¤ÄũÉŧōPĐ;k{ũˇŸŊķ>H—Īŧŧ¨ĄųÎĢäõõašÎąÂô¸ĮÔ(‘c§k[zÉD œ6RqatFŽ/˜n§7JČįÚN/Š’§Ø īŒéÚVgž|CčĶÕ"ПÆ}ōhС+íf–‘(ŧg ¤”ˆtfG Ŗ(UΎ–‰XUgí wŽJČįĄ™– ‰gyEđސA>ķ7a_žŠ; ŋēzAãũ÷û‘×ß÷{ķˇLLqĢŌ'ĮR2y¨šDí\$ÔKŲVšD€dIų<3s‰@E$>ËYJ>,. gl%™zČĩ ]Aī Õĩž¯÷˙öĨÆ{īŊBûV-ihôyíÃˇß ¯¸qļé´TáéWîr-OKīö5—¨ëę'[ũ_ũËŪ!¯ķ7ōú"ĘĐjr¯ĮˆļĖķ >Ĩ#FĘŧkjžR,ĢÚĄčėŊm1Jæ­°Š; 0¸&)~ŒĖGARLŠčøŊĨ Í,GÅĐ$‘‡ŧÚRÆĻē(Ŧōv)´SČ˙KļSqCSíD‘ωtFCÉtTĖĘķS˜íThgģ(đ^uŧ[Á{ļđŽ JâÂČgŒX\Ą0•‘øB7^YV‚×x(äTĪļpŒ‡,å|l5|ā4ŲûîÕˇ˙đWėKĄOÕ"†pŦÄ!īõ~üŨ?Č뀁6Ķ-ĮYmj’Ė)&gfUá`PŅ!†Õ‘āúŨ1°ŋq¨Ķ÷ļÅš­āsë4ŦŊöĩ¤xüĩšā;vgįī'û3ûrĖČØÄČÜ ˛ÁŊč˜›íGOÉg*ÉaĪæ™™ģ™2+¯ų~ŒXyel”„y…0ģ0€2§HI ā]sŽ‘ö ‚šJJ‚ĨÁ`]ų58W}Y(ĖSRÎĀi# ô¯†ŅmLIpŨ}×Ŧ™h‹}&ôŨëB_ž¨ĄÆō‚0䥚oõ}ũĩ˙#¯ŋúĮ×4šÎŅÚŗ*wÔQĢīÆF9>īüx|Ŧ‹ŧ-&Än&øĘõŧåíŊ§#&’xŖD?ųŦxIņ“â6ʗ'Ę§ÆšĒã"×;m+yؒ2Üđ¤›\ī¨ĩ\÷¨•\÷˛^Ž{œ1ę„uKNÚØRĻžq–Ī?į!sڎnW| r֎qΞŒķŒ9—Üå—ŧäcŖœŽōą(xˇ)Ãņņ˜ Fĩünø“܁f…žú‡×đšĪĮBŸŊ%ôauŽ>ÍG!œL˙/á/ÂdėŖ>}ú|JøŦ˙ģ¯~küGķū4åSÎxwĘ`ÃwŊ¯=ūūĢã‡ūYLˤ ßOķoÃ?ųØđŨņƒéŸÛe|{|løįņd˙' fÛS•IMŧCb1ëÔ&Xßqéc_>Œ}ƒ}$ôÕ_„žë§îҧų(ô’0üaEŪÖč×īũžŋī˙‘Æoú~Būū‰ §‹ÁžĀ>Ą}CúˆöëŗW„>|AŖ‹Js‰~Kx“€ëŋ‘ŠūSŖßaĨ{,ũ•ô•ˆr;"bDÖû€ôŇ´OXßŧ)ôU—ËĶZ"\ˆûĄr81ûŖpŒũŗĀÛĩĸl÷ˇ„žĀ>ųĐG}ģ‹<Í%RŠÔG8Žž*Tö7ũ9jEŲî˙#ôE?Ąo^jÖ_ŨŽ(+öĸĀKœn˛?ē­8 ÅéZxá…^xá…^xá…^xá…^xáåW•˙î‹,îv-\;IENDŽB`‚flatbuffers-24.12.23/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png000066400000000000000000000271411473234705300277470ustar00rootroot00000000000000‰PNG  IHDRįFâ¸.(IDATxÚíTTGĮŅ(ö^co ƆREšØ;Ä^bE!ĸ`ĄZčĸ ‚‚-F%{G¤÷b'”K>{—âũæÎ›ˇ,}÷-,‹îžķ?‹˛û˜ōÛ[fî›UQQ>”åCųP>”åŖŌ>Ǎ€sUÔ88øUIâ_GßŖ||y ũCĢõįj2€@ŪK¯GŽ…×ĖL ×gŒhbKy­ūÍ5õĻ{´č—îŪž†gWƒtWuÃT ūŒ˙‡ŋÃ×ākKƒ„U T%ƒFäjŠxĻz6îŽ30ŨkęŒ{[ĮŨ ØirĮ+ØäŽįeĸģDΈŪeåS.ûŋ÷ė5wš÷xã5đZxMŧ6ūâ€’Ųâ)ōƒÆ™|ōgdlí:õŪ–éĶ2ˇmžžš%vÚ?[OËÜ 32ˇĶÃŋĀæÁ>˜Nū=íŪAšN„×Āká5ņÚôoÜÛC~Ū„ۀmQ¤`œŒ=Ä˙oq-f‡šŨõ÷5ģģ!‰č=ˆ”áO5ņn@ŽĮŖãŲËūŨŸm–ą!Į4Ã?Į,Ũ?ešî˙Š$‰^‡ī!īÅkāĩ&fäō×§Ęûģīšļ6‘ļaÅی}(˜ōQŽÖæ`kƒq†QšÛŖ;†iîiFiî RĒ>įŨvË&?įĻēåŪvû4 Õl˙=ŗīmŖÛäuˇŨʝ^¯…×ÄkãßĀŋÅ˙MÖ‘hI[Ķ`_ ēd北8ŽéŧëģÛđŽû›aߔ •!8âhpĮmĐȌõAnÁČ _œlöé–jâ+ |Y&7Ú'Žo냌Ķ=7ʇqŽxl`œęŠG`9…Āđƒ<âîēėâÜSĨHĖ͍H_—íúčhŪ‡ƒô™ÄLũÄc=e|TĘCœūĢ;AÜ-ß|Bp\…wÖ ž,E…}ĸ}# ŅX)¯ßģq,Š#åŖ(ĢC~6ŧínKîĨØ æääĪ žo\ÖČ÷˙%Ž o”Ö¨`Ėh˛ Ķ<’Ä‚ã|Žę‹ˆĪāø€›“dqˇöÅĮFšI[Ģ‹ļŌÜ\Å,N‘՗PžĖ Ņø¸š5†_Üöĩ:7Ũ:’46\ÜęäĪ 1e‹Ĩūá8vE-u|æđä-ÛëßtOã…ČꔒY)-LōÖč…ūß.ŠÛĪ?ŪIuķ’Äę(’ĀŨt^C†´Ęg9C(Ͳē§8ĢÜv?Ė§æ’Ž+*f!’môKq=Ōå´U ņąūlæ,ĐĶKqnL˛ˆXI]– É!E.í†Kœfč’ĻâcūŲ,Zgėī0āÎę ž,yōį HY8ļ&7Ũox:‹Ž|æĻnën÷đīxQšGWB!ŊF’Áu#ƒŒĪB¯ēšNúœ{ÛÁX†ëā{įˆĘ9VËÔϞč›ám÷,ãĨ™ûLķîUŠ!âMčŧ{;ēš?>ūŋO΃åũ]Ys3w€PŲÜß۟„ŅgYŽcņĪ.Øđ_™°c`.ÃuđŊx ŧ^SAú–…cí’yčÉÔx/õJéÎø nIúžööūģthį͈,Į˙$ŸÖ?ËåáØ˙,–>ËrlĮÎ'áāO&ŪN†ëā{ņx-Åę[DŽų’ô=Ė/Ŧí\Šk>4¸ēēŅ ;^)ƒĶאOÅN ΰ4o˜æ%Xféūāųđ}–å:ØlĪüĖ0H†ëā{ņ ÚˇŦÁĝõŋâ|ŖĪAĢf•#Åg YŨ’T=Սf[$ëĘR”@ķsĸ‹ė[*—Ŧč]\žĐÆf\-Å^lĖ[J¯b˜ęūŸm)ü ÎŅĩ"÷,ƒ[ŽĐ7Áá™›ĒæJá\ĮՃ_įŠ4ƒü9Ä-8fë˙í ēąļ>8G įĘøaƒ[.cEãl‘P PÅ÷Î™“~WW‚ÖëI ĩ‹ĪĶÜ÷’sb.ŸŠ€)R žą5Ŋd§gę~ūV1‚ę|q[xQŖJ€¨oX wĶtclcȜ}Uáņ[åŦĸËÕE<îQ¤Ā}#sÔīqeÁ6kqî*lĨšš RVčŒ{”)nßøxH/É z™ßŋb Ę3{U‰YŒ+ŠĻG öweŅļÉdĢËŨ•‰\×MWëâ\— īē˛++@ãė"GųZ!n%ŗŠf”];’u=ŖŽĢ„ĸ0%@ŠŲ7V¨ēqĪŋÛ2ãZŅ(UjûT5¸åļ]’rT%@ Ü7\`ŧž 4ĪÛėÃ9-÷´žœõ.;éxr‹ œ•UŽžņĩn‚CnũsäPs&­ĪI‹á•)xߨ6‡Öy›3tm¨ŧÜo}ô/¯4á âå=ČX­‡Å[+"?û~6ËØ+üžĪTˇƒĖeßxP?0wDšY!v [Õ1w|OŒšëc2ürF§¯‡ŌåGĢėđĶe–ą${OҚIåęÛLx›ķB_ĨĀØtA×Áv`{°]Ø>ám’Ŋo2š>e€ä7¤Ûd#!}ÚuÛ…8œG+TæGîdÖĮéÖ><^Eų *‰ļ= ĨÕvƒ¤ī)J~ĪÁÃŦᐛ› YšŲđįŗxA×Áv`{°]˛´GÖžš?<!¯ū†œÜÚ'ėöQ–öėÛ'œSģkģ`Ö.&8×Îei…øĖkTÚēmŌYŸ˛ĩ@Ķīn“/.ÁĮœ,:āwŪ?†Y÷ļWZ ´øūīđ$ëí ö û†}”ˇâ­ĐČkÁä랞ÍȘ9ĢĸwÁĻĩ$ë>åhŽ~tū~wŸz6ųän$1wGB劁đõ'_\¤ũ@aŸ°o• đëB:Ë^t[=Ž ­:8NvˆØQēUû][š¤`ŠFEe*+IĀų<ë øŸÃŒģÛ*@˙„—Ųoi°/اŠĖ0ąjįVīârčũ§š3Κf’yõ˛ØķBU3¸éšÄR÷  Ī=OYĄŗ/ŽĐ{´* @SWCĘģDÖį/ËaŸ*|‰‚„ iY_%s^“[–aŒ}tãė øĶPĨŊšŧÖJÆgĀĶŦ×ĸ€ĪkŽ,ĄĢâáÁ>`_aK´°gŨˇO†s/SJĪLØWũŽ9ûq_å ZœM˙ÃPc ,éāW$@“36ÁŊ˙ŖmÆļc°/ ŗHJæK_ÕYnÁšîƘûęî<ŽŽÁm×iƒgyŦ֎žŗ^PcãE>ŲB'phÚZzŨ1$sų1}Õ¤Œ@˜HÄ˙˙ŪpōšÁikD'ÜKĶ7ãT8ø,N”ļcÛņšŠ´ĘŽsLŨX°Í­6ãô vcŧûžäa":Ė[—ûņ~rŪ e|øN´$ƒėųđ8ūwžfqƒDŊžWŪۃ;īÁC˜Ŗpq]ūߡß?„ËoīŌEĖߟƀßãŗāķčm“$}›—šCävąÍØv…ÜĻA7kúŋÎ%؍ą7U•âí)Ô}É ŧ3äåuQ@ŊŸLŦņm|īëO>ųSîn§˙„}OŖ!@ō>į#ąZŲô=|<"­˛Iė… ŧÉ~OW“ũ_,Ŋ˙;Ũš(¸´0(ՋBĘŋ÷üËkÔę)(@9X+dô—u2 =@yŲ—ęØ4ß(!Ų—<7ņúŧz•ũĻŨŨB!ú᎝PĖŌ0îā_SžzM`B@ŅĒYfîĸ ‹t$i;Ë[lŗÂnc6vĶ9$jIž×ˆ åߌÍđ{)$û’÷Žõáį ĸØ"îu*ė}E'2G #̞0—ˆËÛūŋP¸ņî_úØlĢ"WđŲØĐ¨U¯ĩ×NîMīh•fQQs+—}ũxŅ{ĸé]AÁŗŧšqo<øøL4I NaW—×l#ļUĄâs‡_ô“= ͑’LŠJ˙TŸxÃĪęžäÆí~IŪw MqÂ6b[ąÍF \ë„nlTĘZzxŲ/ȂäqúēqÔ\՘œpA‘Â8ëh0ûRtp ŨërÔķŋ"4&͆Ÿ]Mã dBĸ8ˆÅ?ß.ŲtJÆĻLĶ ?…saXXfšîOc ~?Š2 ێ}›î§páœã܏w}ĐÚTˇ ƒ$ŠbĻę+ÍÖĶ2ˇdQ€døjĨōČæŸŊü&ŊŌ‚SP‰oî€õ?{ 2įč}Ėŧ˛ģxŽ3ĻLl•`UšŊ¨ZŋÛgdūî~¨ §xá"!nĸbĒüšĀ“—ūŋ#Ö(‘öQN_à ߉÷?Mŧä ='ĪF&$ ¤ŲŪ‡ę„ËžöøuÖîæ*Â9‚Nū¤đ`9ëį/ėöûZáį?Ū?į.Ŋĩ†ėĩYLt?(@ėE5L¯û.~đ;,ģŋ?gŽœdzúÅeēzüšÂà ûˆ}­čhQļä,ŧŗüeŗ™ įūÕ2ēî|lZæV VsŒ*đ,eÜĀ…8yŦ"+а¯Øgė{E2ËØ3åN hąĀbûڌŌĸhúĸÚF).ņĶîm&­Ī5Ŧ Ē=ÜŊü/˜î5})đđÂ>û?>GĮ BŌx"œûŠ›@û¤ÕeÂD=ÆF Šŧ3MĶĒŠti\ßøĻûŠwĢ_dŋųâāá…}ßą¯€í3Öi*-ë6Ŗl8—”ĘsûÕ:Xöoi|Ķí ?š„ī1ĪüžÁđđÂ1Āą0Ē€ür§enķ6ZŒėՑ¨$7ÆTũ[įᝌoš?Š(€0•ÅMČ/^8’Ô9•@}Ö=k;MĢ=KH€Tŋõ1ëj|Ûã546Ũī“<ÂלxžŦ§€pL$ŋ˛hėŋOn¸í›všÔu㔞ũS=ŪË ŒüŅįŋ¸)úâÃxđú ŧx˙Ząvãsrāų‡×đāíSx“%,!Ā1Áą)í¸ōH/ŌöC{ëzČF‰ąUčŨ'÷&Ņ˙Gy„̍|Áš´ ē›?‡øÁøĶÎô9âū…€įcvʈ‹˜0)l5Ø'î€KOŌ] ĮĮHŪõ´Īîl=XŸ˛QŌj4Pˇ ûČ üŨĪb lHæEčšg&ôÚ;‹ĶžY û‡œËˆ¯đ‚˛ˇĪÎI+Đ8nIô3•‚!:đ8 LnyČ (Û,‰b抆šˇY/ãTĪwō3G_r[hqÄáá5=h5ŧüPq™Üŗ÷¯āĮ÷|đhœāä˜ŧ Ū pgŪ?ƒY)›Ā‹žäP„ŨûöķŒŅ…ÕP1×Ŧ^*@]Z×ķôŨK˜}~m!xPϧWR+PQ=}˙F]p.Ę*~3ŧø(Ė:âûæ$l Üt-÷4^÷’§­ĮöQ/ V‰Øj´v[Ŗ›n™ō˙īĐŗxÁˇ×`†s,- 4÷›įƒGã€9lŧ|˜ą@įdÁæ'Aī”u>xtO[ÃéĮgØį?î…CŋĨ…,Qy¤dķ Šžš¨Ii<ˆ¨‰QŠëßōØĘŸąžeɧėų;~$ŽLëĀ<~Üü/‚×+žFú}öHÁø0OĐ&Áķ„đÕ°īNˆėÖíÃ+åZÁրĮĶņ•ĮV†ÖIĢ4ÂÄהq%ߝQUĨC<•ĄąŅ5įXyđßų2ZkɆįÄ]=|ķžˇV‘–§¨lėŲ‡×đÄD¸”Íî“UŪ7ƒöĐąĄĄ;+ķÍÔôM uÄōaĸcŖÄ˛Ö**ũé‹é_\q´ŧË9žOķūŦJS孄'ˇĀ$Ėt.,Å —ān{–i9Įä´@čũû\,įhĖØ( VæšĩÉsÃQIž›Ęģ lÍŖS•ē(žĸ…VmÅå=0!ʋh L$šy5ü“Ŋ ėŪ¯´ Ė*uũfĮŪ5dl”xgF•66zx+kĶ0wĮō.i=÷ō* $• áGīEÃŧ˜ 0/ĩ~Ž„€´Sā÷čl™”´.žą Œ6ÍõF&$h¨žÖķ&ŅĸúŒ€r+ĒĮ ” ČĻ+ĪĶA?ÔV$ã0X°‰Z"Ŧh”ĩ¨~B’¨šŒ˛@&Z” .VßcV¯Ģûč~Sīn~_^ˇõāAá_bĨa™W.fŊƒ!‘ĢH Ŋ˜Ē_č2˜ŋ&ÄxAŋDG0ŧé*Ķm=cŖ<>´k8™č0ŖÍRby~†}:éßv-ķ ņß_RsšÕOg›+Û)<:ĄK@?Ė–´tׂBtKzˆpÎq[~ŋžZ+\ĒŖĸIKŊ;õ+•-ęįŽųžĮ‹”Į­ÍX4ŽH%•U¸¨v’ÂÃ4?!@NÄRú턆ˇÜÚ|{ 9¸8šŽĩjU[ô=ĢĨ<Ē6ëßŊ.ynjãšž<îĮtūĖ‹ËJĘH'$€A¸P8(–D!ZÆ r•ætŽœ‘WŊĀä‹ČcBĸ¯@¨Ę‚ĨÆC,žNw)ãĪT–Ŧ–’žĨÁ ¨• &ĐZĐ2 J7j~åˇD–ˆôéû8WĐ^5q!˛Ā˜ **ßwÁ@ēAˇŲƒúŒŊãû”0%đ€…ĸƒ2?͝ˇŅq´Ž!˛ĀĢHK×'?ˇuuu8$4.  qé!ķÍtëA:Ŋ†WŪŌgiŪSH¸ë`­ø˙ ^ãÕĮˇŌŋ÷c~á;îŨásÁߕĻˎ˙ƒŅqÔ]éGØ1€ŧķĀađđęwqy‰á\ãwˆX€GÜĩŖ,H@‹éĻújõČsËÁÁŽ^e Đ [Ģanœ?Ė ZCä3Νɝ`ÔÚ|šE„…ckŖö‚˜uÁf…ÖėPĻuy ãåK5/b=xÆî§˜í0‡ü<'ÂæDĸÖį)J\~œĸ™büŠæ­HÜ^Éûa~ÜF˜ëOûEŋĄĖIvD• ĻÄ*›ämpũØ\üæ%Āŧd1] ,B›`ŪĨ<E:ˆ˛HÜDę[ŧŽYRqE`–ŃQZšDĻį]`&W÷Ė"ЈpŽņ„Ö^æÜ$s˙ e€cĄŠtЍTk`ĐŽÆAgú–@´Á×V҉+ õ  ^ +ÁđP€Ž€ÎōYJ8@§y€| īkÁđ ÅA˓ éáA”8Ęãkŋ3ÁĪĄūÔâđ˛:í ^Áģ`á™õ`~z-˜ŸņiŪY^>"Í?ˇæåÉâŧ/Ղ`?XžV„ū–Ös ņŖú9ğShž„māž‘ĘŠÃË5æ7đ‰?6‘›`ad §¨MT‹ĸ9YĮlæD˛,^īP̃rLÜ [¯ž§¤]°8qՒ¤_8%oiiō¯œ.rZvi' ĘūĘo°ųÆ)đI9 ļWwQŲ]û-O×9Ų§ėÉîīŨŸnî…9ĮŊ˛4&˜˜â\7ęÔ¨ĐėĢpy‡ŠJ­:›ˇ Ī]p8&ūÕØ#ˆ%2 ļ§ÖĮøđ"jyņcHËs"ĪōŸDëC,ÍŠĨ0蔹@ëajgŠ–g@‘–‡ZœaŪšĄ–˛<ųŦO–gP8g}‡¯ –gyŌo`íI­OŅ–Į†Äay˜õA@ te]–āV¤å&˛<ŧõņĖAk§á;‹į;ÕiNįē–Ŧî+0ŨĶm:XCRžlISzYĮu"Í3 iĖcxx!ĩ<†&ibž‚ë<:'Ŧ`Æy/s–Ä@ĨŦķˆĮ<…Ōt"ŧ÷}N¸/č-–*æ)˜Ē wĸVg`ÄrŠbž‚ë<1ŽđķĨ-09i]‰1U}>aŠGī?ĖsšOĐĀ•į6õZד9x.’XģvûĻxsY Üp‘čKčĘâ¤zƒŋ]č„!8čŽD €'@įœ'H0ˇH(čübÁđ` ŒāäH<"€.o…ÉɤMĨÁC¤—č˜ƒmPķ6=‹s[ģií¯é‰Ŧܜ— @|0­ĒŌĻ>ZĄvmĻëO¨}+‰*̝:@KÔ?؎čČ"Áđ`ĻE ^c āŅæŠXĪ$ ŒwF. fZą +[a W<—Qđ\ôĘ4GhģúŨÛj“Nũ‹‹‹%­N—õ—­8˙s\° Æ;ĐĖ k9€N ƒŨ• H@xĐeĄåÁ,k`Ô Áđ ģ2Œs¨(pˆÛ"đč&9që>;~zTK­š>ĩ>­ę5-‹ÔŊĔžZ!ŽÔÎ]}Į;ęa]IšģÜÂlnøßkčDQp¤„…'„Q€Îį$<"€ŦáĮ0  KÃS đˆēJēD*Âō <Ôú$;åâ8ĩˇėsYŪÖ',„[üĩjĩ%Ī]I@A]Ųm×ly~ánĀâ$öPĪC á˛ˆ˜˙q šQ~ Ąđ ÅAp ZÛ, P<´´> ‚đ$9ek“ŋÛÍob™ÃīHÂŪ–•—õ)”‘ÕéĐŦ%Ž´˜ 1B'zŲģâöÉĘķ "œ,iëytO-¤%ĨÛOÕ)@áE$ žgE¯ =+ēÆ*āļ(@IŽšx¯XĪ=ŗß7JįNå•y•d…p ~͖ ;gĩn“V“ˆ^îq{gĢ8ˆ¤¨įŅ=ŊˆVb)†–ËÃg[ÚÁ  hzؓ,•„hyō$ PÂrŸ Vķ‹C$¯¯ũĻîŒ Ž$ģęX~š )ÜVÁT2ΐ°b0@1ĢÃ#č:Pŋđč’×uß:íA͎͌hŊOĶÚ­ä8—P7ā]Y‡…fjG.ˏ‡ä_ ‚“ZZ*(ԇäJˇ#„–ĄęG€bx€„W"@¸)Z )āá˛ēžĻ^a%˛¸‡dËęĖs[MŅĩ¤ŽĢEƒŽô~/9ÎĨš2ÜtkRŖYũ.hģŽŸčM´RŨ?á*ĩ<âŨZ‚’ļ'°~ÂZ-đh™L•„4X )áÁxĮ0‘ȟžÎŅ÷ē..˙Ôû°t´ũ~#ΛĢ&bĻUT*č‘įĘTTšĢÔ¯ ëŅsĮO駁¸2yÄģ3œ¸âļ'(@aë $m%Ąu|$(vC>€„ƒQ€.ī„ÁąĢÃ2J\V)@z‰N¸Ū“ŖqĘ žqsį†ÍQķŠt]Åš˛z*ĩŠOÅ[AzöÜ;3ĢûDō(_LTÄ"!–ŸbĄYˆ› !e¨@Ģķ$´’p°8@áÁx' âÂ<šAÖ ļÖ,ŠĖ‰:›Z*­é\U ë*Ę UeKā k6ŦŲ},Qo­ƒ–É&—ÁâūŽlĮûeūÚoŗtđ|x‚>Kōúˇ<Á ÜôÎØ€ŪYĻs‹Á0h)Ė ķƒ‰!žĐ/h1Ņčwž)˜×RN8é@ Ę ÔĻD­…ŸãéÉ`úavô” Ē^öôVNÄ*G‰)ڑSŒ#üįWvÃđx7Æ:qŠC-ŖxĻNÆ +8%Š)i%ÕĀdX|}Ėē˜íéš~ōUü÷psĶPlģĸŠŠ‚<ÄãĄÆ$@ë„ĢÔÛˇÖ›~ĘãöšôŖ°ëi…ČV†sû\Ą•ø,é{–fė‹„@v‹3wkŗy¸xÄîĮčí07|=ĖAŅ[œũ`N¤Ėe2ōįÚ@b Üy„bgŽJÚ Ū—Ōŗ įĮPY$Đŋi‘HīEYĸ’P›Š~Nf珅jéå´’pŲ•°āōVNWļqēš'+’ĸsÚNcÔ”_EZœ˛ŌOg;_ÜĻŋ,žĶ¨]3œ 6'!î)-ÂÍĻõÛĐ@íģÖēj&ķÎø¤¯Ŋs,˙ũ-[–_ą˛qû“0ú,Íûf§˙cÖ¸"w˜ę NŅŋÂĸČ@O~ÆCĀ҇SE ŧ`B$S”L¤ZŖ×¤čĩ°$a8'īŠą>0)v-‘7LŠCųĐ{ŗP“ŠÖÁäNSP‰(_˜’Ä k˜×ĨĄ•„S/Ž'ōƒŠ—˜.sšvŲ?OW6PMŋē‘Ķ5|ŪŗS6eģx&ī´ŋ×ĸg§A8õ›ÕĮ°ĸ)››jŠOžęE 5ã3ŗÖšj&SšÜ2J^Ib"ÁįN$ą~é>Kû^C’áq'Zg7fC‹Ā&܉nOø&˜“Í´¸3˜ķk •.Ņ„h/bu6Ō“ÁtÖr _JĪæÁŋ§Aū?Ō–Ū§NeKoˇÉ§h{į vWwÁxgZĻë@wĶEÂûļâķ-öKpâ„Á2Æ<‹Ųļ8ÁÃg\ÍØœTWdx nuĐہjpôwkÔŽ•~Ÿ=s’q1 ŗ3!5HD›‘ÉíKâčG Đ"™*  <“Īå‘Ĩ’p0Ȗä"qĀŦĮ¯ķ`ĒŽ3ųpt÷pĨQÛf† žoXÆUWž[e Fû-ęĩŽ÷-yî^ŊzuîÛ§…čÁ¤ëDŠntŅQ^ņëDú$ČŘkyĐō…GŠņĸ'‚Q€d¨$L,Ū51$ÁEbxúæ-~Ō8ąÔ<ĮF1ÖÂąŽŅ”Žy 6Õ-h–43SehÉ:ԍt°wˇ€‰â$đgņI QY„ęÃ,’7€<¨ÛZIČ´†d'S%!Z@áI(ܞĐK^NĢ3ģ8>BÆļĩ<ÜXˇ,ŽWxŠƒ¨E në;ŌQõoŨĮŦĶLX~šƒŋĮ@šë͘&úߘR—UGĩ'ŽCn,kąą­Ēō™?Ä+ëŗ€¯ƒj#j†¤>l‡­Rß?÷L÷E™ÚmˇO#Ō|Ę îXgčK&XŌ]u\(¤%1€d¨$Dpx€číÆ\ÄMāüÛvžą+˲z˛ąęĀÆŽ~ET* D|pæˇ ųDŠŠO~Âj~ŨČPÍÛlÆ‹W˜mP ”ž.Ûõá‘\Š<â׉ĐI˛Ģž (™* ‡$vcwîĐdˇlŧ[T+Čzũ6ķU—å?ėĢŲ˛Ą1Ͳ¨ÕQíJĮŠ3>Xūĸā)*.ĒÅv‰[°FŊ›üvŒšī¸ã}Nüüã´@#3|søÉ@Ā7Ņ”öŊĸNri%x3f‰'‚HxtŲÉ`:$ŗšėžƒGŦāIeę{æ|øÆuÔÉ&ߎ-Âę´dcUësw¤ĩF5ØÚESú ĢAcŖ^˜îã ļ­9šĪ†Š§-‚|ߎ] ėp‡Oŧ{“$Iž˜k Q ÛŽ%¨xp;‡Ä8ŸHŦ“ƒqŽnŧ=ô?gŗūr{Ģî9ūLķa=Ļ2pzŅ1¨Ąō-ŗ:MŲÕøR­Ž¤Ö¨ķīíĐdWoXÉÔqPģĶ6íŊvâ#Ũ§_°veđĮîQI“¤ßlŒß‚L!*f…אDE;”ēaŨ8ģO: šēĖ6ņZ}Ž[BmĶî÷X9vī7†}Ė8ę´ĪœģjĪÆĸŌęHÕaŲEK:ˆuUŋÃlˇHĩÕĶīŧt¨{÷­Súŗ|ĢC&OđĀcjŲ—…ä”4_MŨYœ}‘‹„ z&!H î īOÄÚä’÷į‹CīE×!ņ•Æé…Đkīėˇ]׏OhkaėAúb ˛8uHI_8-ŲÔų’cĄÖ¨3ÕuY!Ô×4>"ŸJ1×֛HŗÅŊ&}ã0üIÅØŧėŋm~šžĪOĄšNfÛÔĻö_Ô¸KÛĄĖŌôĄÖ†´‘ZŌfl;ëCsÖ'ĨőHĒlŲž>ËLžf{A)Ld‚Ä,“(ĸžMô:é8ËĐJËÁtÎÚÉŋuķ›tĒ×ļéąŊ÷ÍNŅ8`žĄyČâžÖņ˙iŸZø”čšÎéEĪĩO/|ĒubÁš‡-ī÷ŪožŪcËԔī|ÆÅĒš>ÕgŏŋŠ/éÕf’ŽUcĒUĢĻĮūVöˇÕU8KĶK…ƒĻ3kë×Ŧí X_T•āȤ¯XFÂ[Ĩb0áŪPGâÔpũ„~âķâĻ‚Pi0 Ą“_ŗeC“úŋÖ¨wë፴ۍ¤"?ã˙áī :č.Å۟ „EVĻą'j´-\›ÄĄáŨTuÖ%8RAĢ$S–ūļbŸxę.›#P—W§YÃŪ4]&BĨēČb‰[.q‰~§ÂŦ žˇ:š†ĖžjĐûâ:˛ŋ؊ĩĄIh Z%8 Smļđ֐§ÍX ÚšY„öl˛;Qׂ€ĢEAāԍ‰û7ū_ÚĄNėŊíŲĩZŗk7cĢ!ûÛĩ•ĐT^˜žb“V§ĩؚJ]?ņ`5aŽĨ h[0ÄՂũŽ{m1PęŗkÖaŖû›Õ ¸'%4•(q¨x°TŲ„×d“_‹YĸÄ˙ž&{Ē(â°(ųB *WÕ ‰Ģ¨×ŧÎ÷ø?gwâc$°æIENDŽB`‚flatbuffers-24.12.23/android/app/src/main/res/mipmap-xxxhdpi/000077500000000000000000000000001473234705300237415ustar00rootroot00000000000000flatbuffers-24.12.23/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png000066400000000000000000000246341473234705300267340ustar00rootroot00000000000000‰PNG  IHDRĀĀRÜl)cIDATxÚí\TWÚ˙M1ÅėĻė›Ũė&ûî&›d˙ųoÖn4VėŨ vĸ( ** ¤ ĸtģXb”Ūģ(ˆTģ1‰•aōŧį9ˇĖPT`ŽqÔs>ŸīÛ<ÎŊ÷÷Ŋsnyî´kĮ|đÁ|đÁ|đÁ|đÁ|đÁ|đÁ|đÁ|đÁ|đÁ|đÁ|đÁ|đÁ|ôōÂōÁG3CÚ)žX2ˆÁoüĮĪ;ũĩo™Ë×*\:ļŨšĀŽsjB:­XÕąĨ¯yã+|˜×Mj.¨ŲLjsM\f\öņOĄ&nĢ–ž3€Yh’A'pzĩ"Ž厃û—ģRû—ģV‘Ÿ÷u„‡OB÷BāÃ9ÕĄ‡TŦzؒßž?ī÷pn͆‡Ã+=™Õ{ŪûĄAÍχ#+×0̉ĩ°&ÖfU——×̚¸mpáļjákpÛßŗŠŲŒ¨vžN¯:Šåįšû8“~=Ĩz퀩ÕAņSĢÖAŗ\XûD×l‹Ká WÜĸߌjÂĀĒv7ĖŽ aVĶ z#X×îũęPf5ąÖÄÚŦjâ2ã˛ã:`Uˇ n#ÜV-~]sy YÁĖ4—Ĩį.üŗĒ‚ôĒ׃õzUëëɟˇ ‡Úũõ>WŖęįWojõk…õĨ=õ~׎×/ŦŲĖŦĻŲŝõ×bę/ncVkaMŦÍĒ&.3.;ŽV5qÛā6ÂmÕŌ×č]VĘŋ&šPĪĘˊĩÎĪęYCË=V¸ĸSáūP§Üũ7˛•ĐUoĩûaL…´ĩFcæVm§Ëa|…/ŗš3΁ëåÃ0š2€YMŦ…5ą6̚¸Ė¸ė¸XÕÄmƒÛˇ•u~Pžō!Í ųũ 3NëH”^iœ-­=āįü¯ü@öüƒČByŨo„úūĨŽ  FÕa`WģF–¯MkIĖšdoc+ŧ™Õœv~-8“`M¨ôcVkaMŦÍĒ&.3.;ŽV5qÛā6ÂmĨqŊ2×zĖŽNą LÉņt§ĐcJ->0Īöŧ2­ĖwāÕ! PĪbår^2D 0CSOûHĢQ˜­æÎ(jĪŪ_¯Nŋ°.Aā!Ģ•Ëx  "ĶĄ%0.Ņ9dĢŊđI …ŸŌŪŋī‡aĶĢ‚Hæü\.€& $Į?T­‡ī3ŨĄsøü ˜ąî! Úk̝õ=į$ POŪE2ցfÍI‹ÎI{˙ŽûįũŗŠK €įtš\&é´ŠĩĐ=rií6ŖūƒYĶĒiĐ×NēoāŪŋk„qūen¸\–`–Ļ_X=âL|î9qfí‹%ŖŪÔžX‚o捎 {ãũt t>XÉā0ų YÂL}ˇ\ņ…ëØá˜ĩOæŧ%] {ÖãņÍŧÕeßü>ä måp˜ kĻøÜiôHĖÚßMußÖ6Ūîŧkn?.āi đ/ûąŖ1kZ%€øf:tÚ>§?€ đT°1ŗöņ‚q´E€WEŪé¸eö.āŠ `3z,fMāU.€ đŦß € đÔøĖnÔ8ĖÚGzÃßŅ^‘ĶĶáp~ū đŠ6 đ.€ ĀāŧltčŋmĄÎ¤ķuÆ5[aÅĨ}JÃęÍ`PŊ‰ WŽBĐõXXZŗYM Uȍ80Ŋ¸“YMģKû`Íx°¸ÎŦ&ÖšX›UM\f\v\ŦjâļÁm„ÛŠUMĖfÉøâ6‘ā čd7ž ĐIļm‰Îėǐ:ËKáā}%Bi_û#ؒ= ‚¯ĮÁÎ[ŠdƒbV3āZ „ßJ‡•—0Ģé}5 öü”ĢŽcVkaMŦÍĒ&.3.;ŽV5qÛā6ÂmÅĒ&fŗdYģ&$š)žą›¤}HS Žaú:ƒĘ=ęôĒÖÃü •Ŗ*ŧ`xš'–Õ랂q:ĀĒĻŲģŦŧrtĪ2ĢŠ_J;ã|ŗšX kbmV5q™qŲq°Ē‰Ûˇn+V51C˜%Ŋęø6Ö\ņ?āĮü€ Āāp¸\.€ Āāp¸\.€ Āāp¸\.€ Āāp¸\.€ Āāp¸\.€ Āāp¸\.ā%ŋ"4ōv>œž[ ö—~|)Đ)uƒ×ãĄānėš•úBšŦz‚{‡Í×_é[gTŗŦ.†+įT…‚Ū…õLĀø_‹då˛Ē‰ÍÛˇwAŠTÂOuwĀäâkš_ —›÷YŊOŠŲkkZ [+Ö+č2ßŦûV^>Ėė}âļÁm„ÛŠUMĖfÉčâo§øÚnŦv7ÅëW‡ÖY×îŋĢQJü"füâd„^“ØYÕ ģ‘?+îŅ0 §Č^Ņąö€F5ũŽFޟ˛`͕HfīkaMŦ­I7öË’—åßt#Ųû”íq[ąĒ‰Â,Y_Ū “ž‡Ļø!žuŗĢB*L9ŽÂFWx1Áėâ.pģr˜6sŗĒi\ŗ ’~='BĄŦ›K{4ĒiPĩV_ {/VīkaMŦŨÖcȜãxyY\v\ŦŪ'nÜF¸­XÕÄ a–fW‡BŸ8KŪĪú Øëj$\zxK΍‡•{žpĮ+ũáFŨ/ōrâ2ã˛ķƒ`~üÉÔB}ΏúJÄ %ĀĀ2w8üSNƒeÄeæg¸4“+ ãNšÚŪņ&L"{ĖE€Å5[á~ũCyų2~-#ËĀā¨Ž˝Úëëäėž™:mx˙Ú&žž2ÕäÆeÄc ~€ Đ@+•  %āĮļ&÷øāžŪ2i=tÜŽvĖUąs.Æųheøī1Įt€nGËô<ļ‚Ī͍víƒ[0­< đ<€˙'6°k˛Ás¯”@Ÿ=‹›„éŧk$_<­uė­HhūnG†Ÿ°…š_¯iV˙R ô/tæhģÆ5[5>đ /Žm6üHøŸŧ}dn­]ķ~ۜÍ͆éš N^ĘĶėÎŅûˇaVŽ/ô-tähĢØÕĨū@¨ļ˛į\tŪ9¯Ųđ#ž9áOåáWš`OæūͅŋÛ1cčą ĸ/fkü˙ŦIƒ^ņ揔€ đŒXTŊEūŌ;M(ŧ^ ö-m6üȉĒl­›­Jo6üȰ“ļPņK­Æ˙Įuō)0-m5ôŒ_N$pâh“JŨ ęö)6ČA°oî>čž Ađ;ī2ƒX/x ĐžÖÉûŠ`”Ũ7ī(S-‰b2eÃÛĪĮA&Đ3a9ô+râh‹ø|N–ĪđÁsé;‹O¤HGzČFą†5š{āę]ímšŋq˙gđ)<ããœaÄI{˜–´ VĨ2=u{éî ™č=N6•€ đ X=öŠĖËņú{?ĶëĪMã;ų„ē~ī6ũų4Ž7œ ÊßĚBĪDsY.Ā3˙|ˆŋ}á÷!įf ?%N%oŠF-‘V—öȏ3į<}~­ģŗ3}ah‚Ė°TG˜RđrļD>ëĻøÄ_Šy0GpĒš¯2L2‚ ëÁ$SĀ6+ėēšō27Å?›ĮĸT?¸Áƒų;“KĻAŖaT’e4aRŠ;8lë á/×cQžå1ޤgņ/;ŋiЀkr `&ŖC~oœŗ˛}šœ"åÁOIס´ęĒėËž 2Ę j$€ gÁĖ´5Đ+Ւ‰\€Į€ŋũ”ÃųŒވ”ÏW‡uEŌ×ĐkT‚ŗN\€§%~“ûËø\Om!îjŊ7Ã/ °$+X Ҝ"HāĖxā—>ÜU<āa|F\¸sú$XĒH"dŖ^˛=“, WšU›%āH8FØŋ”Iøq/ 0X@ŗđcĐ%FĢ  IøėRܙ„$ ãÛæđKôÎ$xŽčϝ3¤ÂŗÛĒ”ã*|`t…Ė.îˇ+‡iXk^7˛Đú1>ûŒUü(0éđ XéÚCßK›rYFéwHä0b"pDŖĻ”īŖÁ$6ÆFÚA˙cf2"D"—Ģˆ’0ã"ŅjÄXPž‹uķ”˜įF~o :'DNZЈEŦâT ŒŗˆI@la\˛ Xfm‚Ōŧa`ĸ- J´HR#ąHYAœĒF⠐îc3ÜĀē` m”’á()04ĶI Klgœ† ËuĄ ?åcKŊh–fW‡BŸ8KÅÚŨŋDGŋ:´Îēvø]R:]>+j÷3!ôz„ßJ‡•—´úĩ6á0?f =āÕ?*BöüæQāvb,Šô†šĢ"O˜՘Õ0īøj0 ŦƒhX{~ŒĖ?áæqA°&q˜Æ­…'ŊbúhußÅ#~`” baĸŋŒErøeî›”°()@ 9Pfq ˛–bœ*’ļNfIē™ķKX‘đ¯-8.š;aiV°ČzX–-’"c’*ĢFŪ0•ČßHą.Ø Áį"ĀĢč˜l’Y~:LāŒ…›Á\ĸh‹ŒÅŲ­ °.Ų >ĩJëË{aR’›âģIÚ×/ Đ;lžÎøJß:ŖšÍ`u1\‰ĪéĮ[–Y€Ođŋ ČT¨-¯ŸVėŖÉ^yäA ‚%Œũīĸ"AāûDWI"Ɉ›@ŠčĨysîXœRWR&ĻēÃÄ4‘t  ˜”ąJ S,Oœú¸î‹Ķ›arÎjŠnÎĐÍU#ņŨ|)Č) oo˜ZāC™qÚLK”†Uax;‡âką)ž?h=xvįâŌī˜CÖ0ėõûXÖæ9ãS##m`aŦ/ ްlķœŋ1x °$™Ä:´yÎßøLĪ`2ŨYFöø“S=Ú<įo|ĒsPú 09ĩ~Čõkũœ?ËVEļ9îŸģĻņQN>ëC–Ķ”k"€, $o‚k"@ Nu>î ¯,@¤%“đSNÚÖ 0?2$Ņ^%ƒđS2¤`#€EøPčMÖĨąâ3+.€Æĩ¨$cÛĀ<2ߗĐ0ü˛qjh~ÜãįĀ$ü¸Į—ЕĐ0ü¸Į—˜įĪ$üT€<5Ž,VüÃ|8€E=ŧN0.ÚAā  “đSĸP?Aá—H `~*@ ;tĶ<˜„_Āôô&•†O…ĸĶQ€".Sč#ՋÁ0ÖG -sūÆįųQ€ED€!QVLÂOˆ•pd~I“Æh~*@Ϛ Â/āĶ EŽĒ Љ  )s.„€månЉ˛`~•ū‚ S`iǚ†§ēûw  I/ ŗŠšôđCō7ŠĐ´‡—ėņ› aøą§[G D€ßũėP—āQšđÉ Đ´}D" Ō@M؇Ĩ;‚™$ƒđ7€AøeΉD-Õn°)~PšG^Õz˜aŖrT… /÷d²šārųL¨ôcV͍z3Ŧŧr„6ÚˇæuC‹ˆØq–Đ÷¸ô–X}c–Ä8g0K†ąąĐ/ÆúčÂúŸT#ÖR Nŀ8+ņ" Vđ]˛+m`ŸœâAŋšÁīãĸ$Š‘lĢ"ÅN U4{™q+i/6¯č¤¯ 3TdI8ÂĀl‘ƒČŧ_blž;ØīŖĸ”į,/09åĸĸ@ä´+erF2”0ĸČôKƒ•3J×BĪ(SílˆQoŠŸ]Rgy)ŧ¯D(ík[˛×fAđõ8Øy+œ‰Ŧj\‹‘í[ûZËʝ°0-æ'øĀ‚_X(`™ >™{ІI~"ū`˜,`„¤PĻJŌZ‹ŌE2ÖR,Åvģė-°8s,ÎB‚(ÆŲH0įHŦW‘ģ–PB`IžH~(Ej`w+ÜKOm€ĨËNolș`rf˜J„I‘€)9ā5=ĢÃZ >åGĀŦx ˜Û*ŗŧDŌmķŌí`^&R.`Qž,*$v‚Uå.XUuPiv~;Œ?é¨čf7^{›âûo[¨3é|@qÍVXqiŸŌėa Ē71ÁãĘQē Kkļ3̉ö!7âĀôâÎ6Ŋ~Ni0LIö +‘0Lô×ôm0/ŅtãWĒHp§LIT# ņ€ŠÉj¤ ĢROXĢōwĶöiiž„Õ0=]b LĪÉô’™d!Ū0#[˜‘ã†yë`uŅ~ÚĀ>3ח2+ĪOEžČ)ğĸW ÆéĘ2`X¸ŧ˃CÉnøĄp-ev‘g‘uÅA”9Č9‰`˜S úHézŠAY(ØTîTUn‚á'l_[ņĻøgz ĐÜŲ!œ“Kķ}|x6°cĢöI`šJŸåÃǁ}X†}dÉÔ/f ėCō\Āŧx+čŽk휟rZ„Ŧ[Bg˜Y œR ũĮ/Ŗ* LČÜûwЌØX^F`ÕĀN8§@ĶđË”ĘđĻx-@:;„a•ˆĩeÖĀ>"ÉˈßĨ¸0k`–ŲŒļ1ÉGļ~Q“đSŠĻz_ÆĐV¨EN06əöīR5°Sr60j`§ų˙´\/f ė’s%4 ?îTP€Y(@9@ë@tKüÁ4+”6ą°j`™, ęĘŦ}xĻŗJF ėT€QápYeĸŅ\­`ÚųĩāPĩîĩY5°7€A/ā āÍŦ}č)WA€ŗALÂO8+ PČx^ĀĶĢãĪyĶđ˛čá™BČŨHpcÖĀ><ËĖQ€<›°n`ÔĀ. 0`~AW"Ā:íāīēŊ߯7õŸ ŗúîs IЋėŊÛr?˙ČTgA€t7f ėÍ  iãĐĶn`Q嬨š„ŋåĐ-jɃZƒYûx\÷Z#§sžE~žķšíđ˙ö;į| ŋΉ ā×äīpãĒKĐŌ[šŠyĸŒ؇įŠļ´S>ĖØeÎ3 ?~G˜Î9WĐCĘđų­W?™Ųí[@Üéj…¯ļûúë7PŸûœqĖå4/€ē­šŸTš(@ÆJf ėę°j`G,ËX„Ÿ @Žô*ƒ”“ } Ķƒŗ$cŸĐŦ}ņś4{Z!@ģv¯˙Š×īĸŊŌ,ˇŅ)Đ.ĀŖū n`œĘ´ôÆ6Ā<˙´ą™° L?åËŦīßXĪ$üęŒĪp‡¯ÖM?‚ŗöēV đA÷Ŋ‡oîŋĄzzxÕî‡ęüŠË߸‘€¸%÷öŒJGš  A'āŦš zx% JÖ3 ŋ8úMī|0ŒŒ´…Ī,†/ÁŒŊßåĶ÷ĩI€Wč›ųč#œ}Høt|škÎĖōu Sæ^ׯą đH œ žp{ètA€Lwf ė#r]‰Û`z/ŗöagV‚eÅNAáī‹Á%+ëđ‹õlZXD˛õ9ÍØŸ˙üQ€W´E€×o˙áķūB~ūoOY“ŗ=a`Šô-uQr# ?î /ā”š zx›Ā ‡W 4„IøÉÎS9LF°„Nfc—bļŪųė/aÖÄĖi•oĩ{īŊÚũéí˙%ŋūrČ6ã­Ŋ- ß9—ßPM? ^Td ŌŦy‘kT °Y€Q{5°7€Aø1;ßZ }WĪŪ‹™ĸŲŒaÖ´Hé8ĪŊÛáÓŸ˙"üˇË†ŲG{ž4ƒg]@§ÜŊN‡čO 9@n ‹ĒˇĐ/ŊSáÕę×>ŠšUŋĖ{|…/ŗš3΁ëåÃ0š2 u¯%ë¨o† ôIąHĩ–Áo`ˇ*ØŗVAŸ4tžļ*2%ė o–Ųũ˛íeFį­Ģâí0ë´?ôË]!§ŋ˜B攄#ô/9-€Īí‘Yä֕ᰠl (t(RË(S,áJOu ŋϐ9?N{03=Hø˙ģzJ f 3õö˙ŧg€ŪŗöĒļ Đ^<úá[Ŋ‡ü?B§~kį…˛ƒÉ9ž0Ģ2ôĒ‚•2‚”zį[†ÃĨ}Jī+‘J|ÚDK_ķ$Ŧ/†+}¯F)V…1ĢiVŗ]p5Zi\ŊĨÕ¯Y¨ÔÍķTNÎōČ^E™›į¯t+ Wæ¯SNÎ]ĨÔÍõlH˛Z ĩrJūSjxŠ8íĨœ{f­ŌŊtŸŌôl˜ręo‚ŋ‘qZĄ:žĘiE*Ļ#gũŠÕ8į¯Ô/ Rbģmå.åŒåŒŌ\6Jš:k)xĢÃŦĘud‚YąĪžõ˜ņ#ÉPgĖ’˜ŠŌĩזāĻĶ víđlĐ_ßüđ˙&?˙Ķž}ûÎ˙5c> lQņˆ˛7Ku‰…^ [îSČtajÕēąøâ6°¨Ũ zÕë[üš'atq3X]ŪŗĢC™Õ4¨Ų֗÷‚~͆6Ŋ^ˇ"žĪ[ãŗŨeđžũ%Ą03ßžĪõ Ŧĸ˙F&_`Bž§ŠSĢaBŠ‰§×PĻúÉšÍ 6ˆn‰IE"gŊÕđ(öÉį|U”L/ ĶķÛØuËüU”‹TøĶåCĻT ”ĀäR?˜xÆ ÆĻšÂ°#–Đ7ČāÜ˙7f‰ŲÁ ‰Yú̘-­›ū4÷)đ?„ŋŋņĮ7žj÷ÎqAß|ēxÍWŪē1_oĐ+ë´cîn‡?ė~lq=~ō“i­øîø EĪcË-ų÷-aP„ĨâûhŎ&ĖjöXޘí¨čaÖæ]-RõŖč¸U_ŅqÛ\E Ŗ÷˜+žŨšHŅqû\úw2;%æŠØĨĸķ.á"ģį+zėY¤ŗßJŅoß2Eį=ķ)]ö,ØĢÆ>‘Õ1Tą_ÂHŅã€ąbėŐÊ.Œ(].8¤ÆáŇÖw=°°ŽĶŽy7ž™UöÕęI'ūi4ЎdĨ' ?ÉÍɒ˜)­Üû7ūĀ+tÄķĩxÔŪîÍ7˙ŨūũwĐd” +ĄÛë¯ŋŪûOũŋœôņôžŸLīiØžœÕ×đĢY ˙1ŊˇaK_ķ$>ŸÎžæ§¤æf ¤?5Ē5ĩ§áß&ö t3üųųåäžägOúûĻôh5ŸL&ëtj_ÃO'÷6üÛ䚁īuĒđžŋ$Ëũ9Š+ũūąLéiôņԞ˜Ėf3Bŗ‚™!ŲĄ˛ôG1[Zš÷oxM@ø˜zW– ]ģ/ÚŊņÆ×dĄētøķû(AIGĖ‚÷;tÅŦĐˍÂ˙ޘŠ×ĩ9ü’¯6’\đĖЧôTVģv_‘ėˆ2´¯Cˇöž×ĐãItiΐ§QŗũS¯Ų,jjŧNģĶ āŪžd‚fCČȧbf>lūWĩ]€ÆāG^ĩÃsˇodú'á3Ņp\Øs^jžŗđ™˜OÄŦ| fįÍį)ü%xMŗđ1ˆYy[ĖÎkĪ[øõiđ†øQöŽhöģâi­÷Õø€ķR žÍßŗđ1o‰Yyũy~c Ô?^OeŊ!~ŧŊ).4įåCÚūoˆ™xŊŅ˙š˙ŖDxUMG=/\đ["įå†>øāƒ>øāƒ>øāƒ>øāƒ>øāƒ>øāƒ>øāƒ>øāƒÍĮ˙,a­WËķãIENDŽB`‚flatbuffers-24.12.23/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png000066400000000000000000000402721473234705300301370ustar00rootroot00000000000000‰PNG  IHDRĀĀRÜl@IDATxÚí]XW%&bīFŖÄ†ĸ‚ (ļØ{LŒŊ"v@ĨW ‚XÁŪģÆŪA:X Ø{F)÷÷ÍĖîė˛ ģĖ‚3ßwžd§ŧwÎ{÷Ūwß--ņņņņņņņņBßhk™pđ[„y°ëwʀûžƒžK<ÄC“IޤĩˆŨPVBZÁ¯Å\¯Á D‡xۈ^’˛š>\RÃ<Éĩyō.)îmĖxvęrßŗK×d¯n]’<~AĐ“ßŅ˙#ƒ‹ßÁīâ9 *Q⡖QGÜŧūä—Ë+™Ū_Ō¤wĘōžŸl˙ĮCį.Iž[Ė’=O›%{„“ĪÛ]’=ŸĪˇ >dä‹öwŸŲŋyË~į6{ŽĶxN<7^¯…×Äkįu_2ŗ„xˆGAWBs`É#OĒÔmå‡Ļųĩ”æ7lHǟëā‡+÷N]uspÚĘį#ŽËļzēĻ?ŲägÅHõ+8|Ī×Āká5éĩÉ=Đ{I[5t`ęšxō÷MELžÉUƒxäEz$‰C.1ā3“gĮ6āˇÉAŅ<*åfåē${t'$ØFđ<¯Q^Yrjšr Ÿ)‰dŸÛ`ļ ÍŖRÂä‡/-ˆũëūüč˜ĩ䐪*éK’Š!I& Ø6ØF<_1ÄĄÄÅîš “\̚ĨxLŸūdĮuˇįĮā×´ÕŌŅ̓˜7ĨM|3‰!‹›°m°°­L“MŠįyšƒ,ņ§?ÚŽĪŽ‚(€ü€m„mEÍ#ļí$íIÚÛXœ 4āāßäŽKũ.)žëH'}â‘?“ÆÂŲΠœdū‰qíú ÛÛ\Q_ˆGúĻ÷<Į’NI•%~n_@! u˜ųBHÅļgƒĸļõŲŖķĪFĻÉø1üüB™ĸ '™*o-ûûBQ‰‡šLŗ{î#Iã§įeîˆPŸō0‹ŌąOD“HM&7Ē`\š4vĀ—ĖQE f‘i˛×zní@&2'˜F?f1uņwf7\ž^´1BN”úuÉ"ķ{&sŅžū)>Äž=D:xtÃFQƒƒ':ÁÅėtŖ"ŪGûē_˛uŒMīšƒqŧビŗZ”ęÅ2.Ôizsa Ķ$Ī~¨CĀW(6:„"0ŠqˆopbŌ™@'-§ņé}?åķzD|ŸOK8fšÜvŖˆ…Į Gž•ãL)ˆõŗä'ëÍ+;(Yáđu €]1Î6IpÐų̐+rÜ)ųN/yȉ2u7y # ā+Ÿ¤éÔĐųēt ˛žQ*œbŽüo9u$¤˙K’Ü&×0ĸD°ĻPãØ˙mpr†i‰įČž™]•8:qųåķ‹ĀßO`zĮ ÃÜĐ]1ĸĻdĩ¸äåøPûØũî_ÚĖ" @€ŧ:ßt†ŽÁ6Û¨? åSÉ8ؗ/|c’čō[^vŋ(Q_Ø^ Fąö zÆäRŪ–ŠAĻĪ7†‘ ‡x$ũķiQĸšBwҞ}Úfë¨&%ÐNSeČCė.č>^Qĸ‚pMĄ—ŦI×4Øâĸ>&ˇŨ~į•ÉøâŽ.QĸōÜQF>bˆ)trúDž¤Ļ}]Bú{1}Dˆ(H• Œ uŧ #BģÃã‘sÅŋBˤŦ~Ķ`ň f÷ŨÃUũEˆPfĀŒŅŽ—æÆÖždR…™Š1mšĩÃʘ&ēNRuô @É×ē‚a$ÎĶæ"÷t]Ghëč¯{pFersņyezj’gœ‹‡[Ąw˛ˇ(ēŪ÷„)ž0õáđ|v\sg6"„ŗņnũ¸° : GTˆũ 7ú•Ŧyĸß§@vv6„ŋK"ŖŨjQ,f=Ū ū{˙e}† nÁlōŗĻ @2 _@oŋ…r°Č#BŽėčoîj^~ęŖ­OļÅ“í™äß  Ŧžė˙—°ęŘūx;¨zžü°ųU0ŧËüH™—ūNôüØą^ßķsjšž¯×ęœ3H{'}Ė í‚ø+ķ_Øđ2H-÷}‹}Œ}}Žęyk“’6ˆāÅņÍ5§žĀˆĸœ\™¸‡”ÃŨžŠŒc9h?Ē‚e§áĀ›HØķú*-ËĄęyōÃĄ7Q p´ÃPBß'ã zģ^‡Šåūxnŧ^Kˆķšœø+NŌ&ˆŋ3?ĀAŌę¸ė[ėcėkėsU΃/ķÆĪy×浪^˜-ZÆĩČV‡Ĩq˙ī'ûšļ 2‡Ŧ˙ķôĶ›\m‚mĨŽûĮžÅ>ÆžÆ>/ĖšsŊĄûģ@ÂEí"[ālŖ˜E&܋Šķ{=Š&9Á~/ÎÃëĪī$ũ1땎}•>@×û^dVŒ„,brímƒm¤ŅN°ÜępĮyŸuˇŽí]t!ÆÖúÖäļÛÚÂD~ŠC8ú&ĻЧŦLI§ßũSV|u˜FléWŸ˙‘´ļ ļ ļQI€$G(ÖÚ™žƒĻKĢÛ`s~ĘtgKgÁ÷¤-°ô篝į ˇŊŊ“l‘›jK•fCŸˆ˛ĻwŨĪǚö  ø%y ƒōGĀoãčČXÚ€…uo}x,ķėI[ô"mRŌ Ų5và ڟœL¸YF„Ô‘Áū†Ąķ ˆōˇÎoqĻBāˆĪ‹âŋą†}iĀöWWd_|î?RוŒ\ |œáAÖīZø˙Ņ9Ē3ˆ]høÎôĻëBeķũ55h˙›ęđí` KĢđ 0Ī?ũ%ã˙`”˜d¸ŧglŖ¨EĐv¯Åä¨đ‹bތųĶ`„qbū åüˇF„¤Īč"ԓ˙^ÃŊéOfŸĢīîQßũ‘­¯.Ķ5 \ŦÂč Úî žė§×PEØļ(piØķ3,~v‚ļAIgZŋĶ÷Û]p3Č –žėģ~7Û°ŖŽŅMH‡î—â1īČ8…{_‡Cפ/Ī:푴”f Ŧ|~ކī~xJÉũâķß2ÂR­J'Bšũá u^CßŨO" ĖŪD§Ŋ ŗUōˇŅī“eÎE~–'a‰S]:äŒwYē#WYÎ gūārķ€ûËOmūhÂ~eqU˜#.å—‰ g8ī#BÁD˛Ī]Y| ˆ%‚ xHžm;b^÷ģęųy1âŗÎ ß)qbždŨp‚.'Ŧšh fgū ?åÚd`ŠīŖŌ(ÉĪũuCÆ>Žxw_æ^ô(L{øßKø'ķC‘“^БÅuŒD2CŦyq&<Ü(ãČŖéôėĶ[Éßã3ž!ž€ĸ…ŋ’.Ŧ$×íâÂtc÷Ņm3ƒØ“|7:ŪīׁŠ+@hû_Sv„áf>QĐFvH?}“—Ķׇ^#6:ņLSņ’Ė^A˙Üë'ģŠvŋ“6šS“n.™["ŋāāĸXĪĢNĐkķœ)ČŲÂįavĢ9ÎÚîû/e-tÃhʖČudå“ “Ãøk% />ũ ī3eEģæÅ…’ģ'¸áĐŪņ„O‡lh†(rˇPĸlâAųI).ąČ*­Ā˙ÝQ%•đ_ÂCōlCŋđü%v¸įNšŲ7q 9åN8[™r—Ā e˙g~p†™6•f`TeķË`jO—VāŒļée}ÖR:d į~É#ŊŊĶ€ļ4T?€ũrŲ>Wœ{Oyŧ% døS€v2ÆÛ1ūĪ_.­ĀgÄgu'mŅS.rTŌ€ÜDŽŽŒX–ŨaՄ‘ČŨÂø\ų9íū7Ī'rōlu4LqŽ—ËNūđžø6ĮŪÆ–Ž•`ž„ˇ:ī°ôBî˛ūFĩøŋ9ĩŸĘēíŊ…@Viî†Â*i˙Ŋüęˆ/ŸÃœĮģhX´” kė­5`v`6žS <å°JëĖ—žĢmŌŧĘ ûžĄĨE˜ĸ€ļ>V?øÚÉĪámæ{ęLLÛX*0á~t=j[UˇAMZGT5ĐŅŋlkߑ ‡¤ø=*ųØNˊāęé'^NŒi"`Ôģdđ}~–ļU‰t‚qÁ’ptRę&čqnaúO“ē5GkY”UÕÖ6>5§ķȇëŪÍyēF§dcAh`>ēWÆ IEu\cyÆiâüŊÉū`ūÔŅ\e ėkėsu\9:įÉ.ėúž•ېžČaUáoĖ]'”'ŸåFD{˙nũtøž<K2Næ8ĻĄY‰{߄ÃÎץ´„<7Ļo$ĶûķΉ/ 2>ŊĨ5“°í„ė ė[ėcėkėsup 9Š\ŊĖ7Θ†6ļQAYG˜@ųĄqKŦ§?ŲĮs0Õw6q˜„ÆÂ§`ķĢË@ŨúÉAĪŊúŅRÛW0!÷FŲØˇØĮØ×ØįęāŌĸ'Āãųņœņņ+Ál‹f†–WI:ŗû–ÃŦēÎņžXüjĘŖÍŲy- hĒāBF0LK ­p÷ĩ$ų¸†kVũãCĢmã7#‡Y.+'-ę8Tę|Ãi `ōŖ-Y%EŌ›GF›—"ų LÄÔé.…,SÄČxk´Ũ;ųr˜å˛As€đK•M]/ŌāáĻ3`éĀĮĨ8§§č× ^ĀčԀ’!ÂQ´VŨ^íY\%ŽJšŪ,œŪĪ™ŸáŅßĪ!ņU*œ^KÉÁJ§|ūŌūɀ[oŌāîÛGņīČʨ­˛3iΐ2eå‹TÄjéhũ_cÛ~}ËXÕ°ĀhĀ,WÔÛ5ÁŒĖŸ5UX1íŠ@ no?ūū׏ÁāĐųĀL0>0†r†ˇ/P"•4ō§ŋ‹¯īƒÁŽ`rÚēžĩ…1!Ūpūq d $j,+ųģUôŠZm2›Ø÷î\Žo1°bAPF"€mĖL“<>iĸĖÉß]ųįŽ0!>B›Ëë Íމ ˇ{’{&AģŊSĀ.lc‰ų öũ3X˔¸´l¸{Z°kz]îię `õYNÚP†5*éngJf€š&Œú`ŽŠP%Kb3î‚á>Ë\äįĐ~ßT¸ö"ŠÄāäÃ…ä×?É ûy;xö¯0AƒˇŸŪåŨM`v×]ķf€K6Ųöé‡\fM ‚ €ũãJ-Ö˙aLNĒqN0žā"JŽÖĨĒ@˙aeÜ!h›ųõöNĻX{ ÄŒūļŅ›ō$?ĸãé9p$M¸5“ķéqĐ5ÆĖîšk–|ŅęCCÛîŋ —ë4¨¨´š¯؁˜@o4M˜§.ÔjīįŦĪāą=_ō#æ‡ĀĮā ŧũīL_'ųõO̓Sŗa흂]wØYÆŽŖģ|EPÔ08?÷¯,ģwWZœ ÔĖ}@[ō@Ī4i oŠOŽ÷ũv¸~Ú활'ųžŅ쉝 ų)˙e~‡Øíy’3ĀūÁ‚^7đŲ50 ´|QE^æP‘/„™ũōĮq†ĻJ›@œ~šÛ­šÉˇTM€ų;ĄË˜Ü}ũˆF}ō"?"ōYb‰ņ‚ĶoäI~Dˇ vđøũ A¯ų†Ė<ĶbÖĸŲÁˆ@ÁLPÔŠíOĖ|RoHĨ ÕWÂ*Õëמ‘ém×DM–3‰UÃĸΛNŅÁšˆo°8†o,tXĀĩ —kģÁčôÜ\äīzÁö <ús8—KĐ!ĐŒ"æA‘&Ã%­€vNOĒeôsKē'Āŧqų‚ €Ũ CP§ķ-—(MVpū Ļ|Ÿ?„ãÉĄ0ä”#‚!Á/ĮĀÖ[gáõ‡’ˇą}IĄ 3˜œG1ōĘR¸˜¯ļuŋ>Ŋ‡ĄîĐá’…qŒŊŒ9T¤éĐw}@īĀԛ„Ã?P.ëęj++tjßpē¨ 0Oō‚CoĸČh]ûa áũ휊ĸ¤§,ālđüÃ[xōūĨÚg1ô‘ÖÜ?/YCĮ@|s¨Čv„ Lô†6ģ&ᆘ:”Ë §Ël;$Ō­S™ Ö~&ėū`ĩXÉ­āڛčâ(@Į 0ŠfDP”ps)čnw9Ėrųģ§BpáČg-ÃĢ |4aS<:ŋY"Á4ŗš%ŋd sâÃÕĻø~ąžĐjí[‘Ã,—•Ž:} q/eÍžNķ‹ģ, ÖŽŒ0ô)BŊ8ũ8 Æ_õ‘"ܗ`X&Ŧ˙ERelô 0Z9 äÖlŌĶ ûž‹‚ @w„.N5Y8 cųŧ8[l…ą°\˙Ī"4|ũßĪ`~ô&˜ąfEúK`ŊRΞWWÕ^kb¸_Žąû¨YČáæƒč  œęūĸ‡Q ęmŧGtų`íßÅYŅëŲqúVD‘\%äE˙ũsã7B÷ËĐ=DŠ_Ž8Ŧ§{û`äõ–Fė{ÎáŸÆĶĖ#‡ë˜ëVVVe´ŒāÂAĩú#:4|ß÷-Ž›âS,īØ˙:\$V ŽĢ,ŋw„:Ā|ۂEäj˜í=cŨž˜;¤Rq\ÂŅIŠÁü˜ÍB|Ü\MË >—QāÚ@e´tčbúõ$, F xā[,ÕĄņ%Ņ"ąJ.dÄį@gNQūĐíŠĮ9*Ž<úøģū`˛kF áÍ ž&[ˆ|Öíãąš¸ĘŖãkJ3KđŽŦ¯ļļčC§ yōw ž// ˜Í Ķeō;EĀ `Ėõ•`´qōaä.ËamUPļ†Aüō÷=Ī/´ef€9EũŽ0›'{EB•P ‹\"!ŋDQ<„ˇNWæĶŠ"`ß–32 –ZŠÜe9\VYđ×jmœ4hōŖ-Ÿ>đü%Ų_€üģ{E”Ø&l“ŸĀ´¨5˛ "°…ÎņŽ…r_’7<Đķŗîŧ>ã‘ģ5 uĒ*ŗ #Ö{ŽųĶ83Ŋ‰ÉëSđä&÷Ũ‹L¸éũė_×E2•PlIŊ(š;!Ŧb [¨ŖŒ¨ aĄųƒč9 :ēčqũū­;#w•]“ …j5 ‘ ę˜P4ö֚sô=ÁIEöžā~)>âX ÆųŒ80 ąŖä— ZN,ų†a T÷ĸė>7ŧ ÷ʘԈrˇ>}̊Đf*ĮžhŦŪo!^Kx îä%|káũbĄÛ’Šč7÷Ą×Ug9Ŧ• €OūP(‚kʛC”“Éž9Ŋ"œĄÛꊑŗ,wË)•‰Ukķc ôĻ{o›3jĀßL2îä%€Ņiôu="™JčŠđû š˜í;_ąŖ˜ģē‡9å&?+„qŧr3å$áĻųEģŦvÃg"gY(’‰ąNDŸGtn×˙ÎŌĸ2Áũ€ŧ0!mŧüø7ŧ˙ôąĐĀxÜĶ‹)ÎüßãĪBĪ˙Ŋ†:Āĩ?ķ|Čā™!ũÃkŗ\bë+€"ōS\Un&@˜$ē‚ŲáŲėĻk‚œU5$›6T•*ĩČŋūåv¤(Đ÷ž7­p`˛N‚y!ūR\á# o„ŽīˆŊāũ'¸\ŨFFĖãá*`~xˆØ˜ ļ.ŅÛ! ū8ŦŠ; ļ‘›Dņ6K#‡Ø-2Xsķ(lL8Ž×v¸- ây¸ļU!ė(ļIq‡Û%đLØÛUˇÁ›Û#aĮ—q ąėnm‡Wd`ŗN"€<É/tžîôEp°QŒ=tÚ0ųĩ˙‘ŗŒũ˙–JoŠįa-­ōU ę×&ŸõÍĪĩÅi†šAúų…AMn:Cģ?§),Z•ß^m÷MĄrÄ&_ æ‡æBÛũäwĻJqPŠv‡,¤8l‚ęäė}Îė‘ u†.” āĒSūäg`n÷Å)k˙Ķ{iã6ã˙õ+ˇ˙_úĻx`yGXģzģÆ ú_‹ų}ĖMnģŊzøR*6@ģ#–*“1p‚@aČ/'$ŋBL~ĸ ž&ŋDR†üų Ž'€üČĪ!"˙™šhz× ÛũMÃ1&ƒĢŦīĒ­Ē,ãhÕĄ;jPQ"]@-Ȇ˜Îל¨@~ņ%8l%8ųŠNذđT ųqė ĀNpō#úķ ÔČĪ uš by(ųÃYä!.üië­7 'mJšĘpVeû_ÖĐŌĒPY‡N) Û°°§0ZĐMņ&7œĨ"P‚üR,‘ @ŗG2âSœ÷†Ņ|H~‰.¯„îė'?ŽøRx föđaÆ `tw.8ų Œ"ŌJŒcœ;ü‰•(tÜų GYŽV(Œũ/īpëõXš››$8?Ō RĻ.šCíZ*E~*€Ŗ0ų$+G~ÎŪĪ%ÉĪ`™T“_FaŪ‚™=üP''€9ņy ?ōs@Üp–ˆ€š?wܰ^×Ē?9ZĨÅĩØø˙ˇ…€43´fM ‡â÷~ę2˙wņâ(ˆ3’Ž äĮ_‘„"ŋT˨ü8âK°PpōS\vĢHN˜=üP'@œŋbü:ßpĶģlô'jčŒf͟īĩj¨–ú%3¨bĨŸž¯‹9Ö­7ŽžNÎB,ŠŠRíAi B~üi-8ųņ>PSQįŧÔB~NĶCVA÷‹ '?ŽøR,œüTWąØ=øP’üHxŦ4a|͉rŸŊé‚ŪNČÍJëü-éķŖŋL8´jƒĒÔ ĒŪĄQ{âtÜÅp¨ŗ€Ē/ČāĖĄ/‘ŸĀ”SŒ„&?#€y0õ‚TB“Ÿ Ø;O–üRŦ‡1W— föđC\ã @ō"bíŗQmwNJ­Úǁ!5~ kVå…2dÍ -­*ÖŽfPûŖ3Ö°ŗ@ą €['@æG~ņ‡s¤čÆ€Š¯ĸ8ד(*uIž—„ ?ĸoˆ XEå€*¯ĸE.ĀôøFÎ*“Ÿ €߈›fƒv!'YnVŌüÉeUnZũ€† f˜÷1žáø—fPa߉‘ö„ly‘_*€ĨĐíˆĩ #?įđrsŪK-äĪKB‘‰ŽH…5{øvžŦ\T&?Žú8úch´õö‰˙üoXû_‘“Ŧ‰.¨ų“+¤UŊzu­ŠQi:=/ÚÅ7rNķËÄjŧXŅAŒM[K3Nûŗcđkęj•Î1đÖ2čvj>t=; Ē`YÆi8đ&öŧž ĪŽĢt×ôŖā˜z,/úRg&ƒĨ`>_ÚVgWÂÔ3ËXxÃÔŗ<œķ Šå˛8īĶ8\ā\‹ƒuāZđŲ ž—ˇeā )‚ü`ē+Ĩf0qy•!Ģ)fRŦ!¤—bYÄ^đ‹: Â6ÂŦĐĩR„­Ŗ˜¸Ę`"Ü_Šˆ 0Ô97’Ãz˜ÅĀ)fÜ<Ūņh ĢÖ1Á:–Ã&°Žc`CąYŠxķ×ļHq}+łëÛaŨS°ūîpŧšæßÜ&mÂv)nIą q‡ˇwRØŨŲ™mG~žpÄ#ģķŒÁ3‹ÕއÜbņ닋bZUŠ3܀ ŲČĐŗ§¤m†)ļeM}´TÕ“=ā˙2VŊ¸ĶoU΃˜pg ;ī ƒŽŲS Fw€g|`Ņ…wĘ Ÿpdp’ÁÄ)§\záĖā ÂEŠŗ.0ŒÃ9Wwa 8oÛ NŽOqÁMŠ‹îR\bđ+"ĐCŠ )FyōāEą0l¸Eė€I!žô%x—K˛~įpEŠ‘ĄKeÆaŒŧĘÁ›ŽüKã÷Ø­đG¸7ƒoą\ŠH>0*Šƒ/ŒŽæ!†Ã +Åø¸•āyk?,M< ×üaLŧÅØø•R\ãáú* ÆŨ@ŦϟãoŽÉú-d1t_mM8؂r‘IØŦ ķ'Wn:Ô²ĶM~ön‰1ŲÂø…õrų7œŠ­Íö ;îDGũnGmąųåChY\">Ā…Å‚ŲüōO|€Ä BķG›_}¯¸€5ųĮ„ûbķËĮųMÂíaú52ëÜØ="]”˛ų90‘{hģo*4°čj‹ŦđCÍrίZ ã Åa†hCT`ĮKVḇ9š .:$!ų°  B´'¯E.ķĶ(_Fj ?ĀååRL~‰bX"Ú“× ¯Œĸ\”'?Æūcėŗ:\°‚–>#ŽîĩĸŦĖ–@WãčŸÛÖŌĒVĄ~M@S%ÃfĮ9䨚&­p tH<Šŧ‰æ :ōs҉..V ųqė p‘āäĮŋīWF>*Åųŋ”Ûca3ޝ§čåĒų)bėsččŋgrNƒi]ė{ę×ø‘VSŖķ›—3\IĢrå:lõ­–úggŅ9d0Ur?§ē ™ ‡pĻŽŽD’_"€@ž&ŋDĄk¤üRl„ąœ0{øĄNNV76KPPōâãčopv´X6<‚ũdG˙Jęt~ķ\Æ]÷ŦũĨĶÔŽ÷8rŖŸ$û35DœOđÛ%OFĮæ N~*€3<¨üˆ !>RL~*€PW°‰e 0ų  €ä7&ä7ŠuČ6Š\zÛ'|úa‚‘%rŽBÍ ŲĒ%å‹jôĪĨŗ@ųōŅh˙įôÝɈK3ô”˜Ô-Ää;ëaFĐ*č΀PäĮŸĀØKKÔB~ņĨ°œü8â÷“ĀWpō#L#YÜ$ˆv-0ų9蟜Í=ŸŖ‘ŸōZŲҟú,2pÎ0hZīã>†Wæ?Į er„ŠBĶm§´ƒĐëü"Yâ @~Fļ0-h…T“ŸĀĖ0"€ {ÁÉ/Ā&é[h‡WŅ ¯i¤Cn|iägÉ߉\Swũ˜WĩzļFmŲŅ˙ģĸ$ŋ|H”žKŦ|ŨjMČgsŨMcũŒ°ÖŖfŠJ¸`64҇’OHō#ēå @ 䧸€Āä§sĨ‹[ŠPXōKpƒ'€‚ŒüÄņ5ŽĩĪi{Đ~ZĐëũ4/÷}ĩĻôŨ_ ÷´‹zôWä TĶĒUך–­^Š-éėøÎ ΄xî™1…ŠRXl ÷ !…"?}ų4'€ĀĨj!?ŽøŠ ų‘đũÂÜXŦœüTQ0ķÆF1n_&?~Æ:dâŗˇđ‘XļbYšķ_ŗB6ōSäļŋĸY€{§p-nhŧ°Ī2e}FS¨ qQ €F‡nš03Á1a6°Ë @hōs˜uu­DB’_*€Í0.j…āäGs‡€uŠō!ŋQœMxkŗmÂįúã ąØUs–cĩä"?Å"€\ë¸_ĢZ9œžZļŲ1a;Öi)ˆC\`ĸCNЁOˆ=ŧŨÎ- đŖPųC}%Œü|\uƒy<I~‰nōų§×>€!kၑSZUËéPŽqÜŋ !\‰ĢŠUŖŽ ü\ļv5}ƒ“3oąiųŽ —¸u*‚Bncä€×ÕA~ņ9`f§āu{¨Ü%šüTŅŽDÄēåMū4}pÅw.´đqŋl­ SZÕË7ĸc¸Vdq˙‚ÎÚl>Æ÷åęTEĨļhlÕ}BĮËķ>bšD~QĄâA1‡ÎÍ-ÔN.–,‘@ u{¨Â×AĪ`Á‹V!$ˆ^!8ųŅܑāÖVȓŸš>ä\­7˙īŖ:NG.NũĖîIįr~4bôĪ)ʄĻę•Ģ]ĨŽÖénŗ†Æ€ŅĘ#*TÜ`6Ú;QĒē™EFj ?@Ø Š.ZEîNS™%ü$Č €O~ãŠéĶvŋ4YØw r¨\•rČĨz,ˇ*GØSi‡˜ŽđÆõÚšv•Å´™Bš n&`D üN.ŦÖÆ`™Zȏ#žbWŊĄŋD~‚“Ÿ FVšČΚ>¸āÕlÉPLunK9T.´jŒã[‡K¨ÔåLĄZæ-{ĸ<ĸ•ŊT”ĶH|‚ VJ§4S\^)€ęö fG\vœü8âKã'8ųq´— q+ôŠuWHū6ĐrõOk6ęGMÆņ­ËrĒœĻ™>Šbž)TŸ˜BÍqk˛°Ÿ%éĖ~”÷4I\Ũ!$¤2Y¸ĨQ"51é*_­ĸˆp‡ų×ļ(@!ÉĪ€Mâ6Šbxv?9ˇîæqo:š> wę˙>e´4øČm ii5ĐŽUwí´néûÛ2â:ÅüõMˇN@EPĀÄ6ŦÖFė­ōãˆ/€Ŗ`å ųŅžūŠ ųfDŗnmbį.C~Œûëíš ?Ųü˛šĸ]EģģëPãMŸüL!ĸÉrÚôÚ´Ú0zž“ø’T M€Äēd] ÜVlČKBTo ˆô‡ž!Ž‚­BĸsģRpō3pbp[*cÆéÍi{Āš:õ?‚ŅŌĻÉn?ņĸ>oúä—,Į,1ļ\KtlôvNė„e2îšŅČĻ @*Ģ/Ļ7`šÂŧ Té’Iá~  Té’ū‘DסJ ųŅܑøÄ;fˇ;2šy #Üh§`ÁĢŧ&F}”1…pŅĸß¨Ú¸Ž‘Ūž)q†¤Ņ)ÖdP$ēRbæˇÂ‹ĩzPãå dŨEĒhU.Lū\ˆ'3@œCV{âc5÷žPåĮĻlȓŗûkČ-x•((Ęåûēu12tĐōžI´ z°"Ë)ũO°{ēz%/s"Ą1ëņZrå÷Ôĩ*}ŋk‚2Ëā+čtŪ z]´§ĨK&^öĄ?".XKq‘‡K6˛´#ŠyäŠ0Œ‚įÃԈU´pUŸ+Î`L~6ļãË :#B8,€ÎW8ØAįP)LÂ8,“̞å nl‡IqĢÁ$|ƒö4Ÿ_‚(HJÇ#ĩû9˜ĮēĀÜÄ-`{{ôģž8ĢĶY+håûûƒõENh×Ēܒg÷kϧēüē…˛ō˙jâvļÖm†› ųã”ÛctŠ6ŋēœšņUĖēŦŸėĢ_\€]oÂhņ-UĪ1'…ãĒ5s8Úã6En¯î’Č=āžū<ķ÷%¸âK1Ęa mrĀsKÎCÄJ ΏŊā{í­á39r•SĸĢDËbjĖ)b×J`ĮCü: ÛëÛ`͝“´tÉ´këüaÚu`Éá7×K‘°ĻķqkŖ f'nŋ¤°6íLæô+Ģ œt_:`UˇÖ•kVnÅn¯­SRíū‚ø\‰õF•ÖhÁØ^#,Î,KH> [_†d:φEO Žõ/ƒ`˙ÛX–qJås,$°MŨ–á„L—ũ`jˆVĄū°6ÃÜnm‘Ā*q̎Ĩ˜w{;Ŧ{p&Ķ;zŒÜh›Ņf¨Éhä@Ĩē5Úh1/ļūžåHų’ōTÖâÖĒą ĩë2"h2ÆôŠ§–ĻĪKØøfõI^BÃæÉ^Z~q\ÚúBŸĢWĸt &ū˅ų,lĄ 3Á´•Đåĸ-ƒK ¤´“"HŠŽ ķpąHHx$˙ 0čb]¯Øƒ9ĄR„9JĐí*áNšp†1Ū☰ ,¯@ˇHgčå ŨŖ\¤ˆæ!ÆUŠX)zP¸1ˆãØü}ˆŲ3ƒŒüŋm˜˙ü§!Æbßk3äoĖszųņūo´JÉÁwŠšE2|⟴kTĻ"ĐũËīŖŽē=Fģ“8žYBŋž0Np^ëč„rÎ.:ÁhĄųŖŽĸUˆÉÄ šŊŽ8 ^´ Ņ?Ęlonƒ ņĢ íđr‹\\~:ŧhķ f7ōŗ}˙ËnąĢli#~‘ĄzTĖ( ×r ņũ=÷qĀäŽ[ļ"Zō"č~i‘Tj ?Fy @Āę ĸĨ‚ülzCŽaŧcvû3ŅáMŅéAm~=íīkčąä¯W">… 4ŠÔ€6ˆ^-Ŗ&=Ûl×1ØLî¸åņu €I sĻíÁ `BČrĩ_"€˜õĐ+ÔIđĸU8â+@!ČOWxãr°Gķ%ÃnÔÔkÜû¸Ō÷Õ1É­‰\¸Sģ´“_Qx´ģÁ;TøžĻąî†ŅAĔĀQVՒ‹E!Z)Ņ•Ææąd F|ÔA~*€ČU0—€@å ųq~Ā‚„íRnäĪÂŋÅž?ģ ­đ}Jū•ôxä¯ÉrāĢ!ŋĸM4|H|‚˛eËęˇđũu¯ūéŲĖûa )u 1āļ71OÖ3Pųq´Ÿ"€ŗZęö ˆöb°ēP6?’WúÛė˜MúÆždlūJmXŗGžüß~MäĪOõäDЎŒŪúGf|ĀÆ§û Tô Ô-€Á)~`ŸēŸ’Tä— vô sœü8âs˜xmĩŌä7âœ]Ližh ēĮ~l<ˇ§ö!%eíÖ<›˙Ģ'^"āãÆZ•ĩ[iikS4šn>So÷ä‡č˜ŪuĪQåÅ|E!\͞›ēƒ’Uu{pÁK"‹VQÄÜâ @ōŖŊO€ÛJ[ŦüíqŊŅÆV”üÚZmh_2ĄNÎáɟcĖ…Hi•+×ë ‘†l[ŗ“No]˙QĄ|“H™Ų ¨`ũx7ŨY†Ŗŗ ĨK¨VŗpQKŨž|¤hU´tÔĮkčí™?{ ¯ŅĄQ?ė3Ōwíhf'ŗČŅ:šhHū|DĀ-–Ņ ڌã¤GĩŊŽÛ ˙v‡Ļũ‹6Ļé=÷ė‚ÎE)ęßr į YŊĀFøåĒ‹ZęöHp}MÁČOF}cŦØŦģaėŋ?Ųü˛‘ĩ÷õØ>û™íÃēlŸ~ĄNĄËĒąy!XR‡u ¨ę6œÔf͏[Øđ´ėJ’Gæ—fƒĸĸ"¨zæöXņ té*€ÄRäUĢ“–+tČ4ŧēÚîŸ Í– ģ]ī7ũŠØ7”ü•´ą¯tØžĢÃ[áɯDÚDy6) k@Ō×1[R—5‰Ú•­PĄSŗ%Cw´?hų §~Š ]q€[,“Š pÛ§F¯‘@u{Æ.;NŠęķŗ…j ųiJ¸î†1uõŨSļBY#Ú'•ĘļÅ>bÜ?°}WE.ˇG$ŋ"(ĮĻÅ֔8ĮZZÍ8ŋGœãŒĻé7wmaĮ I¤Č,*.p3ĩ°ØŠâˆÂ]ÔRˇG"€kr“ëķc•fr/øRōæK‡]¯7´Ŋ%öÄŪgĒ€4æEz*ŗ}(’_Eđ#DÕY[’šDd¤i-™ ʖíđŗķĀÕz;'e`EZ˜dیPœČKĘîäĘ%K—PÜŪ)ķ6v2âĮ'—|ŋŨKhĩjdFŖ9=֑6īÄõ[ķLžēl_ņ#="ų &åü‚Ē<“cĘÍųŗAí.:ƒš-˙õHÛSßãæ{ÜɅ"@ˇ8sˆ*Õ0§Ÿ€ĢZęö Œãf€ÕĖÛqÔ'ŋĮ:=­7{¯ãØ˙x-ãĻCxŖ>Ļ44gû‚3yĒōė}1ŌŖŋ 2KūaĐŅŌFß b{v6Đ¯?ĒĶä–ĢGˇ;lų™&Ö!Lŧ-Ë5ãhvq €ÎˇŨˆ¨´‘ ~üá*8ųq´į īėĖžxsMc@;ŋõÖ ŸvRo¸žļ-mcŌÖdl×eGũŲž¨ÁöhīIąJųŗA3zĢDE@…đÃ3ĢVkūˆl˙įôL|ī•ãÃđkęj‰i¤ėËü„€Ä"„U6Ĩ`—T$ŋ!K~ņÅ/ÉÂ0čČKž ˇ}bf3¯ĄQ?Œ1˛áˆmĢ]I[ĩõųŖ~5^B›hōQ¨”?pžAS2´¤fQĨJíØŠÚ…Đ{Ũô+“O.ųØ;ؑ zæpæ‘bPF\] TJ3neT(%ÉoČ?Æ>›1uės:…ŲB“ļ0vĶĮnKĮ‡˛Ä7˜;hëkĶĒMyļ>ÔCœÅ8 ŨY‹>4bÍĸV™āüÅ:ë=Ĩãō1'ôvN|ĨOĻwZ­Œ ŸRÜ÷ČQUĘ @bĄ ˜ÕIpm3ôŽpSšü†ĸåPâĮā×A‡ kĀ×ĩ õēË¯'ÛũÖ}*;âŗv>5wZąæN#ļkąm.ŽúÅ(ųp))ĒÃN͍éJ$õd…PĢ{ŗĄ?ģ ÜĐzũ˜ģíÎČF‡™]P“D81TĒ€+š‚„E_åKé šđōcŲJú¨…9„øHø,ĖÛÁu“ö§fŪŽIYÍ}FÜûi^¯MÄš*K|šÆ ËŽæ6fÛ´/Â#ŪÉ_ĖŗŧYô=Ī? B¨DLŖŠŒŗL…PĄF“-ģ.hąü×ŗ­wLH7 ¤@rĐ0*#†lųŲ!/A¨*Î2аûbzƒEÜ:Аŋ~2¤Ī!&N6Kz:Ōcęˆū™9 ˇw ´ō•Žã2đlũqFvĒT0áˆOÛ#;ÚÚņ9;˙{æŽ8ękh¤H› ÃUáų $3‚–ã#T̍Ī:ËT ĩ;5đ“UOĪæ+FrbĀ™Á8Ū‘šID ĖJŗ‚QpæŠ ŋ^‰"Ũ !>?Â.§SäÂlbęd!ņŠsKF~ŧ\ dH?:]Į}PāĶē.ŽŪžá ŪhߎļÚøLå>nÄoĀ#~ļMĩÅOÉ1‹ä…Ā͍X{ļ9F4høTę0#)ôëé jfõ‹k;īßOwÚ<9Éäčœģ^\="œĄw‚ôK^ũS}Ą˙Ÿlō™…ŸcŌüŗgœČvxz(˙?O¤øä‰>w—ŅׇvwâÁēG0˜smSŽ}ŽėáąK˛{Fģ¸fõŒ!Ÿ1ŽĐ#Úē…:@—ķd;2:í°øW嘤Ö.CN7ĩčæ^ĢCãÁŦSËŸ™<;ÕiÎŗņ(ņEō—`!Ôa9Œ_7Ą!=t˜+1ŸŧĒ7¨mŪj´šĨąãok쭚rŠ÷̤Gũ3ėĸüļF_ķƒņwÖÁė´íāûâ,x=?SoÉ!ČĻx´Y7å‹I6fšî—=*ևAÜ 9‹v€kâ^˜ˇ~_ŋyĶN0ā°ôŲaõOˇ5S“LŊÆ]2°ŧNg¸Ņôę?ÔîÆ=‡„ôņËrfN3ļ ~dÛ¤ŽHüŌ/„ĘlÜēģ€Ã™GtV N3ŠĄvEũŠuǎį›I8‚Vū_uķ†Ã:Nh9§ˇ{;Īßöv\3>ÄpķÔ{=YŊúã”Į‡ßƒŧhųrLWčį ũn,†ū‰Ë`Āoxß&û ” øI?'¯€Id6HXJˇ=ö´‡nB×ĶķÁė¨ 9bC÷Ų}č˛ÅōU‡Uãîĩ[ō{ˆîÂA{žŌÃŊ~ŋļņŪ0-„oŪTŦNž3q´éÆn´į˜˙ąmQm‘øĨ\œŗĖ…OųŗBC1 M˚IkWãû íy#k‡ōuj˜ĄŲÔr´ųĖ6Ö<šØ÷÷oî9ėpKß—tũGEén{ĢõæqIz;'>lģoę“vû§f´;hņ˛ŨaËWí˙œūŠūû€EFÛũSŸčíšü°õÖņI­F'4ķõŗë ‹:‹új4§ģŋŽEOOáÆ3Ҝ)_§rŲõy÷ÕŽ"׌yĶRŽô åF{.œÉ9ˇ"ņŋ!|›ĮŦP“ĩëņf†ĻŦc؂Œ ­A0ö3!*JĸJ|Qp0`IÚŠ|*fUuęõŽĄ˙㚝› ¯iĒ3ĸĻyËß)đßäwøø7øˇl˛YžŨޟ‹ėŲČME4opĨ–^[Ģ5ŊW枛ōFúzėŗÕĖc´˙V$ū×5âĪ åˆĄk"üĀÚÉ|A03ÚŌ¸wS0ˆ0ČLŅĄbŊÚ¨8p$–ˆrĀī’s É+Ö#į%įĻv|%v¯-§įFx>ádīųė3ȓžœÜh/FuÄYA2+đÅP‰5Ēŗv2'ˆúŦ)҈•7eMŒf,[°ÄlEg "-´Á+1” 0æÎķ{îīčw´išq+ö\-Øs7c¯Õ”Ŋv#ö^ęķ_‹ŊįĒė3ȓ^íÅŖĀbĐæų œ ¸ĸ6kVü51~`Éø#KĖÆ,I›đDÂág9đ˙¯)ûŸØs4bĪؐŊF=öšßŗ÷Āđá9›^[$ŊxV ŠÁÍYŗĸ KĀęŦcY‹%f–¤uYÂrBáPŸ˙wÜßÕeŋ[‡=W-öÜÕŲkUa¯]‘7Â+"ŧHzņD ō‚P$Šō,+đfŒĘ<‘TåÍ ŠĀũŪ÷*ņH^Ŋ†"˛+"ŧHzņ(2QČ ƒGYžH´ybQūßđŋû]DÉ.'ˆŧÄQ&ą("u™|H.^Āã˙ †Î)%IENDŽB`‚flatbuffers-24.12.23/android/app/src/main/res/values/000077500000000000000000000000001473234705300222635ustar00rootroot00000000000000flatbuffers-24.12.23/android/app/src/main/res/values/colors.xml000066400000000000000000000003201473234705300243010ustar00rootroot00000000000000 #6200EE #3700B3 #03DAC5 flatbuffers-24.12.23/android/app/src/main/res/values/strings.xml000066400000000000000000000001171473234705300244750ustar00rootroot00000000000000 FlatbuffersTestApp flatbuffers-24.12.23/android/app/src/main/res/values/styles.xml000066400000000000000000000005761473234705300243400ustar00rootroot00000000000000 flatbuffers-24.12.23/android/build.gradle000066400000000000000000000014661473234705300201660ustar00rootroot00000000000000// Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { ext.kotlin_version = "1.7.21" repositories { google() mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:7.4.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { google() mavenCentral() } } tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all { sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 compileKotlin { dependsOn flatbuffer } } task clean(type: Delete) { delete rootProject.buildDir } flatbuffers-24.12.23/android/gradle.properties000066400000000000000000000022711473234705300212560ustar00rootroot00000000000000# Project-wide Gradle settings. # IDE (e.g. Android Studio) users: # Gradle settings configured through the IDE *will override* # any settings specified in this file. # For more details on how to configure your build environment visit # http://www.gradle.org/docs/current/userguide/build_environment.html # Specifies the JVM arguments used for the daemon process. # The setting is particularly useful for tweaking memory settings. org.gradle.jvmargs=-Xmx2048m # When configured, Gradle will run in incubating parallel mode. # This option should only be used with decoupled projects. More details, visit # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects # org.gradle.parallel=true # AndroidX package structure to make it clearer which packages are bundled with the # Android operating system, and which are packaged with your app"s APK # https://developer.android.com/topic/libraries/support-library/androidx-rn android.useAndroidX=true # Automatically convert third-party libraries to use AndroidX android.enableJetifier=true # Kotlin code style for this project: "official" or "obsolete": kotlin.code.style=official # Use parallel builds org.gradle.parallel=trueflatbuffers-24.12.23/android/gradle/000077500000000000000000000000001473234705300171365ustar00rootroot00000000000000flatbuffers-24.12.23/android/gradle/wrapper/000077500000000000000000000000001473234705300206165ustar00rootroot00000000000000flatbuffers-24.12.23/android/gradle/wrapper/gradle-wrapper.jar000066400000000000000000001646551473234705300242510ustar00rootroot00000000000000PK A META-INF/PK Amą>=@?META-INF/MANIFEST.MFķMĖËLK-.Ņ K-*ÎĖĪŗR0Ô3āåōĖ-ČIÍMÍ+I, ę†d–ä¤Z)¸%Ļä¤*„%¤ņrņrPK Aorg/PK A org/gradle/PK Aorg/gradle/wrapper/PK A•%ĶĻš/org/gradle/wrapper/BootstrapMainStarter$1.classRËnĶ@=͏u1Ļ„ôEy”@_IikÁ6ˆU‘@.,RuØLė!™ĘGã ü6 ąāø(Äą ]t1ssÎÕš÷ÎĪ_ßxŠŊ폺ˆģîតM|4žiŖŨsZĢ}.āįŠ¸kŖŪŒ‡=eĪd/cĻį‰ĖÎĨÕeié0“c“ ”=<ÚOĻõąbģí+7.P˙ŖômīB%œĀÚßM• Ņ-°wÅēláƒ6i<øZ2ŗ93Ööėčęŗ#đ‡ŌąwšÚēl hÂãâōøšæx8F×čE´‚v~˙ėę9āŊP%pw8Đ.ŅR3ęSō Ņĩ˛ÜAcî+jŸgčQEoN SzéŨBŖz÷ąŒ•ĒÄjÅ\Ã:­‡ÛØĀ zQ^ÅÁoPK Ai,Ģ$ -org/gradle/wrapper/BootstrapMainStarter.classVÛSW˙sŲ°,ˆ1*‰‚ąBI/ĩV°V(Đ-m´Ú.É!ŦnvéfŖĐjī­Ŋ<÷ˇū ö%Ø2ĩĶ—vĻ“ãô;ģIIbŧĀĖŲŗßõ÷]7˙>ũũ1€ŖøIF2^à C˜”0%cīĘđA•0#aVF —d\Æ{2æĮŧŒd\ÁUqŧBNPŽ…p]ÂR2"¸!c7%|؉^|$A aQØĘ‹Ŗ .aIÆ~ †ĸ„eeĘ4š1´r™—‚§tSwN3øÉ+ ūŒUā ÛUŨäŗ•Ō"ˇįĩEƒ(aÕĘkÆÍÖÅ{čw–u˛‘T-ģ˜.ÚZÁāéģļļ˛Âíô9ËrĘŊĖhē™u4Ûáö8C ,Ž ‰ëę-펖64ŗ˜Î:ļnĮ=ŠnĨ/čwņhv‘<ėl#Ė {.'­aénVfčđ¸ĶšMčķ–éđUĮ [ĩ´'bÔĶ0š“^˜SXBšD¨]Îß.I¸üî,[†Xƒ€Í— žwŌ$w7'nmĨžŧHĢŲSçIž‹r•ŋ=Ŗ­¸btr6ąšį+Žn™e ˇ¨:KēYPĩŠ™_æļ_ĸ%u­ÉPŒ-q iûõgôÅķēMĐ-{\f­Šį‚I‰jW˔0 `ƒ NãĘÂV8sĶŅKüØ ĢbâĻåÄ Ę‡ÃãÎ2_t+¯c‹OŸ‹ëf\ĐɧžXâCƒåĄCĪ–“K‹ˇ­„Û ”ōŗį9%Ĩ9 ,ŦHøX ĘŠŖ ‚; îŠcĢÖ|‚OÜÃ}Ę.ĩwĘëĻTkĘ)ĸā3|N­*Z‚RÛRU_āK_ákę¤zŌ3†Uæĸž žÁ`\­4‹T ä[ß၂īņ€Ļė‡lāˆ‚đ#ÃĐ+*0ô>¯iōļX åėiFZ$K–]Ōh˛O&žÕÆņõęVoŅæ‰ŪÕFWŦ€c-ĖM‘ßD˛qh§Æ›ë:U“TŸ‘T…ņ–ĘÔ;#RäNv­ėđRķzH$['tk=ĘeÍæ&śŦo˛ē§įh‰8ō6ŋlsܕ¯ØÂPũ=ŌäÖŖ đeîdÚ,ąXâî: ē×ļØ`ģÔļŲl"´zņĪŧ¤”žNōEë/¨›wŦÛŧĨ-j=đ’¨¨y1/ [Ö\ûf ōUÚe÷“vĄS/7,ļƒxBY|ˇšÍ™ZI,<ņJļėG xâĪ&–¯Ķ[šžŒžá °_é˛ Ct]b :OI Ķ“aŖ$EĘė$úî>ÂļŲC˙ wž\Øī˙œo4ûÁ Hn"”#RGÎw¨ šŠNb(Utm {Ė˙ÛŖū*zĸūđŽ*Âch ŧ“¤#9_xWļŠŨcÁhyGč}ĪÕ¨˙/ôŽCŽúC”A€öģ Sč¤s/AŨ‡ôĄŸ~8Œ#Ž E¯Rü7q%ŠŊBŅß# ܤ@-8q;Dv˜{Kã0Ā*ŽĐÍGļÎŅĸcäM%Ę8Nŧ›äãMœ „ŊUK•Į;Iŧ1ĸD°í ú%Ğↄ„ˆDvNš˜ŪϟDôíŠÕâgĸųčy|ąÜpxīöŠ#Uô­c€ũëčŲÄūÜâU˜ũ]Ŗũŋ@õ}ČēĨiˆP8TŠ(Õj@§ ö1*BŽ“Ü ēqg)øÔ—žč“Ķ_:#BuĻ}Ķ™ū#ūzŅŅqF=÷~t 8“Éš7÷ÜsžīģįėŨ'ũĀ+øČDo4ĸÃԌH“5ɜmĀ9įņf’¸ W.š¸„Ņ&ŒaÜ@ÎĀ[&ĸx;raęc" i.˜4pÅĀCÄņ*á3t<ŋ’ŠøŧėˆĖĒĪ——…Ÿ)(g–ĄĄ,Qá`8ĩׯ1oÕu<^žę{_TĢģW…^öŊíÕĒÛ{„_nĀĀō„Övíā<ÃåÔž ˛o–!<ꕉksÁvŕÚŌ‚đgø‚C+-¯ÄYîÛō}1,ÚU†î1qƒ×œ`ŋĖ VŪĨqÔáÕĒ €sņ:ūŲčh’åē¯đ V]änE”ZS…›|…g\dŽMįŗR“ÁËe™€!ö´›!Zō\J„[ éd'Ė­ä2c”Jˇ&ųr]qRruˇJÁ+ĸčå8 ÔS›XmĨšī“įؚÉāMxÛËä§Æo—Är`{.ąh§“-Õę’gÂT^*wSāÜŲĸߥ¸ĩdŊÅälÉ2ē•gPZčÂU m8lĄŽ ĶÂ) ĢAīX˜FŅ œ´čšyÕŒ…k˜50'=īŌąîA›áˆZučč3Ķ57°—ÄļS"ÎxĪÂû¸ná\7đ!CöTDīāM-Ü%:ūįho-%+ÔąīĶBÕfuN×IĄQ{ųEņqM¸%‘íÛ帨vËÆČ>E¯øļ[ĄÆ[áNMLŨ Ę§ōģ77PPb¯dÄ15ē/Nûnj3‹žˇĒRZlĮ1ÉeShKüļėĄ|^öļdSŲ:83ôĐm˜ņ…†Ų1tũĩČĻĄ1$û†Æ0ųģp”ė1úˇ@덉ô:Xē ĄôĀ´´ļ†đÕMļ :Ųī)ö4âGÄđ!ũLx ŸŠG/ŽĢë6Ąp™šIäÍŠ7ëxŸ#B_`¤§ņî§8”ūÚw0Ķ=máučdīŪC”C-‘¯`ĖI÷ˇˆËĄŸœŅdĨ)VĮ`ũ….û_ ë7R÷;!ũü‰aüĨØĨ‰3ĄmŗÁKH)v#č#oHÍúÕžšëĐņVZĻįĢNųIr.nĻģ{×Ņ7Å!=ŠßÃIbNęŸá¨äœÔ7`íø‰‡h a.ÔéīŖyD˙Ņų}ąĮø´ę2^@Ų#GŖæe! ą†YYĻcœJĘ"#ōĒ#KīĩĶxY&ˇ-/§D15“ĸ4%ĒÚĐ%VéĸĸŽkšTÉčDŧŦõŪéžã%Đ|ë“ Ú@ËÛĨČlĖܧÔgęh ŧĻЈšŠ|/Ē7/]>(Bķ_PK Až‚­ÛĄ~4org/gradle/wrapper/Download$ProxyAuthenticator.class•UŨsSE˙íMčMn74ÄJŠXŠ1IÛ$Eü E ¤ `úaŋ ´ۛôâõŪxscé?ä3:šĸĖ8>é Ė8€:>øWøāÃŲÛ´“¤;éî9ģŋsöœß9ģ÷ŅķŸ~p%G1Ĩᴁ>ŧĢÔ3Qŧ‡÷•ôqÖĀÆuœ3U€(>Šāŧš/tã"&t\Š Á¤ŽËzpÅ@+oŸč¸ĒãC—ŋnU“y†ĸë•seO”l™ÛđDĨ"ŊܤģáØŽ(đœåXūy†ÁTGdz‰!\pK’Ą§h9rēöåšôĚM+‰ĸk {Ix–Ō‹aíÍzîŊ͉šŋ.ß2…īz üĒãH¯`‹jU&ßéčä^wYúŗdžázĨĻ=ËuNĻŌÅģâk‘s¤ŸÛDbåwg[%ØØÂ)įæ}ĪrĘŠČwM×fˆøÅǤøcķž0ŋ˜• WŸ2\čĖ_Į Gzĩ{y5Œ2œ8Í`Ėģ5Ī”W,Åtlg+Ģ2āx Į9ŽĄ_IEŽ)Ėč˜åø sķXйȹ„ë:np,ã&C_{æ—j–]’Į Vé°ėnęŸ+Ã[ˇq‡!ŪnČp8ÛÆ+(ŸĒÁ!°Ļĸ59N"ɐũũĀpt÷„ļŽL2„RŠú8u͜üĒ&Ģd´°YQ¤ļéŠæĻj9$Ų‚¤â$_ĮphvnæÆ2ʗõÛ%QŊ8W¤Ĩæ¨h…PŧYgčVeˇ‰{wđ­m~ŧKTaš˛ZMŽæŠAŗŧÛîkžeįč~¨F!r3’Ú{ôŪh­§îžīî4UŦÅ)U’"âšÎŦŨ•Ļßâ°ąDøna]xž'6éaJĨW Ôôû„ŗRH/aŪá>zĢY<ŽnI!hęRQ'ŋNÚŌ4šĖĐĐ2[}Kš†ģ<Æ4ō@6poŅVŨđđ/iašk™:ÂßáĐ7°HęĒC/fž‡ö‘‡ˆ.oÁĒŖ;Ái¨#ö#kø=SÃŋblXŧ6=ōēGĻ"ą<ĮZŪŗôÛJâDI˛8^I Ø`ˆ+ņ’Xv‚Bxąžm%˛$¤§,”%”Ļ{X ´,ĨtĄ„ĨĐĐ9Á@ - {éltö鴝)3Ėžvhëū÷ž'Y˛…Iį›ī›|ņ}÷ž{îšįžķŸsîĩ_˙Ís/Ņ*ūQ)ÕŅxč?éŋ<čũˇh~ŠĐ˙xČExčqú•—~MŋņŌc4†Iaö’—KOáķÅ÷Ņ,ÍRŅ,ķЛŧÜÃÕŧB45 ×Ē\įĄÕ\ī"ņ¯‚ 7zčužPå•^ʼnEĢeĩÂ+ŧÆCWŌ*¯Å—/ÍĨ*7‰¯CHjVø2ĄéåĸiÍĸšR4ëDĶ*š6…×+ÜŽōmáfĄûU*wx(ÂA•7ĒŧIåNAífíöĐuÜŖōfũ”ˇ¨ÜĢpHúTîWyĢB'ŪæáĢy@åíBÆ…¯Qx§Ę×ĒŧKåëTÖUŪ-tģ‡U6TRyXå•#*īQy¯XUxTᓌŌd[TOĨŒĶšë!=5×Į÷Įĸq=ŧ9NŠTg$e`dōtāāē´9bÄĖČ nÆA,īīŪÔŨŗ­{×ÖöŪP°§l{ô}zcT 7†Ėd$6ÜĖT֏ĨL=fnÕŖihgōļöoØĐŪģ+ÜŪÎÄAQ51ÍÚÜÛsUo{(´Ģ­˛ÂcĐŽ­§ģģŊ­;ėę vĩ÷ô÷íę vvCí˜YÂâåLūŪöuë‹20šŖņáaqŽ…ņäpãpRGÆũI=‘0’rš*wëŖ“Ŋ­F2‰ÃZ‰iö¨/&įÃĖÉЃčbŒfDŊܲUڌDģô˜JC‘á˜nĻ“PāâÂŲËĻv:Ĩ2ܗEbŗ…Šĩz†Ŗž´[™œmņ°!TÄŒîôčn#Ų§īŽÂŅņA=ēUOFÄØ&:͑vÎLķãą}°BhšI–WįzrĸyÅ4SšÃäA|Û­īÜBŽ%’ >O"O|Uqé0ŧø Ž‚cLdÖ\L~žSzvī1ÍæéᔲŠîÅ:)Má„Â×+ uŨĪÚû7Īčô߲gŗã¯Ā<ō˙¨ĀYZI¨šŠ #ŌĻæ5đŽjÁ¤†mŨ‚l?Å ŗąŋ7hˍÄ7Dĸ†”¨čá°ĐIŦÉ.l¤ĖHĖ–=Ģp- Ú~`ĐHˆI,ŽČF2ĻGą 2’ë† ;­ģĶCC" •ėhÅÆąôh¯!”ôšqSvąas$O’Βx#B9›ËÚâiąĸļ€^ķķÕîDʎŊP 26=or:Ük˜}‘Q#ž6sƃ΁q.ĘpĀž´™H›0ŧĄbē$Ë*fƒąüI%ĨũÉčûuĸāĻ6N+ŧOáũ Č1G˜OqˊЯ?§€:3õ:§…˜*x¯UOE§"aEQĮO7’€€g07x„ׂą!;mˇž2ÖŦn ĘdēŦēHŽ-V7+† ĶZ”ė2Ė‘8\ŧ /i Eą[Ŗ5~͐ĖY^Å& ̞•`fAģ¸'ŲŽ'ŖÁ57+ßB’qmŖ[ĸ yy+ä]ĸSNĀeČȕH¤ƒé¨nũ9Kœ_Ü[…Į––‹É*Ŧ& t<‰Ķø ÄÉp`šS]T‚GĐļą°¸¤x­]Ę+'§r4wŒ+Ũ ˇĄUÖ x“Ų4%Ņj|šĪ؀Î_ģ$ˇb–•ũû▧í}ōk€Â¯jüŋûõ÷m¨ŋDã7øÍžėŌŲE S@P46ėŽÄ ëuS7qcnŗn÷V 0-ÕZq7õųP+b×T`Ä™Áo‘T 7Št"Į6áh‘`ˇvÁî>+4ėĐ´ōMU!qŗ]VžßŌømč˛N4ėŗĢ†fėjPn G')J<Õ`)zd]֍…KSKSęĨŠfųE^Wãō;HWE2Ip}îŌyÎLIr%Že(-ei§Ÿáë>§Ø#žv:ĖrMšļÁtÅo<ų9,–ĮžŸ:  Ķ7’Œīˇ^Ss‹Ū ą'‡8  _éųÕųEļā§Ę7aČĀÅ ˛€ ¤æSI5’3PU{ÖpâV:ĸ§ēĻ|lĮ]9&…÷ŽÜ•Ę ]7jæÂNÍžˇ;âz|IõôĨĶ)Eåoú?{\‰ëĒcXXaYuŠn~ÅĖWŸ™&—Ŧ”N"iĘī‘<)ôoˆ›ŧ;bŸ”!á 'A´@[‘õÄä{Ę=ē7I*.3.1˜ãÉ>)>Ļŋāü“´‚‡‹˜›˜ÅōÁŋ`ŠĖ‚÷’įé5ŽOãŲgôāäī6>ú—.•XnËŗk8€W”zHÉz8GŸ{Äßŧ<ƒž°Äsb3û ¨ƒ”ĪGWõŽV1Ŧ(Y9U†ú(lžâßĸŠ‹¤‚“—„yą—NQû;@R˛•8„ú’Nĩ@š>{ĘcbãF!Ûĩ?‰¸Fäâ4Ai3˙‡Æ #F]ƒŅxJ<ŦÅd ĸëĪę‰fߞš§đ ĸŠü53c!—)ĨĩJáˇĐāˆ!j‚~G<*ßI‰ŗÂŪtJđˇLhíūõhj ˛ļŲn)+“ŋđdžą$ąŲ‚vAuđOgŗœ0’ˆ-néGx/ģ0löą|e‘5;Ļ­É—2íų=˙Ãæ`ŒHl_|/üwicė˜;š, ÖzДŋČ,vBņË EÕm3áN bō5îŠ'GusŠVE˙ĄˆnĻķ¨Ž bē<ä§[čúˇQ }œĐmô‰Üø0ƟĖ ãOį?ƒņg Æ>ņTEß'^Ģō{ģũŃS~ņv˙Ũ’˙ŌĐŋ—žˆöK ė 79ņ-¯ŠåēúTr‚cä|F2߇փ/ŅE4‹VĶũčÕXėô=(˙ZT.ˇgŲ ”ČžPÁĩxЃ‚ØąXšyœ\cäîŦɐr’TĻŽē“TĘžĶKä펭?IãáZ†Î,Ļ3xÆ%Í€z’Ę´íčęÚcé”šV‘øûÕZRéZJ—Ō&jĸnj–Z°ûRZF_Ą¯ĸ-čkôu|Uę oHķ<"%”Ø\ß—5wæÅ\9M>…Ž*ôØ­ §B[#…ŧT"ģ‘ ,*œpXø˙KĖY>xBzāIË08 > ĒĢŖŠšÚãTYSœ|5~įqš]ãw'ާ9ĩuc4÷8UmžpCú|H%j Ž RēnZGs¨(iŖå´žjŠ] ÅÚ#įļēœÛę$NJdīˆt›č :eO Į%ÍŖŲüwÁ(.û,ßÂĪSô´&kΊšg‰}ķO’ŋŽĢ”ŖrtšĘĮiá@ žÁ‹NĐ9“™%7î E´‘ĒŠS*mm¸ÂVúQéé’E^PŋMĮlķõ“CŽ,¯ËĐ⠝ģ­F*0 `Kpė´ũ-98‚øúŽ âīŌŗXy\nÆ´ũLv3ĮXQüąmws“Ģö—Ąķ›ÜãtÁĀ8-ĀÆKĮhYˇßĄåMΚZŋsŒĒá°MŠß —*­ryE†ęíoƒß™ĄÆ&We5=¯6ŠbtáOéZoéÚ2ŋ˯fhåĀšŌ’‡iį Z•Ą‹î§˛qZ=āģxŒÖœĒōÎ-=Ŧ¯õV•ÉoYUŲZ;ZzĪC¤aĘsøžh¤kËā„ĒZĐĒŧ'éR7öWsK3ÔttâALUúš3t™ßušTŋ+C—×ŸĻžú ĩĨŽ&El8NW"l×ųZ3Ô&ΡŪ׎^†6ø•1ēęTSyq!Šâ/?õ ,>‹ŪĻ÷S|šö}Ÿg˯€x%´ čē\Ûi1íD@îæŽŖU¤#˜w׃í0õm4Œ™P"4_™´—nĸ(˛f¨NĀgIÄY >5é{´ûßHī‚ãĪčfú ūsdŅ÷é ũ#ŨMnäEtŸG7ķ2:Ä5t+7ĐmŧŲV`æ>`cÚÖ)Ø9M'ų ģ\K΁§šÄh=ôŲKĪĶ ˆ˙!h÷"ze8Į:…äæÄnĐËĐGHĘb=ƒčY,á éûôr@ļ×ē¸ž^Aš—@âĢ@¤ŒwČ;ÍĘĒS¨CĄ×z]Ą7zSĄˇd ;Ņ˙L\,š.¨š€ōJQ>”” œą`’ė)V芰BoO Uc°˙Íųa{äE *~wig˜›`g‘ĢęĮŠc%$Čh6âg~DMéÂO÷õë§-žŪÚ1 ’Ą@Ū\mnå¤Đ;ĨƒEö?§~™~$ųëé÷ā+uĢKÄī<íĖķœ RdK öčëŽ?ƒ˛é믅NÚúi2 ļ! ę|WgŖg1SS?FÛ­ØA:˜Ė€‹ PÜ(Îėā…Vķ@w9ęčdõmÉ%Ž–\âjĄ?@J°úú#™Æ…Ū0Ö¯Č ĪÎÉŲs5˜ŪĨ[öä(6•áĖļ#C×tÕųvfčZß.Į t]†ôî:ßn1tb<āđ…C 69ëķF††š\~§ß…IcĀQëÎІ^ĸČ1ŦÜ+VF Wú\ŒģÉ)Ũ5*2&üU"Ķõ8ŋĄz ž–j`BH̰ū|”T‚K‘žˇĀŊ›Î-8ę­HÚÂ^×ĀķÁņĮô'Đ€ĀûSôœ ĖGøsxp6ļhˇĸŪüũ%zŊH4…žĀȑœ­Hģ↉KÚOč¯ĄŖ°p-•L`{‡„1č§"öL=Î IŒŸ!įXH•S8ŗMVĮ˜ŦްD—ÆŗÃîēĶt.ōčBA¨rmMJÔ[:ŧ],‡!ëô Š4Úv‡ģ9œ×ûņ°ÂƒįĄO˜ÄĒ.r%ãĐJ[™ÍM Į„ņ,Čä]Š‚­8Ÿökߟ_ÃPU:â]š3aēũŠG­ÍÆŠą\°^ļ&aĄt"-ãœE­eY˛˙Âč›Ë›ŧ8\3ŽŦK tЎBNûĐk؁ûPK A!9|ļ„ 3org/gradle/wrapper/ExclusiveFileAccessManager.class•WÛsW˙YŌÚĢu|iĒVÍMNZ*;ą•JŠlB×NåKœÆŽ[—t-Ø¯vÅjĮÜSšB[(ˇļĐP`xĄ 3íLĢ$x†ôŠĖ0à }á…0ŋŗ+9ž%L=öŲsžķŨŋß÷íúO˙ũũÁ¯t<ŠgZ ãYĩĖjxNG_ÔpNGĪ¨Ã—Ôîŧ† Íx^mMEœSKA-EĩH ›1¯ļ ::`éÔvIÃb3lIŞDIGŽēqu”ņåfxJ_Ĩ~OĄĒc—u,áJ ę§íÄņ–ņ _Õđ5öņÉĄą #ųņá SgGFōĪ tŽ_2/›YÛtæŗSžg9ķũ­CŽSņMĮŸ1íĒhņ­’tĢūDE@äv”]ÛÎ;žô.›ļ"Æ,Įō Ä2ų|÷Œ@tČ-R°mÜräŠjiNzĶæœ-•=ˇ`Ú3ĻgŠsõ,jɎģŪ|vŪ3‹ļĖ.yfš,Ŋėđ•‚]­X—åˆeËÁBAV*ĻcÎKŽÆÍ€ 0˜ ã°ÜŦâëOU߲ŗ×)T=O:~vČ´meąŋ{]ԓs—dÁWĘ䕲å-3ÄQēdģ…EŨ!ŖCŊ…Ķq¤] 0ŠE•(šŪ;&fŖ*2ŗB5ûū?ÍĘ^¨¤Ŗą}Ōōč™Ģ\j÷L§č–ÂøCļ‡ÖlŲtGuZŨÛ5Ķ[" äMn,ÉršQ–‡īíõĀôt˙1•„)ß,,N˜å@LÃ×5|CÃ75|K@gųdŲˇˆ'ÂhƚwLŋęQ÷ÄĀtnkŽ}ĸ2†tsĨķԟ&J',ÛVXjĘtŗŠ%syNŲnE>]ĩ¤o3•É;6‚‹ÄlKĄq¸oF3åVŊBŊÖûîŽĖ>%l W Ä!Ŋ8$`ŦÍĀ øļĀ›ģīDÕ˛‹Ō3đ"Žx ßčũD]AĖõŲ…EßU úđ˛WđǁīŠåûx•ĀšcķLÕQ­ŊV$ÃCnÕ.Ļ×O#€&¤A7zxŠ N5@¸īT3„Ī(īúåz˜§Yō4Š}Ī ˆž] Ōŗû4Ŋ?ˆEšvqŨĀ<Ė ŠáĶøLøĨ˜ÁNŠp˙8>K.š‰ü1´â‰DgÖ[A|ö4n›khéLpŠÁ¸ÖSŊŧÍESŅv\ĮcęŲöęŲ~]+蘭ËvvRˆÜ÷5dwŪš˜ČÅĘũ=ī#rÍ<lj\KĒåT´¤öúÛ8ē‚äloį7đ`.–ŠÕĘÅSņ W˙šŠßÄŽTŒ U4]ģ‰ŨīŦ~¨TôŽ7Ŋ‡6•‰övîãūā7ŨBZ §§Hč ŌĢ@'ŧc Ĩŋ›KlĪ“¸3Ö1ˇ™˙ŋãcŅÆļ‰õDQDDwp>¨žäPõzp}”ÕĘ@8B gmÎŗ*& _$W™Ô ëö+ôkôŽrÖ}ŋFŋA?~‹Ô(ĩ‚AZÆĮ8‰đÃņŸü:üưŠqÁ¤Đ8­ Ķ›“"‰ŧ؅Qącâī?… z5)“įqj…™sDPˇhí hô F›9Ԉ‹ޏë§uė>cÄŅ~ęūiMȈvz5ĀHMüž NJø †đ$?b‡)nŦIŽPō$)SĐūƒãĸüŨŗŠhŅ Į§Bĸ†¤†<ŖĀŋqĸĪŌ0ļĘ.ŌļåƒÃxŊdĐ(§øĮWWŊ§Žw@ķMė߉Ĩß­5S< Ÿ ’a„<õĀuõ.Ģ˟į3ôäGhíš…GŪAtü=’ŖdlĨŲĻ@]ą …ųßéįysŽũųü:õmŒšO• ‘ ˛ŧ8x4ķ?PK Aė„,y†-org/gradle/wrapper/GradleUserHomeLookup.classSÛNÛ@= $vŒÔ”K J)$´ÄÚŌ Eĸ`@"\”@¤Õ-Ūsc-ÂÄgĨØOˆN™QMž} (1ŠáėÁ#Šj€ RŽ`ë›ŋ̀i­õmšõßP/ĘQĢđWM:‡Ü‰â;"ĸŦ+) Q¤g4ˇķæÍ+˙{ķŪ >ņĐekÅ"ĪTąĪRĄâŲrxŽžĢāy*J$šĪWp—‚øņB?^$ /Vņŧԏs~ŧLÁËUTIÆ*ŧB.žRÅĢp^ÁĢUĖqɯQņZŧNŠŊ[÷Čáõ*îÅŧŅ7ųņfoQđVux›ŠZŧ]Á;T,•îÅ;ÜįĮģT„đnīÁũōëŊrxŸŪīĮü¸ ĸČųU|Ēø0R*F1Ļâ"R0Žā#*6ᒊ;pŲ+rÃGũxXÁ#ōķcrņã*>O–áSø´‚ĪHÎGĨH’?‹ĪÉáķ*ž€/ĒøžŦā+*vâĢswėki ˇéínßw¤ŖkWû‘Ž==]ģáãú)Ŋ1ĒĮ‡ģm+j˜ŲjÆļˇ÷ëҤ!,ØŪÖŪĶŌnoËČŠNŗėíílīÉPæP 6•lŽÄ#öĸPũ~_Ģ9@máHÜØŒ3ŦũXԐFšũztŋnEä D*ämpn˜rg2âĩĄâ$ŋ‚¯ Ŧ MŪSˇNkĶõbŠv›IĢßpķ|NÁA[-2E卭š‰Zx•ĘĮ´0͜×-N7J3sĻāD˛į^ž˛ėÖå}QŗŒ‘¨.oV‚ü›B͊ĩ—ĖåĶÛJT*&ŠNåu]§Ķ6‹6ĢG›é> ę&ŒO0¤VÄ>ۘĪĶRĶâ#€3øÛPSX—Âú6¤pķm÷afx›úVŒâ–+TŅhNaķ=˜'‰[}—°Ĩ¯¨Ą{ [Gņ¤+„Ēå"ļ \§ÍjEûGrSh#nÅv"×J´¤mË"в ŸR5h!Rˆ‰q+mÜÁdč nŌö†¯‚û’8ÅY5wžfŠ Žkü:˯…L8wõŠüĢ‚oŸ‚ŖTÁÁN…JUųM;ÜįdPÛ(KaûŨ˜åX,';RčfĄSÂX”tƒj1ŸAž„ŗÖÉDWiøŦQåC7­fSZMų8vRzUâļüčDŗÄ•§Å <ÃáēķPK AúâæĒÛ"org/gradle/wrapper/IDownload.classEÁ Â0 †˙Ėéæŧ ^õbÁëŽ* AŅ{ŨĘØ(í¨Ķųl|JėTf $_ōįĪķuX īĄë! ø‰Ž”ÔąŠJąYBŅÆû@kŊoŅV­G=ëöSEũũfv“Ũ͒ķųäŊyīũîß÷÷{oĪũįÁ‡ŦÁ?æĄ)^ȃÍCšGF 2ËaTÂ22ŧ8Ę_ˇ…đ"ž_Ė;/ááĨ<ãávIŧLF7^ÎÃķp'^Á_wÉx%^Å$¯–ņÜÂk™ôu!ŧžeŊAÆņ&Ūys%îÁ[˜đ­ŧ|[%bx{%âxc!ÜËÛī”ņ.ŧ[Æ[‘Ä{xx¯„÷…đū>ÂCøŒ&|˜>ÂŌŽKø¨Œu¸O&?&áãNHø„@ÕaÕXaX1Õč×S7ë†&° sX=ŦFu+Ęë •L×ĶNģn ,Ɲl} ã薹Į6ϘL͉îéî Ļ˘,f™ƒz"cĢL'P×iŲ‰hÂVã†ĩÕTJŗŖŊŪÜVHJüáR5=Cęšĩëz2IjO™Ąš‰h˜ b:CzzÅ*åå´t˜iG5 ĻÛ¨›ēŗIāÎČl„ÅA(ˇĘûzÉNÍ´ēn¯€ŋ͊SÔvęĻ֕Ihönu€ķPŨÉiŲĢÚ:¯s›~öR@é0Mo¨é´FËĢfņdÅjrÚO’(KU‘ēŌä*ēGÖ6¤ÅF$|Ō•=Ŋs‘¤åe’’0ŲIĻĻpä‹3\}-žRÚąsۑ˜–ĘåXNĒöˆf{äķMM‹§Û­QͰÔ81öÖŌę Ö^Š5ÅąRÚaÍ <’ķUžt:7ĸDK‚kŠCw4•_m íÆâpl"Ūų=ŽŲĄĻ\ Ÿ’pRÂũdí”éi §.ĪĶÍč΁a-Æēįõč Su26ŠÛ2“ ĀĒŽXÆļ5͉ļQY]{ä+cĮ4/HųÜ41f›3Ŧ4Ai‡æ Yq ŸVđÆlÃÍ 6ĸUÁ&žƒÍ ļ`Ģ‚6´+؎,É*TĨā4v ,)…č֌nÄ5[ÁÎ(xg)¯Mֈ‚Īđz;>Ģā!L*øŸįŊ/ā‹ ž„/+ø ž*ák žŽs žoJxXÁˇđˆ‚ocRÂw|ß4ĨTÛQđ}ü€ŒĘ€tײÂJø‘‚3×OđS ?SđsüBÁyüRÁ¯đ¨‚ĮđkŋaũŋE‚0ĶŽšÃė„?Џe%Aãw~¯āøŖ‚'đ'Æ_ˆ¸ 0 QmVƈך–S›1oĶSĩT@ĩŽE“hukjÚ2[Hę_Ųáŋáī žÄ¤ĀŌéčugLGOjSB9VäÂNōō؊•´—bFāĘYA#pũ%–h>éšÖEm쏍éLot85.ËÎGÉĩ¨ JK/Ž”Pŗ5ÕqkW šl§-Û#gô'_„›äü„æėRŲk¯$ZwŠI­´ §o–mRY)Ķvglå`NŒ!ĮōļŽ”kûĨũģROˇįæšK}+¨§=;’[Ō–‘q´]Ē3DQc1-MÕ*ēĒsž‚ŠŨ˜CgΊ]ÍjgS[ĖÉŪäy×0oų\–į-Íe˛{ŽĻŽrŸfۅÄ.ōĖ!˙45Y`õ ŦšuΚ‹!ą¨ŒBRŠWáyq9¤P‚ƒqn(”ĖeeÔOßWßU{lnãHņĄŽôm”wëÆg hųwZ‰„ Ö"pį.˜ŲĀž¨0ʄa%ĻM[ËĻmœģių€l¸HŸ›X(>õyuIĊÃIQíSŊīļčeYR–…]÷Ėf—0Ī|<„ôŠÆW)<Ī7Dĸ‘†Ôt—v„z›ßt§ŧ7ą+įb@ųö]Ž;zũ¤đ=T𤛠¯õlË-—`K!â/Ĩåå4ŗ‚ ˙÷3ÚEí Yj‚ ŦrēIÍ5Š|GxWN—6Ę[¨Ĩ_:- ûŦĒâ§@ķĻÜL"wĻ7‘;ĶŗČéŨDŋ}ôŋĪ%îúęG$š¯Ģo‡¨oGEũĘqøęÃūqøëÁqęÃÁqëOCēŸ(+đ<ƒÄŌø|kh$ ]€ûŚčAÁO:#=žƒ°ž ų,B}õ "‹yg!÷FĨˇR˛˜_Ŋ€†,žĻw/íú˛¸l 벨ÃjÚŧé,šĀå;'°x !šjNžÂš¯Č"LôK{=ĄÕ÷Bō‡ß×Jk˙–u-ÃČŦ&,Ÿ2ĄÅöįD‰ \™#­žŠVfq5eQë^ÃâÃū3x–aŋ'íÚŪŧÅXŅâž>[ %œÁuchå¯ë=/C-Á%R’›ž59Eáāęz˙w2'9E} Ŧūé°1wPáŠ]y‡Z%ĸŖ$Ōŗ…W¯ō–žÜru‘Âļ5l)ŧaŠ ČÛáŖx4PBØ97%K]kéģf7R>Ööē‹“gąŽŋŽ8›&!Ä‘)ú1īw1uŽĄq3"„ÜfÂn'!ˇ‡°ģđ:@ˆMÚFi÷áėÂÖ B×)܂GЍG‰ō ėÅSčK°OŦGŸØŠ~ą ûÅIÄIĶ!aC÷a@œCL<ŒAqžžÕcH< ]üÃâ’.Ļ!“Ļe$}7!øÕÔĒ.?Én -­’¤[ŅKļÕ9ėGÄcčŖSQqÕÖ­Ä{L܍ũä•O‰jŧHĘy4ē’8H\ Ņ{g‡(*íŦ†|û$„$t?ķ7“]ސ0p‹%Ä$ğFÛ°„Ļa˙ŋ%*hÄæ'AƒU[(4 ¯ėuËTÃYŦ?Yļz įÁ”‡\zÃî<Ã=KÂÄúĒĻŊfxŨ´ÛųPK AŦāāĮ}-org/gradle/wrapper/Install$InstallCheck.class•”]OA†ßiˇ]ēŨÖoüBŠŌdˇ$QCÕ`RôĶīĻËPļ-ŲmÕä šH4šxé…?ĘxfviKŠĄMĶ3svį}Î{vf÷Īßŋ,`Ų@yffex(Ķ99ÎH`AĮ"ƒQõøŽ+65Á0ZÚįīšå4Ŧ—Ž+VéÂ.wܖ'6…īķ*­H+\^¯Z[MĪŠWi•Žb0_Õũ&wŨ➰TZ^Ņåž/|†ĩėYuŽÔđĒV`ÂúāņÃCáY!%ĶMŖ:ZąąCEÆJN]ŧnÕ*Â{Ë+ŽrÕ°š[æž#ķđĸ^;1­û-ÛĻ„a%{ēÃaĒĮ;u§ų„aĒŌ§Š2™mî9Tq˜ †ã—…įė:b‡!šÍŊcHm5š}°ÉÃĻ Ž:ÉĖ ŗŲá’ųXč$`e@īŅ8-JĐÚĐ Ķ'(yŌ–ęĢ)“ÆVŖåŲB–í°9 1qWMŒâ‚ )’&n▎%†é™¸†ë2xī›{Ī=÷,˙sîš7OŋūĀÃDTãšŦĶ>OšŌIŗPšEyhŠĨ)‘ŸĨ:•p™Æånâ×Iį ™Ģ”ĻJįÅ\-MÎKxŠNwķ2i–kŧB§™|žĐ¯Ô¸ÖĪu:=ÄĢ4~“Ngņjæ däÍōU/_k4nĐ)Če:¯åFxüŧPšõŌ4Mĸ§xƒŸ/Ō¸YĻ7ęt=ˇČā&?o–ū-:oáV?o•™m"ũv!lĶŠßęįvéwhŧS§|ąÆoĶi%ļÃāÛĨšDš]ÂĮ”Ĩ~.-ģũÜãį^鴆/•æ2~Īa#Gå3ĻĶEܧĶ~‡Æq6 ÷ œđŗ-?’Ō4i|šNÛxˇÆũ:đŌ\ŠS›ŒŧS§\æįwI˙ništžŠ¯öķ5:_ËīÉãëx¨tŊŸß+ũ "Đû4žQ§^ąj/ŋ3ß$Í4ū NūhķaųÚ%Ô7küoŅ)! âüQYĩWh>ĻŗK|Ņ+Íū¸ÆŸđķ>Žä‹e/˜~ŋôˇúų“~žÍΟúÛ5ū´Æw0MŅ„m†Ã ŊVįeęgԊ7„ÍDÂJ0Ö6ŽĢßÖŧõ’ĩM­[ˇ4­ŲļĩiSË%›ëˇŽgĘožÔŧÜŦ ›ŅžĒV;ŠöÔ1Mnˆ ŋ¨ŊŨ '-?ßÉä ĮzzŦ8͜æXŧ§Ē'nv…­ĒŨqŗ¯ĪŠW5ĢIŦôwÅvGÃ1ŗ‹i~.ÂĻĩŠyŲĨĪ´{ë!b¤#,œĪÍĩ`s6 eõw†“‰ĐåÖēPØĒīė´‰fÔT˛UåâĐxŌ`į[ІėÕLo/~ŊŪX“S‹]˛ÉĶ벘Ļ6‡ĸVK2ŌaŎš˜Ä:Íđv3’ߊAŨ‚įææÜŲņ5¤×;ã–i[kC ›ieN ڜíõ$ãĻŠEëJ§‡bUbqEgöęHĘīmņ0͇}Ô˛ĢļmiIA6Ik¯Yŗlyk2Â4=,Ē¯ÍšÔø. 7fZzJ+/˜° ;k˛ķÚP<#ԨΆÚ|G¨O~Ã–Ā‰Õ'Ëß ˇ`˛3†yŗ>ˇx,—’\Ņ×›€­ŽdwˇĀŌĩs “ģ×ęĮxžíVē"’yƒ„Õ™Œ‡ėĒ@' š6Ôc%lđrw 2ģ6Eû’6v˛ĖˆD[ĮŧoÚ&SØ;0͞ Õ%‰8ēÕ6;/Ûhö)œiüīŅč°Æ˜f]nÅCŨŲÜ‹YĶzĸŌ9ņ’Âé‚ėÜ ŗÁ°ÖJtÆC}Ž=]Ą8´æđĮ|¸Ē9¤Ė ;Ŧ×Į"0ÜŦą3Зšā¸…ĢƊŊēNãĪŽĒ™ _%VBœģŦxĸb§T‘­E§Á f§4à *y‰X2ŪiŠ€˜dõ÷YļÕĨfüa“P5˜OŲĒ{- ēs,ŠFßĮ&­Ąž¨i'ãØ|ņ)xM°€’°ėÆ~`Īnļâ‘P"!€Ī Šē‹ŗ3ã¨ŦŽ-–Ųå$Ķ„ŨKÚŧĒ­×ÅâĶļ'Œä>}HäYÆÜIZ^“ …NÜĮ4c"ĖXcÂaS&jë2ūW+šĸØ2žėƒŅŗI&;@jˆE"fņg€(OEÆŸƒIC‰ļPĮtu—ė€ZąD‹)ĀËë˛Â–¤Ûxû€PK$Õņ)ņËßŲ uâ€=cgŽ<áÜ5z.NF¯AãŗsÆYļŧVԎdœ  ŒĨUČb2ŖN`d'ĨpF&]HܤųmĘ—$)\C˛Â,žŅdÄĘdyˇ’Đ#ĖąāŠtÖ,œ(H*ŊÖäfĩĒėdĸKx~^ã/ $Ėn+=î˜~aŽØĖ™|=QE?3”؝ČĻ øjjgŦo +ˇ2UŽú";įæ6Ąp´[Áß§ëĻÂŋ3õä<œĶ'ų˙gzuõ/–ĻZššQ)–ŠšK„´9wÉTviF˄ŅĒ3g”]ųĨy-?5¯SæĮ4¯ÂĢâLxí]|ž,~Ëi,>ĶŗÁÕŋdt—•˛KŨ#!;LJąĒ^|ÆębĩŪĒΤTvHŅU ™AĪĐŗũūaĐĶôuƒūH2č;ô]ƒ>D6čôAƒĄG ÚËąņÕŲ˛č‹ŨB5čfÂčKߡ >Ė÷iüeųņƒīįAƒ‡xUī ŊZ˜1ø(?˛5DZj]__RÍāa~š){6+ˆÁēōCü°ÁĮø¸ÁđAƒåĮ"sNÕā¯ņã?ÁOü?-Í× ūßgđ7éEĻ]*yƒŲÅMpQQbQ°+f%‚Ņ˜Dm›ĄhЌ€,Ž‚ &Yˇ2ؘĒ‚v,؍ŗ'hõŖĢ3t•H‹ŖÂmę¸Ã‹ŋmđwøģŸdzÛI…HíĀą`ä“Āāīķ4ūĄÁ?âg˜6œZcqĻŨƒ9VķŗücƒŌ ū ˙Ôāį`RîŨ.…Z¨SÁXwŽĨÁnÎí:§(Zm¸sŌDˁ`¯yšė°ŦhĐ6#}Rļw‡ėŪĘĸ¨ēĪÄ#Aģ×´ŅXÁE9o+‹‚}ņÚAč1 {9­HA´25ƒĨf †P;.փËģdIЌC´TēÔvŠåÁîx,ûØņdB<ᔏ•ĸX0ģ$ĸĸŦ %Šĸé„”zXϜáŒ/;S•m­ō ØëUy:aÂāŸņ}¨ČFņĩ%ĩC+S9IĐũuĖhö­ĮÍIÁ˙‚^4ø—ü+ƒ-_ŋé‰ Ŋ#MÅą0xuËÉjž1čNßcŧŊ‘Š4÷ŠeË ū-b \~gđīųƒ_ĀĪĘ]‹2rŪΜÁā? Ŗ?IķŌĨ2ĩĒÁ‹xĞeI“­9 ~YČæŋqŲŠņ_ ū˙ŨāHî,œ˜cR&(mˆ%Ã]*rP˜#Ķ•y°o´4vĮâĩAÉ?˙Ôø_˙[ŖÅ•Røhüƒ_aÆ¯ü_>ađkü:Ļw;­Á#.2\ėrĄĘY¸ôĒËm¸7{ —_|=wŧ'6Š=ggįâė)8Á•Ÿ¸tƒũŒ/k¸ggY4ļzĖp}ŧ5dÔÎXD*Ų„RŠ&(Õ^2Us ir•áš$,ųbœÆ•2Rk¸ >ŧŸü˜aZtšŽéiI¨ĄkÎüĄ".Ĩp–†sŪāq ‘Ų…k§­ŊņØnįj6̧áIvlũč YAqSN ųpsëą{ļeOą<Ė)n˜HŸyT+?­Ëi†ÜoĮŌrhĄDc¤ĪƍŪ×­ÎuG›ĀlįD į?s;¨–ÛÁ›rŠuú7IO"tŦë†''X,ãį\aŋ&ŗfßF”|­ļˇÅSĨ°l6“Q”ņ &Fæį~ą’Œ>5ŠÛë8ōĶ×ÅgŊ•ObÜ @ږōČãŧí8ŲŠž# 'mKâũ$/Vŋ“ņķäAoķL7œ F(ą6]EÞfuŪŠßTąÅ4Ķ`FcQTÁaGšYÅ9“T4$ÄŌ"nļŖF_δŨfČF…ƒÃ@ÅfV&/ĖJPc_˜gį~‘ũfŒNĨ^eÔ/QÛŦžųV’'<JŠÜ˜~YÍĒqĒŠÄ09•ˆŌŋĮ ÎhŧįĨK2u_>­@M?CNú "<ąžąUëęöˆ“ų6§Ž iįā•ķBž?ˇĩfūî–5Q§’Tsl7˛ĩ™ČzķĘĻÉöūôíNUAC¯ođ-ä`rOXũŒŽå(ÎöÅØ÷ŋŠŊfbc,n5†-)ðդ¨Õo§~ގ~&=h0†ķôæ‹\æ<īFq3á­*[å1¯ƒ'¨ŽPŸh Ilxwã$ąčÚC%DäĨŊn$Ļ÷㗋nĸ|yČĀwžŧj¨ūfúˆęoĄĸ/í^úڏã×ÕāāAŋ tˆōJ‡IoΟ4ž"ã~š\Zv?iĨå÷“¯´â~šrXíđ ´g‘íbŦŦ¤™T jh>-Ąķh)íÃLŠÃ“öĶ­DęKdbõ%RšÔ—ČåÆč'é6Œˆ4GH' ũę˛AšēÍ´–Ō¯Đ|L¯õ<ƒ”_ë•nF­ã“žašŲ^đŧåeCT0HŗŽSáĄqrŽ€Žįƒs-d­Ŗ9´ŠÎĨÕJÎõÎn9WͧčvHäĨ•ôiē\tht'ėëÆÚRē‹îfs įú,¨ÎĨšô9|ųčķXíÁĘ/` îøŽ>üeŒų1ŗ7ö lĻŗÚˆhN‹{šgú4zĐ_ë-đ¸n§šī Í]î)đ|jäåō€×]%įyžbæ ŖÖ'ßąōA:ģÖ3LÁö!:§Öë^î+đ<ßI‹§ĶHĀSā[ōî#tn­Đé<ΧiRĀ;mņ -h xe¨¨í:ų–lˇđ„œ Ã\/ zÕģ•Ųļ$D6ÔJ‚b7 ĶĐŲt-ĸ+ŠœŪ‰uWÐ×`ÕÕԈ~=Ŋ‡Zč:j0;čzęŖ÷bÅ ˜šŨˇ@™ŧ&ͧ…ô%ēÆ €į!: Söáû>Đj´ƒ–Ņ—1+ŽÛ›qÍ^ú §ûiPÉ~= 2nė{!v_MĐ0ø=ˆ5KI[ŸF{4*Ôč!fŽŊBķ×itÜ˙:MĮo‚|‚jÔđ MãĘGčŅT Œ€§Wä/…Ŋ-GiCĄ™ųއ¨¤Ũ]Ūz„JPŲ!Ė”# ŨŽŠŠņSîŖTé"@TĐ|„ĒžŅâqD2Q}HÉ žXHyho†ŪÆˇP–(EøÖaķ aM°Ī.Đ>Ĩ¯’0cŗnSV_Áļ.pŲE_Ĩ¯ÁfÂōcÖCO`ŪP–•š'1'ļ›JîÔčŠŗNĐX‹ŸĻ¯§âôil$îi¨xœęKˇ¨ĻÖS!šd?UŖKÛō—iJ­˛Öv–ˇļ{+ZہUQŗÖ;L+ÚŪ!:˙Øá ęMī€DwŅ$ē÷8īŒß‹Ôrw˜ÖûT úTHZyAŊ‚ž‰/I: íč[*1ʗŠK}}[ķƒ*uōÁ0ÛŨߥīĻ4A/‘ģa˜V"Öj%ÕíŖUčVĩ@ë%⇗;!XāŊ“ΑđĢqBīMûČ(hGiĩ‹œûyųx—˙˜ų(}€f´Õk%=™†Nf\ZMĶø5P.ĨīŅ÷Ą$Ë(ē!åf?VŠs]—:#ObD.#÷R—–‡§4úū1L4_āíÎL€ø‡*‰ū˙?CĪ:1ú”čá°¸`ySa{Yū›‡¨~#ˇ ͚vßCÔĐîÎ_ ¯į7ÂįpũēÖ!ēĐÉŪë‘Ŋ‘yšöŅēaÚĐ>LĩËīæ!Ú8D-ĩČæ›`ëͰĄoŪŌ^ëœ Zū'BūÖAjmCVom9@sļÛņ‰ķáŊuÚe`‡x(ˆBĻāxqūÛéíCtƒtÉ í: m –n mĒŋŠÃáš…öqXû Øī)š´hKąZ@j Ô¤ė‚'.ƒ/Ž‚ŠöĐsāô  õ,NˇįĀíĮ͟Ā??  ˙ūüĨōhāچsķĮ˜—+ÍsØ­—æōFėš„ļ€ū@K-]„Uŋ‚oní¯é7Û ĪūšžW`,ƒĮT0ŖbE:ũ­{Rėī2`o$ŋûúĶ>ÆŋÖhô{6hH#t‚æcL€āÉ&"!Ú’ļÉA°}^LeċđKbjFžy„:îŖÎAęj.ˡŠû`æÖÉo ķķJûYΒ”Üôūƒ R—ü5&Åø8t•DVWĻ"Š]ĪÆōĮŠÄŊz^9ÎēsJîĘįÕxCä‘ss?yŨ¯s#Ō~ōĨĮe•°Ņ‹Øî4 ÍÆV%ôœđg1¤åôĪL°•€ō%Œ{pJ-PįëJé/ô˛Ŋ.cō:úĢ2š˜w2š_Ŗ|ūÆķ^—ü•)U<‚ß:HnĻ^9ũC-8Ë/äĨËäąä+ĖP;"‰ą°Ŋ\‚"z„bP¯Ö'?úO$&Ūô?=Lq„Nĸ=ā"{ˆ’ĩZŠĒ.hC´[bŖ˙MŽõ̝€˙؁‘cĮ)#ōä#wLŽĘ8ĸ+ DJŸ‡ƒũZô×âŋ6“Ģļ įČq™G˙EŽz ųu*BÂXŦq썑Ũ´ž}´ƒũÔÍ:4šDQôIôũlЕ<…ŽâŠt-úĐŋŸ§)So΋¨†˙ėŗåĮŋUĩuä°Ÿ†ŨÂô*vœß”1úM€Šs¤Ũiįy(<^Gžvg˛žZÉĸ¸Ļž´×h*âKc~Î×(\`ķėPIgFƒRø<ūĘ{•\ĒHČÛH—įāLÛ!¤2Įöûhö0]Ųž˙N'W•Ę17Dī:Vz(ƒÄ)’ļy.i<æōŲĘ †Ã%ĀI‰ë]žˆSÛ\ …¨ētŪŊŸ•æ_5HWīĮļųר‚ŌüksûÉ(Í>ö‘æ9@÷h ¨2˜ĪÛ4ƒ‹°ûB8q-ÆØ¨ÕYRøČ]æ~3ÂRŦSGâm°„eŅtÖßR,Ím_îš•Ļ”W¨‚õē#/!øæ#Ņöˇyų¸’Ļs6¯Ašĩ„đŌŦĸĨ(ãá" įˆ¨zE-N‘č† Š{Sž5ČuBŠģc'¨€G4ÍĪ“6ĮzX%§ĨVZ†2Å?z5đŠ-J”A‡đtDĐRdO—ē ,ķyFŠez™ķĘ“›ĄcP¯Ã‹grAŽÅžĶ[<‹ S‹kS×§jĐÜĢëËčâstŸŲČÅĮsđ ųœÅsRˆØ ƒKxúa\\ŋ܇srr.ƒū '?89u™Öuę2?@/GUĻÃ>ķx~jŸąNtåŪæ(Ûd#älæ2įæ}c <Îz>§ŋ Ũ+É\|t•5åŋģôĪPŪ˙PK Ađŋ:öo4org/gradle/wrapper/Logger.class…“koŌ`Į˙—UncŒá@Ø&s*]7ŧ‹11$KHđ’°`˛wĪƓ޺´Ŧ_ÅOĄFgâ ?€ĘxžRŽ5KĶĶįrÎ˙w.éī??h G ˇb¸‚Û1TPŖ†ē4w¤š+ÍļUÁŽ‚]†čÉØ.;`XxfX†ûœ!R9¨öč͞û‚!Ũ1,ņj<8Î>?4édšckÜėqĮ{˙0â#†bĮvtUwxßꇇÂQ;ļŽ §É6m!Wéķ÷\5šĨĢ]×1,Ŋ)Ę@ŒF\÷s ŠŽËĩw/ųĐ'.HqĢΰ3Ģ×:âNWœŒ…Ĩ‰fuæâ…į-Ce"Úč„!ĮĐÔlˇUŖ#—;˛›m"xŠ*­@oĻŅÛbˆwíąŖ‰=C•˜ôj[Æ$‘B#‰’ î%qŸc”‰ąI![3ŒĖ”‘ĄJgŒ´ĮXķ&ÕĄovÂHIFií ķ” QǤV÷(ĩIؔ’õ)rĩŽ /‡,ŽĶ*üœņČåā抧Pæš*qw(¤PŨ&nü_Ũ–7ۛPK Aé`˜Žī8org/gradle/wrapper/PathAssembler$LocalDistribution.class•QÛJÃ@=›¤­ŅÖxŋ+øPĢßAA(*(‚žmÛĨŨ“ēMÕĪRPü?JœŨą*ˆ/3sfæĖœŲ}{y°Žų,RĪĀÁ„6“.Ļ]Ė0¸UŲJ.d“a°Ôā7<q°/CąŲ-íIŐے‘Lļæ ŊMŊhųŒÁŲĢ‚!W’‘8l_•…:åå2~)ŽđđŒ+Šq7é$uŲb2ĩ=Z§dšČ8bđĸH¨ŨˇZ‚Z6JąĒ5ÅĢĄno6… ŽyRߥú SK?†Đ ~M$_Sæœ|aųû­YęŖWЈĀIÜVŅ~Ī’5ÍķÁŦ‡>¸Ōp]Ė1Ŧ˙_ 1*BՂŖrCTģ _qá¯iX¤OLŅĪZđĩŠ|-ˆŧ Fú˛dû S‡M>W|+Ž<Á*Ž>Á~0TĪвu˛’h â”YčĐ&Ō㙉ôB‹bÃŨ5y]KaŨO›äĩčuēF~%ÛßÉwŋ-Œ;† ãVZG‘‡Õ0T\“u…‡e/ë<Јx<Œ6ŦđŠÁ–‚ÅO;ŒŽōō5ÖD\Ŗß ã[øvßa‡8žÂ÷Âø>žã~Ā֓"nđķŠ0úņ4ΈxVÄs!<Æ~Øų^ä@?fë'"^ áe6_ áÕ^ áuöCěn›Ōķri\5-CÍŲ–Ēk¤ŒĻ)ÆXI6MŰ˙ėė™ņŠ‰å…š‰ŲåəėÄōÜülfúŦ€ČÔeųǜ*ÉZ15G´â¨€ö1]3-Yŗ咭č8?;snblžžĢŖhȅ’˛`*Ƥ^f7ŒĒ§TK …čĒúe%oĢēq]@đ”ĒŠÖicÛŊˇĪ†øĮôEíœR5eÚ.įc^ΕĻËš.ʆĘsoŅo­Ē”äĀ”nS.ŗÔ5CŽT#u^ļVΐeō4ˆWgQąļKĩkļīa÷IBŦ¨EېŲwtčsŽ|æ,XÎüÖ(š†i ( ”“MeZfC ëšm†Žŗ´îLä4ķŦ jEĀLėŗû%ōlRĸm”&es•,ŌĐĩŽ6AiēšŊŦ˜Ļ\TÆÕĸbZú]'SÉۆj]Oeˇž&˙@îēŅÛr1-@ ÷n‰:ą–W*ž>Á „9KÎ_ÉƝ(: ĨŦ_U&Ö,E3ŲũšŖ–@ęŌĐĢWÃ/MąR ŗ™]$`yŒRŊŪ7Ŋ)x…Ę@Ä[Â7M‡æČĀî5ž?Ÿ1mœĶm#¯đ"úļ˛áFņâ> 'qŸˆŸJHã ņˆ„‡1-aҎŋ5ŧ„Ÿá] 2rÔvRIÛjŠ ~Î>ŋĀ/I™”„_ņlŋ–đļ~‹w˙ō•Ī1N‰ø„ßã=Å´_vü„ˆ?Jøū,á/øĢ„ŋa]@ˇÃŽL1Siĩ˜Ņ,ĨČÔŪg‡QüiũCĀž&e  ˇą:kk–ZVļŧėĶíR!ĒéVt•Ē6Ējۊēu3Âą? ´É¸‰Ē„nIø'§]c¸čįĨMngo•đ!6¨XŧĻI5Ęåp2J%Uͨ­]ŅôkŽ:˙ĸŨ æ39n˜Û–æŧâöŸ+~Áī—BĆv辍/íÔ\wŦiĄītæ”)†Ō †ŋĐgīU71KßĖäpĶŪŋ-Đĸû Qs9z—ÃM4'9KēLÄDS^Q UæßsCiëœâūŸ~äöŠŒķKĖĄcģ§ŋkC qWp{š?6Ä]-hW ˛Eáą‹iN:XđЂąŒģ˛7–iz<ņfÍŊą2ŋjč׸ :ZļŅ%€Č”ĩ™Ų„;åßjÚšÍVē/–iŽËß+åq[.™;âš<:taœEĸ{Ņ1ēų҃ģqîĄY 4ŋwË|ntdG¸×ŅS¤wÔOhŧŸfKäãŖggŧ!ž¸‰–xō&|ī;›O;Ûü4 ņ ZEAVĸî6<€3€c1ŒāX ÔBvc˧0p#ž¨Â_C OÖœŽ'jOú7ZâW­5„7ĐļTƒDŗö*:"4ôøi¨ĸ̆ÛN6}#Û|÷lķuŦdcSpŨK=ž` {×ëšõ"Hã å#ÖCØOĸŽ‘„kH:9Nēœë9ŪĀ8&(ŖVēž>H"ˇĐ.gÉōŅŪ2ųŸ ÆČ;C (Ž„sdɓū(ž&ÍXĶÁ8ôßž*ö×pût#—ū°KŋA7LOā.=æĐ‹ģaęô*‚c1QĻw;Ļz-üĪđŧGûxįH¤įzŗxĮt’Đú6Đŋä'Rj8Øu¤ŠčzvK‘ÃtVG>q"ĸÛō!Š×īĪĐ]>.J}€6ķģ›$ĸ38Oøm$Ņ×1K{“=‡y'›‘:û,8ėÉBȉ„ĶÂcõeÚÉ%םˆÜYÅŅûûŪA ąžđõU1Čųļ”ë9:¸‡e í´ŋQŽŨu´n|ÃAÉc ÉÃũÚéļÄW÷ ÚÉ1{I§X6ÉGsôt?'דũūKU 5Đ÷QÆ ”ŸDvQNĘĄqZŊuŊxF{ąė“Dsņ9\Z!ü—˜];<:ĪSîT"B„’o!˙-ë‰Čp}æ[įSķĘ)2BeäÔTjķs¸ë“„/Ø#ū(Ņct`—Âû\œ:áSČ׈8t´Ķû‚Sœ žâ”'ũ)ÍãhũPK A„ÍëÂ| 0org/gradle/wrapper/SystemPropertiesHandler.classVŨSU˙]’°!,-Đ Ō‹-á3­ŠTR°–‰ō%A(õŖ.a›,„Ũ¸Ų”âWũ~ė“ãL}đÍÁĮ™ú’2cĮW˙¤Úąūî& $¤ĩ9÷Üs~įÜsįŪ›ũûß?ūđ"ž  QÔ ĀŪP0€Oc(xSNŪ’Ú”‚i3 fh@ԏ99ž-ÅŧņT,Hø;õXÄR=.âŠËr‘¸‚Ģ~ŧĀ{x_Ф¸&ŅÖcš‚æør|!:}mn~vŽ":ģBãԚvC §53Ž;ļa&# 㖙u4ĶYÔŌ9] ö‚aΘ€'Ôŗ(āˇVi=g:ƆžĪŲVšĨK9#ŊĒÛ]QÛļėÎ͔nvĻ-m•žÎŊ†v^g-Ŗ*6`JaŠČā#Y­" GANÅ lǏ‰”Š-|,Đûė÷ƒg+[ō *øDŧøLÅį¸Ĩâ |Šâ+|­â|+ĐXyvyĘ) î'đ1MnÄBĘļ6‹w{/(æčļæX,ŖÖ(~> WŲšĘ## IŽĀą=×ū›(žDÚĘĘWFîŲ$v tđ$õ0;ŠĀ/čĶđ~Į*˜x¤BDôVŠ`Ē -nũĩ|/âē#ˇŋ˙ŽĐ)ãÚÅøy­eđĮ¤2FIiŲũ&Ņ^ĶĘĢ,=A•5ō˛ņŲļė’áđž´Tã‘mĒMëfRØĩ/}6ˇ’-Æˇ„bU ņ$eņgū‡čRevXā|ø3%Āķō_ āšĄ~Šcg5hįOČW‚ō -aŽ‚Ŗ¯÷Äī.¤›˛Ö5ĸT ô —cúĐOƒÅ_đ üļ‹šå{đLõæáũžžģģđŅP;Ŋ e™™ũ3ũyÔņ؆:â•JĐ{3ģP—wŅ@ôĄæÃy42ESÍ÷pä~GwĐ"03°ƒV;¸LĨM`ÄôæqŦš=įî ŋ4éČãøˆ/čŖöZú‚>×u‚Ūœô`iûŅNß]xČG7Yø ÎēcÃA=ˇ#7?Ŗ”ĮáĮ ÆI4šlv1ę4ũŨ$ ĨnŧĖq˜ŗR!9K€MĪ-˛z›™Ā9üBÔ¯r‰œäWĘ)´5Č"č î,ĩÛėĘ9z|Œ~…_=/ą’ĘČ!Ž~üLë0›Ä÷8WIūHą-_„Ú÷{É˙M F1ĩWÁU>…Ë ¯=€˙’‚úއ¨SpņL<`Ļ×Ũ–_b†qWģüPK AĒ=а?-org/gradle/wrapper/WrapperConfiguration.class“mOAĮgĄôÚãJKŸ|iᤠ" HULCߐ-œåHš’ģĢ&~*M$&žđøĄŒ3w ”e›˜&3ŗ3ķŸũíîõĪß_ŋ Ë:¤ĀŌāaæ’`@EƒG xLá<™2OČ<%ŗ¨Á’ĪŽxNŖ8m—ÁPíˆæ–kÖöÖÖ3Ũõ5îÛ ˛QO‹ģMĢŽ5ˇ)÷ŊįÁ!ƒBwĒ~Č+ķ õÎ1íĢsMĸ(ę/;ŽŦ0č/•wÄ^´°žŽ9ŽũŽsܰŊŧŅ ÷nīķÖ÷Z‹d,8t|åZÛkZM´lë‹ĮONlĪڍü‹ļûÉiv,.âsņmâėîŖnsúô =ĖN æN8Ąu‰ ŅŊĐÆØq$&ƒL*AîÂ=HL)ŖÆėBCO*A4dF r_ ĸÉ s¨ŠôÉ )%Č  2¯)ŠAeEÔ,õÉ ˛$!ƒÂįX Ėūywã Ŧâyõ%^}9„¯°úĪ3à 2Ļy~žÉOȸ¨`;žĘä¯)Hãƒ^V0ƒYWđõ^”аŋ;98ĐŨ14ØŨß724Đ3’čOt K÷×Njí-;Ūž´-#;ž[ÂüN3›ˇĩŦ}HËt eû’]„rbbßāAqy1ypßȖmÛG’CŊ–éNŒ$ûē*=” 8%g™9Ũ˛ =/aŠŖzÁ62í‰â9Šŋ ÄuĀȐū NÃlį=qÔ¤Ėė˜1.aCiˇ[Z:ŖˇŸ˛´Ũk?ėĖ‚§`iļaféRŨ˜i‘œãzĘŪoX4šÖ”„­ŅrđÛ!vÖSēF`N3Mš-ė1˛z_arTˇĩQÖ5ÜcĻ´Ė!Í2xī˛ŨŽ\ō)éá&* Ÿ´ĩԉ^-įŪĢŲcd {¯„õZúģnÃ! ]Ģ÷$E×锞s=°' r|˝™¸4gé9ÍŌ÷yJŦŅƒ Y†„EŅ Ž€Ŧnˇ ts@ōfÁJ•BUĸ(Eō2æČDK×ŌŌ˛2t!cjé„'-BF–Y×&‹vŅŨŲ\ÁvŽwËø†Œ—dŧLî×m¯z¤”^B<ú˙d‰Ŧ )GŖGo..?¤n.ļLƗÖaš6é§åz5ļKŗlŨq hÖ8Y[į#ƒ”0H Mˇ(aɨū-ĘÂW ÃvМ$›į‘ûÜ`PmŦ‹ŪŦÜ?}Uˇb§ú4FŲásīN‘Ōú˜VČÜč\;īéˆ/TČŌ,PĄ§Š(ŽHždHW)¯(ąMËî5ōyb-ŲĢ$E;ĩ¸¤ĸ"6˛ Í˙ģvČ oąJˆVđ;Û6wģąÔîT â›$Ú¯ē™ö-†T|ߥÆ]˛y ĩIŊXjZ]"%đČ)Yŋ6ŋ>’6i›5íˆ~šĒg#•M Ģ”;•Šīâ{,í5Ÿ;Ŧ¯ÃëUĀkUDˇ u=‚Ŗ*Žãû$$í)Õ-¯Ģø^Q‘ĮI?dIe ͞Pņ#æø1ëŊÄä„F/Q˛0Šâ'Æi?e6õ!#—¤(莄Ÿ1õįeøLø%ę|ē%y°Ķ,dŌÂKÜĸ"§|j™“ÂĄŲSŋRqŒmũ5˙ŋUņ;^ũGŠQĨ˚h†&Ÿ…}#Y܎I¯§7w<}EüAÅņ'æLĮQQņWüMÆßUü˙”°¯ĪŒˆDœ2ė‰Č }ʉx>§§Œ1COGŒŦ¯)7rƒ’a…WĄäTÖÖN{üRįĶ“Ë|88a™§œ÷ĢÄÛīAXTYŦÖøžoeŨ‚zfu”Į‘´yąĨēŽĄįtRŗũ{…ˇģ:‰íßvęũ:ÉZ˜¯|`GË_8æĒĢx†8퍊Ŗžĸęō~Ė•œŖ7ķ:§Ë+x‹ĩ@¤ü-I Ũ:bäqJŪģq(¸Kq6ąÛˇßb¤…j &™šĐų˜Īī};dm§?JßpõEö¤“›)ē@a ÚύƒÅ•führ%’•QßæĻ2&ÛÔxëg“lLŋ->lDÚÜé×ÁM6øuFŋg–ôĘÛÂēߏŠ Cąšū!ĖŖBĩhĀ^ÜGģ×ĐŽ ›hŋĪŗ_FûĪ~í;=ûU´ßīŲ7ĶžËŗ_‹0ˇkZ‡šc‹™z8ÍķIvz‰ŗv¨ĄĐ0ixUÃąpõ,sĪĸfō´€ë§Ņa\‡Ēs oĐĩ(ŽC´ÖØ BĪbųj‡ÃJā%ĖŽŽ%¯@ÅüĢ,,V.ŖZČX@3#Œ8šĐæ‘ÕꚑŧRMô`:BĨûéB€NĻcŗX@Ā xŅe,Žĩ^F8ŋŒē8isOÆ[¯`IėQfQ?ƒĨb^ÆĶ –ĪĸaÎŲ įŦIœ­tÎV9gw‘‡"3Xí6;‡kc‹sļÖ9['ÎÖ_@cŸpÃĮ qvCÛ,bW/’ū<…guЁE4n"kÖĐ˙ÅÍXB˙™čeÛ(ĻۉrÅ}îĮNLbÅnēŋ—öā<îÅ ˙„pa€öKq‡…K§éÆ0 VėHIŦ8CĒ„K—ĸę?RMÁ“Q%ĶŋVšŖtƝ<Z‹0Ģhn!įÅ{ČŖ­×9o(g.Ąnmt˛‘rgíĶņRHÃ"2„¸ü ŅLōŽDÆrõ â.<€7’^ŦMŌĢh–Éî7Ņ.@§#Ä}Ŧ¨Éâ "áđĻlž%Ū4‹-‡įp÷°XnÅļĘĖę%úPG ”2kĩĢ‚›Yu™ č¸2Ÿ&"[˛rۇÉ÷ôÆ[g°ƒ~;/@éãšM´–dÕåŽĸÔäT­ĨP, Ia’UOs#ÍMä\Ö#"t[éf8¯80Œ´ŖHyCTĪ!âøČHsˆôšĸēcôŖ/ˇˇĐĖօœTÜUYĮĮ<š0ÃŊßîŪōũĘËãžËÁâåã8áú*C9ö­ŽôŨģmņƌ=‹HN@N3XLšĖˆ[[Å\ mRH # SdL9ž\ö¸ŲŠÅĨlĨ 9O†ŠC(ˆ.ĘH']¤„Tí ĩú!Ųž یÄĢS´Ē˜§]ĖįhĩDL…ŗyW !p 5 éÖkļN¯<ÚXœzZ*%q3a0LQwxˆ|q†,8‹åx˜’éĸ?æņcKQ—–ĸ.-Ž.ŧš"öc#ŪLg‘d Ē_EXƙ`-q-z3AiˎšD#ģ7č6˛á×ūļ^á—Į=n*ęŌäę"á-‚˙á˙PK AÔe‹ #gradle-wrapper-classpath.properties+(ĘĪJM.)ļM/JLÉIÕMÎÉä**Í+ÉĖMĩåPK A)gradle-wrapper-parameter-names.propertiesPK Aorg/gradle/cli/PK AÕÜ?Ž<S1org/gradle/cli/AbstractCommandLineConverter.class•T]oA= ‹ëÚ"ļĩ~C?”R*OĻŌh4!­ŌÄĮaY×m`— CŖÂßĸ/4ŅÄā2ېP–´ôaįŪ9{īšsæŪŨ?ūPFŲ@;:v D°c@ĮķĀ{xY9y†xÕõ\Ycˆfs§ ڑ߱VŽg{m[´xģKHĒá[ŧ{ʅė' &?ģ†bÃNÉŧĶĩKV×-ÕÛ)¸%ü^{€ėČ÷Îm!mQaظĖõĩ˙Ÿ¯|ĸjĢUŠ›n†Ãl㌟ķR—{Né…Ŧ•ė¤}f[˛’ C¤… ‡´Ŧ-ĸ k’ôږÁ=,ȍ÷š؂ak^ĀĖÁßĢŠ^tĘę ֔ÂõĨ-JŒ×_,ģ/]ßčØc¸ÕtËĄ +;Xš¨rŠîCĩuVQ CWˆ uÁhúCaŲoÜ ™ĢúļÔ1aā6Cúēë2QÄž‰LÜÃK†Â &„!9¯‰a{ Qá23Quá {ļ'§MĄ†Đ~rՐŨėõ3|i153 ¯mnžDevf¨čÎ߆J…Ŗ–š~-C…Hũ;"dŠ9´š´Ģ“edcų °äDq‡Ö¸SXĄÕ`I˛w/!)˛Œ:ˇFyŨ7˛ŲÍ_ˆ|ŧ@ô8_AË #ÄöFˆŸVX! ĘK`öĒR~œ;Šxëô†)ī>=ŠNâRnpŽ´â؜œc˙h˙˜âŸ¯ōĪ”ô4=c/ƒ-eˇ˙PK A׃ĩŗXė ;org/gradle/cli/AbstractPropertiesCommandLineConverter.class­V[WUūN2ÉĀ0å HĄ°Ô„¤ÄKKĩIQJŠ†‹Ļ‚Ø;L†0fâĖáOøîZžûZ_ĸt­ēúė˙ņA—ˇ}N.iĘ2Y9įė}öŪį;ûvōëßOđ6žQ0Œ÷e| `ķ|¸Ŗ`w,â'?äĢû ŌøHÁĮČô` Ë=˜Å Vģđ‰>íBļƒx‰θ°&cë.cCÆ Á”i™Ūƒ?]cėŧÁЗ1-cšŧˇi8´Í"qB[׊kšcr篔ŧmĶe¸™ąBĸāhųĸ‘Đ‹fb~ĶõM÷Vģd8ži¸ öŪžfåšŲÛÚ'Ļá$ F]čpĨä™ļÅ0‰fv´}-QÔŦB"ë9ĻU Ņ‘Ņ솧™E#Ī0ÖfĪÕŗfą[ˇ­-ŗPvōTä4ØĐV5Į%\ÜÁ’X3LžXž¤íÚQgIW‘‘´ŦW]Āp§0™?Ą•Ŧ:Ŗė™ÅĒVJFOŅš’MA`i ŌŽq¸ĻËÆâAÉ1\W@ ĩķĻ\ėļA܊€A)5"ɓã4‚Ąæä8,ÕäFŗhĒJ+gŽ ^ČzšžKތ‡aņ@7Ē e<ĸ f͂Ĩy"¨ßž´;D='ūûš+›;†î%Ŗ­,†üWģ’J /GŦdí˛Ŗ÷LļXg<ÃmŠx# ũ§íĒx ã*&0.ãKo 'ã+A“|gēŒ<ߥoŠ(`[†Šbģ*ŠØSaÁĻŧž­ĸ„¯ ÂĢÂC™û”%M—UÅ4ĨÜšzŨų%ÜLEu|tššgˇ1qBuŪ)”÷ Ëk$1Ãø‹ú 5ÖČÃÖxE;i1g¯÷Yu[së°¨Ē¯D:2ÜKZMÍu6ō?AlІT'ļ[ô'\íL’z Ŋĸo’B‘“EŸ1]^„Ŋ͆.ŗõĄ&…z6đKŽZ6<ņļŌS+Y‚h~ßu.›VŪ8XŲbˇģuš÷ų2ŠŋiÕtģežÔdŖN§ÛžŗáH;ž4A†Á?2/y/• ™jéŸĀ~¤…Ŗ43Œ1đē¸„Ë€$ņž æ‰Ú<Ég’yWjFK$í§ųj,đ ž ˙tūė†D“”­ °¯ ¸'RŽ kũøÔ$G č}/aŠNäÆĢÖĒÄjŠ~Œäú¨ũDH›ņæARüôßčô Íš?ˇ‚î ”#ô0,_;‚Ęđiqá9|ˇ¤)Ô[Aßl øq"û0āĮú%ĘT‘Âéq¯Ôļūų9ū„NęËäR7ĻČ3ä…wČķ„oƒ="\ü× Ķ bôĶjŠčkDķÛæˇĘQ0ŪžÎá-úé#KuīsÎuâÜQ‘ūŒŲŋácŋcøÚē)Q‚á=áĐ[ũķtx’Vŋpĸ2‹?Į`á'g[Ё:ļéĢYMáļ˜įūPK A}­ÎyGK1org/gradle/cli/CommandLineArgumentException.class•‘ÍJ1…Oú3ŖĩļZm+ęÂî´UÜV " Âā–îĶi˜FfÉˍ¯åĒāÂđĄÄ$-U´fq“{rīwOČûĮë€34K(`˄mu ᜠžöę‡ū=}¤^DEčõSÅEØ=.å˜T}.Øm˜ĐQ¤•š/ Šâ&Ÿ‹…t‚_ĒĐ GĖ "î]Ę8Ļbl *Ėb&ŌĢį€=¤\Š.ŗ$ĄĄĨūrAĐ^âí›2˜(ųdæ[Ãŀf‰&՗V”ú2S쿯oë/c§PFŽ ‚Î?^E°û5˙.)Ųâ-äõ/˜•1ttuÖĶyNīNģ3yą÷+:–ŦÚԕ;XÕ§ÆŦJëk–â ŒuÍ0ŦƜuŖgäõîļ;ĮSä~ÂötĶž…ĖĘ0w3§*6ŦÅMÛ]ûPK Aŗßâúg)org/gradle/cli/CommandLineConverter.classQMKÃ@}ĶÖÆÔ¯Ē'Ī"4 F<6Ĩ EQ($xßĻë˛%ŨČvSúÛ<øüQâ6…L ]XvæÍž÷†™Ÿß¯o÷8wĐupJp’L-¸6„~/œ˛ķSĻ„˙b¸fã”%ėu<å‰ ŧ*Dč<.ūidĻæÎn$…b&לpW'<(a‘ŅR‰`ÄqāŲKxžĐl’r?IĨ˙ÆôœOFŲlÆÔ$”jįÎŽwÚøēvRm_Uˆ%JĄĄīĐÄũĒņ°vJQ–ë„?ÉÔę_”äFë%p}ģb.ˇ;ožē˙-7ۉZä3ŽĖfSmĄÕiļM´lļgŗ–ÅÛplÔĀ~Qqk*[9Āa¯‘#īÉPK ASf Õg&org/gradle/cli/CommandLineOption.classV[wUŨ“Ļ4™^ˆ´iĄ\ä"iBĩ´ ­ÜZ.Å^ĐÖŠĶdLĻ™0™pīwüŧøĻŧđ .UYË哞ųü.—¸Īd:™Ü¤Ë‡œķsžŗŋÛūNæ÷~ūĀËø&Œm8'ã|œkE–Zqo éĸŪ‰ā.Eđ .‹A•ąAšŒwÃh/ŨĘ iEHzWœ¯Š…ÂĒ8ɉÁC^Üž&KFA†-A6ķļnæ :ĻŽ¨×ÕTŅ֍ԜfJhĶŗ9Õ.Zš„Ũ•§cĨĨĄæ˛Š9ÛŌsŲŅÃŧĄ¨Vļ¸Ēåėų[y^ÚäĶ7ÔB*›Ģ÷Æâf$ŖŌ–î8#!Z /!ŦįŌÅeÕæJ‚´D˙˛–YĖ/ęöŠ„Ąj˙L+›ĘZjÆĐRiCO›ĢĢj.3Ĩį´YĮˆão8Ŗå--­ÚZFB˘žĶíÃbqŸųI[ŗÔeCí_73šHafŠĢ˚5/΄ÃfZ5TKkwŗÅtà Ú+:3ŧëŲNUæĮŗ-ĄģŌĶëŠįkƒę´ÍŲjú洚wŽĘ(ʸ.!ša‘pVŗg×)ŗ)Ū_CšŊÕ{ œ‰Ŧ¨…c.[$ Įk¨Ōŋ‘lĒš'č´ĄĢ{âRS|~2ävÆ?á§ęæõx+ÉÚbi…ĸÁČzkNu#ŖYĸ j>¯å2ĶZĄ fYËTŧĄōR­QŽ–ûxu¤Wx8R‹ēą Eë1Ã0oøĐīgëmņŽĻĨž74ŸŠĸ́r_q9éë\…WO•w¸–/jŨhŧŠz"#ņ˙åĐzÎ,Zií¤.ZĒģFkP *؏$}ŲÂiĩ°B+ ļc‡Œ› naˇ‚]bčĮīáļ‚÷1Ŗā|(Ąŗē 2>Rđ1>aŅĘ Sz´‰5 ‚‚ŊxAÁ$>UDœéŧP~Ã.*8…Ķ ö•Ęī%>ĂĪņ…¸ûĨ‚¯đĩ‚;ÂôÎgĨ¨ÂņŲå+ZšūEkߌõM' gĶ6-‡0 ë:ú ĻNVįΟ=!!¤{ŠŨLX`Še2zFģIĢÁœ3Uö\É%ŅNĩ§e5CC]ņZ]AáēmҏYCļYÚb×Z.+ČËØ&%ôÅĮ˙ëb Ũ`¯đ)đŗsÜ4 ē"((ŧá{ąj^×đ<˙¸ˇņë QÁ*°>\¸ÄōÖ{ø#™åæœķÎü%ũNîíĮ׃\ũ&9ŸI<†”x‚ĀųĮhzˆ`âG4?DKyGNŽ!$az˙Z%ÜÅV a ŋ"2“ø Á5(,Ū{úįĸ‘⸠!ŽÛšŠĄ=čÆVúŊŖôé$ĨIjŧHôaŧD˙›„/üi;ĐßaĘ įŌÎĨƒ”ģxʐšdôÉ8$ķ‹ŦđĢTŘfŠ+qŊYøúƒŖr˛*6÷:^”đ›]Û%×¸wG\788ˉ¤H€ir`ÂÎv?/'¨î’š†ė–džØŲãį¨cæGaf„;B'”ˆFÖí|vévĘįrČĩ#áx=ŒļzCÄ8Pc.ÆÎŅ}‚vr cŠšëü JRĖ°i1!¤hôšĮØėˆ]ŅnŠÉGˆ•Sŗ…†Ā¯ÖĢĶÁĸô0§ģė ƒ.§jČ5"GOĨú† ũ™ĒņŽšnŨæJ0ļˇī.b4Öķ-ÂÉ͏Đģ˜n=đŒwŗ"`´á‚~´r<ņaŗs>Ėã)C—ĶÕ0Œ9yŽmjúŽV!:ĢŠ|¸Šk‚Ø"%˛Ŗƒ…*đÕũ5&˜@TZĨ[AkI )†áĒąZb˛=Níʆr2ĻjŠÁŗ åžsšļ噜É(…B`4JY:TCaôŲeēcĒųU•¨°*įœb2ô”vŒTzCɘ‡gKEËÔˇN„öļR¯9‡r,m:ĩīBM}¯V´Î÷{"O.6¸˙u1áŗ ĸ‹~č-ôëg~ŋhW´ĒƒKt/ĐO‘vs´¯ŖŲ }„+ īŖî=í]h§ąYčØ,ęŲŧl$ë ŲãŽÖŠúÉŽ“7õŊ Ü4O?Āõ îđgÔģđ žĨūīh;_‘Ļ!ČöҏwiũŪõP˜ļžūCEĶžEVĐh`l­l í,…[ą¨m'GT&p ŨDAŦnĶĘE‡ĀÂé!iØ/8<~Ų[$›"­ĀáVôė8z€b3%Žø‘+Ž>gÖ*hÅ/V!r'îˇßÂĀeš§Ém3=ŗ:Irƒæ›n w„ŋNÄ0ņžŠ!ņ؊uņ2‹aÚíÂÍIˇôPK AĨDŖĸ&3org/gradle/cli/CommandLineParser$AfterOptions.class­•mOAĮ˙{-Ŋr-´¨ >W+p€Š"ÆDđ!$MFxa˛´g9Ŋî™íĄøü.žD%ŅÄā‡2Î^ĪrŌ’cšėÎĖÎūffwnûķסfqۀŽQiŒu“4ŽŖh ‰IS°tLë˜aČTŧz‹jÉ6ÃPɓ5Ģ&yÕĩ­ŠëXOšlØÕĨ}Ÿ†ÔG8ū]†‘ąx÷ņ2CrÉĢ<§ +ÛõM[>ã›.YN”ŧ wË\:JIËi0dīŊômųäīxBŠËBØrÉ卆MĒu0r$f„Žî§Ŧķuū~Ķ^õšô›F†ūąŌ+ū–[.5k՗ލ-Œo0$¸ŦŠäÚz<Ač˜ečkĘͨ´čS ČbÅŅÆVįī…ųg<ąâ‰?ÕdūĘ`ąSmņņĸ‘t\cX>ÂĮcg‚>ĐvĻÕ@]7|”- ÆĒˇ-+öCGõÅ@›Ī”Ē0‹ ˛j¸žE7 7æcékâĩđŪ‰W7xؒŠ1§ãfˇ0Ī0yŦd˜8ÎŲ3Ėŋ5čķ?U†Ņļ=ėž q~ :5úh˜hūkēmqéķåÕęƒ_ō2wˇíC^€2 ô\Ļé ĨG@õI]ĐTŸ‘Ĩ‡´G¤i4gLļÍ,~Ab—T Ŋ4ö"A;ŸŖ‹­Ã`ȑm éŽō:CķŲ¤ú÷3q‘æ‚äĶôhbÆoPK AŒ‹Müu <org/gradle/cli/CommandLineParser$BeforeFirstSubCommand.classÅVërÛTūޭ䏞Ō:ĻI ā§I|‰sk›ØiK’^‰Üœr“Õ¨ąĨŽ,ĶžĀ[”˜2ĐūƒáxöHnb×Nä0áĪšėŲŗûí§=ĢũķŸ_~0‡‡2Ncņ K2†°Č‘“!aYF—ø‚ĢŠÍ ĮĒPģ&CÆuŽ!Üä¸%ã6>’1€uŽŧŒ(68 wúoŒz|†a,oŲ•LÅVˇĢzFĢ™5ĢVSÍíŧaęwUģŽÛ9Ō^6LÚÂpsŌ_ũu WŧŨĸ—›ÚdÖŦmá”l4jeŨž§–Ģ$‰æ-M­nĒļ!öMĄ$ā2 ­ę-[ŋaØu§Ø(7m2(ˇMSˇ×ĒjŊŽ“Úĸ/ČxWCiX;PíBNg, –YtTÛ)§âō}›ø”ã3%l1ÄüøTđŸ3,ųzēoî˜ÖŗKfž=ėHÁ9Œ T_1$w°bW5ŨtŽ?ÕôfœkšŒ5s$]%Ŋ˜—€ą‰ņúÄ4Cä Y åGēæp|­@EYxÔ.ų†´~H@ÃŨ„]*˙[qčįrå‰jëí€;˜;ūk§G柎G&ާİŪSEęõQÉĒĻéõz|q†×|īyĘķÕpŒj†Š( mĒjŨa8ß Ķ˔Ww[E–‚ņ^lqŸá6vŋëÆĘ(=­ģWN#¯#ĄrNŠYS‰–Ĩ.8ÍÔ~éęrWøûß´öŋ€š˙ŋ¨KĮ*bÔ; QËÅ"QŧiD@Ôr0ŧMģ[´ŌŦ$’?!HĻvüöŧCãIqÆæŅĮfđ.ɆéŒô1JļᎨ–’ŒáœoZũ }4Ģ{JÉÛEßFâGžŖ?õ3x/ĘJ#Ōī˜õÄ'žGtr)IÛp‚ô•g{(EOJŋâT)˜.>Gdƒ/ö-ĨG¤WZo=sPß#—`K3‹Q–Ã[FŠ]FŽ]ĨļpՅžāÚ‡Žb“YŦĻh@˜~R ¤Čæ(Ž!ijJ3nŋ‘ã8B§# g›ĄHWĸ™ģÜąîú…a6į:Nx*ûŽ9ĩĀg\Įķ.{bĩ€ îךčÚ¸„÷i^Eˆž`– Nķ¸$úä,’ÔĪS‘DŸŧŅgqĸŸÎâc)€/hūR’˙PK A´*ĢZMīForg/gradle/cli/CommandLineParser$CaseInsensitiveStringComparator.classĨS]OA=wûąPˇRˇŠ"ˆUhAx1Ļ„¨MLšÔ¤„÷Ąęāv—Ėn‰Å˙Ā‹/˜ø`|öņãÎîƒEkâCįÎÜ9÷Ü{Ng?˙đĀ&6 °Q)`Ė,9Ü5Ë=K&ŊlŖfcÅÆ*!ŋĨ|m2ËÕ]Bļt%aĸĨ|ų|ĐߓzGėyœ)ˇ‚Žđv…Væœ&ŗŅ+æ"”M?”~¨"u$ۑV~¯ô…Q  NĶ÷Ĩnx" %œŠ6m܏Á#Ĩnԍķ֛uBå_Єņļęų"ņ[šf)ĪũåØÖ°āmĻ*´ƒîȧĘH›jˇfŠpÉÁ\ëp ĨߊLbĘûúč˙Ųsė‰ ÂÔEŠ‹ŖŨ"LĻīd'höü@K͟0}Á›1/dü MXEĪnØü…qsYXÆ'>9|r9Į\í=ŦwŧąPä5o’ô—yī$L Ė‘Œ…iąft–cyeõ™íšˇČÍ›}ö˜ŗ™˜Šlôy:EžÁĄ1k-ŠLYÍn3q§2ŽōÎâ\Ãuæ™M&:åâŌcî#í˙€ī2‹ĩ•OČ­ōīųãŋˆ(&íJ`æR’‡­Ô稁™p6kˇ0Ī÷,ÄøÛXŒã\‰įˇØî*w™ÅM/ũPK A|ėRÎĐ&=org/gradle/cli/CommandLineParser$KnownOptionParserState.classÍXéwU˙Ŋ6ͤĶK‘*EqDč’t‚;VkEŦ´E­+. ɐ¤3ufŌ‚î숊HQpCqPđ![˙>žäuŋ\|Â˙ŸIø\@-V< á°ĀĨgØZ§Y͓ˆæ€5ͨ-4ΤĻj§×Ǎ įĒŦĶÕmÍĩløÅ Z n­ÍīÔpi SŦ5ęŋ—˜$ëģĻ —b^Ą)ÄĖSē™tįĐd%fŗųâsT‹CPÅž`Åg^íá •€ôt ¤ĩŌÎH‘@Ú'ŲØ„N‚rŒ"#ÁŸ^häÛÁN°oGQ7AUߑįt$‹ åYFRkē|˛ôžÃyŪaCč@Æįg‚˛°pPÆÉëčn'ģIė<:\(đ=õĚÆpŅÁ˙ōŲ,§œĘ᝛ÁĢía…ĩîāŋŌą<įÔV˛â8æŠoßSTĀ=âGŒˆŸ°KüŒQņ Ŋ’~Ãqņ;~āWqÂķW”|˛‹ōļ›â\ŠãäšĘTÎĪÛ°kqS Žä'×Í'Q.á–ŋQsŠw8ŋThˇáÚDL)Ų GcMķCG!O Ø+žm>V6åd܍Œž hdŦ ŠFÆí^ŅđŠwŒŦ÷øŪ‰&Ī aÄā ‘îWĐ~qˆ˙ĒpĐNßŊĖž2BIî ū7ÄÁŗ!ų?PK A$ÄžĸĨô<org/gradle/cli/CommandLineParser$MissingOptionArgState.class•mOĶPĮ˙wŨÖ*ˆLDŲ˛ ‘!¨ ·'š`0ÁWÖ˚îo;ĸņoôĶøB…Ä~?”ņÜļĖK˒îœÛs~įąíŸŋŋ~˜Å’Žr:’Č'I*(uZG 7Õ،’Šq”ã˜eМ-ĪrDˇ†_øōK.]SŽzÜ3Œ§B˜˛js×5]†šš#ņäuÛ,nÚVąę4›\Ôk–0ŋÉ#%Šr×–wŸĄ’í[cˆU:å3¤ WZÍ Sžâ6œŽ9›Ü^ãŌRzxķŪZ”îČsËu-ŅË˛VĩĐ;‹ŽžTJēÉ?n˜¤I/¸GQ˛ĩw|›m.ÅUO’ÛRn!ĘeCåwä&à# Öģ ē@ûë~Ę+ŽØ•:0ßŨrīæ`€´#:L‰:՞ͭÅ1Įđϝ‰÷ö)û[ųPR—2Ãäq\ôU§%7ÍĮ–Ú’Ņ#63džV—Ûtœ201,¸ˆKî`<ŽE†ųū–ˆaú$ũe˜=y&zˇƒaęà °ÜũŌũioŲĻ Sʞx[tŋ­Ļ)<†L/gdč핤÷=Ij$iˆ¨ ŅÉ0iOH‹Đ*ĪöÉ~"ēCj„ĖAæQōÜÂ{IœĄŗŅĀgI‚/),Ŗß9Œ…ĐÅĒå ģˆ}kķ4ēļŨÁŅÚ įqÁįЖ„œgŸ2Ā`ūĸģ(LīBû~÷ÉĮeÃ6n0Ä)I')BōeŒ‡ā{a‚IĻã‡ĄŸ;rLļĄÉvŽ\ Q_Q”ãë˙íĶ•;û‚ûęãŒĀ0ĀĨAS¸B’e4hØØÎĄdšv6lŌoŧ’Žã†_Ņ”ī™Ĩš Äh8%1õ+aęûUÂŌ' øPK ATK>ĒÄ=org/gradle/cli/CommandLineParser$OptionAwareParserState.class­UÛnĶ@=›¤qâ¸$”6\Ę%¤)MŨKÚ@)Ŋp)EĄ E*oĮĶÄŽÖ…Oá xá$ ˆJ|…˜MŨ’*A./Ū™ŗįŒgfíŸŋž˙PÄŊ8ČŠĐ0*w×TzŒŠČc\…Ž “*L+(¨ˆcVAQÁu†„á4›ÜŽ•,ÛdȖQ/Ô¯5˂Ұ OšpÍÚęĖCÔ{išš™č\û čeËļŧ; ķÁđ`ųņ CdÕŠQ˛IéØh5ĢĻxÆĢ ō ”ƒ7*\XŌö™.CúÉļg9öĘžZŲãÅĩuÛ6ÅjƒģŽI¸…Ā,sŊ™č]SMūļj’%ŧ} ÃPžôŠŋæ…ˇë…˛',ģž4ūœ!ĖE]&ܤ–8ö†c$Ž${ŋ]pÆGĶė§ąõ˜oûRËNKæš%t×éiЍ!‰”†Ķ˜ĶЏSnbXÁŧ†[XP°¨a Ë s™ŦŧđLąf ×+ˇĒ~˜a°—[ĒŨf˜:į~Ŋ¨Z§)9höæOØS†ÉŠ­‚ģ cÁsž›mĪqĖrēœ |ę¯Õŧņ¯đFËüËdUēŠēÔŠáÜ0L×ÍÍÍĐ-=ÆŊ”ģõ_îīqkŗŪĨvrŽl0.’ĄĪĨFŌå|Š”œxō„Ą!Ã˛J„͚Ō'vÁtö!}ráOūYĐYŠŗ,T6‚$Ëaˆ|iŠŅZĪíÔį ûĖ‹dKTTŸø‚ȇCž(ÅÁō<ŅCž(.âÅ.#ãķė ¯*ęŸ&Ē>ZŲ7Dß!ŊeSZ2B™ĮŪ#š‡øĻoĒÛo+5UÉĀĻcĶēÅCŨĸ¯{•ö BŖ*^ŲvŌ#8GĢNi$čy6ĸ˜Ž+ų˙Ņ1Eˆ8­3$rŖ]‹ØoPK A˜%āĖģĒ7org/gradle/cli/CommandLineParser$OptionComparator.class•TmOĶP~îÖŅQ:¯ ž€ Ũ ƒ2@Š.Ņ,YĀd†Äe4ŗ¤kIÛ†?„/~#‰áŗ˙ƨ_įļ N6).]ĪË}Îsî=įô~ũõų €E”%d0#ĄŸŋú0+bN‚UÂJ"E,IHs;'"V8|UÄSk"Öz6LÛô7’eA(;íĒi;­æžážŅ÷-ō VēníéŽÉíČ)øīL!ģ{䛎]všGēĢûŽË WlÛp˖îy!–ĒŽÛPŽ~`jŨ2UÂ6uû€§y­ģžáN_åĐÄz`QĸW…kÂH-ĄTˆĶ ôÃT|Ā%|‘ÎÚ4yÔ`õP?ÖUKˇjÍwMģĄ…kÉÚw÷ē¯uz”Š-ĮÖ¤¤ņž$Ū/0LßÍĐ[3ļîˇxŅĒ˙ÚMË7-õOĨ7â ąIÔRÍišuãĨÉ;?ڑ~žSËČb@Æž‰ ™ZŊa×ÃBļĪĪh÷Οņ\ÆļiđŽö‚a+6eY÷ŒŠíļgúæąŅ™{"!c /&ãĒÆqã Ĩ˙ũŋvŽa¸[ëhŠãĮ‚Z×0ü0 }‹Ĩm j†¯]{–…a¤=ŋeŅžBē$Í>•ŊPíļŪ}ā4Ĩs2¯|=ҧÕéQ*tąečēŖKŠ.@ >rd ’Ĩ’d$S3gH|$%!z÷p'û†aŌå€Ü!Éx‹ĸāD–"š2{Šä9„ˇė ŠO蹀¸Sėp­ įHsģwnL8…tr™­I"ūŽ!öyö3Čē2GYšv÷‚Ŧā>i<2‡˜ Ø<l’4!ģMģ{ín•Vˆ™™Ų ôé ųäš#fÂdYūä"’5’‰¨>Ŧ{}FCĀåNS˜Æ#ZOâq€ĪŖHˇINQÍ2(RÔ8éôËĻÉSÄ<Ųi’Ë˙ PK AäfC˜§Ŗ8org/gradle/cli/CommandLineParser$OptionParserState.class•’ßJAÆŋŗYŗēĻ˙4ÕļÖ¨Ŗ×JoJ¤PĨ… …H.ŧ›$Ã:˛™•Ų‰ø }¯/ú}¨Ō3›€ˆ…4ģߙŗßųΜũũįá€#ÔB°ÂĮF€ÍUBņXie? õŊÁoĻ}IXl)-O‡ƒŽ4įĸ›pfš•öDŌFšķ8éÛK•–ÎŽ­Jõa2iÚVXūTúŽĩ4ÍDd™dËĮVjâ(6ĸŸČ¨—¨¨™B÷]ŸQ]í¤AXH5‡ÆžĘ[ûÅÄļķOúÖ÷&ŖŸBÃT3k8ÚNę­+q#ĸDč8j[Ŗtܘš¸KûMdTžĖ‹ŧW^'ŌĘۄŨúdđ‡†[ƒw{H¨ũ›ģ´ĶĄéɯĘm¤ōĖsāÆ+aÅ;„Ŗé÷@(?^ŅY÷JöxÂ÷Ķ\a{ō(„ę$“_å˙ׇ{ŠđÜL |ŠX‰uf˙Ūfs'é'æ8. ņđygXĘu+šŽâeŽ—/;įÚū‰ÕÃéßđĘČ0‚įŅ:^įeor˙[nÎø}‡y?Ä"k™õ•ŗ—g˙PK AĸÆ÷EĢļ3org/gradle/cli/CommandLineParser$OptionString.class•T˙NAūözåĘq”ZDQ‹´GËQğ kLŒ&(˙[Ž—rxŊkîŖâø/$‰&>€ī¤qv[l“B“ÎîĖÎ|ķÍĖîũúķũ'€9<éE?LÄ´Ž4ŠB-Ĩ0Ŗã, ŗ:4…( 1—Âmá;¯áކ{ Ö˛ËÛü#ˇ<î×Ŧĩ8tũÚCOЈŨ§ÍĸëģņÃTžŨ¯ŨRXgP+AÕaXv}ge§žé„oøĻįˆLÍŊuēBoÕxˍŒU™° Cę ßwŠĮŖČĄSk9kV-äUĪąlĪĩ*AŊÎũĒHņš‡‘æNÆSéš?sŖ†Į?¯đ:嚘/t*´-æö‡Wŧ!éh¸ĪŠƒæą† /ĪTww~eŲåĶŦe!ærg‰cčãļíDQŽäšŽĀOE„–;McBŌģ…ÛÉ-Ü!š%Œá.ÕĖ"‡{äŠäN'MöëŦzz‹ÆĮY%ŧB65[ümŽ~įčk˙E“T‡BZƓq‘5˛<”]/hϏäŸĀ}LŅž‚>‡‡‘ÆM˛c”īGÃäMHxēĻ) ˆąīPK A`M~U¸2org/gradle/cli/CommandLineParser$ParserState.class•SßoŌPūN) s€ÛÔ97ÕŊŒ&MLČf‚ŲÃŪ.а.åÖÜvF˙'_|ŅÄ˙˙(ãš-›Ũ Aš´įGŋķīœÛūūķ퀴mdQŗ‘C-Į6ęxbaĮBƒ{áI/zIČ4šĮŗŒ\ÂjĪ“îáųdāĒbāsĻŌ †Â?ĘĶņ4iF§^H(ŧ*tU?'‹ī¤tU×ačōËv/PcgŦÄČwĄī9Ũ`2r¤;$uõTy‡Pšˆ/—#}Œŧ@ÖŊ3ņI8žc§)OŽ;ÍBŪ / ĄÆZå Ž°Č›…&ĄœøWtŸĖi2§íâqf¸YC!‡ŧûzŪPڕh&ߗûP2Ŗģe˛ģgÆvĄń‚$Ų$T@|„*>AŸŅ%ž W|Å):ËT Џ3€ŋâ‚Â_qIÅ_q3!ŠžÅš t–¯^= xÎc @椚ŲCäÍ!đ÷:°Z_ eĒāYōĘqā>8YM¨ŨHÅE˙F‚Ÿw@ŗ@9\"žŲ!ĩvÚC”œz1‹ø‰vņĢŽĨx••&ԃá€k$}ˌfĮö!ļuõÁĮĪTsj]Åp9Đ9†+Î1Œø:ķ*…4ņ*4fEų!Š´“æŋËœĻ./1YœŸÍ އĩ?PK AŖ=l)&org/gradle/cli/CommandLineParser.classYi`\őūJš™7zzļeŲ˛=`láë–1ļ°åS>K6–ą‘ĖXz’FΈ™ļ8B¸ÂŽŽ``‡‚šd ŲM¸ÂČîØÍ˛a؃=€ !lĮĮ~ũŪ›ŅĖč‰üPwOwUuUuÕ×ÕO¯{ö€YōT:ņąjūW5ŋ׹Ÿhøƒ/>Ņņ)ū¨sú3 ˙§áOųø >ץã yøRÃa#ņį|ÁŅ|ėĮ1ÕׄW‹ø%GĮÉÕÄŖcŧxũâSŋ5ÕøEžŽ]ĸû%_ÍĒĄfFúeu‘ŋŒÖ¤PĮt|eŒ&cu”āŋą—qǝ8&¨& œ¤äžŦš‰JO‹ī”|7#ņP"t‰™M$(°šĶųÎL8?˛=Ũą×cq3֔&LMÖsĮsO°ļA0ÚeúAQC(įÖöj]ŦŨZĸ-um 3fĪÆ5iŒĩfÎ Åâ‰ĻîmÔkG0ŌJKÍļhĖ˚×dcĘu;ƒ13cßM‚üŒ‰ÍÜ0Ũ[‚1Ģ×ŦĢ_Ũ¸ĩąŽaÅÖ5uëÖ­XÛ(Ŧę ^ŦîN„ÂÕ1ŗŨÜUŊ&˜ V‘ų‚QQ[ŲĨ=IŖŌ¨‚]¤Ék ĩG‚‰î-\‘šēĀūFÚĢmķWEcíÕíą`kØŦn ‡ĒÛV…"Ļ­ėüE”9:Gw6„v™­ŽģĘú1Ö|ÆyqeĖ41ë×ōP<¸-lŌ‰žĄH(ąH[RĘsô,‹ļšJîÔØŊc›[§…Ģĸ-Áđú`,¤~;“žDGˆ’§|…ēļŗŠŦˇKg–lloiļ‹­5M%äˇ ü¤9.bˆI+vĩ˜ÉĐŲ"˜[’FUĪķRŠo;ÃRØņŦ`öFNį”â3#­ŒmL=ƒ šŒ4åPõ%$ĐlĸĶÉuöÎ * cŨLate+īr"nęŖ“uUC›—iØ¸Ė€čéJ…›Į]B\đ kŲΰX5šP°jØėÃ:ÄÉ)Bˆp(^H˜i%ƒš…¯n ZÍükn ģ‰Ũ’É_>Nļ§ĸ‚ Īœ&3A†32g R4ėŅd̊ Z”8?lįyŌO¤ŽĢ‹m'áˆf@įØhŦՌ%sƞUĘuÅĖ6ë’3iĘ­ ŕžšÛÍĸÄ%Áp77õš‘DLũ^a÷E™9͚V\ŅEW ™pŧ vX8)âŦä4iFf(Måŧaú„}îŽā.ÁÔl?ēFō´,ƒN@6ßÍ 7üwåž3ôŊá§ÉEš5ŲFŧp JŌ-‹†Ãf‹n1íR^ĸž:ít[Ŋ­“BŪY‹ņԙdīÁ3‰›ŠRÃˇ­ģ­M΄A-ĩVÔvmę‚Īŧ.(SžYėn‘ZĻQ_;ĨS™Š[ZĖx|ڜ™3ĶK†FR^Ņ9ģfpÎUœg ‡sPY‘1O‰đ/ ›}›ëMŅîX k#…ČãIĒRr ܊[ ܀ ÜŦFßÁíD¨-Î Æ;¸&-†´Šiā{¸OP<ė’Á´1¤MÚšƒt¨†ˇ\͐׍ku§¸;5ŲnHXv‘¨!]r1%ûđ ‰ Ã0§˛Ō„t *‡Ü1ŊđT]BØ­ŦÜtáÂ-å†ė”¸!ģ¤ĮKå2C.—+%‹ãĨÅÂĒ2Cž!W*ĸor•\Mx´ÖÕ˛ZÅm¸…UŒ3WšĨnjqŸ\ÉęlE,rRzüā´…[UÆíēVŽ3ä[rŊ!7(GÜ(Wr“|ې›åjCnÁí†Ü*ˇō%*ûÜŞ!ˇËwYXšĀ¤Š2Îu]Ė4yނ͇Y <'”kīP͝†Ü%w't°3˛ŨluY9LáŲCž'÷d˜R‹{23$*Š ŧƒ0dˇ\/€!{ä^Cž/÷hrŸ7å†ÜŸÅžkCPáæ™ŸɈ: ųĄ\lȃō÷™nŅEņâbÅ`ČÃ*ÅÆšc&{ũ>Vi%ąŦ=f ŲŊƒwbĒŧeic›^ĪRĉ^ŌÉw÷wļ`Öם „OđFŸ3<,ôdn>g?Ü_įy2°Ī|ô—Ÿ˜Ū%õ €ÁzĸXį>"ŖNd1ėV“fY72ŗpLbĘh1s}Á¸Ŋ6=ŖJqŠŽŌÁÅ´Ī*ŖÉ9Ą¤ôDuXāU ĒëĮģ?›š˛}eĘĐŗĄ›§[ģւeN(åķqæ%ĪB=—:‚ņFsWÂúŽÁzËą~Œ-)u+Z v{ļŠ—p,‘|”•¸”ƒÕ{ūâî`8žE< ÔrĐ_nžÆÛˇĨCc^ŧ{[܉Õĸ’z×v„ į46ē˜đ—<[]ŋkŒt6SNļžoĖÆ;:낊´šģԃÚC“ęÕqÖģ›Ļ[ācĨĄ`ŠÛŅ|ŨŊķÛ(~Žzvú‚V†7\eŸ Ŗ"šzü–¸Ē>˛ŨL°žP_ˇkĄ°ŠpĘ6#í‰+Lé€üh¤1I`E™4c…Ō/ˇ]AËinąįØšŧ™<íąhw׆Ú§0=ë՗g3†Nj'"ŗ@#yëYk>nV˛0=tziÎH_ûģ…ō×r3Ū %?~uŠ'ū\“‡éßvŗĮBä‘‹ Aå ¯Š7ēŨo}m°hüÜ~Ŋũ ÂĮĄöW„‡sú Čé_&ē%î@,yÛÂŨņŽäőå<Ū€Ã MįŲ<īkéšŗŽāĮÖ­˛0nGRZ՞ņA<[1ëQ; hKŊ&§i13|dŗ7ØLķ]$7$åJ“ĻūŲAČh5ãĄ˜Ųšz=Šīæ‚ÖÂ贞ŋ_‘Ķ.Ÿķq*:ą€'ŠĒ—ŖõF†ā&kümūņšloU}Áõ˛ãī¤ášíwųkr9ârŲxĘúám>ß3ČyÂâŧƒ­Î˜æâNŽ ›wánöWņš})”Ŧ…ėm^YųAhŊđīO ņYL+,ãl"G€íÆŽßËą‡ũ÷ųĮ7<ŖĐÜ7hb>Åxú‘×ÜŊšėiäô!_pÆŒhčĮČæ˛ 9€Qå}(ā Âđôa´`ˇŧŽF…‚ŋ˜ZoeĀۋąģåą€ˇ°¨ãvŖ ã›ë„Æ}r§Ŋ8i7N"eĀKâ“{1ąÖđõâ\N‚IAUĀ[°°“k|6e)Š­ĐüåšČâ=•Lg“iŠÅtĒEëņ:¤đúRt“ŸÄÔ=("õ4RīA~?Ļķ(N{,$Ēõ)ŗž>ĖČĄģÆ)Y>gGK;ŧåČŽÕ,JÍĄŧǞ%TZX֋rE\Ū‹ ÕOŦõüŊ¨ÜÂ€?i.UÁMjēĒŅ[“W”§\Vũ æŌ*ūRv×ę™"uG¤žYÕxmžė;ūâ>,Ļ.’ŽŽŗž͇ŌKé֑ÍlÜwlfe/N¯ØoEˆŠ§'QÁöÛõbļãô Wb#Ķ`cm3Æ< ņרŠ_ã"ŧKĘ÷° ŸŖĮŅ*#`Ęx´É)h—btH):åLl—&„evH'ĸŌ….šËMˆÉ^ÄåQū~;å9ôČ˸TŪÄ7äC\)Ā5ōŽ“?ãz9†sr˜–*öÅhęåÃp?Ûģ0ā‡=ŒQ֜FÍ {•ēØtw›‚ņt‰c1~DŽĖÎÁ†kŊŒûßUôaŽ ąŌ!Œ¯t0¨F!SE/ÎÜwüƒ˛XžÂSũá'æMâŠÍd_ø8įŧįž‘gĻôMÍ'ĄĐ9Íķø×K ô(=SXē-,õ3úđ,-NžĄ=ĶĪu†Sá9ÎPôičÔđœ†įŲ ŨņĻQŗûc"™áÛ%šĪp;°üĒs›Ë`qˇ–x<ŋ™đšā6VĻ€š‹č‹~,Ļī–Ôz*-wÔü‡ŧŽFŽG|ļ˜:%f)ÅXJ¨X–˛œBV4[J^ Ī‘˛^l×úT{Ā”€ß œúp…íÃäåĸÁËĮ÷ü…gÄ9܅*Ô+ą/#ߒŊZáJNxyŊįæ*ú™ŒuÃŦR6+í|*,í&Š‘ŖVäUĀV} 5^ƇbiĖŌ•bY­ŧЇ5ģĩųÉ…įyžĮÚæ\ĩĐ$hęÅ:4¯"iĪų4Ĩˆhšžpƒm”7ƒŧŲãH´ßĖ8ŧā‰T ^ĘČRč”Įx 0ĶK%ŗ°k˜ŸAæg„éĩ“r7sä~ÆŨ!ÆŲo_˙ŒįđžĮĮœ9Ė`9†Ÿ‹Ž_K_”ŧ$ŗņ˛,Á+˛ ¯J;~);ņšÜ†×å%ŧ!¯âMyxw§•Ø#){9í%ĘqĮGˆŌĪ2wRģŸãŒŪ0 /r5{‚—,ē5¤ŲËđqÃBHģ\ˆ—‰ƒš Öd^pôKŧÆPΓņ7xY§ņ+ōįb–Ü‹7X:y¨ņķx“Yįĩ˛F园ɯSšü-1ÍŪáī8gËčOÉø{zSe× yĩNvŊĨaŽ•`ŋaZxŧúā 5Öøm‹čCãd"æQL´đtLîq:ɛŠeÍc%,3w„…Įä]}sÚęę˛Sž}ÆŪĮ~e?š2<‹Ę_¯påǞ>lJ¯›0ŨŠ›jŊ§ėA^Ãiķ† uoQŖÜEûŽŋÃøšpÃĒ8Đ~?ŪâžoSŅw/ŋå-ũOÄŗw‰gŋÃŪļKņ/´˙ũžU°üGŌy•^¤}×Bą•ŒĢ‡,ĖZJž÷,;–ķ–ô;ÉĸŸŊōøxŽb´†f9ÍrļöKęaß2˙J|ߋsđ=ÄŗSž8TŪPqhQn§ČsʃØYQä™Uëĩ@Ũë”O~lm.ŧČI=oĶA`‹2/-ÉõÖėõ'a*oĩõĸ}CĶ‘Ms­‡wōũ¨iVÕō„*,ØKŋ:&UĻ@ÄcéåŠHbĪ{V5”kyŋ†E=đ!Æâ#Ū&ŗP˙==÷ k O҆?ârŽ]?1Ë>gŽAäų’y{8u cŅaŨ*^ŽŽ°ōHŨ*‡RˇĘ!įVš•gŠō-y‡hĮāˇ.Ž#¨f€N>ŒŠ_Ā{EV43$§øņīøįfŽf¯Nš8÷ŅŦˇÁœ´;ŲËlįÎdūOü— sNöÝųŋ]w–aėĖČûŸÔi‰ĩ ;{ąg<šOajaø v<sđ[Š€Gō¸%.ĮX"œüĐ"ųQ kGOaŠXĮg\ŸpŗąŸĪ>Î>Áž›â.aŋ“ũ.ö=ŧ¸ŒŋĮŗŋœũėŋAÉ#Ų_Éū›ė¯ōäđ´;q é¯eéV)^ņåũ?PK A‹å>É&org/gradle/cli/ParsedCommandLine.class•Wiwg~FÛČōċę%v“TMc[–å’ņRˇŽ›8ļSâÆÆ)-LŦ‰ŦTÖ(Ŗ‘ˇ”.PhŲĄliŲ7 ’`rXžÁá;ßøÆŸ œœ˜į}g$KÖ¸1GįĖÜ÷Î}Ÿ÷Ūį.3úĮŊ?ūĀü.‚v˜*ōø`Ö!‰‹*Ŧ‚Îĸ .ļŠbuŽfš¸T“¸,.+*žWņBM0#hÄ'ëņ".ŠøT=^ÂËaŧĸâÕˇ}:‚|FÅkt ãŗâūš0^÷7„ÅįÅÎ/Ô㋸$–__Vņ•0žAžV¯ãMaķ qųϏŧŠâ[ Íŧ1s…#+3ļ•ÉĨŠ™ŧ /ëE;“˜Ōķà ęf2éœn-CÁÉę§#Î2ĢįŌĀđ¤iĨŌ–žĘ ŲĖĀ“ēU0RãæŌ’žKMfrÆ)yâđ(‘ō–Q0rļŖ*T>cØ4y¤Zãq ˛Œ%sŲH•ŒËļĨYéâņŠhĒĀ™ĖôžMĒ-°C#™\ÆUĐ¯08a–~.k ÷Î*Œ›)CxĪđĻ‹Kį ë)ņLAtŌ\Đŗŗē•kWYįpÎ#„A͙ ´ŧäĖ FA|ģ”ŌWĶŨŗwķ/ë€Ŋ˜)xØÖāĶV5KÔļxą  ­:ԕ|)ÜÃö#÷wOPŋcÆÖžcI(ßVņÃ^yØĸČUØ6KĨŪīõ¤˙bŅ´ą\jÂĖúŊĶîĩ3Tp‘UG(ˆŒí|ŅVĐQŗáH1“M– 7S8–ą ´RΊ|{…įY›#ÛļõôˇnQ/”ĒŦ5^kŅKošuˇO;=F‚¸m,ˇRÚŲ¯h¤q3›5$ßbwcÖLOËFļܙmŪÆ žļŧßûLīĐĪn"ĒŨöûĒ9mØG7M”hŠz*gJwr‹v詔DœÕŗEc úYŽÁeįyíK„?ëa{˙ō˙?Â՜qZ:¯Ģfy Ķ×ȌY´ŒcŅöm5đû…Ķã Ũ é¸^Xd‹kčĮūšųŪဂ6žŽY–ž"Öđ|PÃ[x[Ãwņ= ßĮÄîį1sĩ=>4ü?RņcļÂfÖUüDÃOņ3Ũņ8ë*$cÕ/GWũ†ē*ĀSį.°„5œÂ“~ŽUžnļ˜ |ɘ†_ā—=Ļ0­a į4ü WU\Ķ0ŗ~ßp´WLöHZĪ–ŧ:zyÁpyØéøëé*ôÄrĻKį}jŋČcü­†ë¸ĒážŅđŽÖ’[ÃģŖv.•”2}Ri›ŒÆ—c9SV´UõPÉPŒIΝir+÷°Š9š¨ã‘´Ž°gËS§š Ķų´ØQĨ¨ZŗyˆœÛ‡ãĩāĩOBįMkI'Æ GÃ>ũŪ ī=Ÿ7rŠ‘W=Âļ~Š„˜­gDô­1[ŧf(O :ēŊ6y…ŲP=đ¸ŸŗJ8žJeŗœŌĮÃü2mį‡sQŅëP0Ā•īãš-^^äúĐĻ5[ŧŧūęy?ŒAĘC€2?TjŪH܆’¸ßümøo"@1H1tę†ĻXG1rõ}kĐL%×°CÁœ¤Đ ā¯hœžƒ&Ú4úo!ē† ;‚Ž]LHŌ°e(”ø=ĄŽĀZũ˜[]˙×ęú;7dÃō?‚Æk'W­üžoŖÔÎĪņ ųAū؅ė†=xá5Äđ:IáŽCüaŖb!ZĀcxœ(DÃĖp1Ž')Å1ŌķaĘīŽæ8Ĩ”÷!°NÎü*’*&TūīĀ=tĢhTŅÄÕĐũ_éP;É=œ'ŧ’XœáŲ­/ÚúÚįũ FĢŪÆÎ™ų€ëĨbXˆ@Įu #BwļvÉp§ú\‡}bČ9šÃģŧ‡x?}düÁŠĀ¨“•Ą€āTō}HH.ßÁŨo!’Œîē…ŨsÉčyëVŦüŖĢëOŪÂC×ËIØ/ëĨa$ĄqÖa’xA1cŦžã¤x‚š)R_J@{ņ& (ü+“}š?Av˜ö3xŠūG¸û f™”Ģ97­đßCTE§Bēī"Ļĸå]t¸Œ”Fœ×.ã'¨ņņۜčģ…Øœ ›t<ėÃĩ2¯i Ęâ1éi›ŗĄė_3ã%œ‚§ß6ė ;Aؓ÷ũžq“÷6īA-ÁöV4RgŠ‘ZĻl GŽ ¸ļēūo˙ĩrNÚ$ĢgØŗdyŽE:ú+ŽŽ‘ÉN:$ôËĖ•œčÅŗøxUĄ Í'\ž5øīB%Įģ6 Zį3ž]^ᜐˆĸkéô>lšJū ;ī k>ڐeŪ'*ų6zū’Eä—Ge¤)ö¤Aų<],;[íĸÃS;\ôŦOē†r=l8>Y ŠÃ߀äŠ^ÚÜ9ŲŠÎ ēđNL¯į‘vczÂÍ­&@S܇š›Ōšg\ŦHĢVvWcŖōŒ .¸ˆ97­{ĒXšŘ”ã°—GôoøÛ )ãĒȑļ,ĪI8åsöČQĻHI 0­›$AbīsŒÖ9ûŠ{ö`_iđ–Ģ*^QUtĨ Õ ĸšščķ‰ņûĪåŒ9%ö<'ė tįEžB^âKãårÖvs?ę–Ø`ŲŅAé^EAEXP QP –dČš˙PK AyßtÚE,org/gradle/cli/ParsedCommandLineOption.classS]OÔ@=Ũ¯îGeųPa„eQǍø"ˆhHV1YƒÁˇawRģíĻíá§đl⋘¨IÔg”ņN[`Y$ņĄĶ™Û{Ī=įÜéī?ߘ“4˛(ǘH#‚b ¸žĻ冊É$ô4¸™Á-L%q[žī¨¸+ßĶrš§âžŠ [ĖlpWAļ´Éļ˜Ūđ„Š—„ëÍ(H•…a1¯áp#-ŸgƒŗÉ,C/{ްŒ™9*IĖ Kxs ĸ…ņUąEģJÅ%aņ—Ú:w^ŗu“"š’]aæ*s„<‡Á˜ˇ!ˆIĄd;†n8ŦjrŊb ũs\^]´k5fU%ÔJŨļEí’÷VĨŨ…ņŗ”´•=Vy÷‚ÕÊŖ j”;*i=z&xŽÔ ĢVŖQ㖧 §p6K:dĮ)šņKn07T@–ŊU.Û §ÂŸ Évāé“ICzt°]pļ-)kčDNÃ(Æ t]6Mn0“,ņøŌû ÷ą(#ÍWmîæ-ÛËo°-žgÖvŪŋ“˛Ņ°Š‡f0Ģ ?L'æųZÃôDŨäAĻKŠ@ĶĪļ*Õđķ$ĄŅ˙ī)”•õM^!ÛO†îŒ+vī–iĨáĘQ,7_… ”ŦŽŌĀZ~“žĢÂ]ĒÕŊm\Ą(K? LēHī.:EЍ8íÉrZ/PdQÚŲâ>”â!"kûˆ~E뺟}‘Vų_‚*bTĶG;-ČĮ%ôûø¸bí„XĶÅoˆīĸí‰ĩœēäĪâĐ"ĄÂpú(=@&‚_Đö¨2ęwė%Ž ^*õč$üAęPĀPS÷é°û =1D:Ĩš!䉩äĄĶIfÅ%ūŪą„n‚‰‡05W(v•žbžRD ×$ČÄÚ"xĶjĘ2DŦΧėį†xr7‚k> ēŊ!âķV.pŖ]Á.ÔØG˛āĶąô€ãDĮ\“Ô8"Ųy Rđ‰Œ˙PK A\vÆB| :org/gradle/cli/ProjectPropertiesCommandLineConverter.class’KOÂ@…ĪD|?PÃĸėĀšuã#QŒ+ĸ$÷C;–1m‡  ˙JW&.üū(ãĒ1ØDã,îéœ9ßôvĻoī/¯öą[@ylæą•G)‡ívŲ }FHWkw„LS眰Ü!ŋ]ŽnY×7ÎZK:ĖŋcJDķØĖ螎ZRy律ësÛņ…ŨVō;ÚHŸ+-ø )ƒ€…n´kS†#cruLXõøgh|Ķ×B†„j­õĀFĖöYčŲ­Dč™čΏč%×LøÜ%”ÖŽņŽ…Ž*‡_‰¨åŊ?õֈ:("‡<Ú„bJՍö Ž­ØŠtōfë^*K÷¸Õ ßĩĻ XUŪđVŊŒŖÜi01Čk ÂÁp8ƒwZąß8T0gî?PôaĻΛ™m”ŒÎí=ƒžĖC Sŗs ϧŖ‹| Ë1\áôZęq-}CĶ_čJšžEˉčjš™E+ ¨ųw'ŠõPK A Ī8=|ü9org/gradle/cli/SystemPropertiesCommandLineConverter.class’ËJÃ@†ĪØĢmĩļÖjÕEÜ5BPąR/Pé~šĶ‘$&ĶBŪJW‚ ‡'iŠAÄYœ3ķĪ˙͜šŧŧžĀl— "lĄY„Íl E Ę<&Ī dÚú@ļËĮH ÚgŪLŨŠ{:r”Rīs‹:C*X4NÄŦœ°€ĀQŸ Û´;hZ3a ŅŊÜG!]îēÔG‹vš7S"Š5eb o}ɸG ŅÖûtFM‡zļ9‚yļ˛ļ~X{()spL`7e.°KV, øTXxÉĸŠõŋ”fDT E¤G ÄPĮWãJmŽh~˛­Æ49Aíjx­ĩҰ ­ĶsÃhöĖ gԙĸn8üĮ5ŠÛ] .FԒŋs°9õāQˉÎĸⲙ*•sû/@žUg J*æcąe+sƒĘ+1ž Õî$pĻžô´€6ŋĄ™/t-Í,ĸ;Šh-Í.ĸZ Ē>kėZ˙PK A íAMETA-INF/PK Amą>=@?¤)META-INF/MANIFEST.MFPK AíA›org/PK A íAŋorg/gradle/PK AíAęorg/gradle/wrapper/PK A•%ĶĻš/¤org/gradle/wrapper/BootstrapMainStarter$1.classPK Ai,Ģ$ -¤#org/gradle/wrapper/BootstrapMainStarter.classPK AhQū}ĸŌ#¤org/gradle/wrapper/Download$1.classPK Ay´[Ā4ØA¤p org/gradle/wrapper/Download$DefaultDownloadProgressListener.classPK Až‚­ÛĄ~4¤org/gradle/wrapper/Download$ProxyAuthenticator.classPK ApOĖ)¨&!¤öorg/gradle/wrapper/Download.classPK AyLĸĄĘ1¤^$org/gradle/wrapper/DownloadProgressListener.classPK A!9|ļ„ 3¤N%org/gradle/wrapper/ExclusiveFileAccessManager.classPK Aė„,y†-¤U,org/gradle/wrapper/GradleUserHomeLookup.classPK APrē™Ģ -*¤/org/gradle/wrapper/GradleWrapperMain.classPK AúâæĒÛ"¤ 9org/gradle/wrapper/IDownload.classPK A$P™[U†"¤ö9org/gradle/wrapper/Install$1.classPK AŦāāĮ}-¤‹Borg/gradle/wrapper/Install$InstallCheck.classPK AVĖ„‰ž/ ¤SEorg/gradle/wrapper/Install.classPK Ađŋ:öo4¤O[org/gradle/wrapper/Logger.classPK Aé`˜Žī8¤û]org/gradle/wrapper/PathAssembler$LocalDistribution.classPK A áļ;+&¤ß_org/gradle/wrapper/PathAssembler.classPK A„ÍëÂ| 0¤'gorg/gradle/wrapper/SystemPropertiesHandler.classPK AĒ=а?-¤7lorg/gradle/wrapper/WrapperConfiguration.classPK AGü¨ (¤2oorg/gradle/wrapper/WrapperExecutor.classPK AÔe‹ #¤xgradle-wrapper-classpath.propertiesPK A)¤íxgradle-wrapper-parameter-names.propertiesPK AíA6yorg/gradle/cli/PK AÕÜ?Ž<S1¤eyorg/gradle/cli/AbstractCommandLineConverter.classPK A׃ĩŗXė ;¤đ{org/gradle/cli/AbstractPropertiesCommandLineConverter.classPK A}­ÎyGK1¤Ą€org/gradle/cli/CommandLineArgumentException.classPK Aŗßâúg)¤7‚org/gradle/cli/CommandLineConverter.classPK ASf Õg&¤—ƒorg/gradle/cli/CommandLineOption.classPK Aü튯Ĩå(¤Ũ‰org/gradle/cli/CommandLineParser$1.classPK A$f{Kŋ ;¤ČŠorg/gradle/cli/CommandLineParser$AfterFirstSubCommand.classPK AĨDŖĸ&3¤lŽorg/gradle/cli/CommandLineParser$AfterOptions.classPK AŒ‹Müu <¤_‘org/gradle/cli/CommandLineParser$BeforeFirstSubCommand.classPK A´*ĢZMīF¤ĩ•org/gradle/cli/CommandLineParser$CaseInsensitiveStringComparator.classPK A|ėRÎĐ&=¤f˜org/gradle/cli/CommandLineParser$KnownOptionParserState.classPK A$ÄžĸĨô<¤‘Ÿorg/gradle/cli/CommandLineParser$MissingOptionArgState.classPK ATK>ĒÄ=¤ĸorg/gradle/cli/CommandLineParser$OptionAwareParserState.classPK A˜%āĖģĒ7¤•Ĩorg/gradle/cli/CommandLineParser$OptionComparator.classPK AäfC˜§Ŗ8¤Ĩ¨org/gradle/cli/CommandLineParser$OptionParserState.classPK AĸÆ÷EĢļ3¤ĸĒorg/gradle/cli/CommandLineParser$OptionString.classPK AgAq˛”x=¤ž­org/gradle/cli/CommandLineParser$OptionStringComparator.classPK A`M~U¸2¤°org/gradle/cli/CommandLineParser$ParserState.classPK ApÍX Ũk?¤á˛org/gradle/cli/CommandLineParser$UnknownOptionParserState.classPK AŖ=l)&¤ļorg/gradle/cli/CommandLineParser.classPK A‹å>É&¤uČorg/gradle/cli/ParsedCommandLine.classPK AyßtÚE,¤‚Đorg/gradle/cli/ParsedCommandLineOption.classPK A\vÆB| :¤ĻĶorg/gradle/cli/ProjectPropertiesCommandLineConverter.classPK A Ī8=|ü9¤zÕorg/gradle/cli/SystemPropertiesCommandLineConverter.classPK44JM×flatbuffers-24.12.23/android/gradle/wrapper/gradle-wrapper.properties000066400000000000000000000003121473234705300256440ustar00rootroot00000000000000distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists flatbuffers-24.12.23/android/gradlew000077500000000000000000000122601473234705300172540ustar00rootroot00000000000000#!/usr/bin/env sh ############################################################################## ## ## Gradle start up script for UN*X ## ############################################################################## # Attempt to set APP_HOME # Resolve links: $0 may be a link PRG="$0" # Need this for relative symlinks. while [ -h "$PRG" ] ; do ls=`ls -ld "$PRG"` link=`expr "$ls" : '.*-> \(.*\)$'` if expr "$link" : '/.*' > /dev/null; then PRG="$link" else PRG=`dirname "$PRG"`"/$link" fi done SAVED="`pwd`" cd "`dirname \"$PRG\"`/" >/dev/null APP_HOME="`pwd -P`" cd "$SAVED" >/dev/null APP_NAME="Gradle" APP_BASE_NAME=`basename "$0"` # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS="" # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD="maximum" warn () { echo "$*" } die () { echo echo "$*" echo exit 1 } # OS specific support (must be 'true' or 'false'). cygwin=false msys=false darwin=false nonstop=false case "`uname`" in CYGWIN* ) cygwin=true ;; Darwin* ) darwin=true ;; MINGW* ) msys=true ;; NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then # IBM's JDK on AIX uses strange locations for the executables JAVACMD="$JAVA_HOME/jre/sh/java" else JAVACMD="$JAVA_HOME/bin/java" fi if [ ! -x "$JAVACMD" ] ; then die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi else JAVACMD="java" which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi # Increase the maximum file descriptors if we can. if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then MAX_FD_LIMIT=`ulimit -H -n` if [ $? -eq 0 ] ; then if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then MAX_FD="$MAX_FD_LIMIT" fi ulimit -n $MAX_FD if [ $? -ne 0 ] ; then warn "Could not set maximum file descriptor limit: $MAX_FD" fi else warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" fi fi # For Darwin, add options to specify how the application appears in the dock if $darwin; then GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" fi # For Cygwin, switch paths to Windows format before running java if $cygwin ; then APP_HOME=`cygpath --path --mixed "$APP_HOME"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` JAVACMD=`cygpath --unix "$JAVACMD"` # We build the pattern for arguments to be converted via cygpath ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` SEP="" for dir in $ROOTDIRSRAW ; do ROOTDIRS="$ROOTDIRS$SEP$dir" SEP="|" done OURCYGPATTERN="(^($ROOTDIRS))" # Add a user-defined pattern to the cygpath arguments if [ "$GRADLE_CYGPATTERN" != "" ] ; then OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" fi # Now convert the arguments - kludge to limit ourselves to /bin/sh i=0 for arg in "$@" ; do CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` else eval `echo args$i`="\"$arg\"" fi i=$((i+1)) done case $i in (0) set -- ;; (1) set -- "$args0" ;; (2) set -- "$args0" "$args1" ;; (3) set -- "$args0" "$args1" "$args2" ;; (4) set -- "$args0" "$args1" "$args2" "$args3" ;; (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; esac fi # Escape application args save () { for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done echo " " } APP_ARGS=$(save "$@") # Collect all arguments for the java command, following the shell quoting and substitution rules eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then cd "$(dirname "$0")" fi exec "$JAVACMD" "$@" flatbuffers-24.12.23/android/gradlew.bat000066400000000000000000000042001473234705300200110ustar00rootroot00000000000000@if "%DEBUG%" == "" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @rem @rem ########################################################################## @rem Set local scope for the variables with windows NT shell if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 if "%DIRNAME%" == "" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. set DEFAULT_JVM_OPTS= @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if "%ERRORLEVEL%" == "0" goto init echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. echo. echo Please set the JAVA_HOME variable in your environment to match the echo location of your Java installation. goto fail :findJavaFromJavaHome set JAVA_HOME=%JAVA_HOME:"=% set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto init echo. echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% echo. echo Please set the JAVA_HOME variable in your environment to match the echo location of your Java installation. goto fail :init @rem Get command-line arguments, handling Windows variants if not "%OS%" == "Windows_NT" goto win9xME_args :win9xME_args @rem Slurp the command line arguments. set CMD_LINE_ARGS= set _SKIP=2 :win9xME_args_slurp if "x%~1" == "x" goto execute set CMD_LINE_ARGS=%* :execute @rem Setup the command line set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar @rem Execute Gradle "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% :end @rem End local scope for the variables with windows NT shell if "%ERRORLEVEL%"=="0" goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 exit /b 1 :mainEnd if "%OS%"=="Windows_NT" endlocal :omega flatbuffers-24.12.23/android/settings.gradle000066400000000000000000000000641473234705300207200ustar00rootroot00000000000000include ':app' rootProject.name = "FlatbuffersTest" flatbuffers-24.12.23/bazel/000077500000000000000000000000001473234705300153555ustar00rootroot00000000000000flatbuffers-24.12.23/bazel/BUILD.bazel000066400000000000000000000000001473234705300172210ustar00rootroot00000000000000flatbuffers-24.12.23/benchmarks/000077500000000000000000000000001473234705300163755ustar00rootroot00000000000000flatbuffers-24.12.23/benchmarks/CMakeLists.txt000066400000000000000000000056101473234705300211370ustar00rootroot00000000000000# Setup for running Google Benchmarks (https://github.com/google/benchmark) on # flatbuffers. This requires both that benchmark library and its dependency gtest # to build. Instead of including them here or doing a submodule, this uses # FetchContent (https://cmake.org/cmake/help/latest/module/FetchContent.html) to # grab the dependencies at config time. This requires CMake 3.14 or higher. cmake_minimum_required(VERSION 3.14) include(FetchContent) # No particular reason for the specific GIT_TAGs for the following repos, they # were just the latest releases when this was added. FetchContent_Declare( googletest GIT_REPOSITORY https://github.com/google/googletest.git GIT_TAG e2239ee6043f73722e7aa812a459f54a28552929 # release-1.11.0 ) FetchContent_Declare( googlebenchmark GIT_REPOSITORY https://github.com/google/benchmark.git GIT_TAG 0d98dba29d66e93259db7daa53a9327df767a415 # v1.6.1 ) # For Windows: Prevent overriding the parent project's compiler/linker # settings. set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) FetchContent_MakeAvailable( googletest googlebenchmark ) set(CPP_BENCH_DIR ${CMAKE_CURRENT_SOURCE_DIR}/cpp) set(CPP_FB_BENCH_DIR ${CPP_BENCH_DIR}/flatbuffers) set(CPP_RAW_BENCH_DIR ${CPP_BENCH_DIR}/raw) set(CPP_BENCH_FBS ${CPP_FB_BENCH_DIR}/bench.fbs) set(CPP_BENCH_FB_GEN ${CPP_FB_BENCH_DIR}/bench_generated.h) set(FlatBenchmark_SRCS ${CPP_BENCH_DIR}/benchmark_main.cpp ${CPP_FB_BENCH_DIR}/fb_bench.cpp ${CPP_RAW_BENCH_DIR}/raw_bench.cpp ${CPP_BENCH_FB_GEN} ) # Generate the flatbuffers benchmark code from the flatbuffers schema using # flatc itself, thus it depends on flatc. This also depends on the C++ runtime # flatbuffers and the schema file itself, so it should auto-generated at the # correct times. add_custom_command( OUTPUT ${CPP_BENCH_FB_GEN} COMMAND "${FLATBUFFERS_FLATC_EXECUTABLE}" --cpp -o ${CPP_FB_BENCH_DIR} ${CPP_BENCH_FBS} DEPENDS flatc flatbuffers ${CPP_BENCH_FBS} COMMENT "Run Flatbuffers Benchmark Codegen: ${CPP_BENCH_FB_GEN}" VERBATIM) # The main flatbuffers benchmark executable add_executable(flatbenchmark ${FlatBenchmark_SRCS}) # Benchmark requires C++11 target_compile_features(flatbenchmark PRIVATE cxx_std_11 # requires cmake 3.8 ) target_compile_options(flatbenchmark PRIVATE -fno-aligned-new -Wno-deprecated-declarations ) # Set the output directory to the root binary directory set_target_properties(flatbenchmark PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" ) # The includes of the benchmark files are fully qualified from flatbuffers root. target_include_directories(flatbenchmark PUBLIC ${CMAKE_SOURCE_DIR}) target_link_libraries(flatbenchmark PRIVATE benchmark::benchmark_main # _main to use their entry point gtest # Link to gtest so we can also assert in the benchmarks )flatbuffers-24.12.23/benchmarks/cpp/000077500000000000000000000000001473234705300171575ustar00rootroot00000000000000flatbuffers-24.12.23/benchmarks/cpp/bench.h000066400000000000000000000006511473234705300204110ustar00rootroot00000000000000#ifndef BENCHMARKS_CPP_BENCH_H_ #define BENCHMARKS_CPP_BENCH_H_ #include struct Bench { virtual ~Bench() {} inline void Add(int64_t value) { sum += value; } virtual uint8_t *Encode(void *buf, int64_t &len) = 0; virtual void *Decode(void *buf, int64_t len) = 0; virtual int64_t Use(void *decoded) = 0; virtual void Dealloc(void *decoded) = 0; int64_t sum = 0; }; #endif // BENCHMARKS_CPP_BENCH_H_flatbuffers-24.12.23/benchmarks/cpp/benchmark_main.cpp000066400000000000000000000054031473234705300226230ustar00rootroot00000000000000#include #include #include "benchmarks/cpp/bench.h" #include "benchmarks/cpp/flatbuffers/fb_bench.h" #include "benchmarks/cpp/raw/raw_bench.h" static inline void Encode(benchmark::State &state, std::unique_ptr &bench, uint8_t *buffer) { int64_t length; for (auto _ : state) { bench->Encode(buffer, length); benchmark::DoNotOptimize(length); } } static inline void Decode(benchmark::State &state, std::unique_ptr &bench, uint8_t *buffer) { int64_t length; uint8_t *encoded = bench->Encode(buffer, length); for (auto _ : state) { void *decoded = bench->Decode(encoded, length); benchmark::DoNotOptimize(decoded); } } static inline void Use(benchmark::State &state, std::unique_ptr &bench, uint8_t *buffer, int64_t check_sum) { int64_t length; uint8_t *encoded = bench->Encode(buffer, length); void *decoded = bench->Decode(encoded, length); int64_t sum = 0; for (auto _ : state) { sum = bench->Use(decoded); } EXPECT_EQ(sum, check_sum); } static void BM_Flatbuffers_Encode(benchmark::State &state) { const int64_t kBufferLength = 1024; uint8_t buffer[kBufferLength]; StaticAllocator allocator(&buffer[0]); std::unique_ptr bench = NewFlatBuffersBench(kBufferLength, &allocator); Encode(state, bench, buffer); } BENCHMARK(BM_Flatbuffers_Encode); static void BM_Flatbuffers_Decode(benchmark::State &state) { const int64_t kBufferLength = 1024; uint8_t buffer[kBufferLength]; StaticAllocator allocator(&buffer[0]); std::unique_ptr bench = NewFlatBuffersBench(kBufferLength, &allocator); Decode(state, bench, buffer); } BENCHMARK(BM_Flatbuffers_Decode); static void BM_Flatbuffers_Use(benchmark::State &state) { const int64_t kBufferLength = 1024; uint8_t buffer[kBufferLength]; StaticAllocator allocator(&buffer[0]); std::unique_ptr bench = NewFlatBuffersBench(kBufferLength, &allocator); Use(state, bench, buffer, 218812692406581874); } BENCHMARK(BM_Flatbuffers_Use); static void BM_Raw_Encode(benchmark::State &state) { const int64_t kBufferLength = 1024; uint8_t buffer[kBufferLength]; std::unique_ptr bench = NewRawBench(); Encode(state, bench, buffer); } BENCHMARK(BM_Raw_Encode); static void BM_Raw_Decode(benchmark::State &state) { const int64_t kBufferLength = 1024; uint8_t buffer[kBufferLength]; std::unique_ptr bench = NewRawBench(); Decode(state, bench, buffer); } BENCHMARK(BM_Raw_Decode); static void BM_Raw_Use(benchmark::State &state) { const int64_t kBufferLength = 1024; uint8_t buffer[kBufferLength]; std::unique_ptr bench = NewRawBench(); Use(state, bench, buffer, 218812692406581874); } BENCHMARK(BM_Raw_Use); flatbuffers-24.12.23/benchmarks/cpp/flatbuffers/000077500000000000000000000000001473234705300214625ustar00rootroot00000000000000flatbuffers-24.12.23/benchmarks/cpp/flatbuffers/bench.fbs000066400000000000000000000023531473234705300232400ustar00rootroot00000000000000// Copyright 2021 Google Inc. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // trying to represent a typical mix of datatypes: // 1 array of 3 elements, each element: 1 string, 3 nested objects, 9 scalars // root element has the array, additional string and an enum namespace benchmarks_flatbuffers; enum Enum : short { Apples, Pears, Bananas} struct Foo { id:ulong; count:short; prefix:byte; length:uint; } struct Bar { parent:Foo; time:int; ratio:float; size:ushort; } table FooBar { sibling:Bar; name:string; rating:double; postfix:ubyte; } table FooBarContainer { list:[FooBar]; // 3 copies of the above initialized:bool; fruit:Enum; location:string; } root_type FooBarContainer; flatbuffers-24.12.23/benchmarks/cpp/flatbuffers/bench_generated.h000066400000000000000000000254361473234705300247420ustar00rootroot00000000000000// automatically generated by the FlatBuffers compiler, do not modify #ifndef FLATBUFFERS_GENERATED_BENCH_BENCHMARKS_FLATBUFFERS_H_ #define FLATBUFFERS_GENERATED_BENCH_BENCHMARKS_FLATBUFFERS_H_ #include "flatbuffers/flatbuffers.h" // Ensure the included flatbuffers.h is the same version as when this file was // generated, otherwise it may not be compatible. static_assert(FLATBUFFERS_VERSION_MAJOR == 24 && FLATBUFFERS_VERSION_MINOR == 12 && FLATBUFFERS_VERSION_REVISION == 23, "Non-compatible flatbuffers version included"); namespace benchmarks_flatbuffers { struct Foo; struct Bar; struct FooBar; struct FooBarBuilder; struct FooBarContainer; struct FooBarContainerBuilder; enum Enum : int16_t { Enum_Apples = 0, Enum_Pears = 1, Enum_Bananas = 2, Enum_MIN = Enum_Apples, Enum_MAX = Enum_Bananas }; inline const Enum (&EnumValuesEnum())[3] { static const Enum values[] = { Enum_Apples, Enum_Pears, Enum_Bananas }; return values; } inline const char * const *EnumNamesEnum() { static const char * const names[4] = { "Apples", "Pears", "Bananas", nullptr }; return names; } inline const char *EnumNameEnum(Enum e) { if (flatbuffers::IsOutRange(e, Enum_Apples, Enum_Bananas)) return ""; const size_t index = static_cast(e); return EnumNamesEnum()[index]; } FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(8) Foo FLATBUFFERS_FINAL_CLASS { private: uint64_t id_; int16_t count_; int8_t prefix_; int8_t padding0__; uint32_t length_; public: Foo() : id_(0), count_(0), prefix_(0), padding0__(0), length_(0) { (void)padding0__; } Foo(uint64_t _id, int16_t _count, int8_t _prefix, uint32_t _length) : id_(flatbuffers::EndianScalar(_id)), count_(flatbuffers::EndianScalar(_count)), prefix_(flatbuffers::EndianScalar(_prefix)), padding0__(0), length_(flatbuffers::EndianScalar(_length)) { (void)padding0__; } uint64_t id() const { return flatbuffers::EndianScalar(id_); } int16_t count() const { return flatbuffers::EndianScalar(count_); } int8_t prefix() const { return flatbuffers::EndianScalar(prefix_); } uint32_t length() const { return flatbuffers::EndianScalar(length_); } }; FLATBUFFERS_STRUCT_END(Foo, 16); FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(8) Bar FLATBUFFERS_FINAL_CLASS { private: benchmarks_flatbuffers::Foo parent_; int32_t time_; float ratio_; uint16_t size_; int16_t padding0__; int32_t padding1__; public: Bar() : parent_(), time_(0), ratio_(0), size_(0), padding0__(0), padding1__(0) { (void)padding0__; (void)padding1__; } Bar(const benchmarks_flatbuffers::Foo &_parent, int32_t _time, float _ratio, uint16_t _size) : parent_(_parent), time_(flatbuffers::EndianScalar(_time)), ratio_(flatbuffers::EndianScalar(_ratio)), size_(flatbuffers::EndianScalar(_size)), padding0__(0), padding1__(0) { (void)padding0__; (void)padding1__; } const benchmarks_flatbuffers::Foo &parent() const { return parent_; } int32_t time() const { return flatbuffers::EndianScalar(time_); } float ratio() const { return flatbuffers::EndianScalar(ratio_); } uint16_t size() const { return flatbuffers::EndianScalar(size_); } }; FLATBUFFERS_STRUCT_END(Bar, 32); struct FooBar FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef FooBarBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_SIBLING = 4, VT_NAME = 6, VT_RATING = 8, VT_POSTFIX = 10 }; const benchmarks_flatbuffers::Bar *sibling() const { return GetStruct(VT_SIBLING); } const flatbuffers::String *name() const { return GetPointer(VT_NAME); } double rating() const { return GetField(VT_RATING, 0.0); } uint8_t postfix() const { return GetField(VT_POSTFIX, 0); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyField(verifier, VT_SIBLING, 8) && VerifyOffset(verifier, VT_NAME) && verifier.VerifyString(name()) && VerifyField(verifier, VT_RATING, 8) && VerifyField(verifier, VT_POSTFIX, 1) && verifier.EndTable(); } }; struct FooBarBuilder { typedef FooBar Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; void add_sibling(const benchmarks_flatbuffers::Bar *sibling) { fbb_.AddStruct(FooBar::VT_SIBLING, sibling); } void add_name(flatbuffers::Offset name) { fbb_.AddOffset(FooBar::VT_NAME, name); } void add_rating(double rating) { fbb_.AddElement(FooBar::VT_RATING, rating, 0.0); } void add_postfix(uint8_t postfix) { fbb_.AddElement(FooBar::VT_POSTFIX, postfix, 0); } explicit FooBarBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset(end); return o; } }; inline flatbuffers::Offset CreateFooBar( flatbuffers::FlatBufferBuilder &_fbb, const benchmarks_flatbuffers::Bar *sibling = nullptr, flatbuffers::Offset name = 0, double rating = 0.0, uint8_t postfix = 0) { FooBarBuilder builder_(_fbb); builder_.add_rating(rating); builder_.add_name(name); builder_.add_sibling(sibling); builder_.add_postfix(postfix); return builder_.Finish(); } inline flatbuffers::Offset CreateFooBarDirect( flatbuffers::FlatBufferBuilder &_fbb, const benchmarks_flatbuffers::Bar *sibling = nullptr, const char *name = nullptr, double rating = 0.0, uint8_t postfix = 0) { auto name__ = name ? _fbb.CreateString(name) : 0; return benchmarks_flatbuffers::CreateFooBar( _fbb, sibling, name__, rating, postfix); } struct FooBarContainer FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef FooBarContainerBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_LIST = 4, VT_INITIALIZED = 6, VT_FRUIT = 8, VT_LOCATION = 10 }; const flatbuffers::Vector> *list() const { return GetPointer> *>(VT_LIST); } bool initialized() const { return GetField(VT_INITIALIZED, 0) != 0; } benchmarks_flatbuffers::Enum fruit() const { return static_cast(GetField(VT_FRUIT, 0)); } const flatbuffers::String *location() const { return GetPointer(VT_LOCATION); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyOffset(verifier, VT_LIST) && verifier.VerifyVector(list()) && verifier.VerifyVectorOfTables(list()) && VerifyField(verifier, VT_INITIALIZED, 1) && VerifyField(verifier, VT_FRUIT, 2) && VerifyOffset(verifier, VT_LOCATION) && verifier.VerifyString(location()) && verifier.EndTable(); } }; struct FooBarContainerBuilder { typedef FooBarContainer Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; void add_list(flatbuffers::Offset>> list) { fbb_.AddOffset(FooBarContainer::VT_LIST, list); } void add_initialized(bool initialized) { fbb_.AddElement(FooBarContainer::VT_INITIALIZED, static_cast(initialized), 0); } void add_fruit(benchmarks_flatbuffers::Enum fruit) { fbb_.AddElement(FooBarContainer::VT_FRUIT, static_cast(fruit), 0); } void add_location(flatbuffers::Offset location) { fbb_.AddOffset(FooBarContainer::VT_LOCATION, location); } explicit FooBarContainerBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } flatbuffers::Offset Finish() { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset(end); return o; } }; inline flatbuffers::Offset CreateFooBarContainer( flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::Offset>> list = 0, bool initialized = false, benchmarks_flatbuffers::Enum fruit = benchmarks_flatbuffers::Enum_Apples, flatbuffers::Offset location = 0) { FooBarContainerBuilder builder_(_fbb); builder_.add_location(location); builder_.add_list(list); builder_.add_fruit(fruit); builder_.add_initialized(initialized); return builder_.Finish(); } inline flatbuffers::Offset CreateFooBarContainerDirect( flatbuffers::FlatBufferBuilder &_fbb, const std::vector> *list = nullptr, bool initialized = false, benchmarks_flatbuffers::Enum fruit = benchmarks_flatbuffers::Enum_Apples, const char *location = nullptr) { auto list__ = list ? _fbb.CreateVector>(*list) : 0; auto location__ = location ? _fbb.CreateString(location) : 0; return benchmarks_flatbuffers::CreateFooBarContainer( _fbb, list__, initialized, fruit, location__); } inline const benchmarks_flatbuffers::FooBarContainer *GetFooBarContainer(const void *buf) { return flatbuffers::GetRoot(buf); } inline const benchmarks_flatbuffers::FooBarContainer *GetSizePrefixedFooBarContainer(const void *buf) { return flatbuffers::GetSizePrefixedRoot(buf); } inline bool VerifyFooBarContainerBuffer( flatbuffers::Verifier &verifier) { return verifier.VerifyBuffer(nullptr); } inline bool VerifySizePrefixedFooBarContainerBuffer( flatbuffers::Verifier &verifier) { return verifier.VerifySizePrefixedBuffer(nullptr); } inline void FinishFooBarContainerBuffer( flatbuffers::FlatBufferBuilder &fbb, flatbuffers::Offset root) { fbb.Finish(root); } inline void FinishSizePrefixedFooBarContainerBuffer( flatbuffers::FlatBufferBuilder &fbb, flatbuffers::Offset root) { fbb.FinishSizePrefixed(root); } } // namespace benchmarks_flatbuffers #endif // FLATBUFFERS_GENERATED_BENCH_BENCHMARKS_FLATBUFFERS_H_ flatbuffers-24.12.23/benchmarks/cpp/flatbuffers/fb_bench.cpp000066400000000000000000000046061473234705300237220ustar00rootroot00000000000000#include "benchmarks/cpp/flatbuffers/fb_bench.h" #include #include #include "benchmarks/cpp/bench.h" #include "benchmarks/cpp/flatbuffers/bench_generated.h" #include "flatbuffers/flatbuffers.h" using namespace flatbuffers; using namespace benchmarks_flatbuffers; namespace { struct FlatBufferBench : Bench { explicit FlatBufferBench(int64_t initial_size, Allocator *allocator) : fbb(initial_size, allocator, false) {} uint8_t *Encode(void *, int64_t &len) override { fbb.Clear(); const int kVectorLength = 3; Offset vec[kVectorLength]; for (int i = 0; i < kVectorLength; ++i) { Foo foo(0xABADCAFEABADCAFE + i, 10000 + i, '@' + i, 1000000 + i); Bar bar(foo, 123456 + i, 3.14159f + i, 10000 + i); auto name = fbb.CreateString("Hello, World!"); auto foobar = CreateFooBar(fbb, &bar, name, 3.1415432432445543543 + i, '!' + i); vec[i] = foobar; } auto location = fbb.CreateString("http://google.com/flatbuffers/"); auto foobarvec = fbb.CreateVector(vec, kVectorLength); auto foobarcontainer = CreateFooBarContainer(fbb, foobarvec, true, Enum_Bananas, location); fbb.Finish(foobarcontainer); len = fbb.GetSize(); return fbb.GetBufferPointer(); } int64_t Use(void *decoded) override { sum = 0; auto foobarcontainer = GetFooBarContainer(decoded); sum = 0; Add(foobarcontainer->initialized()); Add(foobarcontainer->location()->Length()); Add(foobarcontainer->fruit()); for (unsigned int i = 0; i < foobarcontainer->list()->Length(); i++) { auto foobar = foobarcontainer->list()->Get(i); Add(foobar->name()->Length()); Add(foobar->postfix()); Add(static_cast(foobar->rating())); auto bar = foobar->sibling(); Add(static_cast(bar->ratio())); Add(bar->size()); Add(bar->time()); auto &foo = bar->parent(); Add(foo.count()); Add(foo.id()); Add(foo.length()); Add(foo.prefix()); } return sum; } void *Decode(void *buffer, int64_t) override { return buffer; } void Dealloc(void *) override {}; FlatBufferBuilder fbb; }; } // namespace std::unique_ptr NewFlatBuffersBench(int64_t initial_size, Allocator *allocator) { return std::unique_ptr( new FlatBufferBench(initial_size, allocator)); } flatbuffers-24.12.23/benchmarks/cpp/flatbuffers/fb_bench.h000066400000000000000000000012011473234705300233530ustar00rootroot00000000000000#ifndef BENCHMARKS_CPP_FLATBUFFERS_FB_BENCH_H_ #define BENCHMARKS_CPP_FLATBUFFERS_FB_BENCH_H_ #include #include #include "benchmarks/cpp/bench.h" #include "include/flatbuffers/flatbuffers.h" struct StaticAllocator : public flatbuffers::Allocator { explicit StaticAllocator(uint8_t *buffer) : buffer_(buffer) {} uint8_t *allocate(size_t) override { return buffer_; } void deallocate(uint8_t *, size_t) override {} uint8_t *buffer_; }; std::unique_ptr NewFlatBuffersBench( int64_t initial_size = 1024, flatbuffers::Allocator *allocator = nullptr); #endif // BENCHMARKS_CPP_FLATBUFFERS_FB_BENCH_H_flatbuffers-24.12.23/benchmarks/cpp/raw/000077500000000000000000000000001473234705300177505ustar00rootroot00000000000000flatbuffers-24.12.23/benchmarks/cpp/raw/raw_bench.cpp000066400000000000000000000053221473234705300224060ustar00rootroot00000000000000#include "benchmarks/cpp/raw/raw_bench.h" #include #include #include #include "benchmarks/cpp/bench.h" namespace { const int64_t kStringLength = 32; const int64_t kVectorLength = 3; enum Enum { Apples, Pears, Bananas }; struct Foo { int64_t id; short count; char prefix; int length; }; struct Bar { Foo parent; int time; float ratio; unsigned short size; }; struct FooBar { Bar sibling; // We have to stick this in, otherwise strlen() will make it slower than // FlatBuffers: int name_len; char name[kStringLength]; double rating; unsigned char postfix; }; struct FooBarContainer { FooBar list[kVectorLength]; // 3 copies of the above bool initialized; Enum fruit; int location_len; char location[kStringLength]; }; struct RawBench : Bench { uint8_t *Encode(void *buf, int64_t &len) override { FooBarContainer *fbc = new (buf) FooBarContainer; strcpy(fbc->location, "http://google.com/flatbuffers/"); // Unsafe eek! fbc->location_len = (int)strlen(fbc->location); fbc->fruit = Bananas; fbc->initialized = true; for (int i = 0; i < kVectorLength; i++) { // We add + i to not make these identical copies for a more realistic // compression test. auto &foobar = fbc->list[i]; foobar.rating = 3.1415432432445543543 + i; foobar.postfix = '!' + i; strcpy(foobar.name, "Hello, World!"); foobar.name_len = (int)strlen(foobar.name); auto &bar = foobar.sibling; bar.ratio = 3.14159f + i; bar.size = 10000 + i; bar.time = 123456 + i; auto &foo = bar.parent; foo.id = 0xABADCAFEABADCAFE + i; foo.count = 10000 + i; foo.length = 1000000 + i; foo.prefix = '@' + i; } len = sizeof(FooBarContainer); return reinterpret_cast(fbc); }; int64_t Use(void *decoded) override { auto foobarcontainer = reinterpret_cast(decoded); sum = 0; Add(foobarcontainer->initialized); Add(foobarcontainer->location_len); Add(foobarcontainer->fruit); for (unsigned int i = 0; i < kVectorLength; i++) { auto foobar = &foobarcontainer->list[i]; Add(foobar->name_len); Add(foobar->postfix); Add(static_cast(foobar->rating)); auto bar = &foobar->sibling; Add(static_cast(bar->ratio)); Add(bar->size); Add(bar->time); auto &foo = bar->parent; Add(foo.count); Add(foo.id); Add(foo.length); Add(foo.prefix); } return sum; } void *Decode(void *buf, int64_t) override { return buf; } void Dealloc(void *) override{}; }; } // namespace std::unique_ptr NewRawBench() { return std::unique_ptr(new RawBench()); } flatbuffers-24.12.23/benchmarks/cpp/raw/raw_bench.h000066400000000000000000000003301473234705300220450ustar00rootroot00000000000000#ifndef BENCHMARKS_CPP_RAW_RAW_BENCH_H_ #define BENCHMARKS_CPP_RAW_RAW_BENCH_H_ #include #include "benchmarks/cpp/bench.h" std::unique_ptr NewRawBench(); #endif // BENCHMARKS_CPP_RAW_RAW_BENCH_H_flatbuffers-24.12.23/benchmarks/swift/000077500000000000000000000000001473234705300175315ustar00rootroot00000000000000flatbuffers-24.12.23/benchmarks/swift/Benchmarks/000077500000000000000000000000001473234705300216065ustar00rootroot00000000000000flatbuffers-24.12.23/benchmarks/swift/Benchmarks/FlatbuffersBenchmarks/000077500000000000000000000000001473234705300260475ustar00rootroot00000000000000flatbuffers-24.12.23/benchmarks/swift/Benchmarks/FlatbuffersBenchmarks/FlatbuffersBenchmarks.swift000066400000000000000000000135211473234705300333700ustar00rootroot00000000000000/* * Copyright 2024 Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import Benchmark import CoreFoundation import FlatBuffers @usableFromInline struct AA: NativeStruct { public init(a: Double, b: Double) { self.a = a self.b = b } var a: Double var b: Double } let benchmarks = { let ints: [Int] = Array(repeating: 42, count: 100) let bytes: [UInt8] = Array(repeating: 42, count: 100) let str10 = (0...9).map { _ -> String in "x" }.joined() let str100 = (0...99).map { _ -> String in "x" }.joined() let array: [AA] = [ AA(a: 2.4, b: 2.4), AA(a: 2.4, b: 2.4), AA(a: 2.4, b: 2.4), AA(a: 2.4, b: 2.4), AA(a: 2.4, b: 2.4), ] let metrics: [BenchmarkMetric] = [ .cpuTotal, .wallClock, .mallocCountTotal, .releaseCount, .peakMemoryResident, ] let maxIterations = 1_000_000 let maxDuration: Duration = .seconds(3) let singleConfiguration: Benchmark.Configuration = .init( metrics: metrics, warmupIterations: 1, scalingFactor: .one, maxDuration: maxDuration, maxIterations: maxIterations) let kiloConfiguration: Benchmark.Configuration = .init( metrics: metrics, warmupIterations: 1, scalingFactor: .kilo, maxDuration: maxDuration, maxIterations: maxIterations) let megaConfiguration: Benchmark.Configuration = .init( metrics: metrics, warmupIterations: 1, scalingFactor: .mega, maxDuration: maxDuration, maxIterations: maxIterations) Benchmark.defaultConfiguration = megaConfiguration Benchmark("Allocating 1GB", configuration: singleConfiguration) { benchmark in for _ in benchmark.scaledIterations { blackHole(FlatBufferBuilder(initialSize: 1_024_000_000)) } } Benchmark("Clearing 1GB", configuration: singleConfiguration) { benchmark in var fb = FlatBufferBuilder(initialSize: 1_024_000_000) benchmark.startMeasurement() for _ in benchmark.scaledIterations { blackHole(fb.clear()) } } Benchmark("Strings 10") { benchmark in var fb = FlatBufferBuilder(initialSize: 1<<20) benchmark.startMeasurement() for _ in benchmark.scaledIterations { blackHole(fb.create(string: str10)) } } Benchmark("Strings 100") { benchmark in var fb = FlatBufferBuilder(initialSize: 1<<20) benchmark.startMeasurement() for _ in benchmark.scaledIterations { blackHole(fb.create(string: str100)) } } Benchmark("Vector 1 Bytes") { benchmark in var fb = FlatBufferBuilder(initialSize: 1<<20) benchmark.startMeasurement() for _ in benchmark.scaledIterations { blackHole(fb.createVector(bytes: bytes)) } } Benchmark("Vector 1 Ints") { benchmark in var fb = FlatBufferBuilder(initialSize: 1<<20) benchmark.startMeasurement() for _ in benchmark.scaledIterations { blackHole(fb.createVector(ints)) } } Benchmark("Vector 100 Ints") { benchmark in var fb = FlatBufferBuilder(initialSize: 1<<20) benchmark.startMeasurement() for i in benchmark.scaledIterations { blackHole(fb.createVector(ints)) } } Benchmark("Vector 100 Bytes") { benchmark in var fb = FlatBufferBuilder(initialSize: 1<<20) benchmark.startMeasurement() for i in benchmark.scaledIterations { blackHole(fb.createVector(bytes)) } } Benchmark("Vector 100 ContiguousBytes") { benchmark in var fb = FlatBufferBuilder(initialSize: 1<<20) benchmark.startMeasurement() for i in benchmark.scaledIterations { blackHole(fb.createVector(bytes: bytes)) } } Benchmark( "FlatBufferBuilder Add", configuration: kiloConfiguration) { benchmark in var fb = FlatBufferBuilder(initialSize: 1024 * 1024 * 32) benchmark.startMeasurement() for _ in benchmark.scaledIterations { let off = fb.create(string: "T") let s = fb.startTable(with: 4) fb.add(element: 3.2, def: 0, at: 2) fb.add(element: 4.2, def: 0, at: 4) fb.add(element: 5.2, def: 0, at: 6) fb.add(offset: off, at: 8) blackHole(fb.endTable(at: s)) } } Benchmark("Structs") { benchmark in let rawSize = ((16 * 5) * benchmark.scaledIterations.count) / 1024 var fb = FlatBufferBuilder(initialSize: Int32(rawSize * 1600)) var offsets: [Offset] = [] benchmark.startMeasurement() for _ in benchmark.scaledIterations { let vector = fb.createVector( ofStructs: array) let start = fb.startTable(with: 1) fb.add(offset: vector, at: 4) offsets.append(Offset(offset: fb.endTable(at: start))) } let vector = fb.createVector(ofOffsets: offsets) let start = fb.startTable(with: 1) fb.add(offset: vector, at: 4) let root = Offset(offset: fb.endTable(at: start)) fb.finish(offset: root) } Benchmark("Vector of Offsets") { benchmark in let rawSize = ((16 * 5) * benchmark.scaledIterations.count) / 1024 var fb = FlatBufferBuilder(initialSize: Int32(rawSize * 1600)) benchmark.startMeasurement() for _ in benchmark.scaledIterations { let offsets = [ fb.create(string: "T"), fb.create(string: "2"), fb.create(string: "3"), ] let off = fb.createVector(ofOffsets: [ fb.createVector(ofOffsets: offsets), fb.createVector(ofOffsets: offsets), ]) let s = fb.startTable(with: 2) fb.add(offset: off, at: 2) blackHole(fb.endTable(at: s)) } } } flatbuffers-24.12.23/benchmarks/swift/Package.swift000066400000000000000000000024111473234705300221400ustar00rootroot00000000000000// swift-tools-version:5.8 /* * Copyright 2020 Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import PackageDescription let package = Package( name: "benchmarks", platforms: [ .macOS(.v13), ], dependencies: [ .package(path: "../.."), .package( url: "https://github.com/ordo-one/package-benchmark", from: "1.27.0"), ], targets: [ .executableTarget( name: "FlatbuffersBenchmarks", dependencies: [ .product(name: "FlatBuffers", package: "flatbuffers"), .product(name: "Benchmark", package: "package-benchmark"), ], path: "Benchmarks/FlatbuffersBenchmarks", plugins: [ .plugin(name: "BenchmarkPlugin", package: "package-benchmark"), ]), ]) flatbuffers-24.12.23/benchmarks/swift/README.md000066400000000000000000000002721473234705300210110ustar00rootroot00000000000000# Benchmarks To open the benchmarks in xcode use: `open --env BENCHMARK_DISABLE_JEMALLOC=true Package.swift` or running them directly within terminal using: `swift package benchmark`flatbuffers-24.12.23/build_defs.bzl000066400000000000000000000256051473234705300171010ustar00rootroot00000000000000# Description: # BUILD rules for generating flatbuffer files in various languages. """ Rules for building C++ flatbuffers with Bazel. """ load("@rules_cc//cc:defs.bzl", "cc_library") TRUE_FLATC_PATH = "@com_github_google_flatbuffers//:flatc" DEFAULT_INCLUDE_PATHS = [ "./", "$(GENDIR)", "$(BINDIR)", "$(execpath @com_github_google_flatbuffers//:flatc).runfiles/com_github_google_flatbuffers", ] def default_include_paths(flatc_path): return [ "./", "$(GENDIR)", "$(BINDIR)", "$(execpath %s).runfiles/com_github_google_flatbuffers" % (flatc_path), ] DEFAULT_FLATC_ARGS = [ "--gen-object-api", "--gen-compare", "--no-includes", "--gen-mutable", "--reflect-names", "--cpp-ptr-type flatbuffers::unique_ptr", ] def flatbuffer_library_public( name, srcs, outs, language_flag, out_prefix = "", includes = [], include_paths = None, flatc_args = DEFAULT_FLATC_ARGS, reflection_name = "", reflection_visibility = None, compatible_with = None, restricted_to = None, target_compatible_with = None, flatc_path = "@com_github_google_flatbuffers//:flatc", output_to_bindir = False, tools = None, extra_env = None, **kwargs): """Generates code files for reading/writing the given flatbuffers in the requested language using the public compiler. Args: name: Rule name. srcs: Source .fbs files. Sent in order to the compiler. outs: Output files from flatc. language_flag: Target language flag. One of [-c, -j, -js]. out_prefix: Prepend this path to the front of all generated files except on single source targets. Usually is a directory name. includes: Optional, list of filegroups of schemas that the srcs depend on. include_paths: Optional, list of paths the includes files can be found in. flatc_args: Optional, list of additional arguments to pass to flatc. reflection_name: Optional, if set this will generate the flatbuffer reflection binaries for the schemas. reflection_visibility: The visibility of the generated reflection Fileset. output_to_bindir: Passed to genrule for output to bin directory. compatible_with: Optional, The list of environments this rule can be built for, in addition to default-supported environments. restricted_to: Optional, The list of environments this rule can be built for, instead of default-supported environments. target_compatible_with: Optional, The list of target platform constraints to use. flatc_path: Bazel target corresponding to the flatc compiler to use. output_to_bindir: Passed to genrule for output to bin directory. tools: Optional, passed to genrule for list of tools to make available during the action. extra_env: Optional, must be a string of "VAR1=VAL1 VAR2=VAL2". These get set as environment variables that "flatc_path" sees. **kwargs: Passed to the underlying genrule. This rule creates a filegroup(name) with all generated source files, and optionally a Fileset([reflection_name]) with all generated reflection binaries. """ reflection_include_paths = include_paths if include_paths == None: include_paths = default_include_paths(flatc_path) include_paths_cmd = ["-I %s" % (s) for s in include_paths] extra_env = extra_env or "" # '$(@D)' when given a single source target will give the appropriate # directory. Appending 'out_prefix' is only necessary when given a build # target with multiple sources. output_directory = ( ("-o $(@D)/%s" % (out_prefix)) if len(srcs) > 1 else ("-o $(@D)") ) genrule_cmd = " ".join([ "SRCS=($(SRCS));", "for f in $${SRCS[@]:0:%s}; do" % len(srcs), "OUTPUT_FILE=\"$(OUTS)\" %s $(location %s)" % (extra_env, flatc_path), " ".join(include_paths_cmd), " ".join(flatc_args), language_flag, output_directory, "$$f;", "done", ]) native.genrule( name = name, srcs = srcs + includes, outs = outs, output_to_bindir = output_to_bindir, tools = (tools or []) + [flatc_path], cmd = genrule_cmd, compatible_with = compatible_with, target_compatible_with = target_compatible_with, restricted_to = restricted_to, message = "Generating flatbuffer files for %s:" % (name), **kwargs ) if reflection_name: if reflection_include_paths == None: reflection_include_paths = default_include_paths(TRUE_FLATC_PATH) reflection_include_paths_cmd = ["-I %s" % (s) for s in reflection_include_paths] reflection_genrule_cmd = " ".join([ "SRCS=($(SRCS));", "for f in $${SRCS[@]:0:%s}; do" % len(srcs), "$(location %s)" % (TRUE_FLATC_PATH), "-b --schema", " ".join(flatc_args), " ".join(reflection_include_paths_cmd), language_flag, output_directory, "$$f;", "done", ]) reflection_outs = [ (out_prefix + "%s.bfbs") % (s.replace(".fbs", "").split("/")[-1]) for s in srcs ] native.genrule( name = "%s_srcs" % reflection_name, srcs = srcs + includes, outs = reflection_outs, output_to_bindir = output_to_bindir, tools = [TRUE_FLATC_PATH], compatible_with = compatible_with, restricted_to = restricted_to, target_compatible_with = target_compatible_with, cmd = reflection_genrule_cmd, message = "Generating flatbuffer reflection binary for %s:" % (name), visibility = reflection_visibility, ) native.filegroup( name = "%s_out" % reflection_name, srcs = reflection_outs, visibility = reflection_visibility, compatible_with = compatible_with, restricted_to = restricted_to, ) def flatbuffer_cc_library( name, srcs, srcs_filegroup_name = "", outs = [], out_prefix = "", deps = [], includes = [], include_paths = None, cc_include_paths = [], flatc_args = DEFAULT_FLATC_ARGS, visibility = None, compatible_with = None, restricted_to = None, target_compatible_with = None, srcs_filegroup_visibility = None, gen_reflections = False): """A cc_library with the generated reader/writers for the given flatbuffer definitions. Args: name: Rule name. srcs: Source .fbs files. Sent in order to the compiler. srcs_filegroup_name: Name of the output filegroup that holds srcs. Pass this filegroup into the `includes` parameter of any other flatbuffer_cc_library that depends on this one's schemas. outs: Additional outputs expected to be generated by flatc. out_prefix: Prepend this path to the front of all generated files. Usually is a directory name. deps: Optional, list of other flatbuffer_cc_library's to depend on. Cannot be specified alongside includes. includes: Optional, list of filegroups of schemas that the srcs depend on. Use of this is discouraged, and may be deprecated. include_paths: Optional, list of paths the includes files can be found in. cc_include_paths: Optional, list of paths to add to the cc_library includes attribute. flatc_args: Optional list of additional arguments to pass to flatc (e.g. --gen-mutable). visibility: The visibility of the generated cc_library. By default, use the default visibility of the project. srcs_filegroup_visibility: The visibility of the generated srcs filegroup. By default, use the value of the visibility parameter above. gen_reflections: Optional, if true this will generate the flatbuffer reflection binaries for the schemas. compatible_with: Optional, The list of environments this rule can be built for, in addition to default-supported environments. restricted_to: Optional, The list of environments this rule can be built for, instead of default-supported environments. target_compatible_with: Optional, The list of target platform constraints to use. This produces: filegroup([name]_srcs): all generated .h files. filegroup(srcs_filegroup_name if specified, or [name]_includes if not): Other flatbuffer_cc_library's can pass this in for their `includes` parameter, if they depend on the schemas in this library. Fileset([name]_reflection): (Optional) all generated reflection binaries. cc_library([name]): library with sources and flatbuffers deps. """ output_headers = [ (out_prefix + "%s_generated.h") % (s.replace(".fbs", "").split("/")[-1].split(":")[-1]) for s in srcs ] if deps and includes: # There is no inherent reason we couldn't support both, but this discourages # use of includes without good reason. fail("Cannot specify both deps and include in flatbuffer_cc_library.") if deps: includes = [d + "_includes" for d in deps] reflection_name = "%s_reflection" % name if gen_reflections else "" srcs_lib = "%s_srcs" % (name) flatbuffer_library_public( name = srcs_lib, srcs = srcs, outs = outs + output_headers, language_flag = "-c", out_prefix = out_prefix, includes = includes, include_paths = include_paths, flatc_args = flatc_args, compatible_with = compatible_with, restricted_to = restricted_to, target_compatible_with = target_compatible_with, reflection_name = reflection_name, reflection_visibility = visibility, ) cc_library( name = name, hdrs = [ ":" + srcs_lib, ], srcs = [ ":" + srcs_lib, ], features = [ "-parse_headers", ], deps = [ "@com_github_google_flatbuffers//:runtime_cc", "@com_github_google_flatbuffers//:flatbuffers", ] + deps, includes = cc_include_paths, compatible_with = compatible_with, restricted_to = restricted_to, target_compatible_with = target_compatible_with, linkstatic = 1, visibility = visibility, ) # A filegroup for the `srcs`. That is, all the schema files for this # Flatbuffer set. native.filegroup( name = srcs_filegroup_name if srcs_filegroup_name else "%s_includes" % (name), srcs = srcs + includes, compatible_with = compatible_with, restricted_to = restricted_to, visibility = srcs_filegroup_visibility if srcs_filegroup_visibility != None else visibility, ) flatbuffers-24.12.23/composer.json000066400000000000000000000005711473234705300170050ustar00rootroot00000000000000{ "name": "google/flatbuffers", "type": "library", "description": "FlatBuffers for PHP", "keywords": ["google", "flatbuffers", "serialization"], "homepage": "https://github.com/google/flatbuffers", "license": "Apache-2.0", "require": { "php": ">=5.4" }, "require-dev": { }, "autoload": { "psr-4": { "Google\\FlatBuffers\\": "php" } } }flatbuffers-24.12.23/conan/000077500000000000000000000000001473234705300153565ustar00rootroot00000000000000flatbuffers-24.12.23/conan/CMakeLists.txt000066400000000000000000000005571473234705300201250ustar00rootroot00000000000000cmake_minimum_required(VERSION 2.8) message(STATUS "Conan FlatBuffers Wrapper") include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup() if (WIN32 AND MSVC_LIKE AND FLATBUFFERS_BUILD_SHAREDLIB) set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) endif(WIN32 AND MSVC_LIKE AND FLATBUFFERS_BUILD_SHAREDLIB) include(${CMAKE_SOURCE_DIR}/CMakeListsOriginal.txt) flatbuffers-24.12.23/conan/build.py000066400000000000000000000033251473234705300170320ustar00rootroot00000000000000#!/usr/bin/env python # -*- coding: utf-8 -*- import os import re import subprocess from cpt.packager import ConanMultiPackager def get_branch(): try: for line in subprocess.check_output("git branch", shell=True).decode().splitlines(): line = line.strip() if line.startswith("*") and " (HEAD detached" not in line: return line.replace("*", "", 1).strip() return "" except Exception: pass return "" def get_version(): version = get_branch() match = re.search(r"v(\d+\.\d+\.\d+.*)", version) if match: return match.group(1) return version def get_reference(username): return "flatbuffers/{}@google/stable".format(get_version()) if __name__ == "__main__": login_username = os.getenv("CONAN_LOGIN_USERNAME", "aardappel") username = os.getenv("CONAN_USERNAME", "google") upload = os.getenv("CONAN_UPLOAD", "https://api.bintray.com/conan/aardappel/flatbuffers") stable_branch_pattern = os.getenv("CONAN_STABLE_BRANCH_PATTERN", r"v\d+\.\d+\.\d+.*") test_folder = os.getenv("CPT_TEST_FOLDER", os.path.join("conan", "test_package")) upload_only_when_stable = os.getenv("CONAN_UPLOAD_ONLY_WHEN_STABLE", True) builder = ConanMultiPackager(reference=get_reference(username), username=username, login_username=login_username, upload=upload, stable_branch_pattern=stable_branch_pattern, upload_only_when_stable=upload_only_when_stable, test_folder=test_folder) builder.add_common_builds(pure_c=False) builder.run() flatbuffers-24.12.23/conan/test_package/000077500000000000000000000000001473234705300200105ustar00rootroot00000000000000flatbuffers-24.12.23/conan/test_package/CMakeLists.txt000066400000000000000000000004551473234705300225540ustar00rootroot00000000000000project(test_package CXX) cmake_minimum_required(VERSION 2.8.11) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup() add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) flatbuffers-24.12.23/conan/test_package/conanfile.py000066400000000000000000000010531473234705300223170ustar00rootroot00000000000000#!/usr/bin/env python # -*- coding: utf-8 -*- from conans import ConanFile, CMake import os class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" generators = "cmake" def build(self): cmake = CMake(self) cmake.configure() cmake.build() def test(self): bin_path = os.path.join("bin", "test_package") self.run(bin_path, run_environment=True) self.run("flatc --version", run_environment=True) self.run("flathash fnv1_16 conan", run_environment=True) flatbuffers-24.12.23/conan/test_package/test_package.cpp000066400000000000000000000020601473234705300231440ustar00rootroot00000000000000/* * Copyright 2018 Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include #include #include "flatbuffers/util.h" // Test to validate Conan package generated int main(int /*argc*/, const char * /*argv*/ []) { const std::string filename("conanbuildinfo.cmake"); if (flatbuffers::FileExists(filename.c_str())) { std::cout << "File " << filename << " exists.\n"; } else { std::cout << "File " << filename << " does not exist.\n"; return EXIT_FAILURE; } return EXIT_SUCCESS; } flatbuffers-24.12.23/conanfile.py000066400000000000000000000057731473234705300166040ustar00rootroot00000000000000#!/usr/bin/env python # -*- coding: utf-8 -*- """Conan recipe package for Google FlatBuffers """ import os import shutil from conans import ConanFile, CMake, tools class FlatbuffersConan(ConanFile): name = "flatbuffers" license = "Apache-2.0" url = "https://github.com/google/flatbuffers" homepage = "http://google.github.io/flatbuffers/" author = "Wouter van Oortmerssen" topics = ("conan", "flatbuffers", "serialization", "rpc", "json-parser") description = "Memory Efficient Serialization Library" settings = "os", "compiler", "build_type", "arch" options = {"shared": [True, False], "fPIC": [True, False]} default_options = {"shared": False, "fPIC": True} generators = "cmake" exports = "LICENSE" exports_sources = ["CMake/*", "include/*", "src/*", "grpc/*", "CMakeLists.txt", "conan/CMakeLists.txt"] def source(self): """Wrap the original CMake file to call conan_basic_setup """ shutil.move("CMakeLists.txt", "CMakeListsOriginal.txt") shutil.move(os.path.join("conan", "CMakeLists.txt"), "CMakeLists.txt") def config_options(self): """Remove fPIC option on Windows platform """ if self.settings.os == "Windows": self.options.remove("fPIC") def configure_cmake(self): """Create CMake instance and execute configure step """ cmake = CMake(self) cmake.definitions["FLATBUFFERS_BUILD_TESTS"] = False cmake.definitions["FLATBUFFERS_BUILD_SHAREDLIB"] = self.options.shared cmake.definitions["FLATBUFFERS_BUILD_FLATLIB"] = not self.options.shared cmake.configure() return cmake def build(self): """Configure, build and install FlatBuffers using CMake. """ cmake = self.configure_cmake() cmake.build() def package(self): """Copy Flatbuffers' artifacts to package folder """ cmake = self.configure_cmake() cmake.install() self.copy(pattern="LICENSE", dst="licenses") self.copy(pattern="FindFlatBuffers.cmake", dst=os.path.join("lib", "cmake", "flatbuffers"), src="CMake") self.copy(pattern="flathash*", dst="bin", src="bin") self.copy(pattern="flatc*", dst="bin", src="bin") if self.settings.os == "Windows" and self.options.shared: if self.settings.compiler == "Visual Studio": shutil.move(os.path.join(self.package_folder, "lib", "%s.dll" % self.name), os.path.join(self.package_folder, "bin", "%s.dll" % self.name)) elif self.settings.compiler == "gcc": shutil.move(os.path.join(self.package_folder, "lib", "lib%s.dll" % self.name), os.path.join(self.package_folder, "bin", "lib%s.dll" % self.name)) def package_info(self): """Collect built libraries names and solve flatc path. """ self.cpp_info.libs = tools.collect_libs(self) self.user_info.flatc = os.path.join(self.package_folder, "bin", "flatc") flatbuffers-24.12.23/dart/000077500000000000000000000000001473234705300152125ustar00rootroot00000000000000flatbuffers-24.12.23/dart/CHANGELOG.md000066400000000000000000000035171473234705300170310ustar00rootroot00000000000000# Changelog ## 23.5.26 - omit type annotationes for local variables (#7067, #7069, #7070) - remove BSD 3-clause license (#7073) - correctly parse lists of enums (#7157) - align naming conventions for generated code (#7187) - add `putBool` to fix errors when serializing structs with booleans (#7359) - fix handling of +/-inf defaults in codegen (#7588) - fix import issues in generated code (#7621) - Fix incorrect storage of floats as ints in some cases (#7703) - add final modifiers to the library implementation (#7943) ## 2.0.5 - switch to null safety (#6696) - add Object APIs (pack/unpack) (#6682, #6723, #6846) - add custom builder buffer allocator support (#6711) - add `Builder.size()` - finished buffer size (#6403) - make `writeString()` argument non-nullable (#6737) - make tables fixed size (expect the number of fields when creating) (#6735) - make table deduplication optional (param `deduplicateTables`) (#6734) - change `Builder.reset()` to reuse an existing buffer (#6661) - change table building to assert() instead of exceptions (#6754) - optimize `writeString()` for ASCII (param `asciiOptimization`) (#6736) - change `StringReader` to make ASCII optimization optional (param `asciiOptimization`) (#6758) - change `[byte]` and `[ubyte]` representation to `dart:typed_data` `Int8List` and `Uint8List` (#6839) - rename `lowFinish()` to `buffer` getter (#6712) - fix `Builder._writeString()` - always write trailing zero byte (#6390) - fix `Builder.reset()` - clear vTables (#6386) - make sure added padding is zeroed, same as in C++ (#6716) - many performance improvements (#6755) ## 1.9.2 - Ensure `_writeString` adds enough padding to null terminate strings. ## 1.9.1 - Changed constant identifiers to be compatible with Dart 2.x - No longer supports Dart 1.x ## 1.9.0 - Initial release, supports Dart 1.x and many dev versions of Dart 2.x flatbuffers-24.12.23/dart/LICENSE000066400000000000000000000261151473234705300162240ustar00rootroot00000000000000 Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright 2014 Google Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. flatbuffers-24.12.23/dart/README.md000066400000000000000000000017061473234705300164750ustar00rootroot00000000000000# FlatBuffers for Dart This package is used to read and write [FlatBuffers](https://google.github.io/flatbuffers/). Most consumers will want to use the [`flatc` - FlatBuffer compiler](https://github.com/google/flatbuffers) binary for your platform. You can download the flatc version matching your dart package version from [GitHub releases](https://github.com/google/flatbuffers/releases). The FlatBuffer compiler `flatc` reads a FlatBuffers IDL schema and generates Dart code. The generated classes can be used to read or write binary data/files that are interoperable with other languages and platforms supported by FlatBuffers, as illustrated in the `example.dart` in the examples folder. For more details and documentation, head over to the official site and read the [Tutorial](https://google.github.io/flatbuffers/flatbuffers_guide_tutorial.html) and how to [use FlatBuffers in Dart](https://google.github.io/flatbuffers/flatbuffers_guide_use_dart.html). flatbuffers-24.12.23/dart/analysis_options.yaml000066400000000000000000000000501473234705300214670ustar00rootroot00000000000000include: package:lints/recommended.yaml flatbuffers-24.12.23/dart/example/000077500000000000000000000000001473234705300166455ustar00rootroot00000000000000flatbuffers-24.12.23/dart/example/example.dart000066400000000000000000000115511473234705300211570ustar00rootroot00000000000000/* * Copyright 2018 Dan Field. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import 'package:flat_buffers/flat_buffers.dart' as fb; import './monster_my_game.sample_generated.dart' as my_game; // Example how to use FlatBuffers to create and read binary buffers. void main() { builderTest(); objectBuilderTest(); } void builderTest() { final builder = fb.Builder(initialSize: 1024); final int? weaponOneName = builder.writeString("Sword"); final int weaponOneDamage = 3; final int? weaponTwoName = builder.writeString("Axe"); final int weaponTwoDamage = 5; final swordBuilder = my_game.WeaponBuilder(builder) ..begin() ..addNameOffset(weaponOneName) ..addDamage(weaponOneDamage); final int sword = swordBuilder.finish(); final axeBuilder = my_game.WeaponBuilder(builder) ..begin() ..addNameOffset(weaponTwoName) ..addDamage(weaponTwoDamage); final int axe = axeBuilder.finish(); // Serialize a name for our monster, called "Orc". final int? name = builder.writeString('Orc'); // Create a list representing the inventory of the Orc. Each number // could correspond to an item that can be claimed after he is slain. final List treasure = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; final inventory = builder.writeListUint8(treasure); final weapons = builder.writeList([sword, axe]); // Struct builders are very easy to reuse. final vec3Builder = my_game.Vec3Builder(builder); vec3Builder.finish(4.0, 5.0, 6.0); vec3Builder.finish(1.0, 2.0, 3.0); // Set his hit points to 300 and his mana to 150. final int hp = 300; final int mana = 150; final monster = my_game.MonsterBuilder(builder) ..begin() ..addNameOffset(name) ..addInventoryOffset(inventory) ..addWeaponsOffset(weapons) ..addEquippedType(my_game.EquipmentTypeId.Weapon) ..addEquippedOffset(axe) ..addHp(hp) ..addMana(mana) ..addPos(vec3Builder.finish(1.0, 2.0, 3.0)) ..addColor(my_game.Color.Red); final int monsteroff = monster.finish(); builder.finish(monsteroff); if (verify(builder.buffer)) { print( "The FlatBuffer was successfully created with a builder and verified!"); } } void objectBuilderTest() { // Create the builder here so we can use it for both weapons and equipped // the actual data will only be written to the buffer once. var axe = my_game.WeaponObjectBuilder(name: 'Axe', damage: 5); var monsterBuilder = my_game.MonsterObjectBuilder( pos: my_game.Vec3ObjectBuilder(x: 1.0, y: 2.0, z: 3.0), mana: 150, hp: 300, name: 'Orc', inventory: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], color: my_game.Color.Red, weapons: [my_game.WeaponObjectBuilder(name: 'Sword', damage: 3), axe], equippedType: my_game.EquipmentTypeId.Weapon, equipped: axe, ); var buffer = monsterBuilder.toBytes(); // We now have a FlatBuffer we can store on disk or send over a network. // ** file/network code goes here :) ** // Instead, we're going to access it right away (as if we just received it). if (verify(buffer)) { print( "The FlatBuffer was successfully created with an object builder and verified!"); } } bool verify(List buffer) { // Get access to the root: var monster = my_game.Monster(buffer); // Get and test some scalar types from the FlatBuffer. assert(monster.hp == 80); assert(monster.mana == 150); // default assert(monster.name == "MyMonster"); // Get and test a field of the FlatBuffer's `struct`. var pos = monster.pos!; assert(pos.z == 3.0); // Get a test an element from the `inventory` FlatBuffer's `vector`. var inv = monster.inventory!; assert(inv.length == 10); assert(inv[9] == 9); // Get and test the `weapons` FlatBuffers's `vector`. var expectedWeaponNames = ["Sword", "Axe"]; var expectedWeaponDamages = [3, 5]; var weps = monster.weapons!; for (int i = 0; i < weps.length; i++) { assert(weps[i].name == expectedWeaponNames[i]); assert(weps[i].damage == expectedWeaponDamages[i]); } // Get and test the `Equipment` union (`equipped` field). assert(monster.equippedType!.value == my_game.EquipmentTypeId.Weapon.value); assert(monster.equippedType == my_game.EquipmentTypeId.Weapon); assert(monster.equipped is my_game.Weapon); var equipped = monster.equipped as my_game.Weapon; assert(equipped.name == "Axe"); assert(equipped.damage == 5); print(monster); return true; } flatbuffers-24.12.23/dart/example/monster_my_game.sample_generated.dart000066400000000000000000000262541473234705300262150ustar00rootroot00000000000000// automatically generated by the FlatBuffers compiler, do not modify // ignore_for_file: unused_import, unused_field, unused_element, unused_local_variable library my_game.sample; import 'dart:typed_data' show Uint8List; import 'package:flat_buffers/flat_buffers.dart' as fb; class Color { final int value; const Color._(this.value); factory Color.fromValue(int value) { final result = values[value]; if (result == null) { throw StateError('Invalid value $value for bit flag enum Color'); } return result; } static Color? _createOrNull(int? value) => value == null ? null : Color.fromValue(value); static const int minValue = 0; static const int maxValue = 2; static bool containsValue(int value) => values.containsKey(value); static const Color Red = Color._(0); static const Color Green = Color._(1); static const Color Blue = Color._(2); static const Map values = { 0: Red, 1: Green, 2: Blue}; static const fb.Reader reader = _ColorReader(); @override String toString() { return 'Color{value: $value}'; } } class _ColorReader extends fb.Reader { const _ColorReader(); @override int get size => 1; @override Color read(fb.BufferContext bc, int offset) => Color.fromValue(const fb.Int8Reader().read(bc, offset)); } class EquipmentTypeId { final int value; const EquipmentTypeId._(this.value); factory EquipmentTypeId.fromValue(int value) { final result = values[value]; if (result == null) { throw StateError('Invalid value $value for bit flag enum EquipmentTypeId'); } return result; } static EquipmentTypeId? _createOrNull(int? value) => value == null ? null : EquipmentTypeId.fromValue(value); static const int minValue = 0; static const int maxValue = 1; static bool containsValue(int value) => values.containsKey(value); static const EquipmentTypeId NONE = EquipmentTypeId._(0); static const EquipmentTypeId Weapon = EquipmentTypeId._(1); static const Map values = { 0: NONE, 1: Weapon}; static const fb.Reader reader = _EquipmentTypeIdReader(); @override String toString() { return 'EquipmentTypeId{value: $value}'; } } class _EquipmentTypeIdReader extends fb.Reader { const _EquipmentTypeIdReader(); @override int get size => 1; @override EquipmentTypeId read(fb.BufferContext bc, int offset) => EquipmentTypeId.fromValue(const fb.Uint8Reader().read(bc, offset)); } class Vec3 { Vec3._(this._bc, this._bcOffset); static const fb.Reader reader = _Vec3Reader(); final fb.BufferContext _bc; final int _bcOffset; double get x => const fb.Float32Reader().read(_bc, _bcOffset + 0); double get y => const fb.Float32Reader().read(_bc, _bcOffset + 4); double get z => const fb.Float32Reader().read(_bc, _bcOffset + 8); @override String toString() { return 'Vec3{x: $x, y: $y, z: $z}'; } } class _Vec3Reader extends fb.StructReader { const _Vec3Reader(); @override int get size => 12; @override Vec3 createObject(fb.BufferContext bc, int offset) => Vec3._(bc, offset); } class Vec3Builder { Vec3Builder(this.fbBuilder); final fb.Builder fbBuilder; int finish(double x, double y, double z) { fbBuilder.putFloat32(z); fbBuilder.putFloat32(y); fbBuilder.putFloat32(x); return fbBuilder.offset; } } class Vec3ObjectBuilder extends fb.ObjectBuilder { final double _x; final double _y; final double _z; Vec3ObjectBuilder({ required double x, required double y, required double z, }) : _x = x, _y = y, _z = z; /// Finish building, and store into the [fbBuilder]. @override int finish(fb.Builder fbBuilder) { fbBuilder.putFloat32(_z); fbBuilder.putFloat32(_y); fbBuilder.putFloat32(_x); return fbBuilder.offset; } /// Convenience method to serialize to byte list. @override Uint8List toBytes([String? fileIdentifier]) { final fbBuilder = fb.Builder(deduplicateTables: false); fbBuilder.finish(finish(fbBuilder), fileIdentifier); return fbBuilder.buffer; } } class Monster { Monster._(this._bc, this._bcOffset); factory Monster(List bytes) { final rootRef = fb.BufferContext.fromBytes(bytes); return reader.read(rootRef, 0); } static const fb.Reader reader = _MonsterReader(); final fb.BufferContext _bc; final int _bcOffset; Vec3? get pos => Vec3.reader.vTableGetNullable(_bc, _bcOffset, 4); int get mana => const fb.Int16Reader().vTableGet(_bc, _bcOffset, 6, 150); int get hp => const fb.Int16Reader().vTableGet(_bc, _bcOffset, 8, 100); String? get name => const fb.StringReader().vTableGetNullable(_bc, _bcOffset, 10); List? get inventory => const fb.Uint8ListReader().vTableGetNullable(_bc, _bcOffset, 14); Color get color => Color.fromValue(const fb.Int8Reader().vTableGet(_bc, _bcOffset, 16, 2)); List? get weapons => const fb.ListReader(Weapon.reader).vTableGetNullable(_bc, _bcOffset, 18); EquipmentTypeId? get equippedType => EquipmentTypeId._createOrNull(const fb.Uint8Reader().vTableGetNullable(_bc, _bcOffset, 20)); dynamic get equipped { switch (equippedType?.value) { case 1: return Weapon.reader.vTableGetNullable(_bc, _bcOffset, 22); default: return null; } } List? get path => const fb.ListReader(Vec3.reader).vTableGetNullable(_bc, _bcOffset, 24); @override String toString() { return 'Monster{pos: $pos, mana: $mana, hp: $hp, name: $name, inventory: $inventory, color: $color, weapons: $weapons, equippedType: $equippedType, equipped: $equipped, path: $path}'; } } class _MonsterReader extends fb.TableReader { const _MonsterReader(); @override Monster createObject(fb.BufferContext bc, int offset) => Monster._(bc, offset); } class MonsterBuilder { MonsterBuilder(this.fbBuilder); final fb.Builder fbBuilder; void begin() { fbBuilder.startTable(10); } int addPos(int offset) { fbBuilder.addStruct(0, offset); return fbBuilder.offset; } int addMana(int? mana) { fbBuilder.addInt16(1, mana); return fbBuilder.offset; } int addHp(int? hp) { fbBuilder.addInt16(2, hp); return fbBuilder.offset; } int addNameOffset(int? offset) { fbBuilder.addOffset(3, offset); return fbBuilder.offset; } int addInventoryOffset(int? offset) { fbBuilder.addOffset(5, offset); return fbBuilder.offset; } int addColor(Color? color) { fbBuilder.addInt8(6, color?.value); return fbBuilder.offset; } int addWeaponsOffset(int? offset) { fbBuilder.addOffset(7, offset); return fbBuilder.offset; } int addEquippedType(EquipmentTypeId? equippedType) { fbBuilder.addUint8(8, equippedType?.value); return fbBuilder.offset; } int addEquippedOffset(int? offset) { fbBuilder.addOffset(9, offset); return fbBuilder.offset; } int addPathOffset(int? offset) { fbBuilder.addOffset(10, offset); return fbBuilder.offset; } int finish() { return fbBuilder.endTable(); } } class MonsterObjectBuilder extends fb.ObjectBuilder { final Vec3ObjectBuilder? _pos; final int? _mana; final int? _hp; final String? _name; final List? _inventory; final Color? _color; final List? _weapons; final EquipmentTypeId? _equippedType; final dynamic _equipped; final List? _path; MonsterObjectBuilder({ Vec3ObjectBuilder? pos, int? mana, int? hp, String? name, List? inventory, Color? color, List? weapons, EquipmentTypeId? equippedType, dynamic equipped, List? path, }) : _pos = pos, _mana = mana, _hp = hp, _name = name, _inventory = inventory, _color = color, _weapons = weapons, _equippedType = equippedType, _equipped = equipped, _path = path; /// Finish building, and store into the [fbBuilder]. @override int finish(fb.Builder fbBuilder) { final int? nameOffset = _name == null ? null : fbBuilder.writeString(_name!); final int? inventoryOffset = _inventory == null ? null : fbBuilder.writeListUint8(_inventory!); final int? weaponsOffset = _weapons == null ? null : fbBuilder.writeList(_weapons!.map((b) => b.getOrCreateOffset(fbBuilder)).toList()); final int? equippedOffset = _equipped?.getOrCreateOffset(fbBuilder); final int? pathOffset = _path == null ? null : fbBuilder.writeListOfStructs(_path!); fbBuilder.startTable(10); if (_pos != null) { fbBuilder.addStruct(0, _pos!.finish(fbBuilder)); } fbBuilder.addInt16(1, _mana); fbBuilder.addInt16(2, _hp); fbBuilder.addOffset(3, nameOffset); fbBuilder.addOffset(5, inventoryOffset); fbBuilder.addInt8(6, _color?.value); fbBuilder.addOffset(7, weaponsOffset); fbBuilder.addUint8(8, _equippedType?.value); fbBuilder.addOffset(9, equippedOffset); fbBuilder.addOffset(10, pathOffset); return fbBuilder.endTable(); } /// Convenience method to serialize to byte list. @override Uint8List toBytes([String? fileIdentifier]) { final fbBuilder = fb.Builder(deduplicateTables: false); fbBuilder.finish(finish(fbBuilder), fileIdentifier); return fbBuilder.buffer; } } class Weapon { Weapon._(this._bc, this._bcOffset); factory Weapon(List bytes) { final rootRef = fb.BufferContext.fromBytes(bytes); return reader.read(rootRef, 0); } static const fb.Reader reader = _WeaponReader(); final fb.BufferContext _bc; final int _bcOffset; String? get name => const fb.StringReader().vTableGetNullable(_bc, _bcOffset, 4); int get damage => const fb.Int16Reader().vTableGet(_bc, _bcOffset, 6, 0); @override String toString() { return 'Weapon{name: $name, damage: $damage}'; } } class _WeaponReader extends fb.TableReader { const _WeaponReader(); @override Weapon createObject(fb.BufferContext bc, int offset) => Weapon._(bc, offset); } class WeaponBuilder { WeaponBuilder(this.fbBuilder); final fb.Builder fbBuilder; void begin() { fbBuilder.startTable(2); } int addNameOffset(int? offset) { fbBuilder.addOffset(0, offset); return fbBuilder.offset; } int addDamage(int? damage) { fbBuilder.addInt16(1, damage); return fbBuilder.offset; } int finish() { return fbBuilder.endTable(); } } class WeaponObjectBuilder extends fb.ObjectBuilder { final String? _name; final int? _damage; WeaponObjectBuilder({ String? name, int? damage, }) : _name = name, _damage = damage; /// Finish building, and store into the [fbBuilder]. @override int finish(fb.Builder fbBuilder) { final int? nameOffset = _name == null ? null : fbBuilder.writeString(_name!); fbBuilder.startTable(2); fbBuilder.addOffset(0, nameOffset); fbBuilder.addInt16(1, _damage); return fbBuilder.endTable(); } /// Convenience method to serialize to byte list. @override Uint8List toBytes([String? fileIdentifier]) { final fbBuilder = fb.Builder(deduplicateTables: false); fbBuilder.finish(finish(fbBuilder), fileIdentifier); return fbBuilder.buffer; } } flatbuffers-24.12.23/dart/lib/000077500000000000000000000000001473234705300157605ustar00rootroot00000000000000flatbuffers-24.12.23/dart/lib/flat_buffers.dart000066400000000000000000001324741473234705300213110ustar00rootroot00000000000000import 'dart:collection'; import 'dart:convert'; import 'dart:math'; import 'dart:typed_data'; const int _sizeofUint8 = 1; const int _sizeofUint16 = 2; const int _sizeofUint32 = 4; const int _sizeofUint64 = 8; const int _sizeofInt8 = 1; const int _sizeofInt16 = 2; const int _sizeofInt32 = 4; const int _sizeofInt64 = 8; const int _sizeofFloat32 = 4; const int _sizeofFloat64 = 8; /// Callback used to invoke a struct builder's finish method. /// /// This callback is used by other struct's `finish` methods to write the nested /// struct's fields inline. typedef StructBuilder = void Function(); /// Buffer with data and some context about it. class BufferContext { final ByteData _buffer; ByteData get buffer => _buffer; /// Create from a FlatBuffer represented by a list of bytes (uint8). factory BufferContext.fromBytes(List byteList) => BufferContext(byteList is Uint8List ? byteList.buffer.asByteData(byteList.offsetInBytes) : ByteData.view(Uint8List.fromList(byteList).buffer)); /// Create from a FlatBuffer represented by ByteData. BufferContext(this._buffer); @pragma('vm:prefer-inline') int derefObject(int offset) => offset + _getUint32(offset); @pragma('vm:prefer-inline') Uint8List _asUint8List(int offset, int length) => _buffer.buffer.asUint8List(_buffer.offsetInBytes + offset, length); @pragma('vm:prefer-inline') double _getFloat64(int offset) => _buffer.getFloat64(offset, Endian.little); @pragma('vm:prefer-inline') double _getFloat32(int offset) => _buffer.getFloat32(offset, Endian.little); @pragma('vm:prefer-inline') int _getInt64(int offset) => _buffer.getInt64(offset, Endian.little); @pragma('vm:prefer-inline') int _getInt32(int offset) => _buffer.getInt32(offset, Endian.little); @pragma('vm:prefer-inline') int _getInt16(int offset) => _buffer.getInt16(offset, Endian.little); @pragma('vm:prefer-inline') int _getInt8(int offset) => _buffer.getInt8(offset); @pragma('vm:prefer-inline') int _getUint64(int offset) => _buffer.getUint64(offset, Endian.little); @pragma('vm:prefer-inline') int _getUint32(int offset) => _buffer.getUint32(offset, Endian.little); @pragma('vm:prefer-inline') int _getUint16(int offset) => _buffer.getUint16(offset, Endian.little); @pragma('vm:prefer-inline') int _getUint8(int offset) => _buffer.getUint8(offset); } /// Interface implemented by the "object-api" classes (ending with "T"). abstract class Packable { /// Serialize the object using the given builder, returning the offset. int pack(Builder fbBuilder); } /// Class implemented by typed builders generated by flatc. abstract class ObjectBuilder { int? _firstOffset; /// Can be used to write the data represented by this builder to the [Builder] /// and reuse the offset created in multiple tables. /// /// Note that this method assumes you call it using the same [Builder] instance /// every time. The returned offset is only good for the [Builder] used in the /// first call to this method. int getOrCreateOffset(Builder fbBuilder) { _firstOffset ??= finish(fbBuilder); return _firstOffset!; } /// Writes the data in this helper to the [Builder]. int finish(Builder fbBuilder); /// Convenience method that will create a new [Builder], [finish]es the data, /// and returns the buffer as a [Uint8List] of bytes. Uint8List toBytes(); } /// Class that helps building flat buffers. class Builder { bool _finished = false; final int initialSize; /// The list of existing VTable(s). final List _vTables; final bool deduplicateTables; ByteData _buf; final Allocator _allocator; /// The maximum alignment that has been seen so far. If [_buf] has to be /// reallocated in the future (to insert room at its start for more bytes) the /// reallocation will need to be a multiple of this many bytes. int _maxAlign = 1; /// The number of bytes that have been written to the buffer so far. The /// most recently written byte is this many bytes from the end of [_buf]. int _tail = 0; /// The location of the end of the current table, measured in bytes from the /// end of [_buf]. int _currentTableEndTail = 0; _VTable? _currentVTable; /// Map containing all strings that have been written so far. This allows us /// to avoid duplicating strings. /// /// Allocated only if `internStrings` is set to true on the constructor. Map? _strings; /// Creates a new FlatBuffers Builder. /// /// `initialSize` is the initial array size in bytes. The [Builder] will /// automatically grow the array if/as needed. `internStrings`, if set to /// true, will cause [writeString] to pool strings in the buffer so that /// identical strings will always use the same offset in tables. Builder({ this.initialSize = 1024, bool internStrings = false, Allocator allocator = const DefaultAllocator(), this.deduplicateTables = true, }) : _allocator = allocator, _buf = allocator.allocate(initialSize), _vTables = deduplicateTables ? [] : const [] { if (internStrings) { _strings = {}; } } /// Calculate the finished buffer size (aligned). @pragma('vm:prefer-inline') int size() => _tail + ((-_tail) & (_maxAlign - 1)); /// Add the [field] with the given boolean [value]. The field is not added if /// the [value] is equal to [def]. Booleans are stored as 8-bit fields with /// `0` for `false` and `1` for `true`. void addBool(int field, bool? value, [bool? def]) { assert(_inVTable); if (value != null && value != def) { _prepare(_sizeofUint8, 1); _trackField(field); _buf.setInt8(_buf.lengthInBytes - _tail, value ? 1 : 0); } } /// Add the [field] with the given 32-bit signed integer [value]. The field is /// not added if the [value] is equal to [def]. void addInt32(int field, int? value, [int? def]) { assert(_inVTable); if (value != null && value != def) { _prepare(_sizeofInt32, 1); _trackField(field); _setInt32AtTail(_tail, value); } } /// Add the [field] with the given 32-bit signed integer [value]. The field is /// not added if the [value] is equal to [def]. void addInt16(int field, int? value, [int? def]) { assert(_inVTable); if (value != null && value != def) { _prepare(_sizeofInt16, 1); _trackField(field); _setInt16AtTail(_tail, value); } } /// Add the [field] with the given 8-bit signed integer [value]. The field is /// not added if the [value] is equal to [def]. void addInt8(int field, int? value, [int? def]) { assert(_inVTable); if (value != null && value != def) { _prepare(_sizeofInt8, 1); _trackField(field); _setInt8AtTail(_tail, value); } } void addStruct(int field, int offset) { assert(_inVTable); _trackField(field); _currentVTable!.addField(field, offset); } /// Add the [field] referencing an object with the given [offset]. void addOffset(int field, int? offset) { assert(_inVTable); if (offset != null) { _prepare(_sizeofUint32, 1); _trackField(field); _setUint32AtTail(_tail, _tail - offset); } } /// Add the [field] with the given 32-bit unsigned integer [value]. The field /// is not added if the [value] is equal to [def]. void addUint32(int field, int? value, [int? def]) { assert(_inVTable); if (value != null && value != def) { _prepare(_sizeofUint32, 1); _trackField(field); _setUint32AtTail(_tail, value); } } /// Add the [field] with the given 32-bit unsigned integer [value]. The field /// is not added if the [value] is equal to [def]. void addUint16(int field, int? value, [int? def]) { assert(_inVTable); if (value != null && value != def) { _prepare(_sizeofUint16, 1); _trackField(field); _setUint16AtTail(_tail, value); } } /// Add the [field] with the given 8-bit unsigned integer [value]. The field /// is not added if the [value] is equal to [def]. void addUint8(int field, int? value, [int? def]) { assert(_inVTable); if (value != null && value != def) { _prepare(_sizeofUint8, 1); _trackField(field); _setUint8AtTail(_tail, value); } } /// Add the [field] with the given 32-bit float [value]. The field /// is not added if the [value] is equal to [def]. void addFloat32(int field, double? value, [double? def]) { assert(_inVTable); if (value != null && value != def) { _prepare(_sizeofFloat32, 1); _trackField(field); _setFloat32AtTail(_tail, value); } } /// Add the [field] with the given 64-bit double [value]. The field /// is not added if the [value] is equal to [def]. void addFloat64(int field, double? value, [double? def]) { assert(_inVTable); if (value != null && value != def) { _prepare(_sizeofFloat64, 1); _trackField(field); _setFloat64AtTail(_tail, value); } } /// Add the [field] with the given 64-bit unsigned integer [value]. The field /// is not added if the [value] is equal to [def]. void addUint64(int field, int? value, [double? def]) { assert(_inVTable); if (value != null && value != def) { _prepare(_sizeofUint64, 1); _trackField(field); _setUint64AtTail(_tail, value); } } /// Add the [field] with the given 64-bit unsigned integer [value]. The field /// is not added if the [value] is equal to [def]. void addInt64(int field, int? value, [double? def]) { assert(_inVTable); if (value != null && value != def) { _prepare(_sizeofInt64, 1); _trackField(field); _setInt64AtTail(_tail, value); } } /// End the current table and return its offset. int endTable() { assert(_inVTable); // Prepare for writing the VTable. _prepare(_sizeofInt32, 1); final tableTail = _tail; // Prepare the size of the current table. final currentVTable = _currentVTable!; currentVTable.tableSize = tableTail - _currentTableEndTail; // Prepare the VTable to use for the current table. int? vTableTail; { currentVTable.computeFieldOffsets(tableTail); // Try to find an existing compatible VTable. if (deduplicateTables) { // Search backward - more likely to have recently used one for (var i = _vTables.length - 1; i >= 0; i--) { final vt2Offset = _vTables[i]; final vt2Start = _buf.lengthInBytes - vt2Offset; final vt2Size = _buf.getUint16(vt2Start, Endian.little); if (currentVTable._vTableSize == vt2Size && currentVTable._offsetsMatch(vt2Start, _buf)) { vTableTail = vt2Offset; break; } } } // Write a new VTable. if (vTableTail == null) { _prepare(_sizeofUint16, _currentVTable!.numOfUint16); vTableTail = _tail; currentVTable.tail = vTableTail; currentVTable.output(_buf, _buf.lengthInBytes - _tail); if (deduplicateTables) _vTables.add(currentVTable.tail); } } // Set the VTable offset. _setInt32AtTail(tableTail, vTableTail - tableTail); // Done with this table. _currentVTable = null; return tableTail; } /// Returns the finished buffer. You must call [finish] before accessing this. @pragma('vm:prefer-inline') Uint8List get buffer { assert(_finished); final finishedSize = size(); return _buf.buffer .asUint8List(_buf.lengthInBytes - finishedSize, finishedSize); } /// Finish off the creation of the buffer. The given [offset] is used as the /// root object offset, and usually references directly or indirectly every /// written object. If [fileIdentifier] is specified (and not `null`), it is /// interpreted as a 4-byte Latin-1 encoded string that should be placed at /// bytes 4-7 of the file. void finish(int offset, [String? fileIdentifier]) { final sizeBeforePadding = size(); final requiredBytes = _sizeofUint32 * (fileIdentifier == null ? 1 : 2); _prepare(max(requiredBytes, _maxAlign), 1); final finishedSize = size(); _setUint32AtTail(finishedSize, finishedSize - offset); if (fileIdentifier != null) { for (var i = 0; i < 4; i++) { _setUint8AtTail( finishedSize - _sizeofUint32 - i, fileIdentifier.codeUnitAt(i)); } } // zero out the added padding for (var i = sizeBeforePadding + 1; i <= finishedSize - requiredBytes; i++) { _setUint8AtTail(i, 0); } _finished = true; } /// Writes a Float64 to the tail of the buffer after preparing space for it. /// /// Updates the [offset] pointer. This method is intended for use when writing structs to the buffer. void putFloat64(double value) { _prepare(_sizeofFloat64, 1); _setFloat64AtTail(_tail, value); } /// Writes a Float32 to the tail of the buffer after preparing space for it. /// /// Updates the [offset] pointer. This method is intended for use when writing structs to the buffer. void putFloat32(double value) { _prepare(_sizeofFloat32, 1); _setFloat32AtTail(_tail, value); } /// Writes a bool to the tail of the buffer after preparing space for it. /// Bools are represented as a Uint8, with the value set to '1' for true, and '0' for false /// /// Updates the [offset] pointer. This method is intended for use when writing structs to the buffer. void putBool(bool value) { _prepare(_sizeofUint8, 1); _buf.setInt8(_buf.lengthInBytes - _tail, value ? 1 : 0); } /// Writes a Int64 to the tail of the buffer after preparing space for it. /// /// Updates the [offset] pointer. This method is intended for use when writing structs to the buffer. void putInt64(int value) { _prepare(_sizeofInt64, 1); _setInt64AtTail(_tail, value); } /// Writes a Uint32 to the tail of the buffer after preparing space for it. /// /// Updates the [offset] pointer. This method is intended for use when writing structs to the buffer. void putInt32(int value) { _prepare(_sizeofInt32, 1); _setInt32AtTail(_tail, value); } /// Writes a Uint16 to the tail of the buffer after preparing space for it. /// /// Updates the [offset] pointer. This method is intended for use when writing structs to the buffer. void putInt16(int value) { _prepare(_sizeofInt16, 1); _setInt16AtTail(_tail, value); } /// Writes a Uint8 to the tail of the buffer after preparing space for it. /// /// Updates the [offset] pointer. This method is intended for use when writing structs to the buffer. void putInt8(int value) { _prepare(_sizeofInt8, 1); _buf.setInt8(_buf.lengthInBytes - _tail, value); } /// Writes a Uint64 to the tail of the buffer after preparing space for it. /// /// Updates the [offset] pointer. This method is intended for use when writing structs to the buffer. void putUint64(int value) { _prepare(_sizeofUint64, 1); _setUint64AtTail(_tail, value); } /// Writes a Uint32 to the tail of the buffer after preparing space for it. /// /// Updates the [offset] pointer. This method is intended for use when writing structs to the buffer. void putUint32(int value) { _prepare(_sizeofUint32, 1); _setUint32AtTail(_tail, value); } /// Writes a Uint16 to the tail of the buffer after preparing space for it. /// /// Updates the [offset] pointer. This method is intended for use when writing structs to the buffer. void putUint16(int value) { _prepare(_sizeofUint16, 1); _setUint16AtTail(_tail, value); } /// Writes a Uint8 to the tail of the buffer after preparing space for it. /// /// Updates the [offset] pointer. This method is intended for use when writing structs to the buffer. void putUint8(int value) { _prepare(_sizeofUint8, 1); _buf.setUint8(_buf.lengthInBytes - _tail, value); } /// Reset the builder and make it ready for filling a new buffer. void reset() { _finished = false; _maxAlign = 1; _tail = 0; _currentVTable = null; if (deduplicateTables) _vTables.clear(); if (_strings != null) { _strings = {}; } } /// Start a new table. Must be finished with [endTable] invocation. void startTable(int numFields) { assert(!_inVTable); // Inline tables are not supported. _currentVTable = _VTable(numFields); _currentTableEndTail = _tail; } /// Finish a Struct vector. Most callers should preferto use [writeListOfStructs]. /// /// Most callers should prefer [writeListOfStructs]. int endStructVector(int count) { putUint32(count); return _tail; } /// Writes a list of Structs to the buffer, returning the offset int writeListOfStructs(List structBuilders) { assert(!_inVTable); for (var i = structBuilders.length - 1; i >= 0; i--) { structBuilders[i].finish(this); } return endStructVector(structBuilders.length); } /// Write the given list of [values]. int writeList(List values) { assert(!_inVTable); _prepare(_sizeofUint32, 1 + values.length); final result = _tail; var tail = _tail; _setUint32AtTail(tail, values.length); tail -= _sizeofUint32; for (final value in values) { _setUint32AtTail(tail, tail - value); tail -= _sizeofUint32; } return result; } /// Write the given list of 64-bit float [values]. int writeListFloat64(List values) { assert(!_inVTable); _prepare(_sizeofFloat64, values.length, additionalBytes: _sizeofUint32); final result = _tail; var tail = _tail; _setUint32AtTail(tail, values.length); tail -= _sizeofUint32; for (final value in values) { _setFloat64AtTail(tail, value); tail -= _sizeofFloat64; } return result; } /// Write the given list of 32-bit float [values]. int writeListFloat32(List values) { assert(!_inVTable); _prepare(_sizeofFloat32, 1 + values.length); final result = _tail; var tail = _tail; _setUint32AtTail(tail, values.length); tail -= _sizeofUint32; for (final value in values) { _setFloat32AtTail(tail, value); tail -= _sizeofFloat32; } return result; } /// Write the given list of signed 64-bit integer [values]. int writeListInt64(List values) { assert(!_inVTable); _prepare(_sizeofInt64, values.length, additionalBytes: _sizeofUint32); final result = _tail; var tail = _tail; _setUint32AtTail(tail, values.length); tail -= _sizeofUint32; for (final value in values) { _setInt64AtTail(tail, value); tail -= _sizeofInt64; } return result; } /// Write the given list of signed 64-bit integer [values]. int writeListUint64(List values) { assert(!_inVTable); _prepare(_sizeofUint64, values.length, additionalBytes: _sizeofUint32); final result = _tail; var tail = _tail; _setUint32AtTail(tail, values.length); tail -= _sizeofUint32; for (final value in values) { _setUint64AtTail(tail, value); tail -= _sizeofUint64; } return result; } /// Write the given list of signed 32-bit integer [values]. int writeListInt32(List values) { assert(!_inVTable); _prepare(_sizeofUint32, 1 + values.length); final result = _tail; var tail = _tail; _setUint32AtTail(tail, values.length); tail -= _sizeofUint32; for (final value in values) { _setInt32AtTail(tail, value); tail -= _sizeofInt32; } return result; } /// Write the given list of unsigned 32-bit integer [values]. int writeListUint32(List values) { assert(!_inVTable); _prepare(_sizeofUint32, 1 + values.length); final result = _tail; var tail = _tail; _setUint32AtTail(tail, values.length); tail -= _sizeofUint32; for (final value in values) { _setUint32AtTail(tail, value); tail -= _sizeofUint32; } return result; } /// Write the given list of signed 16-bit integer [values]. int writeListInt16(List values) { assert(!_inVTable); _prepare(_sizeofUint32, 1, additionalBytes: 2 * values.length); final result = _tail; var tail = _tail; _setUint32AtTail(tail, values.length); tail -= _sizeofUint32; for (final value in values) { _setInt16AtTail(tail, value); tail -= _sizeofInt16; } return result; } /// Write the given list of unsigned 16-bit integer [values]. int writeListUint16(List values) { assert(!_inVTable); _prepare(_sizeofUint32, 1, additionalBytes: 2 * values.length); final result = _tail; var tail = _tail; _setUint32AtTail(tail, values.length); tail -= _sizeofUint32; for (final value in values) { _setUint16AtTail(tail, value); tail -= _sizeofUint16; } return result; } /// Write the given list of bools as unsigend 8-bit integer [values]. int writeListBool(List values) { return writeListUint8(values.map((b) => b ? 1 : 0).toList()); } /// Write the given list of signed 8-bit integer [values]. int writeListInt8(List values) { assert(!_inVTable); _prepare(_sizeofUint32, 1, additionalBytes: values.length); final result = _tail; var tail = _tail; _setUint32AtTail(tail, values.length); tail -= _sizeofUint32; for (final value in values) { _setInt8AtTail(tail, value); tail -= _sizeofUint8; } return result; } /// Write the given list of unsigned 8-bit integer [values]. int writeListUint8(List values) { assert(!_inVTable); _prepare(_sizeofUint32, 1, additionalBytes: values.length); final result = _tail; var tail = _tail; _setUint32AtTail(tail, values.length); tail -= _sizeofUint32; for (final value in values) { _setUint8AtTail(tail, value); tail -= _sizeofUint8; } return result; } /// Write the given string [value] and return its offset. /// /// Dart strings are UTF-16 but must be stored as UTF-8 in FlatBuffers. /// If the given string consists only of ASCII characters, you can indicate /// enable [asciiOptimization]. In this mode, [writeString()] first tries to /// copy the ASCII string directly to the output buffer and if that fails /// (because there are no-ASCII characters in the string) it falls back and to /// the default UTF-16 -> UTF-8 conversion (with slight performance penalty). int writeString(String value, {bool asciiOptimization = false}) { assert(!_inVTable); if (_strings != null) { return _strings! .putIfAbsent(value, () => _writeString(value, asciiOptimization)); } else { return _writeString(value, asciiOptimization); } } int _writeString(String value, bool asciiOptimization) { if (asciiOptimization) { // [utf8.encode()] is slow (up to at least Dart SDK 2.13). If the given // string is ASCII we can just write it directly, without any conversion. final originalTail = _tail; if (_tryWriteASCIIString(value)) return _tail; // if non-ASCII: reset the output buffer position for [_writeUTFString()] _tail = originalTail; } _writeUTFString(value); return _tail; } // Try to write the string as ASCII, return false if there's a non-ascii char. @pragma('vm:prefer-inline') bool _tryWriteASCIIString(String value) { _prepare(4, 1, additionalBytes: value.length + 1); final length = value.length; var offset = _buf.lengthInBytes - _tail + 4; for (var i = 0; i < length; i++) { // utf16 code unit, e.g. for '†' it's [0x20 0x20], which is 8224 decimal. // ASCII characters go from 0x00 to 0x7F (which is 0 to 127 decimal). final char = value.codeUnitAt(i); if ((char & ~0x7F) != 0) { return false; } _buf.setUint8(offset++, char); } _buf.setUint8(offset, 0); // trailing zero _setUint32AtTail(_tail, value.length); return true; } @pragma('vm:prefer-inline') void _writeUTFString(String value) { final bytes = utf8.encode(value) as Uint8List; final length = bytes.length; _prepare(4, 1, additionalBytes: length + 1); _setUint32AtTail(_tail, length); var offset = _buf.lengthInBytes - _tail + 4; for (var i = 0; i < length; i++) { _buf.setUint8(offset++, bytes[i]); } _buf.setUint8(offset, 0); // trailing zero } /// Used to assert whether a "Table" is currently being built. /// /// If you hit `assert(!_inVTable())`, you're trying to add table fields /// without starting a table with [Builder.startTable()]. /// /// If you hit `assert(_inVTable())`, you're trying to construct a /// Table/Vector/String during the construction of its parent table, /// between the MyTableBuilder and [Builder.endTable()]. /// Move the creation of these sub-objects to before the MyTableBuilder to /// not get this assert. @pragma('vm:prefer-inline') bool get _inVTable => _currentVTable != null; /// The number of bytes that have been written to the buffer so far. The /// most recently written byte is this many bytes from the end of the buffer. @pragma('vm:prefer-inline') int get offset => _tail; /// Zero-pads the buffer, which may be required for some struct layouts. @pragma('vm:prefer-inline') void pad(int howManyBytes) { for (var i = 0; i < howManyBytes; i++) { putUint8(0); } } /// Prepare for writing the given `count` of scalars of the given `size`. /// Additionally allocate the specified `additionalBytes`. Update the current /// tail pointer to point at the allocated space. @pragma('vm:prefer-inline') void _prepare(int size, int count, {int additionalBytes = 0}) { assert(!_finished); // Update the alignment. if (_maxAlign < size) { _maxAlign = size; } // Prepare amount of required space. final dataSize = size * count + additionalBytes; final alignDelta = (-(_tail + dataSize)) & (size - 1); final bufSize = alignDelta + dataSize; // Ensure that we have the required amount of space. { final oldCapacity = _buf.lengthInBytes; if (_tail + bufSize > oldCapacity) { final desiredNewCapacity = (oldCapacity + bufSize) * 2; var deltaCapacity = desiredNewCapacity - oldCapacity; deltaCapacity += (-deltaCapacity) & (_maxAlign - 1); final newCapacity = oldCapacity + deltaCapacity; _buf = _allocator.resize(_buf, newCapacity, _tail, 0); } } // zero out the added padding for (var i = _tail + 1; i <= _tail + alignDelta; i++) { _setUint8AtTail(i, 0); } // Update the tail pointer. _tail += bufSize; } /// Record the offset of the given [field]. @pragma('vm:prefer-inline') void _trackField(int field) => _currentVTable!.addField(field, _tail); @pragma('vm:prefer-inline') void _setFloat64AtTail(int tail, double x) => _buf.setFloat64(_buf.lengthInBytes - tail, x, Endian.little); @pragma('vm:prefer-inline') void _setFloat32AtTail(int tail, double x) => _buf.setFloat32(_buf.lengthInBytes - tail, x, Endian.little); @pragma('vm:prefer-inline') void _setUint64AtTail(int tail, int x) => _buf.setUint64(_buf.lengthInBytes - tail, x, Endian.little); @pragma('vm:prefer-inline') void _setInt64AtTail(int tail, int x) => _buf.setInt64(_buf.lengthInBytes - tail, x, Endian.little); @pragma('vm:prefer-inline') void _setInt32AtTail(int tail, int x) => _buf.setInt32(_buf.lengthInBytes - tail, x, Endian.little); @pragma('vm:prefer-inline') void _setUint32AtTail(int tail, int x) => _buf.setUint32(_buf.lengthInBytes - tail, x, Endian.little); @pragma('vm:prefer-inline') void _setInt16AtTail(int tail, int x) => _buf.setInt16(_buf.lengthInBytes - tail, x, Endian.little); @pragma('vm:prefer-inline') void _setUint16AtTail(int tail, int x) => _buf.setUint16(_buf.lengthInBytes - tail, x, Endian.little); @pragma('vm:prefer-inline') void _setInt8AtTail(int tail, int x) => _buf.setInt8(_buf.lengthInBytes - tail, x); @pragma('vm:prefer-inline') void _setUint8AtTail(int tail, int x) => _buf.setUint8(_buf.lengthInBytes - tail, x); } /// Reader of lists of boolean values. /// /// The returned unmodifiable lists lazily read values on access. class BoolListReader extends Reader> { const BoolListReader(); @override @pragma('vm:prefer-inline') int get size => _sizeofUint32; @override @pragma('vm:prefer-inline') List read(BufferContext bc, int offset) => _FbBoolList(bc, bc.derefObject(offset)); } /// The reader of booleans. class BoolReader extends Reader { const BoolReader() : super(); @override @pragma('vm:prefer-inline') int get size => _sizeofUint8; @override @pragma('vm:prefer-inline') bool read(BufferContext bc, int offset) => bc._getInt8(offset) != 0; } /// The reader of lists of 64-bit float values. /// /// The returned unmodifiable lists lazily read values on access. class Float64ListReader extends Reader> { const Float64ListReader(); @override @pragma('vm:prefer-inline') int get size => _sizeofFloat64; @override @pragma('vm:prefer-inline') List read(BufferContext bc, int offset) => _FbFloat64List(bc, bc.derefObject(offset)); } class Float32ListReader extends Reader> { const Float32ListReader(); @override @pragma('vm:prefer-inline') int get size => _sizeofFloat32; @override @pragma('vm:prefer-inline') List read(BufferContext bc, int offset) => _FbFloat32List(bc, bc.derefObject(offset)); } class Float64Reader extends Reader { const Float64Reader(); @override @pragma('vm:prefer-inline') int get size => _sizeofFloat64; @override @pragma('vm:prefer-inline') double read(BufferContext bc, int offset) => bc._getFloat64(offset); } class Float32Reader extends Reader { const Float32Reader(); @override @pragma('vm:prefer-inline') int get size => _sizeofFloat32; @override @pragma('vm:prefer-inline') double read(BufferContext bc, int offset) => bc._getFloat32(offset); } class Int64Reader extends Reader { const Int64Reader() : super(); @override @pragma('vm:prefer-inline') int get size => _sizeofInt64; @override @pragma('vm:prefer-inline') int read(BufferContext bc, int offset) => bc._getInt64(offset); } /// The reader of signed 32-bit integers. class Int32Reader extends Reader { const Int32Reader() : super(); @override @pragma('vm:prefer-inline') int get size => _sizeofInt32; @override @pragma('vm:prefer-inline') int read(BufferContext bc, int offset) => bc._getInt32(offset); } /// The reader of signed 32-bit integers. class Int16Reader extends Reader { const Int16Reader() : super(); @override @pragma('vm:prefer-inline') int get size => _sizeofInt16; @override @pragma('vm:prefer-inline') int read(BufferContext bc, int offset) => bc._getInt16(offset); } /// The reader of 8-bit signed integers. class Int8Reader extends Reader { const Int8Reader() : super(); @override @pragma('vm:prefer-inline') int get size => _sizeofInt8; @override @pragma('vm:prefer-inline') int read(BufferContext bc, int offset) => bc._getInt8(offset); } /// The reader of lists of objects. Lazy by default - see [lazy]. class ListReader extends Reader> { final Reader _elementReader; /// Enables lazy reading of the list /// /// If true, the returned unmodifiable list lazily reads objects on access. /// Therefore, the underlying buffer must not change while accessing the list. /// /// If false, reads the whole list immediately on access. final bool lazy; const ListReader(this._elementReader, {this.lazy = true}); @override @pragma('vm:prefer-inline') int get size => _sizeofUint32; @override List read(BufferContext bc, int offset) { final listOffset = bc.derefObject(offset); return lazy ? _FbGenericList(_elementReader, bc, listOffset) : List.generate( bc.buffer.getUint32(listOffset, Endian.little), (int index) => _elementReader.read( bc, listOffset + size + _elementReader.size * index), growable: true); } } /// Object that can read a value at a [BufferContext]. abstract class Reader { const Reader(); /// The size of the value in bytes. int get size; /// Read the value at the given [offset] in [bc]. T read(BufferContext bc, int offset); /// Read the value of the given [field] in the given [object]. @pragma('vm:prefer-inline') T vTableGet(BufferContext object, int offset, int field, T defaultValue) { final fieldOffset = _vTableFieldOffset(object, offset, field); return fieldOffset == 0 ? defaultValue : read(object, offset + fieldOffset); } /// Read the value of the given [field] in the given [object]. @pragma('vm:prefer-inline') T? vTableGetNullable(BufferContext object, int offset, int field) { final fieldOffset = _vTableFieldOffset(object, offset, field); return fieldOffset == 0 ? null : read(object, offset + fieldOffset); } @pragma('vm:prefer-inline') int _vTableFieldOffset(BufferContext object, int offset, int field) { final vTableSOffset = object._getInt32(offset); final vTableOffset = offset - vTableSOffset; final vTableSize = object._getUint16(vTableOffset); if (field >= vTableSize) return 0; return object._getUint16(vTableOffset + field); } } /// The reader of string values. class StringReader extends Reader { final bool asciiOptimization; const StringReader({this.asciiOptimization = false}) : super(); @override @pragma('vm:prefer-inline') int get size => _sizeofUint32; @override @pragma('vm:prefer-inline') String read(BufferContext bc, int offset) { final strOffset = bc.derefObject(offset); final length = bc._getUint32(strOffset); final bytes = bc._asUint8List(strOffset + _sizeofUint32, length); if (asciiOptimization && _isLatin(bytes)) { return String.fromCharCodes(bytes); } return utf8.decode(bytes); } @pragma('vm:prefer-inline') static bool _isLatin(Uint8List bytes) { final length = bytes.length; for (var i = 0; i < length; i++) { if (bytes[i] > 127) { return false; } } return true; } } /// An abstract reader for structs. abstract class StructReader extends Reader { const StructReader(); /// Return the object at `offset`. T createObject(BufferContext bc, int offset); @override T read(BufferContext bc, int offset) { return createObject(bc, offset); } } /// An abstract reader for tables. abstract class TableReader extends Reader { const TableReader(); @override @pragma('vm:prefer-inline') int get size => 4; /// Return the object at [offset]. T createObject(BufferContext bc, int offset); @override T read(BufferContext bc, int offset) { final objectOffset = bc.derefObject(offset); return createObject(bc, objectOffset); } } /// Reader of lists of unsigned 32-bit integer values. /// /// The returned unmodifiable lists lazily read values on access. class Uint32ListReader extends Reader> { const Uint32ListReader(); @override @pragma('vm:prefer-inline') int get size => _sizeofUint32; @override @pragma('vm:prefer-inline') List read(BufferContext bc, int offset) => _FbUint32List(bc, bc.derefObject(offset)); } /// The reader of unsigned 64-bit integers. /// /// WARNING: May have compatibility issues with JavaScript class Uint64Reader extends Reader { const Uint64Reader() : super(); @override @pragma('vm:prefer-inline') int get size => _sizeofUint64; @override @pragma('vm:prefer-inline') int read(BufferContext bc, int offset) => bc._getUint64(offset); } /// The reader of unsigned 32-bit integers. class Uint32Reader extends Reader { const Uint32Reader() : super(); @override @pragma('vm:prefer-inline') int get size => _sizeofUint32; @override @pragma('vm:prefer-inline') int read(BufferContext bc, int offset) => bc._getUint32(offset); } /// Reader of lists of unsigned 32-bit integer values. /// /// The returned unmodifiable lists lazily read values on access. class Uint16ListReader extends Reader> { const Uint16ListReader(); @override @pragma('vm:prefer-inline') int get size => _sizeofUint32; @override @pragma('vm:prefer-inline') List read(BufferContext bc, int offset) => _FbUint16List(bc, bc.derefObject(offset)); } /// The reader of unsigned 32-bit integers. class Uint16Reader extends Reader { const Uint16Reader() : super(); @override @pragma('vm:prefer-inline') int get size => _sizeofUint16; @override @pragma('vm:prefer-inline') int read(BufferContext bc, int offset) => bc._getUint16(offset); } /// Reader of unmodifiable binary data (a list of unsigned 8-bit integers). class Uint8ListReader extends Reader> { /// Enables lazy reading of the list /// /// If true, the returned unmodifiable list lazily reads bytes on access. /// Therefore, the underlying buffer must not change while accessing the list. /// /// If false, reads the whole list immediately as an Uint8List. final bool lazy; const Uint8ListReader({this.lazy = true}); @override @pragma('vm:prefer-inline') int get size => _sizeofUint32; @override @pragma('vm:prefer-inline') List read(BufferContext bc, int offset) { final listOffset = bc.derefObject(offset); if (lazy) return _FbUint8List(bc, listOffset); final length = bc._getUint32(listOffset); final result = Uint8List(length); var pos = listOffset + _sizeofUint32; for (var i = 0; i < length; i++, pos++) { result[i] = bc._getUint8(pos); } return result; } } /// The reader of unsigned 8-bit integers. class Uint8Reader extends Reader { const Uint8Reader() : super(); @override @pragma('vm:prefer-inline') int get size => _sizeofUint8; @override @pragma('vm:prefer-inline') int read(BufferContext bc, int offset) => bc._getUint8(offset); } /// Reader of unmodifiable binary data (a list of signed 8-bit integers). class Int8ListReader extends Reader> { /// Enables lazy reading of the list /// /// If true, the returned unmodifiable list lazily reads bytes on access. /// Therefore, the underlying buffer must not change while accessing the list. /// /// If false, reads the whole list immediately as an Uint8List. final bool lazy; const Int8ListReader({this.lazy = true}); @override @pragma('vm:prefer-inline') int get size => _sizeofUint32; @override @pragma('vm:prefer-inline') List read(BufferContext bc, int offset) { final listOffset = bc.derefObject(offset); if (lazy) return _FbUint8List(bc, listOffset); final length = bc._getUint32(listOffset); final result = Int8List(length); var pos = listOffset + _sizeofUint32; for (var i = 0; i < length; i++, pos++) { result[i] = bc._getInt8(pos); } return result; } } /// The list backed by 64-bit values - Uint64 length and Float64. class _FbFloat64List extends _FbList { _FbFloat64List(BufferContext bc, int offset) : super(bc, offset); @override @pragma('vm:prefer-inline') double operator [](int i) => bc._getFloat64(offset + 4 + 8 * i); } /// The list backed by 32-bit values - Float32. class _FbFloat32List extends _FbList { _FbFloat32List(BufferContext bc, int offset) : super(bc, offset); @override @pragma('vm:prefer-inline') double operator [](int i) => bc._getFloat32(offset + 4 + 4 * i); } /// List backed by a generic object which may have any size. class _FbGenericList extends _FbList { final Reader elementReader; List? _items; _FbGenericList(this.elementReader, BufferContext bp, int offset) : super(bp, offset); @override @pragma('vm:prefer-inline') E operator [](int i) { _items ??= List.filled(length, null); var item = _items![i]; if (item == null) { item = elementReader.read(bc, offset + 4 + elementReader.size * i); _items![i] = item; } return item!; } } /// The base class for immutable lists read from flat buffers. abstract class _FbList extends Object with ListMixin implements List { final BufferContext bc; final int offset; int? _length; _FbList(this.bc, this.offset); @override @pragma('vm:prefer-inline') int get length => _length ??= bc._getUint32(offset); @override set length(int i) => throw StateError('Attempt to modify immutable list'); @override void operator []=(int i, E e) => throw StateError('Attempt to modify immutable list'); } /// List backed by 32-bit unsigned integers. class _FbUint32List extends _FbList { _FbUint32List(BufferContext bc, int offset) : super(bc, offset); @override @pragma('vm:prefer-inline') int operator [](int i) => bc._getUint32(offset + 4 + 4 * i); } /// List backed by 16-bit unsigned integers. class _FbUint16List extends _FbList { _FbUint16List(BufferContext bc, int offset) : super(bc, offset); @override @pragma('vm:prefer-inline') int operator [](int i) => bc._getUint16(offset + 4 + 2 * i); } /// List backed by 8-bit unsigned integers. class _FbUint8List extends _FbList { _FbUint8List(BufferContext bc, int offset) : super(bc, offset); @override @pragma('vm:prefer-inline') int operator [](int i) => bc._getUint8(offset + 4 + i); } /// List backed by 8-bit signed integers. class _FbInt8List extends _FbList { _FbInt8List(BufferContext bc, int offset) : super(bc, offset); @override @pragma('vm:prefer-inline') int operator [](int i) => bc._getInt8(offset + 4 + i); } /// List backed by 8-bit unsigned integers. class _FbBoolList extends _FbList { _FbBoolList(BufferContext bc, int offset) : super(bc, offset); @override @pragma('vm:prefer-inline') bool operator [](int i) => bc._getUint8(offset + 4 + i) == 1 ? true : false; } /// Class that describes the structure of a table. class _VTable { static const int _metadataLength = 4; final int numFields; // Note: fieldOffsets start as "tail offsets" and are then transformed by // [computeFieldOffsets()] to actual offsets when a table is finished. final Uint32List fieldOffsets; bool offsetsComputed = false; _VTable(this.numFields) : fieldOffsets = Uint32List(numFields); /// The size of the table that uses this VTable. int tableSize = 0; /// The tail of this VTable. It is used to share the same VTable between /// multiple tables of identical structure. int tail = 0; int get _vTableSize => numOfUint16 * _sizeofUint16; int get numOfUint16 => 1 + 1 + numFields; @pragma('vm:prefer-inline') void addField(int field, int offset) { assert(!offsetsComputed); assert(offset > 0); // it's impossible for field to start at the buffer end assert(offset <= 4294967295); // uint32 max fieldOffsets[field] = offset; } @pragma('vm:prefer-inline') bool _offsetsMatch(int vt2Start, ByteData buf) { assert(offsetsComputed); for (var i = 0; i < numFields; i++) { if (fieldOffsets[i] != buf.getUint16(vt2Start + _metadataLength + (2 * i), Endian.little)) { return false; } } return true; } /// Fill the [fieldOffsets] field. @pragma('vm:prefer-inline') void computeFieldOffsets(int tableTail) { assert(!offsetsComputed); offsetsComputed = true; for (var i = 0; i < numFields; i++) { if (fieldOffsets[i] != 0) { fieldOffsets[i] = tableTail - fieldOffsets[i]; } } } /// Outputs this VTable to [buf], which is is expected to be aligned to 16-bit /// and have at least [numOfUint16] 16-bit words available. @pragma('vm:prefer-inline') void output(ByteData buf, int bufOffset) { assert(offsetsComputed); // VTable size. buf.setUint16(bufOffset, numOfUint16 * 2, Endian.little); bufOffset += 2; // Table size. buf.setUint16(bufOffset, tableSize, Endian.little); bufOffset += 2; // Field offsets. for (var i = 0; i < numFields; i++) { buf.setUint16(bufOffset, fieldOffsets[i], Endian.little); bufOffset += 2; } } } /// The interface that [Builder] uses to allocate buffers for encoding. abstract class Allocator { const Allocator(); /// Allocate a [ByteData] buffer of a given size. ByteData allocate(int size); /// Free the given [ByteData] buffer previously allocated by [allocate]. void deallocate(ByteData data); /// Reallocate [newSize] bytes of memory, replacing the old [oldData]. This /// grows downwards, and is intended specifically for use with [Builder]. /// Params [inUseBack] and [inUseFront] indicate how much of [oldData] is /// actually in use at each end, and needs to be copied. ByteData resize( ByteData oldData, int newSize, int inUseBack, int inUseFront) { final newData = allocate(newSize); _copyDownward(oldData, newData, inUseBack, inUseFront); deallocate(oldData); return newData; } /// Called by [resize] to copy memory from [oldData] to [newData]. Only /// memory of size [inUseFront] and [inUseBack] will be copied from the front /// and back of the old memory allocation. void _copyDownward( ByteData oldData, ByteData newData, int inUseBack, int inUseFront) { if (inUseBack != 0) { newData.buffer.asUint8List().setAll( newData.lengthInBytes - inUseBack, oldData.buffer.asUint8List().getRange( oldData.lengthInBytes - inUseBack, oldData.lengthInBytes)); } if (inUseFront != 0) { newData.buffer .asUint8List() .setAll(0, oldData.buffer.asUint8List().getRange(0, inUseFront)); } } } class DefaultAllocator extends Allocator { const DefaultAllocator(); @override ByteData allocate(int size) => ByteData(size); @override void deallocate(ByteData data) { // nothing to do, it's garbage-collected } } flatbuffers-24.12.23/dart/lib/flex_buffers.dart000066400000000000000000000000701473234705300213030ustar00rootroot00000000000000export 'src/builder.dart'; export 'src/reference.dart'; flatbuffers-24.12.23/dart/lib/src/000077500000000000000000000000001473234705300165475ustar00rootroot00000000000000flatbuffers-24.12.23/dart/lib/src/builder.dart000066400000000000000000000530161473234705300210560ustar00rootroot00000000000000import 'dart:convert'; import 'dart:typed_data'; import 'types.dart'; /// The main builder class for creation of a FlexBuffer. class Builder { final ByteData _buffer; List<_StackValue> _stack = []; List<_StackPointer> _stackPointers = []; int _offset = 0; bool _finished = false; final Map _stringCache = {}; final Map _keyCache = {}; final Map<_KeysHash, _StackValue> _keyVectorCache = {}; final Map _indirectIntCache = {}; final Map _indirectDoubleCache = {}; /// Instantiate the builder if you intent to gradually build up the buffer by calling /// add... methods and calling [finish] to receive the resulting byte array. /// /// The default size of internal buffer is set to 2048. Provide a different value in order to avoid buffer copies. Builder({int size = 2048}) : _buffer = ByteData(size); /// Use this method in order to turn an object into a FlexBuffer directly. /// /// Use the manual instantiation of the [Builder] and gradual addition of values, if performance is more important than convenience. static ByteBuffer buildFromObject(Object? value) { final builder = Builder(); builder._add(value); final buffer = builder.finish(); final byteData = ByteData(buffer.lengthInBytes); byteData.buffer.asUint8List().setAll(0, buffer); return byteData.buffer; } void _add(Object? value) { if (value == null) { addNull(); } else if (value is bool) { addBool(value); } else if (value is int) { addInt(value); } else if (value is double) { addDouble(value); } else if (value is ByteBuffer) { addBlob(value); } else if (value is String) { addString(value); } else if (value is List) { startVector(); for (var i = 0; i < value.length; i++) { _add(value[i]); } end(); } else if (value is Map) { startMap(); value.forEach((key, value) { addKey(key); _add(value); }); end(); } else { throw UnsupportedError('Value of unexpected type: $value'); } } /// Use this method if you want to store a null value. /// /// Specifically useful when building up a vector where values can be null. void addNull() { _integrityCheckOnValueAddition(); _stack.add(_StackValue.withNull()); } /// Adds a string value. void addInt(int value) { _integrityCheckOnValueAddition(); _stack.add(_StackValue.withInt(value)); } /// Adds a bool value. void addBool(bool value) { _integrityCheckOnValueAddition(); _stack.add(_StackValue.withBool(value)); } /// Adds a double value. void addDouble(double value) { _integrityCheckOnValueAddition(); _stack.add(_StackValue.withDouble(value)); } /// Adds a string value. void addString(String value) { _integrityCheckOnValueAddition(); if (_stringCache.containsKey(value)) { _stack.add(_stringCache[value]!); return; } final utf8String = utf8.encode(value); final length = utf8String.length; final bitWidth = BitWidthUtil.uwidth(length); final byteWidth = _align(bitWidth); _writeUInt(length, byteWidth); final stringOffset = _offset; final newOffset = _newOffset(length + 1); _pushBuffer(utf8String); _offset = newOffset; final stackValue = _StackValue.withOffset(stringOffset, ValueType.String, bitWidth); _stack.add(stackValue); _stringCache[value] = stackValue; } /// This methods adds a key to a map and should be followed by an add... value call. /// /// It also implies that you call this method only after you called [startMap]. void addKey(String value) { _integrityCheckOnKeyAddition(); if (_keyCache.containsKey(value)) { _stack.add(_keyCache[value]!); return; } final utf8String = utf8.encode(value); final length = utf8String.length; final keyOffset = _offset; final newOffset = _newOffset(length + 1); _pushBuffer(utf8String); _offset = newOffset; final stackValue = _StackValue.withOffset(keyOffset, ValueType.Key, BitWidth.width8); _stack.add(stackValue); _keyCache[value] = stackValue; } /// Adds a byte array. /// /// This method can be used to store any generic BLOB. void addBlob(ByteBuffer value) { _integrityCheckOnValueAddition(); final length = value.lengthInBytes; final bitWidth = BitWidthUtil.uwidth(length); final byteWidth = _align(bitWidth); _writeUInt(length, byteWidth); final blobOffset = _offset; final newOffset = _newOffset(length); _pushBuffer(value.asUint8List()); _offset = newOffset; final stackValue = _StackValue.withOffset(blobOffset, ValueType.Blob, bitWidth); _stack.add(stackValue); } /// Stores int value indirectly in the buffer. /// /// Adding large integer values indirectly might be beneficial if those values suppose to be store in a vector together with small integer values. /// This is due to the fact that FlexBuffers will add padding to small integer values, if they are stored together with large integer values. /// When we add integer indirectly the vector of ints will contain not the value itself, but only the relative offset to the value. /// By setting the [cache] parameter to true, you make sure that the builder tracks added int value and performs deduplication. void addIntIndirectly(int value, {bool cache = false}) { _integrityCheckOnValueAddition(); if (_indirectIntCache.containsKey(value)) { _stack.add(_indirectIntCache[value]!); return; } final stackValue = _StackValue.withInt(value); final byteWidth = _align(stackValue.width); final newOffset = _newOffset(byteWidth); final valueOffset = _offset; _pushBuffer(stackValue.asU8List(stackValue.width)); final stackOffset = _StackValue.withOffset( valueOffset, ValueType.IndirectInt, stackValue.width); _stack.add(stackOffset); _offset = newOffset; if (cache) { _indirectIntCache[value] = stackOffset; } } /// Stores double value indirectly in the buffer. /// /// Double are stored as 8 or 4 byte values in FlexBuffers. If they are stored in a mixed vector, values which are smaller than 4 / 8 bytes will be padded. /// When we add double indirectly, the vector will contain not the value itself, but only the relative offset to the value. Which could occupy only 1 or 2 bytes, reducing the odds for unnecessary padding. /// By setting the [cache] parameter to true, you make sure that the builder tracks already added double value and performs deduplication. void addDoubleIndirectly(double value, {bool cache = false}) { _integrityCheckOnValueAddition(); if (cache && _indirectDoubleCache.containsKey(value)) { _stack.add(_indirectDoubleCache[value]!); return; } final stackValue = _StackValue.withDouble(value); final byteWidth = _align(stackValue.width); final newOffset = _newOffset(byteWidth); final valueOffset = _offset; _pushBuffer(stackValue.asU8List(stackValue.width)); final stackOffset = _StackValue.withOffset( valueOffset, ValueType.IndirectFloat, stackValue.width); _stack.add(stackOffset); _offset = newOffset; if (cache) { _indirectDoubleCache[value] = stackOffset; } } /// This method starts a vector definition and needs to be followed by 0 to n add... value calls. /// /// The vector definition needs to be finished with an [end] call. /// It is also possible to add nested vector or map by calling [startVector] / [startMap]. void startVector() { _integrityCheckOnValueAddition(); _stackPointers.add(_StackPointer(_stack.length, true)); } /// This method starts a map definition. /// /// This method call needs to be followed by 0 to n [addKey] + add... value calls. /// The map definition needs to be finished with an [end] call. /// It is also possible to add nested vector or map by calling [startVector] / [startMap] after calling [addKey]. void startMap() { _integrityCheckOnValueAddition(); _stackPointers.add(_StackPointer(_stack.length, false)); } /// Marks that the addition of values to the last vector, or map have ended. void end() { final pointer = _stackPointers.removeLast(); if (pointer.isVector) { _endVector(pointer); } else { _sortKeysAndEndMap(pointer); } } /// Finish building the FlatBuffer and return array of bytes. /// /// Can be called multiple times, to get the array of bytes. /// After the first call, adding values, or starting vectors / maps will result in an exception. Uint8List finish() { if (_finished == false) { _finish(); } return _buffer.buffer.asUint8List(0, _offset); } /// Builds a FlatBuffer with current state without finishing the builder. /// /// Creates an internal temporary copy of current builder and finishes the copy. /// Use this method, when the state of a long lasting builder need to be persisted periodically. ByteBuffer snapshot() { final tmp = Builder(size: _offset + 200); tmp._offset = _offset; tmp._stack = List.from(_stack); tmp._stackPointers = List.from(_stackPointers); tmp._buffer.buffer .asUint8List() .setAll(0, _buffer.buffer.asUint8List(0, _offset)); for (var i = 0; i < tmp._stackPointers.length; i++) { tmp.end(); } final buffer = tmp.finish(); final bd = ByteData(buffer.lengthInBytes); bd.buffer.asUint8List().setAll(0, buffer); return bd.buffer; } void _integrityCheckOnValueAddition() { if (_finished) { throw StateError('Adding values after finish is prohibited'); } if (_stackPointers.isNotEmpty && _stackPointers.last.isVector == false) { if (_stack.last.type != ValueType.Key) { throw StateError( 'Adding value to a map before adding a key is prohibited'); } } } void _integrityCheckOnKeyAddition() { if (_finished) { throw StateError('Adding values after finish is prohibited'); } if (_stackPointers.isEmpty || _stackPointers.last.isVector) { throw StateError('Adding key before staring a map is prohibited'); } } void _finish() { if (_stack.length != 1) { throw StateError( 'Stack has to be exactly 1, but is ${_stack.length}. You have to end all started vectors and maps, before calling [finish]'); } final value = _stack[0]; final byteWidth = _align(value.elementWidth(_offset, 0)); _writeStackValue(value, byteWidth); _writeUInt(value.storedPackedType(), 1); _writeUInt(byteWidth, 1); _finished = true; } _StackValue _createVector(int start, int vecLength, int step, [_StackValue? keys]) { var bitWidth = BitWidthUtil.uwidth(vecLength); var prefixElements = 1; if (keys != null) { var elemWidth = keys.elementWidth(_offset, 0); if (elemWidth.index > bitWidth.index) { bitWidth = elemWidth; } prefixElements += 2; } var vectorType = ValueType.Key; var typed = keys == null; for (var i = start; i < _stack.length; i += step) { final elemWidth = _stack[i].elementWidth(_offset, i + prefixElements); if (elemWidth.index > bitWidth.index) { bitWidth = elemWidth; } if (i == start) { vectorType = _stack[i].type; typed &= ValueTypeUtils.isTypedVectorElement(vectorType); } else { if (vectorType != _stack[i].type) { typed = false; } } } final byteWidth = _align(bitWidth); final fix = typed & ValueTypeUtils.isNumber(vectorType) && vecLength >= 2 && vecLength <= 4; if (keys != null) { _writeStackValue(keys, byteWidth); _writeUInt(1 << keys.width.index, byteWidth); } if (fix == false) { _writeUInt(vecLength, byteWidth); } final vecOffset = _offset; for (var i = start; i < _stack.length; i += step) { _writeStackValue(_stack[i], byteWidth); } if (typed == false) { for (var i = start; i < _stack.length; i += step) { _writeUInt(_stack[i].storedPackedType(), 1); } } if (keys != null) { return _StackValue.withOffset(vecOffset, ValueType.Map, bitWidth); } if (typed) { final vType = ValueTypeUtils.toTypedVector(vectorType, fix ? vecLength : 0); return _StackValue.withOffset(vecOffset, vType, bitWidth); } return _StackValue.withOffset(vecOffset, ValueType.Vector, bitWidth); } void _endVector(_StackPointer pointer) { final vecLength = _stack.length - pointer.stackPosition; final vec = _createVector(pointer.stackPosition, vecLength, 1); _stack.removeRange(pointer.stackPosition, _stack.length); _stack.add(vec); } void _sortKeysAndEndMap(_StackPointer pointer) { if (((_stack.length - pointer.stackPosition) & 1) == 1) { throw StateError( 'The stack needs to hold key value pairs (even number of elements). Check if you combined [addKey] with add... method calls properly.'); } var sorted = true; for (var i = pointer.stackPosition; i < _stack.length - 2; i += 2) { if (_shouldFlip(_stack[i], _stack[i + 2])) { sorted = false; break; } } if (sorted == false) { for (var i = pointer.stackPosition; i < _stack.length; i += 2) { var flipIndex = i; for (var j = i + 2; j < _stack.length; j += 2) { if (_shouldFlip(_stack[flipIndex], _stack[j])) { flipIndex = j; } } if (flipIndex != i) { var k = _stack[flipIndex]; var v = _stack[flipIndex + 1]; _stack[flipIndex] = _stack[i]; _stack[flipIndex + 1] = _stack[i + 1]; _stack[i] = k; _stack[i + 1] = v; } } } _endMap(pointer); } void _endMap(_StackPointer pointer) { final vecLength = (_stack.length - pointer.stackPosition) >> 1; final offsets = []; for (var i = pointer.stackPosition; i < _stack.length; i += 2) { offsets.add(_stack[i].offset!); } final keysHash = _KeysHash(offsets); _StackValue? keysStackValue; if (_keyVectorCache.containsKey(keysHash)) { keysStackValue = _keyVectorCache[keysHash]; } else { keysStackValue = _createVector(pointer.stackPosition, vecLength, 2); _keyVectorCache[keysHash] = keysStackValue; } final vec = _createVector(pointer.stackPosition + 1, vecLength, 2, keysStackValue); _stack.removeRange(pointer.stackPosition, _stack.length); _stack.add(vec); } bool _shouldFlip(_StackValue v1, _StackValue v2) { if (v1.type != ValueType.Key || v2.type != ValueType.Key) { throw StateError( 'Stack values are not keys $v1 | $v2. Check if you combined [addKey] with add... method calls properly.'); } late int c1, c2; var index = 0; do { c1 = _buffer.getUint8(v1.offset! + index); c2 = _buffer.getUint8(v2.offset! + index); if (c2 < c1) return true; if (c1 < c2) return false; index += 1; } while (c1 != 0 && c2 != 0); return false; } int _align(BitWidth width) { final byteWidth = BitWidthUtil.toByteWidth(width); _offset += BitWidthUtil.paddingSize(_offset, byteWidth); return byteWidth; } void _writeStackValue(_StackValue value, int byteWidth) { final newOffset = _newOffset(byteWidth); if (value.isOffset) { final relativeOffset = _offset - value.offset!; if (byteWidth == 8 || relativeOffset < (1 << (byteWidth * 8))) { _writeUInt(relativeOffset, byteWidth); } else { throw StateError( 'Unexpected size $byteWidth. This might be a bug. Please create an issue https://github.com/google/flatbuffers/issues/new'); } } else { _pushBuffer(value.asU8List(BitWidthUtil.fromByteWidth(byteWidth))); } _offset = newOffset; } void _writeUInt(int value, int byteWidth) { final newOffset = _newOffset(byteWidth); _pushUInt(value, BitWidthUtil.fromByteWidth(byteWidth)); _offset = newOffset; } int _newOffset(int newValueSize) { final newOffset = _offset + newValueSize; var size = _buffer.lengthInBytes; final prevSize = size; while (size < newOffset) { size <<= 1; } if (prevSize < size) { final newBuf = ByteData(size); newBuf.buffer.asUint8List().setAll(0, _buffer.buffer.asUint8List()); } return newOffset; } void _pushInt(int value, BitWidth width) { switch (width) { case BitWidth.width8: _buffer.setInt8(_offset, value); break; case BitWidth.width16: _buffer.setInt16(_offset, value, Endian.little); break; case BitWidth.width32: _buffer.setInt32(_offset, value, Endian.little); break; case BitWidth.width64: _buffer.setInt64(_offset, value, Endian.little); break; } } void _pushUInt(int value, BitWidth width) { switch (width) { case BitWidth.width8: _buffer.setUint8(_offset, value); break; case BitWidth.width16: _buffer.setUint16(_offset, value, Endian.little); break; case BitWidth.width32: _buffer.setUint32(_offset, value, Endian.little); break; case BitWidth.width64: _buffer.setUint64(_offset, value, Endian.little); break; } } void _pushBuffer(List value) { _buffer.buffer.asUint8List().setAll(_offset, value); } } class _StackValue { late Object _value; int? _offset; final ValueType _type; final BitWidth _width; _StackValue.withNull() : _type = ValueType.Null, _width = BitWidth.width8; _StackValue.withInt(int value) : _type = ValueType.Int, _width = BitWidthUtil.width(value), _value = value; _StackValue.withBool(bool value) : _type = ValueType.Bool, _width = BitWidth.width8, _value = value; _StackValue.withDouble(double value) : _type = ValueType.Float, _width = BitWidthUtil.width(value), _value = value; _StackValue.withOffset(int value, ValueType type, BitWidth width) : _offset = value, _type = type, _width = width; BitWidth storedWidth({BitWidth width = BitWidth.width8}) { return ValueTypeUtils.isInline(_type) ? BitWidthUtil.max(_width, width) : _width; } int storedPackedType({BitWidth width = BitWidth.width8}) { return ValueTypeUtils.packedType(_type, storedWidth(width: width)); } BitWidth elementWidth(int size, int index) { if (ValueTypeUtils.isInline(_type)) return _width; final offset = _offset!; for (var i = 0; i < 4; i++) { final width = 1 << i; final bitWidth = BitWidthUtil.uwidth(size + BitWidthUtil.paddingSize(size, width) + index * width - offset); if (1 << bitWidth.index == width) { return bitWidth; } } throw StateError( 'Element is of unknown. Size: $size at index: $index. This might be a bug. Please create an issue https://github.com/google/flatbuffers/issues/new'); } List asU8List(BitWidth width) { if (ValueTypeUtils.isNumber(_type)) { if (_type == ValueType.Float) { if (width == BitWidth.width32) { final result = ByteData(4); result.setFloat32(0, _value as double, Endian.little); return result.buffer.asUint8List(); } else { final result = ByteData(8); result.setFloat64(0, _value as double, Endian.little); return result.buffer.asUint8List(); } } else { switch (width) { case BitWidth.width8: final result = ByteData(1); result.setInt8(0, _value as int); return result.buffer.asUint8List(); case BitWidth.width16: final result = ByteData(2); result.setInt16(0, _value as int, Endian.little); return result.buffer.asUint8List(); case BitWidth.width32: final result = ByteData(4); result.setInt32(0, _value as int, Endian.little); return result.buffer.asUint8List(); case BitWidth.width64: final result = ByteData(8); result.setInt64(0, _value as int, Endian.little); return result.buffer.asUint8List(); } } } if (_type == ValueType.Null) { final result = ByteData(1); result.setInt8(0, 0); return result.buffer.asUint8List(); } if (_type == ValueType.Bool) { final result = ByteData(1); result.setInt8(0, _value as bool ? 1 : 0); return result.buffer.asUint8List(); } throw StateError( 'Unexpected type: $_type. This might be a bug. Please create an issue https://github.com/google/flatbuffers/issues/new'); } ValueType get type { return _type; } BitWidth get width { return _width; } bool get isOffset { return !ValueTypeUtils.isInline(_type); } int? get offset => _offset; bool get isFloat32 { return _type == ValueType.Float && _width == BitWidth.width32; } } class _StackPointer { int stackPosition; bool isVector; _StackPointer(this.stackPosition, this.isVector); } class _KeysHash { final List keys; const _KeysHash(this.keys); @override bool operator ==(Object other) { if (other is _KeysHash) { if (keys.length != other.keys.length) return false; for (var i = 0; i < keys.length; i++) { if (keys[i] != other.keys[i]) return false; } return true; } return false; } @override int get hashCode { var result = 17; for (var i = 0; i < keys.length; i++) { result = result * 23 + keys[i]; } return result; } } flatbuffers-24.12.23/dart/lib/src/reference.dart000066400000000000000000000367611473234705300213760ustar00rootroot00000000000000import 'dart:collection'; import 'dart:convert'; import 'dart:typed_data'; import 'types.dart'; /// Main class to read a value out of a FlexBuffer. /// /// This class let you access values stored in the buffer in a lazy fashion. class Reference { final ByteData _buffer; final int _offset; final BitWidth _parentWidth; final String _path; final int _byteWidth; final ValueType _valueType; int? _length; Reference._( this._buffer, this._offset, this._parentWidth, int packedType, this._path, [int? byteWidth, ValueType? valueType]) : _byteWidth = byteWidth ?? 1 << (packedType & 3), _valueType = valueType ?? ValueTypeUtils.fromInt(packedType >> 2); /// Use this method to access the root value of a FlexBuffer. static Reference fromBuffer(ByteBuffer buffer) { final len = buffer.lengthInBytes; if (len < 3) { throw UnsupportedError('Buffer needs to be bigger than 3'); } final byteData = ByteData.view(buffer); final byteWidth = byteData.getUint8(len - 1); final packedType = byteData.getUint8(len - 2); final offset = len - byteWidth - 2; return Reference._(ByteData.view(buffer), offset, BitWidthUtil.fromByteWidth(byteWidth), packedType, "/"); } /// Returns true if the underlying value is null. bool get isNull => _valueType == ValueType.Null; /// Returns true if the underlying value can be represented as [num]. bool get isNum => ValueTypeUtils.isNumber(_valueType) || ValueTypeUtils.isIndirectNumber(_valueType); /// Returns true if the underlying value was encoded as a float (direct or indirect). bool get isDouble => _valueType == ValueType.Float || _valueType == ValueType.IndirectFloat; /// Returns true if the underlying value was encoded as an int or uint (direct or indirect). bool get isInt => isNum && !isDouble; /// Returns true if the underlying value was encoded as a string or a key. bool get isString => _valueType == ValueType.String || _valueType == ValueType.Key; /// Returns true if the underlying value was encoded as a bool. bool get isBool => _valueType == ValueType.Bool; /// Returns true if the underlying value was encoded as a blob. bool get isBlob => _valueType == ValueType.Blob; /// Returns true if the underlying value points to a vector. bool get isVector => ValueTypeUtils.isAVector(_valueType); /// Returns true if the underlying value points to a map. bool get isMap => _valueType == ValueType.Map; /// If this [isBool], returns the bool value. Otherwise, returns null. bool? get boolValue { if (_valueType == ValueType.Bool) { return _readInt(_offset, _parentWidth) != 0; } return null; } /// Returns an [int], if the underlying value can be represented as an int. /// /// Otherwise returns [null]. int? get intValue { if (_valueType == ValueType.Int) { return _readInt(_offset, _parentWidth); } if (_valueType == ValueType.UInt) { return _readUInt(_offset, _parentWidth); } if (_valueType == ValueType.IndirectInt) { return _readInt(_indirect, BitWidthUtil.fromByteWidth(_byteWidth)); } if (_valueType == ValueType.IndirectUInt) { return _readUInt(_indirect, BitWidthUtil.fromByteWidth(_byteWidth)); } return null; } /// Returns [double], if the underlying value [isDouble]. /// /// Otherwise returns [null]. double? get doubleValue { if (_valueType == ValueType.Float) { return _readFloat(_offset, _parentWidth); } if (_valueType == ValueType.IndirectFloat) { return _readFloat(_indirect, BitWidthUtil.fromByteWidth(_byteWidth)); } return null; } /// Returns [num], if the underlying value is numeric, be it int uint, or float (direct or indirect). /// /// Otherwise returns [null]. num? get numValue => doubleValue ?? intValue; /// Returns [String] value or null otherwise. /// /// This method performers a utf8 decoding, as FlexBuffers format stores strings in utf8 encoding. String? get stringValue { if (_valueType == ValueType.String || _valueType == ValueType.Key) { return utf8.decode(_buffer.buffer.asUint8List(_indirect, length)); } return null; } /// Returns [Uint8List] value or null otherwise. Uint8List? get blobValue { if (_valueType == ValueType.Blob) { return _buffer.buffer.asUint8List(_indirect, length); } return null; } /// Can be used with an [int] or a [String] value for key. /// If the underlying value in FlexBuffer is a vector, then use [int] for access. /// If the underlying value in FlexBuffer is a map, then use [String] for access. /// Returns [Reference] value. Throws an exception when [key] is not applicable. Reference operator [](Object key) { if (key is int && ValueTypeUtils.isAVector(_valueType)) { final index = key; if (index >= length || index < 0) { throw ArgumentError( 'Key: [$key] is not applicable on: $_path of: $_valueType length: $length'); } final elementOffset = _indirect + index * _byteWidth; int packedType = 0; int? byteWidth; ValueType? valueType; if (ValueTypeUtils.isTypedVector(_valueType)) { byteWidth = 1; valueType = ValueTypeUtils.typedVectorElementType(_valueType); } else if (ValueTypeUtils.isFixedTypedVector(_valueType)) { byteWidth = 1; valueType = ValueTypeUtils.fixedTypedVectorElementType(_valueType); } else { packedType = _buffer.getUint8(_indirect + length * _byteWidth + index); } return Reference._( _buffer, elementOffset, BitWidthUtil.fromByteWidth(_byteWidth), packedType, "$_path[$index]", byteWidth, valueType); } if (key is String && _valueType == ValueType.Map) { final index = _keyIndex(key); if (index != null) { return _valueForIndexWithKey(index, key); } } throw ArgumentError( 'Key: [$key] is not applicable on: $_path of: $_valueType'); } /// Get an iterable if the underlying flexBuffer value is a vector. /// Otherwise throws an exception. Iterable get vectorIterable { if (isVector == false) { throw UnsupportedError('Value is not a vector. It is: $_valueType'); } return _VectorIterator(this); } /// Get an iterable for keys if the underlying flexBuffer value is a map. /// Otherwise throws an exception. Iterable get mapKeyIterable { if (isMap == false) { throw UnsupportedError('Value is not a map. It is: $_valueType'); } return _MapKeyIterator(this); } /// Get an iterable for values if the underlying flexBuffer value is a map. /// Otherwise throws an exception. Iterable get mapValueIterable { if (isMap == false) { throw UnsupportedError('Value is not a map. It is: $_valueType'); } return _MapValueIterator(this); } /// Returns the length of the underlying FlexBuffer value. /// If the underlying value is [null] the length is 0. /// If the underlying value is a number, or a bool, the length is 1. /// If the underlying value is a vector, or map, the length reflects number of elements / element pairs. /// If the values is a string or a blob, the length reflects a number of bytes the value occupies (strings are encoded in utf8 format). int get length { if (_length == null) { // needs to be checked before more generic isAVector if (ValueTypeUtils.isFixedTypedVector(_valueType)) { _length = ValueTypeUtils.fixedTypedVectorElementSize(_valueType); } else if (_valueType == ValueType.Blob || ValueTypeUtils.isAVector(_valueType) || _valueType == ValueType.Map) { _length = _readUInt( _indirect - _byteWidth, BitWidthUtil.fromByteWidth(_byteWidth)); } else if (_valueType == ValueType.Null) { _length = 0; } else if (_valueType == ValueType.String) { final indirect = _indirect; var sizeByteWidth = _byteWidth; var size = _readUInt(indirect - sizeByteWidth, BitWidthUtil.fromByteWidth(sizeByteWidth)); while (_buffer.getInt8(indirect + size) != 0) { sizeByteWidth <<= 1; size = _readUInt(indirect - sizeByteWidth, BitWidthUtil.fromByteWidth(sizeByteWidth)); } _length = size; } else if (_valueType == ValueType.Key) { final indirect = _indirect; var size = 1; while (_buffer.getInt8(indirect + size) != 0) { size += 1; } _length = size; } else { _length = 1; } } return _length!; } /// Returns a minified JSON representation of the underlying FlexBuffer value. /// /// This method involves materializing the entire object tree, which may be /// expensive. It is more efficient to work with [Reference] and access only the needed data. /// Blob values are represented as base64 encoded string. String get json { if (_valueType == ValueType.Bool) { return boolValue! ? 'true' : 'false'; } if (_valueType == ValueType.Null) { return 'null'; } if (ValueTypeUtils.isNumber(_valueType)) { return jsonEncode(numValue); } if (_valueType == ValueType.String) { return jsonEncode(stringValue); } if (_valueType == ValueType.Blob) { return jsonEncode(base64Encode(blobValue!)); } if (ValueTypeUtils.isAVector(_valueType)) { final result = StringBuffer(); result.write('['); for (var i = 0; i < length; i++) { result.write(this[i].json); if (i < length - 1) { result.write(','); } } result.write(']'); return result.toString(); } if (_valueType == ValueType.Map) { final result = StringBuffer(); result.write('{'); for (var i = 0; i < length; i++) { result.write(jsonEncode(_keyForIndex(i))); result.write(':'); result.write(_valueForIndex(i).json); if (i < length - 1) { result.write(','); } } result.write('}'); return result.toString(); } throw UnsupportedError( 'Type: $_valueType is not supported for JSON conversion'); } /// Computes the indirect offset of the value. /// /// To optimize for the more common case of being called only once, this /// value is not cached. Callers that need to use it more than once should /// cache the return value in a local variable. int get _indirect { final step = _readUInt(_offset, _parentWidth); return _offset - step; } int _readInt(int offset, BitWidth width) { _validateOffset(offset, width); if (width == BitWidth.width8) { return _buffer.getInt8(offset); } if (width == BitWidth.width16) { return _buffer.getInt16(offset, Endian.little); } if (width == BitWidth.width32) { return _buffer.getInt32(offset, Endian.little); } return _buffer.getInt64(offset, Endian.little); } int _readUInt(int offset, BitWidth width) { _validateOffset(offset, width); if (width == BitWidth.width8) { return _buffer.getUint8(offset); } if (width == BitWidth.width16) { return _buffer.getUint16(offset, Endian.little); } if (width == BitWidth.width32) { return _buffer.getUint32(offset, Endian.little); } return _buffer.getUint64(offset, Endian.little); } double _readFloat(int offset, BitWidth width) { _validateOffset(offset, width); if (width.index < BitWidth.width32.index) { throw StateError('Bad width: $width'); } if (width == BitWidth.width32) { return _buffer.getFloat32(offset, Endian.little); } return _buffer.getFloat64(offset, Endian.little); } void _validateOffset(int offset, BitWidth width) { if (_offset < 0 || _buffer.lengthInBytes <= offset + width.index || offset & (BitWidthUtil.toByteWidth(width) - 1) != 0) { throw StateError('Bad offset: $offset, width: $width'); } } int? _keyIndex(String key) { final input = utf8.encode(key); final keysVectorOffset = _indirect - _byteWidth * 3; final indirectOffset = keysVectorOffset - _readUInt(keysVectorOffset, BitWidthUtil.fromByteWidth(_byteWidth)); final byteWidth = _readUInt( keysVectorOffset + _byteWidth, BitWidthUtil.fromByteWidth(_byteWidth)); var low = 0; var high = length - 1; while (low <= high) { final mid = (high + low) >> 1; final dif = _diffKeys(input, mid, indirectOffset, byteWidth); if (dif == 0) return mid; if (dif < 0) { high = mid - 1; } else { low = mid + 1; } } return null; } int _diffKeys(List input, int index, int indirectOffset, int byteWidth) { final keyOffset = indirectOffset + index * byteWidth; final keyIndirectOffset = keyOffset - _readUInt(keyOffset, BitWidthUtil.fromByteWidth(byteWidth)); for (var i = 0; i < input.length; i++) { final dif = input[i] - _buffer.getUint8(keyIndirectOffset + i); if (dif != 0) { return dif; } } return (_buffer.getUint8(keyIndirectOffset + input.length) == 0) ? 0 : -1; } Reference _valueForIndexWithKey(int index, String key) { final indirect = _indirect; final elementOffset = indirect + index * _byteWidth; final packedType = _buffer.getUint8(indirect + length * _byteWidth + index); return Reference._(_buffer, elementOffset, BitWidthUtil.fromByteWidth(_byteWidth), packedType, "$_path/$key"); } Reference _valueForIndex(int index) { final indirect = _indirect; final elementOffset = indirect + index * _byteWidth; final packedType = _buffer.getUint8(indirect + length * _byteWidth + index); return Reference._(_buffer, elementOffset, BitWidthUtil.fromByteWidth(_byteWidth), packedType, "$_path/[$index]"); } String _keyForIndex(int index) { final keysVectorOffset = _indirect - _byteWidth * 3; final indirectOffset = keysVectorOffset - _readUInt(keysVectorOffset, BitWidthUtil.fromByteWidth(_byteWidth)); final byteWidth = _readUInt( keysVectorOffset + _byteWidth, BitWidthUtil.fromByteWidth(_byteWidth)); final keyOffset = indirectOffset + index * byteWidth; final keyIndirectOffset = keyOffset - _readUInt(keyOffset, BitWidthUtil.fromByteWidth(byteWidth)); var length = 0; while (_buffer.getUint8(keyIndirectOffset + length) != 0) { length += 1; } return utf8.decode(_buffer.buffer.asUint8List(keyIndirectOffset, length)); } } class _VectorIterator with IterableMixin implements Iterator { final Reference _vector; int index = -1; _VectorIterator(this._vector); @override Reference get current => _vector[index]; @override bool moveNext() { index++; return index < _vector.length; } @override Iterator get iterator => this; } class _MapKeyIterator with IterableMixin implements Iterator { final Reference _map; int index = -1; _MapKeyIterator(this._map); @override String get current => _map._keyForIndex(index); @override bool moveNext() { index++; return index < _map.length; } @override Iterator get iterator => this; } class _MapValueIterator with IterableMixin implements Iterator { final Reference _map; int index = -1; _MapValueIterator(this._map); @override Reference get current => _map._valueForIndex(index); @override bool moveNext() { index++; return index < _map.length; } @override Iterator get iterator => this; } flatbuffers-24.12.23/dart/lib/src/types.dart000066400000000000000000000116151473234705300205730ustar00rootroot00000000000000import 'dart:typed_data'; /// Represents the number of bits a value occupies. enum BitWidth { width8, width16, width32, width64 } class BitWidthUtil { static int toByteWidth(BitWidth self) { return 1 << self.index; } static BitWidth width(num value) { if (value is int) { var v = value.toInt().abs(); if (v >> 7 == 0) return BitWidth.width8; if (v >> 15 == 0) return BitWidth.width16; if (v >> 31 == 0) return BitWidth.width32; return BitWidth.width64; } return value == _toF32(value as double) ? BitWidth.width32 : BitWidth.width64; } static BitWidth uwidth(num value) { if (value.toInt() == value) { var v = value.toInt().abs(); if (v >> 8 == 0) return BitWidth.width8; if (v >> 16 == 0) return BitWidth.width16; if (v >> 32 == 0) return BitWidth.width32; return BitWidth.width64; } return value == _toF32(value as double) ? BitWidth.width32 : BitWidth.width64; } static BitWidth fromByteWidth(int value) { if (value == 1) { return BitWidth.width8; } if (value == 2) { return BitWidth.width16; } if (value == 4) { return BitWidth.width32; } if (value == 8) { return BitWidth.width64; } throw Exception('Unexpected value $value'); } static int paddingSize(int bufSize, int scalarSize) { return (~bufSize + 1) & (scalarSize - 1); } static double _toF32(double value) { var bdata = ByteData(4); bdata.setFloat32(0, value); return bdata.getFloat32(0); } static BitWidth max(BitWidth self, BitWidth other) { if (self.index < other.index) { return other; } return self; } } /// Represents all internal FlexBuffer types. enum ValueType { Null, Int, UInt, Float, Key, String, IndirectInt, IndirectUInt, IndirectFloat, Map, Vector, VectorInt, VectorUInt, VectorFloat, VectorKey, @Deprecated( 'VectorString is deprecated due to a flaw in the binary format (https://github.com/google/flatbuffers/issues/5627)') VectorString, VectorInt2, VectorUInt2, VectorFloat2, VectorInt3, VectorUInt3, VectorFloat3, VectorInt4, VectorUInt4, VectorFloat4, Blob, Bool, VectorBool } class ValueTypeUtils { static int toInt(ValueType self) { if (self == ValueType.VectorBool) return 36; return self.index; } static ValueType fromInt(int value) { if (value == 36) return ValueType.VectorBool; return ValueType.values[value]; } static bool isInline(ValueType self) { return self == ValueType.Bool || toInt(self) <= toInt(ValueType.Float); } static bool isNumber(ValueType self) { return toInt(self) >= toInt(ValueType.Int) && toInt(self) <= toInt(ValueType.Float); } static bool isIndirectNumber(ValueType self) { return toInt(self) >= toInt(ValueType.IndirectInt) && toInt(self) <= toInt(ValueType.IndirectFloat); } static bool isTypedVectorElement(ValueType self) { return self == ValueType.Bool || (toInt(self) >= toInt(ValueType.Int) && toInt(self) <= toInt(ValueType.String)); } static bool isTypedVector(ValueType self) { return self == ValueType.VectorBool || (toInt(self) >= toInt(ValueType.VectorInt) && toInt(self) <= toInt(ValueType.VectorString)); } static bool isFixedTypedVector(ValueType self) { return (toInt(self) >= toInt(ValueType.VectorInt2) && toInt(self) <= toInt(ValueType.VectorFloat4)); } static bool isAVector(ValueType self) { return (isTypedVector(self) || isFixedTypedVector(self) || self == ValueType.Vector); } static ValueType toTypedVector(ValueType self, int length) { if (length == 0) { return ValueTypeUtils.fromInt( toInt(self) - toInt(ValueType.Int) + toInt(ValueType.VectorInt)); } if (length == 2) { return ValueTypeUtils.fromInt( toInt(self) - toInt(ValueType.Int) + toInt(ValueType.VectorInt2)); } if (length == 3) { return ValueTypeUtils.fromInt( toInt(self) - toInt(ValueType.Int) + toInt(ValueType.VectorInt3)); } if (length == 4) { return ValueTypeUtils.fromInt( toInt(self) - toInt(ValueType.Int) + toInt(ValueType.VectorInt4)); } throw Exception('unexpected length ' + length.toString()); } static ValueType typedVectorElementType(ValueType self) { return ValueTypeUtils.fromInt( toInt(self) - toInt(ValueType.VectorInt) + toInt(ValueType.Int)); } static ValueType fixedTypedVectorElementType(ValueType self) { return ValueTypeUtils.fromInt( (toInt(self) - toInt(ValueType.VectorInt2)) % 3 + toInt(ValueType.Int)); } static int fixedTypedVectorElementSize(ValueType self) { return (toInt(self) - toInt(ValueType.VectorInt2)) ~/ 3 + 2; } static int packedType(ValueType self, BitWidth bitWidth) { return bitWidth.index | (toInt(self) << 2); } } flatbuffers-24.12.23/dart/publish.sh000077500000000000000000000021241473234705300172160ustar00rootroot00000000000000#!/bin/sh # # Copyright 2018 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # # Note to pub consumers: this file is used to assist with publishing the # pub package from the flatbuffers repository and is not meant for general use. # As pub does not currently provide a way to exclude files, it is included here. set -e command -v dart >/dev/null 2>&1 || { echo >&2 "Require `dart` but it's not installed. Aborting."; exit 1; } pushd ../tests ./DartTest.sh popd pushd ../samples ./dart_sample.sh popd dart pub publish rm example/monster.fbs rm test/*.fbs rm -rf test/sub flatbuffers-24.12.23/dart/pubspec.yaml000066400000000000000000000006601473234705300175410ustar00rootroot00000000000000name: flat_buffers version: 24.12.23 description: FlatBuffers reading and writing library for Dart. Based on original work by Konstantin Scheglov and Paul Berry of the Dart SDK team. homepage: https://github.com/google/flatbuffers documentation: https://google.github.io/flatbuffers/index.html environment: sdk: '>=2.17.0 <4.0.0' dev_dependencies: test: ^1.17.7 test_reflective_loader: ^0.2.0 path: ^1.8.0 lints: ^1.0.1 flatbuffers-24.12.23/dart/test/000077500000000000000000000000001473234705300161715ustar00rootroot00000000000000flatbuffers-24.12.23/dart/test/bool_structs.fbs000066400000000000000000000001621473234705300214060ustar00rootroot00000000000000// Test for #7355 table Foo { my_foo : foo_properties; } struct foo_properties { a : bool; b : bool; } flatbuffers-24.12.23/dart/test/bool_structs_generated.dart000066400000000000000000000107201473234705300236050ustar00rootroot00000000000000// automatically generated by the FlatBuffers compiler, do not modify // ignore_for_file: unused_import, unused_field, unused_element, unused_local_variable, constant_identifier_names import 'dart:typed_data' show Uint8List; import 'package:flat_buffers/flat_buffers.dart' as fb; class Foo { Foo._(this._bc, this._bcOffset); factory Foo(List bytes) { final rootRef = fb.BufferContext.fromBytes(bytes); return reader.read(rootRef, 0); } static const fb.Reader reader = _FooReader(); final fb.BufferContext _bc; final int _bcOffset; FooProperties? get myFoo => FooProperties.reader.vTableGetNullable(_bc, _bcOffset, 4); @override String toString() { return 'Foo{myFoo: ${myFoo}}'; } FooT unpack() => FooT( myFoo: myFoo?.unpack()); static int pack(fb.Builder fbBuilder, FooT? object) { if (object == null) return 0; return object.pack(fbBuilder); } } class FooT implements fb.Packable { FooPropertiesT? myFoo; FooT({ this.myFoo}); @override int pack(fb.Builder fbBuilder) { fbBuilder.startTable(1); if (myFoo != null) { fbBuilder.addStruct(0, myFoo!.pack(fbBuilder)); } return fbBuilder.endTable(); } @override String toString() { return 'FooT{myFoo: ${myFoo}}'; } } class _FooReader extends fb.TableReader { const _FooReader(); @override Foo createObject(fb.BufferContext bc, int offset) => Foo._(bc, offset); } class FooBuilder { FooBuilder(this.fbBuilder); final fb.Builder fbBuilder; void begin() { fbBuilder.startTable(1); } int addMyFoo(int offset) { fbBuilder.addStruct(0, offset); return fbBuilder.offset; } int finish() { return fbBuilder.endTable(); } } class FooObjectBuilder extends fb.ObjectBuilder { final FooPropertiesObjectBuilder? _myFoo; FooObjectBuilder({ FooPropertiesObjectBuilder? myFoo, }) : _myFoo = myFoo; /// Finish building, and store into the [fbBuilder]. @override int finish(fb.Builder fbBuilder) { fbBuilder.startTable(1); if (_myFoo != null) { fbBuilder.addStruct(0, _myFoo!.finish(fbBuilder)); } return fbBuilder.endTable(); } /// Convenience method to serialize to byte list. @override Uint8List toBytes([String? fileIdentifier]) { final fbBuilder = fb.Builder(deduplicateTables: false); fbBuilder.finish(finish(fbBuilder), fileIdentifier); return fbBuilder.buffer; } } class FooProperties { FooProperties._(this._bc, this._bcOffset); static const fb.Reader reader = _FooPropertiesReader(); final fb.BufferContext _bc; final int _bcOffset; bool get a => const fb.BoolReader().read(_bc, _bcOffset + 0); bool get b => const fb.BoolReader().read(_bc, _bcOffset + 1); @override String toString() { return 'FooProperties{a: ${a}, b: ${b}}'; } FooPropertiesT unpack() => FooPropertiesT( a: a, b: b); static int pack(fb.Builder fbBuilder, FooPropertiesT? object) { if (object == null) return 0; return object.pack(fbBuilder); } } class FooPropertiesT implements fb.Packable { bool a; bool b; FooPropertiesT({ required this.a, required this.b}); @override int pack(fb.Builder fbBuilder) { fbBuilder.putBool(b); fbBuilder.putBool(a); return fbBuilder.offset; } @override String toString() { return 'FooPropertiesT{a: ${a}, b: ${b}}'; } } class _FooPropertiesReader extends fb.StructReader { const _FooPropertiesReader(); @override int get size => 2; @override FooProperties createObject(fb.BufferContext bc, int offset) => FooProperties._(bc, offset); } class FooPropertiesBuilder { FooPropertiesBuilder(this.fbBuilder); final fb.Builder fbBuilder; int finish(bool a, bool b) { fbBuilder.putBool(b); fbBuilder.putBool(a); return fbBuilder.offset; } } class FooPropertiesObjectBuilder extends fb.ObjectBuilder { final bool _a; final bool _b; FooPropertiesObjectBuilder({ required bool a, required bool b, }) : _a = a, _b = b; /// Finish building, and store into the [fbBuilder]. @override int finish(fb.Builder fbBuilder) { fbBuilder.putBool(_b); fbBuilder.putBool(_a); return fbBuilder.offset; } /// Convenience method to serialize to byte list. @override Uint8List toBytes([String? fileIdentifier]) { final fbBuilder = fb.Builder(deduplicateTables: false); fbBuilder.finish(finish(fbBuilder), fileIdentifier); return fbBuilder.buffer; } } flatbuffers-24.12.23/dart/test/enums.fbs000066400000000000000000000001561473234705300200160ustar00rootroot00000000000000enum OptionsEnum : uint32 { A = 1, B = 2, C = 3 } table MyTable { options : [OptionsEnum]; } flatbuffers-24.12.23/dart/test/enums_generated.dart000066400000000000000000000072061473234705300222170ustar00rootroot00000000000000// automatically generated by the FlatBuffers compiler, do not modify // ignore_for_file: unused_import, unused_field, unused_element, unused_local_variable, constant_identifier_names import 'dart:typed_data' show Uint8List; import 'package:flat_buffers/flat_buffers.dart' as fb; enum OptionsEnum { A(1), B(2), C(3); final int value; const OptionsEnum(this.value); factory OptionsEnum.fromValue(int value) { switch (value) { case 1: return OptionsEnum.A; case 2: return OptionsEnum.B; case 3: return OptionsEnum.C; default: throw StateError('Invalid value $value for bit flag enum'); } } static OptionsEnum? _createOrNull(int? value) => value == null ? null : OptionsEnum.fromValue(value); static const int minValue = 1; static const int maxValue = 3; static const fb.Reader reader = _OptionsEnumReader(); } class _OptionsEnumReader extends fb.Reader { const _OptionsEnumReader(); @override int get size => 4; @override OptionsEnum read(fb.BufferContext bc, int offset) => OptionsEnum.fromValue(const fb.Uint32Reader().read(bc, offset)); } class MyTable { MyTable._(this._bc, this._bcOffset); factory MyTable(List bytes) { final rootRef = fb.BufferContext.fromBytes(bytes); return reader.read(rootRef, 0); } static const fb.Reader reader = _MyTableReader(); final fb.BufferContext _bc; final int _bcOffset; List? get options => const fb.ListReader(OptionsEnum.reader).vTableGetNullable(_bc, _bcOffset, 4); @override String toString() { return 'MyTable{options: ${options}}'; } MyTableT unpack() => MyTableT( options: const fb.ListReader(OptionsEnum.reader, lazy: false).vTableGetNullable(_bc, _bcOffset, 4)); static int pack(fb.Builder fbBuilder, MyTableT? object) { if (object == null) return 0; return object.pack(fbBuilder); } } class MyTableT implements fb.Packable { List? options; MyTableT({ this.options}); @override int pack(fb.Builder fbBuilder) { final int? optionsOffset = options == null ? null : fbBuilder.writeListUint32(options!.map((f) => f.value).toList()); fbBuilder.startTable(1); fbBuilder.addOffset(0, optionsOffset); return fbBuilder.endTable(); } @override String toString() { return 'MyTableT{options: ${options}}'; } } class _MyTableReader extends fb.TableReader { const _MyTableReader(); @override MyTable createObject(fb.BufferContext bc, int offset) => MyTable._(bc, offset); } class MyTableBuilder { MyTableBuilder(this.fbBuilder); final fb.Builder fbBuilder; void begin() { fbBuilder.startTable(1); } int addOptionsOffset(int? offset) { fbBuilder.addOffset(0, offset); return fbBuilder.offset; } int finish() { return fbBuilder.endTable(); } } class MyTableObjectBuilder extends fb.ObjectBuilder { final List? _options; MyTableObjectBuilder({ List? options, }) : _options = options; /// Finish building, and store into the [fbBuilder]. @override int finish(fb.Builder fbBuilder) { final int? optionsOffset = _options == null ? null : fbBuilder.writeListUint32(_options!.map((f) => f.value).toList()); fbBuilder.startTable(1); fbBuilder.addOffset(0, optionsOffset); return fbBuilder.endTable(); } /// Convenience method to serialize to byte list. @override Uint8List toBytes([String? fileIdentifier]) { final fbBuilder = fb.Builder(deduplicateTables: false); fbBuilder.finish(finish(fbBuilder), fileIdentifier); return fbBuilder.buffer; } } flatbuffers-24.12.23/dart/test/flat_buffers_test.dart000066400000000000000000001014641473234705300225540ustar00rootroot00000000000000import 'dart:typed_data'; import 'dart:io' as io; import 'package:path/path.dart' as path; import 'package:flat_buffers/flat_buffers.dart'; import 'package:test/test.dart'; import 'package:test_reflective_loader/test_reflective_loader.dart'; import './monster_test_my_game.example_generated.dart' as example; import './monster_test_my_game.example2_generated.dart' as example2; import 'enums_generated.dart' as example3; import './bool_structs_generated.dart' as example4; main() { defineReflectiveSuite(() { defineReflectiveTests(BuilderTest); defineReflectiveTests(ObjectAPITest); defineReflectiveTests(CheckOtherLangaugesData); defineReflectiveTests(GeneratorTest); defineReflectiveTests(ListOfEnumsTest); }); } int indexToField(int index) { return (1 + 1 + index) * 2; } @reflectiveTest class CheckOtherLangaugesData { test_cppData() async { List data = await io.File(path.join( path.context.current, 'test', 'monsterdata_test.mon', )).readAsBytes(); example.Monster mon = example.Monster(data); expect(mon.hp, 80); expect(mon.mana, 150); expect(mon.name, 'MyMonster'); expect(mon.pos!.x, 1.0); expect(mon.pos!.y, 2.0); expect(mon.pos!.z, 3.0); expect(mon.pos!.test1, 3.0); expect(mon.pos!.test2.value, 2.0); expect(mon.pos!.test3.a, 5); expect(mon.pos!.test3.b, 6); expect(mon.testType!.value, example.AnyTypeId.Monster.value); expect(mon.test is example.Monster, true); final monster2 = mon.test as example.Monster; expect(monster2.name, "Fred"); expect(mon.inventory!.length, 5); expect(mon.inventory!.reduce((cur, next) => cur + next), 10); final test4 = mon.test4!; expect(test4.length, 2); expect(test4[0].a + test4[0].b + test4[1].a + test4[1].b, 100); expect(mon.testarrayofstring!.length, 2); expect(mon.testarrayofstring![0], "test1"); expect(mon.testarrayofstring![1], "test2"); // this will fail if accessing any field fails. expect( mon.toString(), 'Monster{' 'pos: Vec3{x: 1.0, y: 2.0, z: 3.0, test1: 3.0, test2: Color.Green, test3: Test{a: 5, b: 6}}, ' 'mana: 150, hp: 80, name: MyMonster, inventory: [0, 1, 2, 3, 4], ' 'color: Color.Blue, testType: AnyTypeId.Monster, ' 'test: Monster{pos: null, mana: 150, hp: 100, name: Fred, ' 'inventory: null, color: Color.Blue, testType: null, ' 'test: null, test4: null, testarrayofstring: null, ' 'testarrayoftables: null, enemy: null, testnestedflatbuffer: null, ' 'testempty: null, testbool: false, testhashs32Fnv1: 0, ' 'testhashu32Fnv1: 0, testhashs64Fnv1: 0, testhashu64Fnv1: 0, ' 'testhashs32Fnv1a: 0, testhashu32Fnv1a: 0, testhashs64Fnv1a: 0, ' 'testhashu64Fnv1a: 0, testarrayofbools: null, testf: 3.14159, ' 'testf2: 3.0, testf3: 0.0, testarrayofstring2: null, ' 'testarrayofsortedstruct: null, flex: null, test5: null, ' 'vectorOfLongs: null, vectorOfDoubles: null, parentNamespaceTest: null, ' 'vectorOfReferrables: null, singleWeakReference: 0, ' 'vectorOfWeakReferences: null, vectorOfStrongReferrables: null, ' 'coOwningReference: 0, vectorOfCoOwningReferences: null, ' 'nonOwningReference: 0, vectorOfNonOwningReferences: null, ' 'anyUniqueType: null, anyUnique: null, anyAmbiguousType: null, ' 'anyAmbiguous: null, vectorOfEnums: null, signedEnum: Race.None, ' 'testrequirednestedflatbuffer: null, scalarKeySortedTables: null, ' 'nativeInline: null, ' 'longEnumNonEnumDefault: LongEnum._default, ' 'longEnumNormalDefault: LongEnum.LongOne, nanDefault: NaN, ' 'infDefault: Infinity, positiveInfDefault: Infinity, infinityDefault: ' 'Infinity, positiveInfinityDefault: Infinity, negativeInfDefault: ' '-Infinity, negativeInfinityDefault: -Infinity, doubleInfDefault: Infinity}, ' 'test4: [Test{a: 10, b: 20}, Test{a: 30, b: 40}], ' 'testarrayofstring: [test1, test2], testarrayoftables: null, ' 'enemy: Monster{pos: null, mana: 150, hp: 100, name: Fred, ' 'inventory: null, color: Color.Blue, testType: null, ' 'test: null, test4: null, testarrayofstring: null, ' 'testarrayoftables: null, enemy: null, testnestedflatbuffer: null, ' 'testempty: null, testbool: false, testhashs32Fnv1: 0, ' 'testhashu32Fnv1: 0, testhashs64Fnv1: 0, testhashu64Fnv1: 0, ' 'testhashs32Fnv1a: 0, testhashu32Fnv1a: 0, testhashs64Fnv1a: 0, ' 'testhashu64Fnv1a: 0, testarrayofbools: null, testf: 3.14159, ' 'testf2: 3.0, testf3: 0.0, testarrayofstring2: null, ' 'testarrayofsortedstruct: null, flex: null, test5: null, ' 'vectorOfLongs: null, vectorOfDoubles: null, parentNamespaceTest: null, ' 'vectorOfReferrables: null, singleWeakReference: 0, ' 'vectorOfWeakReferences: null, vectorOfStrongReferrables: null, ' 'coOwningReference: 0, vectorOfCoOwningReferences: null, ' 'nonOwningReference: 0, vectorOfNonOwningReferences: null, ' 'anyUniqueType: null, anyUnique: null, anyAmbiguousType: null, ' 'anyAmbiguous: null, vectorOfEnums: null, signedEnum: Race.None, ' 'testrequirednestedflatbuffer: null, scalarKeySortedTables: null, ' 'nativeInline: null, ' 'longEnumNonEnumDefault: LongEnum._default, ' 'longEnumNormalDefault: LongEnum.LongOne, nanDefault: NaN, ' 'infDefault: Infinity, positiveInfDefault: Infinity, infinityDefault: ' 'Infinity, positiveInfinityDefault: Infinity, negativeInfDefault: ' '-Infinity, negativeInfinityDefault: -Infinity, doubleInfDefault: Infinity}, ' 'testnestedflatbuffer: null, testempty: null, testbool: true, ' 'testhashs32Fnv1: -579221183, testhashu32Fnv1: 3715746113, ' 'testhashs64Fnv1: 7930699090847568257, ' 'testhashu64Fnv1: 7930699090847568257, ' 'testhashs32Fnv1a: -1904106383, testhashu32Fnv1a: 2390860913, ' 'testhashs64Fnv1a: 4898026182817603057, ' 'testhashu64Fnv1a: 4898026182817603057, ' 'testarrayofbools: [true, false, true], testf: 3.14159, testf2: 3.0, ' 'testf3: 0.0, testarrayofstring2: null, testarrayofsortedstruct: [' 'Ability{id: 0, distance: 45}, Ability{id: 1, distance: 21}, ' 'Ability{id: 5, distance: 12}], ' 'flex: null, test5: [Test{a: 10, b: 20}, Test{a: 30, b: 40}], ' 'vectorOfLongs: [1, 100, 10000, 1000000, 100000000], ' 'vectorOfDoubles: [-1.7976931348623157e+308, 0.0, 1.7976931348623157e+308], ' 'parentNamespaceTest: null, vectorOfReferrables: null, ' 'singleWeakReference: 0, vectorOfWeakReferences: null, ' 'vectorOfStrongReferrables: null, coOwningReference: 0, ' 'vectorOfCoOwningReferences: null, nonOwningReference: 0, ' 'vectorOfNonOwningReferences: null, ' 'anyUniqueType: null, anyUnique: null, ' 'anyAmbiguousType: null, ' 'anyAmbiguous: null, vectorOfEnums: null, signedEnum: Race.None, ' 'testrequirednestedflatbuffer: null, scalarKeySortedTables: [Stat{id: ' 'miss, val: 0, count: 0}, Stat{id: hit, val: 10, count: 1}], ' 'nativeInline: Test{a: 1, b: 2}, ' 'longEnumNonEnumDefault: LongEnum._default, ' 'longEnumNormalDefault: LongEnum.LongOne, nanDefault: NaN, ' 'infDefault: Infinity, positiveInfDefault: Infinity, infinityDefault: ' 'Infinity, positiveInfinityDefault: Infinity, negativeInfDefault: ' '-Infinity, negativeInfinityDefault: -Infinity, doubleInfDefault: Infinity}'); } } /// Test a custom, fixed-memory allocator (no actual allocations performed) class CustomAllocator extends Allocator { final _memory = ByteData(10 * 1024); int _used = 0; Uint8List buffer(int size) => _memory.buffer.asUint8List(_used - size, size); @override ByteData allocate(int size) { if (size > _memory.lengthInBytes) { throw UnsupportedError('Trying to allocate too much'); } _used = size; return ByteData.sublistView(_memory, 0, size); } @override void deallocate(ByteData _) {} } @reflectiveTest class BuilderTest { void test_monsterBuilder([Builder? builder]) { final fbBuilder = builder ?? Builder(); final str = fbBuilder.writeString('MyMonster'); fbBuilder.writeString('test1'); fbBuilder.writeString('test2', asciiOptimization: true); final testArrayOfString = fbBuilder.endStructVector(2); final fred = fbBuilder.writeString('Fred'); final List treasure = [0, 1, 2, 3, 4]; final inventory = fbBuilder.writeListUint8(treasure); final monBuilder = example.MonsterBuilder(fbBuilder) ..begin() ..addNameOffset(fred); final mon2 = monBuilder.finish(); final testBuilder = example.TestBuilder(fbBuilder); testBuilder.finish(10, 20); testBuilder.finish(30, 40); final test4 = fbBuilder.endStructVector(2); monBuilder ..begin() ..addPos( example.Vec3Builder(fbBuilder).finish( 1.0, 2.0, 3.0, 3.0, example.Color.Green, () => testBuilder.finish(5, 6), ), ) ..addHp(80) ..addNameOffset(str) ..addInventoryOffset(inventory) ..addTestType(example.AnyTypeId.Monster) ..addTestOffset(mon2) ..addTest4Offset(test4) ..addTestarrayofstringOffset(testArrayOfString); final mon = monBuilder.finish(); fbBuilder.finish(mon); final mon3 = example.Monster(fbBuilder.buffer); expect(mon3.name, 'MyMonster'); expect(mon3.pos!.test1, 3.0); } void test_error_addInt32_withoutStartTable([Builder? builder]) { builder ??= Builder(); expect(() { builder!.addInt32(0, 0); }, throwsA(isA())); } void test_error_addOffset_withoutStartTable() { Builder builder = Builder(); expect(() { builder.addOffset(0, 0); }, throwsA(isA())); } void test_error_endTable_withoutStartTable() { Builder builder = Builder(); expect(() { builder.endTable(); }, throwsA(isA())); } void test_error_startTable_duringTable() { Builder builder = Builder(); builder.startTable(0); expect(() { builder.startTable(0); }, throwsA(isA())); } void test_error_writeString_duringTable() { Builder builder = Builder(); builder.startTable(1); expect(() { builder.writeString('12345'); }, throwsA(isA())); } void test_file_identifier() { Uint8List byteList; { Builder builder = Builder(initialSize: 0); builder.startTable(0); int offset = builder.endTable(); builder.finish(offset, 'Az~Ãŋ'); byteList = builder.buffer; } // Convert byteList to a ByteData so that we can read data from it. ByteData byteData = byteList.buffer.asByteData(byteList.offsetInBytes); // First 4 bytes are an offset to the table data. int tableDataLoc = byteData.getUint32(0, Endian.little); // Next 4 bytes are the file identifier. expect(byteData.getUint8(4), 65); // 'a' expect(byteData.getUint8(5), 122); // 'z' expect(byteData.getUint8(6), 126); // '~' expect(byteData.getUint8(7), 255); // 'Ãŋ' // First 4 bytes of the table data are a backwards offset to the vtable. int vTableLoc = tableDataLoc - byteData.getInt32(tableDataLoc, Endian.little); // First 2 bytes of the vtable are the size of the vtable in bytes, which // should be 4. expect(byteData.getUint16(vTableLoc, Endian.little), 4); // Next 2 bytes are the size of the object in bytes (including the vtable // pointer), which should be 4. expect(byteData.getUint16(vTableLoc + 2, Endian.little), 4); } void test_low() { final allocator = CustomAllocator(); final builder = Builder(initialSize: 0, allocator: allocator); builder.putUint8(1); expect(allocator.buffer(builder.size()), [1]); builder.putUint32(2); expect(allocator.buffer(builder.size()), [2, 0, 0, 0, 0, 0, 0, 1]); builder.putUint8(3); expect( allocator.buffer(builder.size()), [0, 0, 0, 3, 2, 0, 0, 0, 0, 0, 0, 1]); builder.putUint8(4); expect( allocator.buffer(builder.size()), [0, 0, 4, 3, 2, 0, 0, 0, 0, 0, 0, 1]); builder.putUint8(5); expect( allocator.buffer(builder.size()), [0, 5, 4, 3, 2, 0, 0, 0, 0, 0, 0, 1]); builder.putUint32(6); expect(allocator.buffer(builder.size()), [6, 0, 0, 0, 0, 5, 4, 3, 2, 0, 0, 0, 0, 0, 0, 1]); } void test_table_default() { List byteList; { final builder = Builder(initialSize: 0, allocator: CustomAllocator()); builder.startTable(2); builder.addInt32(0, 10, 10); builder.addInt32(1, 20, 10); int offset = builder.endTable(); builder.finish(offset); byteList = builder.buffer; expect(builder.size(), byteList.length); } // read and verify BufferContext buffer = BufferContext.fromBytes(byteList); int objectOffset = buffer.derefObject(0); // was not written, so uses the new default value expect( const Int32Reader() .vTableGet(buffer, objectOffset, indexToField(0), 15), 15); // has the written value expect( const Int32Reader() .vTableGet(buffer, objectOffset, indexToField(1), 15), 20); } void test_table_format([Builder? builder]) { Uint8List byteList; { builder ??= Builder(initialSize: 0); builder.startTable(3); builder.addInt32(0, 10); builder.addInt32(1, 20); builder.addInt32(2, 30); builder.finish(builder.endTable()); byteList = builder.buffer; } // Convert byteList to a ByteData so that we can read data from it. ByteData byteData = byteList.buffer.asByteData(byteList.offsetInBytes); // First 4 bytes are an offset to the table data. int tableDataLoc = byteData.getUint32(0, Endian.little); // First 4 bytes of the table data are a backwards offset to the vtable. int vTableLoc = tableDataLoc - byteData.getInt32(tableDataLoc, Endian.little); // First 2 bytes of the vtable are the size of the vtable in bytes, which // should be 10. expect(byteData.getUint16(vTableLoc, Endian.little), 10); // Next 2 bytes are the size of the object in bytes (including the vtable // pointer), which should be 16. expect(byteData.getUint16(vTableLoc + 2, Endian.little), 16); // Remaining 6 bytes are the offsets within the object where the ints are // located. for (int i = 0; i < 3; i++) { int offset = byteData.getUint16(vTableLoc + 4 + 2 * i, Endian.little); expect( byteData.getInt32(tableDataLoc + offset, Endian.little), 10 + 10 * i); } } void test_table_string() { String latinString = 'test'; String unicodeString = 'ĐŸŅ€ĐžĐąĐ° ĐŋĐĩŅ€Đ°'; List byteList; { Builder builder = Builder(initialSize: 0); int? latinStringOffset = builder.writeString(latinString, asciiOptimization: true); int? unicodeStringOffset = builder.writeString(unicodeString, asciiOptimization: true); builder.startTable(2); builder.addOffset(0, latinStringOffset); builder.addOffset(1, unicodeStringOffset); int offset = builder.endTable(); builder.finish(offset); byteList = builder.buffer; } // read and verify BufferContext buf = BufferContext.fromBytes(byteList); int objectOffset = buf.derefObject(0); expect( const StringReader() .vTableGetNullable(buf, objectOffset, indexToField(0)), latinString); expect( const StringReader(asciiOptimization: true) .vTableGetNullable(buf, objectOffset, indexToField(1)), unicodeString); } void test_table_types([Builder? builder]) { List byteList; { builder ??= Builder(initialSize: 0); int? stringOffset = builder.writeString('12345'); builder.startTable(7); builder.addBool(0, true); builder.addInt8(1, 10); builder.addInt32(2, 20); builder.addOffset(3, stringOffset); builder.addInt32(4, 40); builder.addUint32(5, 0x9ABCDEF0); builder.addUint8(6, 0x9A); int offset = builder.endTable(); builder.finish(offset); byteList = builder.buffer; } // read and verify BufferContext buf = BufferContext.fromBytes(byteList); int objectOffset = buf.derefObject(0); expect( const BoolReader() .vTableGetNullable(buf, objectOffset, indexToField(0)), true); expect( const Int8Reader() .vTableGetNullable(buf, objectOffset, indexToField(1)), 10); expect( const Int32Reader() .vTableGetNullable(buf, objectOffset, indexToField(2)), 20); expect( const StringReader() .vTableGetNullable(buf, objectOffset, indexToField(3)), '12345'); expect( const Int32Reader() .vTableGetNullable(buf, objectOffset, indexToField(4)), 40); expect( const Uint32Reader() .vTableGetNullable(buf, objectOffset, indexToField(5)), 0x9ABCDEF0); expect( const Uint8Reader() .vTableGetNullable(buf, objectOffset, indexToField(6)), 0x9A); } void test_writeList_of_Uint32() { List values = [10, 100, 12345, 0x9abcdef0]; // write List byteList; { Builder builder = Builder(initialSize: 0); int offset = builder.writeListUint32(values); builder.finish(offset); byteList = builder.buffer; } // read and verify BufferContext buf = BufferContext.fromBytes(byteList); List items = const Uint32ListReader().read(buf, 0); expect(items, hasLength(4)); expect(items, orderedEquals(values)); } void test_writeList_ofBool() { void verifyListBooleans(int len, List trueBits) { // write List byteList; { Builder builder = Builder(initialSize: 0); List values = List.filled(len, false); for (int bit in trueBits) { values[bit] = true; } int offset = builder.writeListBool(values); builder.finish(offset); byteList = builder.buffer; } // read and verify BufferContext buf = BufferContext.fromBytes(byteList); List items = const BoolListReader().read(buf, 0); expect(items, hasLength(len)); for (int i = 0; i < items.length; i++) { expect(items[i], trueBits.contains(i), reason: 'bit $i of $len'); } } verifyListBooleans(0, []); verifyListBooleans(1, []); verifyListBooleans(1, [0]); verifyListBooleans(31, [0, 1]); verifyListBooleans(31, [1, 2, 24, 25, 30]); verifyListBooleans(31, [0, 30]); verifyListBooleans(32, [1, 2, 24, 25, 31]); verifyListBooleans(33, [1, 2, 24, 25, 32]); verifyListBooleans(33, [1, 2, 24, 25, 31, 32]); verifyListBooleans(63, []); verifyListBooleans(63, [0, 1, 2, 61, 62]); verifyListBooleans(63, List.generate(63, (i) => i)); verifyListBooleans(64, []); verifyListBooleans(64, [0, 1, 2, 61, 62, 63]); verifyListBooleans(64, [1, 2, 62]); verifyListBooleans(64, [0, 1, 2, 63]); verifyListBooleans(64, List.generate(64, (i) => i)); verifyListBooleans(100, [0, 3, 30, 60, 90, 99]); } void test_writeList_ofInt32() { List byteList; { Builder builder = Builder(initialSize: 0); int offset = builder.writeListInt32([1, 2, 3, 4, 5]); builder.finish(offset); byteList = builder.buffer; } // read and verify BufferContext buf = BufferContext.fromBytes(byteList); List items = const ListReader(Int32Reader()).read(buf, 0); expect(items, hasLength(5)); expect(items, orderedEquals([1, 2, 3, 4, 5])); } void test_writeList_ofFloat64() { List values = [-1.234567, 3.4E+9, -5.6E-13, 7.8, 12.13]; // write List byteList; { Builder builder = Builder(initialSize: 0); int offset = builder.writeListFloat64(values); builder.finish(offset); byteList = builder.buffer; } // read and verify BufferContext buf = BufferContext.fromBytes(byteList); List items = const Float64ListReader().read(buf, 0); expect(items, hasLength(values.length)); for (int i = 0; i < values.length; i++) { expect(values[i], closeTo(items[i], .001)); } } void test_writeList_ofFloat32() { List values = [1.0, 2.23, -3.213, 7.8, 12.13]; // write List byteList; { Builder builder = Builder(initialSize: 0); int offset = builder.writeListFloat32(values); builder.finish(offset); byteList = builder.buffer; } // read and verify BufferContext buf = BufferContext.fromBytes(byteList); List items = const Float32ListReader().read(buf, 0); expect(items, hasLength(5)); for (int i = 0; i < values.length; i++) { expect(values[i], closeTo(items[i], .001)); } } void test_writeList_ofObjects([Builder? builder]) { List byteList; { builder ??= Builder(initialSize: 0); // write the object #1 int object1; { builder.startTable(2); builder.addInt32(0, 10); builder.addInt32(1, 20); object1 = builder.endTable(); } // write the object #1 int object2; { builder.startTable(2); builder.addInt32(0, 100); builder.addInt32(1, 200); object2 = builder.endTable(); } // write the list int offset = builder.writeList([object1, object2]); builder.finish(offset); byteList = builder.buffer; } // read and verify BufferContext buf = BufferContext.fromBytes(byteList); List items = const ListReader(TestPointReader()).read(buf, 0); expect(items, hasLength(2)); expect(items[0].x, 10); expect(items[0].y, 20); expect(items[1].x, 100); expect(items[1].y, 200); } void test_writeList_ofStrings_asRoot() { List byteList; { Builder builder = Builder(initialSize: 0); int? str1 = builder.writeString('12345'); int? str2 = builder.writeString('ABC'); int offset = builder.writeList([str1, str2]); builder.finish(offset); byteList = builder.buffer; } // read and verify BufferContext buf = BufferContext.fromBytes(byteList); List items = const ListReader(StringReader()).read(buf, 0); expect(items, hasLength(2)); expect(items, contains('12345')); expect(items, contains('ABC')); } void test_writeList_ofStrings_inObject([Builder? builder]) { List byteList; { builder ??= Builder(initialSize: 0); int listOffset = builder.writeList( [builder.writeString('12345'), builder.writeString('ABC')]); builder.startTable(1); builder.addOffset(0, listOffset); int offset = builder.endTable(); builder.finish(offset); byteList = builder.buffer; } // read and verify BufferContext buf = BufferContext.fromBytes(byteList); StringListWrapperImpl reader = StringListWrapperReader().read(buf, 0); List? items = reader.items; expect(items, hasLength(2)); expect(items, contains('12345')); expect(items, contains('ABC')); } void test_writeList_ofUint32() { List byteList; { Builder builder = Builder(initialSize: 0); int offset = builder.writeListUint32([1, 2, 0x9ABCDEF0]); builder.finish(offset); byteList = builder.buffer; } // read and verify BufferContext buf = BufferContext.fromBytes(byteList); List items = const Uint32ListReader().read(buf, 0); expect(items, hasLength(3)); expect(items, orderedEquals([1, 2, 0x9ABCDEF0])); } void test_writeList_ofUint16() { List byteList; { Builder builder = Builder(initialSize: 0); int offset = builder.writeListUint16([1, 2, 60000]); builder.finish(offset); byteList = builder.buffer; } // read and verify BufferContext buf = BufferContext.fromBytes(byteList); List items = const Uint16ListReader().read(buf, 0); expect(items, hasLength(3)); expect(items, orderedEquals([1, 2, 60000])); } void test_writeList_ofUint8() { List byteList; { Builder builder = Builder(initialSize: 0); int offset = builder.writeListUint8([1, 2, 3, 4, 0x9A, 0xFA]); builder.finish(offset); byteList = builder.buffer; } // read and verify BufferContext buf = BufferContext.fromBytes(byteList); const buffOffset = 8; // 32-bit offset to the list, + 32-bit length for (final lazy in [true, false]) { List items = Uint8ListReader(lazy: lazy).read(buf, 0); expect(items, hasLength(6)); expect(items, orderedEquals([1, 2, 3, 4, 0x9A, 0xFA])); // overwrite the buffer to verify the laziness buf.buffer.setUint8(buffOffset + 1, 99); expect(items, orderedEquals([1, lazy ? 99 : 2, 3, 4, 0x9A, 0xFA])); // restore the previous value for the next loop buf.buffer.setUint8(buffOffset + 1, 2); } } void test_reset() { // We'll run a selection of tests , reusing the builder between them. final testCases = [ test_monsterBuilder, test_error_addInt32_withoutStartTable, test_table_format, test_table_types, test_writeList_ofObjects, test_writeList_ofStrings_inObject ]; // Execute all test cases in all permutations of their order. // To do that, we generate permutations of test case indexes. final testCasesPermutations = _permutationsOf(List.generate(testCases.length, (index) => index)); expect(testCasesPermutations.length, _factorial(testCases.length)); for (var indexes in testCasesPermutations) { // print the order so failures are reproducible printOnFailure('Running reset() test cases in order: $indexes'); Builder? builder; for (var index in indexes) { if (builder == null) { // Initial size small enough so at least one test case increases it. // On the other hand, it's large enough so that some test cases don't. builder = Builder(initialSize: 32); } else { builder.reset(); } testCases[index](builder); } } } // Generate permutations of the given list List> _permutationsOf(List source) { final result = >[]; void permutate(List items, int startAt) { for (var i = startAt; i < items.length; i++) { List permutation = items.toList(growable: false); permutation[i] = items[startAt]; permutation[startAt] = items[i]; // add the current list upon reaching the end if (startAt == items.length - 1) { result.add(items); } else { permutate(permutation, startAt + 1); } } } permutate(source, 0); return result; } // a very simple implementation of n! int _factorial(int n) { var result = 1; for (var i = 2; i <= n; i++) { result *= i; } return result; } } @reflectiveTest class ObjectAPITest { void test_tableStat() { final object1 = example.StatT(count: 3, id: "foo", val: 4); final fbb = Builder(); fbb.finish(object1.pack(fbb)); final object2 = example.Stat(fbb.buffer).unpack(); expect(object2.count, object1.count); expect(object2.id, object1.id); expect(object2.val, object1.val); expect(object2.toString(), object1.toString()); } void test_tableMonster() { final monster = example.MonsterT() ..pos = example.Vec3T( x: 1, y: 2, z: 3, test1: 4.0, test2: example.Color.Red, test3: example.TestT(a: 1, b: 2)) ..mana = 2 ..name = 'Monstrous' ..inventory = [24, 42] ..color = example.Color.Green // TODO be smarter for unions and automatically set the `type` field? ..testType = example.AnyTypeId.MyGame_Example2_Monster ..test = example2.MonsterT() ..test4 = [example.TestT(a: 3, b: 4), example.TestT(a: 5, b: 6)] ..testarrayofstring = ["foo", "bar"] ..testarrayoftables = [example.MonsterT(name: 'Oof')] ..enemy = example.MonsterT(name: 'Enemy') ..testarrayofbools = [false, true, false] ..testf = 42.24 ..testarrayofsortedstruct = [ example.AbilityT(id: 1, distance: 5), example.AbilityT(id: 3, distance: 7) ] ..vectorOfLongs = [5, 6, 7] ..vectorOfDoubles = [8.9, 9.0, 10.1, 11.2] ..anyAmbiguousType = example.AnyAmbiguousAliasesTypeId.M2 ..anyAmbiguous = null ..vectorOfEnums = [example.Color.Blue, example.Color.Green] ..signedEnum = example.Race.None; final fbBuilder = Builder(); final offset = monster.pack(fbBuilder); expect(offset, isNonZero); fbBuilder.finish(offset); final data = fbBuilder.buffer; // TODO currently broken because of struct builder issue, see #6688 // final monster2 = example.Monster(data); // Monster (reader) // expect( // // map Monster => MonsterT, Vec3 => Vec3T, ... // monster2.toString().replaceAllMapped( // RegExp('([a-zA-z0-9]+){'), (match) => match.group(1) + 'T{'), // monster.toString()); // // final monster3 = monster2.unpack(); // MonsterT // expect(monster3.toString(), monster.toString()); } void test_Lists() { // Ensure unpack() reads lists eagerly by reusing the same builder and // overwriting data. Why: because standard reader reads lists lazily... final fbb = Builder(); final object1 = example.TypeAliasesT(v8: [1, 2, 3], vf64: [5, 6]); fbb.finish(object1.pack(fbb)); final object1Read = example.TypeAliases(fbb.buffer).unpack(); // overwrite the original buffer by writing to the same builder fbb.reset(); final object2 = example.TypeAliasesT(v8: [7, 8, 9], vf64: [10, 11]); fbb.finish(object2.pack(fbb)); final object2Read = example.TypeAliases(fbb.buffer).unpack(); // this is fine even with lazy lists: expect(object2.toString(), object2Read.toString()); // this fails with lazy lists: expect(object1.toString(), object1Read.toString()); // empty list must be serialized as such (were stored NULL before v2.0) fbb.reset(); final object3 = example.TypeAliasesT(v8: [], vf64: null); fbb.finish(object3.pack(fbb)); final object3Read = example.TypeAliases(fbb.buffer).unpack(); expect(object3.toString(), object3Read.toString()); } } class StringListWrapperImpl { final BufferContext bp; final int offset; StringListWrapperImpl(this.bp, this.offset); List? get items => const ListReader(StringReader()) .vTableGetNullable(bp, offset, indexToField(0)); } class StringListWrapperReader extends TableReader { const StringListWrapperReader(); @override StringListWrapperImpl createObject(BufferContext object, int offset) { return StringListWrapperImpl(object, offset); } } class TestPointImpl { final BufferContext bp; final int offset; TestPointImpl(this.bp, this.offset); int get x => const Int32Reader().vTableGet(bp, offset, indexToField(0), 0); int get y => const Int32Reader().vTableGet(bp, offset, indexToField(1), 0); } class TestPointReader extends TableReader { const TestPointReader(); @override TestPointImpl createObject(BufferContext object, int offset) { return TestPointImpl(object, offset); } } @reflectiveTest class GeneratorTest { void test_constantEnumValues() async { expect(example.Color.values, same(example.Color.values)); expect(example.Race.values, same(example.Race.values)); expect(example.AnyTypeId.values, same(example.AnyTypeId.values)); expect(example.AnyUniqueAliasesTypeId.values, same(example.AnyUniqueAliasesTypeId.values)); expect(example.AnyAmbiguousAliasesTypeId.values, same(example.AnyAmbiguousAliasesTypeId.values)); } } // See #6869 @reflectiveTest class ListOfEnumsTest { void test_listOfEnums() async { var mytable = example3.MyTableObjectBuilder(options: [ example3.OptionsEnum.A, example3.OptionsEnum.B, example3.OptionsEnum.C ]); var bytes = mytable.toBytes(); var mytable_read = example3.MyTable(bytes); expect(mytable_read.options![0].value, example3.OptionsEnum.A.value); expect(mytable_read.options![1].value, example3.OptionsEnum.B.value); expect(mytable_read.options![2].value, example3.OptionsEnum.C.value); } } @reflectiveTest class BoolInStructTest { void test_boolInStruct() async { var mystruct = example4.FooObjectBuilder( myFoo: example4.FooPropertiesObjectBuilder(a: true, b: false)); var bytes = mystruct.toBytes(); var mystruct_read = example4.Foo(bytes); expect(mystruct_read.myFoo!.a, true); expect(mystruct_read.myFoo!.b, false); } } flatbuffers-24.12.23/dart/test/flex_builder_test.dart000066400000000000000000000252411473234705300225540ustar00rootroot00000000000000import 'dart:typed_data'; import 'package:flat_buffers/flex_buffers.dart' show Builder; import 'package:test/test.dart'; void main() { test('build with single value', () { { var flx = Builder(); flx.addNull(); expect(flx.finish(), [0, 0, 1]); } { var flx = Builder(); flx.addBool(true); expect(flx.finish(), [1, 104, 1]); } { var flx = Builder(); flx.addBool(false); expect(flx.finish(), [0, 104, 1]); } { var flx = Builder(); flx.addInt(1); expect(flx.finish(), [1, 4, 1]); } { var flx = Builder(); flx.addInt(230); expect(flx.finish(), [230, 0, 5, 2]); } { var flx = Builder(); flx.addInt(1025); expect(flx.finish(), [1, 4, 5, 2]); } { var flx = Builder(); flx.addInt(-1025); expect(flx.finish(), [255, 251, 5, 2]); } { var builder = Builder()..addDouble(1.0); expect(builder.finish(), [0, 0, 128, 63, 14, 4]); } { var flx = Builder(); flx.addDouble(0.1); expect(flx.finish(), [154, 153, 153, 153, 153, 153, 185, 63, 15, 8]); } { var flx = Builder(); flx.addDouble(0.5); expect(flx.finish(), [0, 0, 0, 63, 14, 4]); } { var flx = Builder(); flx.addString('Maxim'); expect(flx.finish(), [5, 77, 97, 120, 105, 109, 0, 6, 20, 1]); } { var flx = Builder(); flx.addString('hello 😱'); expect(flx.finish(), [10, 104, 101, 108, 108, 111, 32, 240, 159, 152, 177, 0, 11, 20, 1]); } }); test('build vector', () { { var flx = Builder() ..startVector() ..addInt(1) ..addInt(2) ..end(); expect(flx.finish(), [1, 2, 2, 64, 1]); } { var flx = Builder() ..startVector() ..addInt(-1) ..addInt(256) ..end(); expect(flx.finish(), [255, 255, 0, 1, 4, 65, 1]); } { var flx = Builder() ..startVector() ..addInt(-45) ..addInt(256000) ..end(); expect(flx.finish(), [211, 255, 255, 255, 0, 232, 3, 0, 8, 66, 1]); } { var flx = Builder() ..startVector() ..addDouble(1.1) ..addDouble(-256) ..end(); expect(flx.finish(), [ 154, 153, 153, 153, 153, 153, 241, 63, 0, 0, 0, 0, 0, 0, 112, 192, 16, 75, 1 ]); } { var flx = Builder() ..startVector() ..addInt(1) ..addInt(2) ..addInt(4) ..end(); expect(flx.finish(), [1, 2, 4, 3, 76, 1]); } { var flx = Builder() ..startVector() ..addInt(-1) ..addInt(256) ..addInt(4) ..end(); expect(flx.finish(), [255, 255, 0, 1, 4, 0, 6, 77, 1]); } { var flx = Builder() ..startVector() ..startVector() ..addInt(61) ..end() ..addInt(64) ..end(); expect(flx.finish(), [1, 61, 2, 2, 64, 44, 4, 4, 40, 1]); } { var flx = Builder() ..startVector() ..addString('foo') ..addString('bar') ..addString('baz') ..end(); expect(flx.finish(), [ 3, 102, 111, 111, 0, 3, 98, 97, 114, 0, 3, 98, 97, 122, 0, 3, 15, 11, 7, 3, 60, 1 ]); } { var flx = Builder() ..startVector() ..addString('foo') ..addString('bar') ..addString('baz') ..addString('foo') ..addString('bar') ..addString('baz') ..end(); expect(flx.finish(), [ 3, 102, 111, 111, 0, 3, 98, 97, 114, 0, 3, 98, 97, 122, 0, 6, 15, 11, 7, 18, 14, 10, 6, 60, 1 ]); } { var flx = Builder() ..startVector() ..addBool(true) ..addBool(false) ..addBool(true) ..end(); expect(flx.finish(), [3, 1, 0, 1, 3, 144, 1]); } { var flx = Builder() ..startVector() ..addString('foo') ..addInt(1) ..addInt(-5) ..addDouble(1.3) ..addBool(true) ..end(); expect(flx.finish(), [ 3, 102, 111, 111, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 251, 255, 255, 255, 255, 255, 255, 255, 205, 204, 204, 204, 204, 204, 244, 63, 1, 0, 0, 0, 0, 0, 0, 0, 20, 4, 4, 15, 104, 45, 43, 1 ]); } }); test('build map', () { { var flx = Builder() ..startMap() ..addKey('a') ..addInt(12) ..end(); expect(flx.finish(), [97, 0, 1, 3, 1, 1, 1, 12, 4, 2, 36, 1]); } { var flx = Builder() ..startMap() ..addKey('a') ..addInt(12) ..addKey('') ..addInt(45) ..end(); expect( flx.finish(), [97, 0, 0, 2, 2, 5, 2, 1, 2, 45, 12, 4, 4, 4, 36, 1]); } { var flx = Builder() ..startVector() ..startMap() ..addKey('something') ..addInt(12) ..end() ..startMap() ..addKey('something') ..addInt(45) ..end() ..end(); expect(flx.finish(), [ 115, 111, 109, 101, 116, 104, 105, 110, 103, 0, 1, 11, 1, 1, 1, 12, 4, 6, 1, 1, 45, 4, 2, 8, 4, 36, 36, 4, 40, 1 ]); } }); test('build blob', () { { var flx = Builder()..addBlob(Uint8List.fromList([1, 2, 3]).buffer); expect(flx.finish(), [3, 1, 2, 3, 3, 100, 1]); } }); test('build from object', () { expect( Builder.buildFromObject(Uint8List.fromList([1, 2, 3]).buffer) .asUint8List(), [3, 1, 2, 3, 3, 100, 1]); expect(Builder.buildFromObject(null).asUint8List(), [0, 0, 1]); expect(Builder.buildFromObject(true).asUint8List(), [1, 104, 1]); expect(Builder.buildFromObject(false).asUint8List(), [0, 104, 1]); expect(Builder.buildFromObject(25).asUint8List(), [25, 4, 1]); expect(Builder.buildFromObject(-250).asUint8List(), [6, 255, 5, 2]); expect( Builder.buildFromObject(-2.50).asUint8List(), [0, 0, 32, 192, 14, 4]); expect(Builder.buildFromObject('Maxim').asUint8List(), [5, 77, 97, 120, 105, 109, 0, 6, 20, 1]); expect( Builder.buildFromObject([1, 3.3, 'max', true, null, false]) .asUint8List(), [ 3, 109, 97, 120, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 102, 102, 102, 102, 102, 102, 10, 64, 31, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 15, 20, 104, 0, 104, 54, 43, 1 ]); expect( Builder.buildFromObject([ {'something': 12}, {'something': 45} ]).asUint8List(), [ 115, 111, 109, 101, 116, 104, 105, 110, 103, 0, 1, 11, 1, 1, 1, 12, 4, 6, 1, 1, 45, 4, 2, 8, 4, 36, 36, 4, 40, 1 ]); }); test('add double indirectly', () { var flx = Builder()..addDoubleIndirectly(0.1); expect(flx.finish(), [154, 153, 153, 153, 153, 153, 185, 63, 8, 35, 1]); }); test('add double indirectly to vector with cache', () { var flx = Builder() ..startVector() ..addDoubleIndirectly(0.1, cache: true) ..addDoubleIndirectly(0.1, cache: true) ..addDoubleIndirectly(0.1, cache: true) ..addDoubleIndirectly(0.1, cache: true) ..end(); expect(flx.finish(), [ 154, 153, 153, 153, 153, 153, 185, 63, 4, 9, 10, 11, 12, 35, 35, 35, 35, 8, 40, 1 ]); }); test('add int indirectly', () { var flx = Builder()..addIntIndirectly(2345234523452345); expect(flx.finish(), [185, 115, 175, 118, 250, 84, 8, 0, 8, 27, 1]); }); test('add int indirectly to vector with cache', () { var flx = Builder() ..startVector() ..addIntIndirectly(2345234523452345, cache: true) ..addIntIndirectly(2345234523452345, cache: true) ..addIntIndirectly(2345234523452345, cache: true) ..addIntIndirectly(2345234523452345, cache: true) ..end(); expect(flx.finish(), [ 185, 115, 175, 118, 250, 84, 8, 0, 4, 9, 10, 11, 12, 27, 27, 27, 27, 8, 40, 1 ]); }); test('snapshot', () { var flx = Builder(); flx.startVector(); flx.addInt(12); expect(flx.snapshot().asUint8List(), [1, 12, 1, 44, 1]); flx.addInt(24); expect(flx.snapshot().asUint8List(), [12, 24, 2, 64, 1]); flx.addInt(45); expect(flx.snapshot().asUint8List(), [12, 24, 45, 3, 76, 1]); }); } flatbuffers-24.12.23/dart/test/flex_reader_test.dart000066400000000000000000000377171473234705300224030ustar00rootroot00000000000000import 'dart:typed_data'; import 'package:flat_buffers/flex_buffers.dart' show Reference, Builder; import 'package:test/test.dart'; void main() { test('is null', () { expect(Reference.fromBuffer(b([0, 0, 1])).isNull, isTrue); }); test('bool value', () { expect(Reference.fromBuffer(b([1, 104, 1])).boolValue, isTrue); expect(Reference.fromBuffer(b([0, 104, 1])).boolValue, isFalse); }); test('int value', () { expect(Reference.fromBuffer(b([25, 4, 1])).intValue, 25); expect(Reference.fromBuffer(b([231, 4, 1])).intValue, -25); expect(Reference.fromBuffer(b([230, 8, 1])).intValue, 230); expect(Reference.fromBuffer(b([230, 0, 5, 2])).intValue, 230); expect(Reference.fromBuffer(b([1, 4, 5, 2])).intValue, 1025); expect(Reference.fromBuffer(b([255, 251, 5, 2])).intValue, -1025); expect(Reference.fromBuffer(b([1, 4, 9, 2])).intValue, 1025); expect(Reference.fromBuffer(b([255, 255, 255, 127, 6, 4])).intValue, 2147483647); expect(Reference.fromBuffer(b([0, 0, 0, 128, 6, 4])).intValue, -2147483648); expect( Reference.fromBuffer(b([255, 255, 255, 255, 0, 0, 0, 0, 7, 8])) .intValue, 4294967295); expect( Reference.fromBuffer(b([255, 255, 255, 255, 255, 255, 255, 127, 7, 8])) .intValue, 9223372036854775807); expect(Reference.fromBuffer(b([0, 0, 0, 0, 0, 0, 0, 128, 7, 8])).intValue, -9223372036854775808); // Dart does not really support UInt64 // expect(FlxValue.fromBuffer(b([255, 255, 255, 255, 255, 255, 255, 255, 11, 8])).intValue, 18446744073709551615); }); test('double value', () { expect(Reference.fromBuffer(b([0, 0, 128, 63, 14, 4])).doubleValue, 1.0); expect(Reference.fromBuffer(b([0, 0, 144, 64, 14, 4])).doubleValue, 4.5); expect(Reference.fromBuffer(b([205, 204, 204, 61, 14, 4])).doubleValue, closeTo(.1, .001)); expect( Reference.fromBuffer(b([154, 153, 153, 153, 153, 153, 185, 63, 15, 8])) .doubleValue, .1); }); test('num value', () { expect(Reference.fromBuffer(b([0, 0, 144, 64, 14, 4])).numValue, 4.5); expect(Reference.fromBuffer(b([205, 204, 204, 61, 14, 4])).numValue, closeTo(.1, .001)); expect( Reference.fromBuffer(b([154, 153, 153, 153, 153, 153, 185, 63, 15, 8])) .numValue, .1); expect(Reference.fromBuffer(b([255, 251, 5, 2])).numValue, -1025); }); test('string value', () { expect( Reference.fromBuffer(b([5, 77, 97, 120, 105, 109, 0, 6, 20, 1])) .stringValue, 'Maxim'); expect( Reference.fromBuffer(b([ 10, 104, 101, 108, 108, 111, 32, 240, 159, 152, 177, 0, 11, 20, 1 ])).stringValue, 'hello 😱'); }); test('blob value', () { expect( Reference.fromBuffer(b([3, 1, 2, 3, 3, 100, 1])).blobValue, [1, 2, 3]); }); test('bool vector', () { var flx = Reference.fromBuffer(b([3, 1, 0, 1, 3, 144, 1])); expect(flx[0].boolValue, true); expect(flx[1].boolValue, false); expect(flx[2].boolValue, true); }); test('number vector', () { testNumbers([3, 1, 2, 3, 3, 44, 1], [1, 2, 3]); testNumbers([3, 255, 2, 3, 3, 44, 1], [-1, 2, 3]); testNumbers([3, 0, 1, 0, 43, 2, 3, 0, 6, 45, 1], [1, 555, 3]); testNumbers([3, 0, 0, 0, 1, 0, 0, 0, 204, 216, 0, 0, 3, 0, 0, 0, 12, 46, 1], [1, 55500, 3]); testNumbers([ 3, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 172, 128, 94, 239, 12, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 24, 47, 1 ], [ 1, 55555555500, 3 ]); testNumbers( [3, 0, 0, 0, 0, 0, 192, 63, 0, 0, 32, 64, 0, 0, 96, 64, 12, 54, 1], [1.5, 2.5, 3.5]); testNumbers([ 3, 0, 0, 0, 0, 0, 0, 0, 154, 153, 153, 153, 153, 153, 241, 63, 154, 153, 153, 153, 153, 153, 1, 64, 102, 102, 102, 102, 102, 102, 10, 64, 24, 55, 1 ], [ 1.1, 2.2, 3.3 ]); }); test('number vector, fixed type', () { testNumbers([1, 2, 2, 64, 1], [1, 2]); testNumbers([255, 255, 0, 1, 4, 65, 1], [-1, 256]); testNumbers([211, 255, 255, 255, 0, 232, 3, 0, 8, 66, 1], [-45, 256000]); testNumbers([ 211, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 127, 16, 67, 1 ], [ -45, 9223372036854775807 ]); testNumbers([1, 2, 2, 68, 1], [1, 2]); testNumbers([1, 0, 0, 1, 4, 69, 1], [1, 256]); testNumbers([45, 0, 0, 0, 0, 232, 3, 0, 8, 70, 1], [45, 256000]); testNumbers([205, 204, 140, 63, 0, 0, 0, 192, 8, 74, 1], [1.1, -2]); testNumbers([ 154, 153, 153, 153, 153, 153, 241, 63, 0, 0, 0, 0, 0, 0, 112, 192, 16, 75, 1 ], [ 1.1, -256 ]); testNumbers([211, 255, 255, 255, 0, 232, 3, 0, 4, 0, 0, 0, 12, 78, 1], [-45, 256000, 4]); testNumbers([ 211, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 127, 4, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 32, 91, 1 ], [ -45, 9223372036854775807, 4, 9 ]); testNumbers([ 45, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 127, 4, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 32, 95, 1 ], [ 45, 9223372036854775807, 4, 9 ]); testNumbers([ 154, 153, 153, 153, 153, 153, 241, 63, 0, 0, 0, 0, 0, 0, 112, 64, 0, 0, 0, 0, 0, 0, 16, 64, 24, 87, 1 ], [ 1.1, 256, 4 ]); testNumbers([ 154, 153, 153, 153, 153, 153, 241, 63, 0, 0, 0, 0, 0, 0, 112, 64, 0, 0, 0, 0, 0, 0, 16, 64, 0, 0, 0, 0, 0, 0, 34, 64, 32, 99, 1 ], [ 1.1, 256, 4, 9 ]); }); test('string vector', () { testStrings([ 3, 102, 111, 111, 0, 3, 98, 97, 114, 0, 3, 98, 97, 122, 0, 3, 15, 11, 7, 3, 60, 1 ], [ 'foo', 'bar', 'baz' ]); testStrings([ 3, 102, 111, 111, 0, 3, 98, 97, 114, 0, 3, 98, 97, 122, 0, 6, 15, 11, 7, 18, 14, 10, 6, 60, 1 ], [ 'foo', 'bar', 'baz', 'foo', 'bar', 'baz' ]); }); test('mixed vector', () { var flx = Reference.fromBuffer(b([ 3, 102, 111, 111, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 251, 255, 255, 255, 255, 255, 255, 255, 205, 204, 204, 204, 204, 204, 244, 63, 1, 0, 0, 0, 0, 0, 0, 0, 20, 4, 4, 15, 104, 45, 43, 1 ])); expect(flx.length, 5); expect(flx[0].stringValue, 'foo'); expect(flx[1].numValue, 1); expect(flx[2].numValue, -5); expect(flx[3].numValue, 1.3); expect(flx[4].boolValue, true); }); test('single value map', () { var flx = Reference.fromBuffer(b([97, 0, 1, 3, 1, 1, 1, 12, 4, 2, 36, 1])); expect(flx.length, 1); expect(flx['a'].numValue, 12); }); test('two value map', () { var flx = Reference.fromBuffer( b([0, 97, 0, 2, 4, 4, 2, 1, 2, 45, 12, 4, 4, 4, 36, 1])); expect(flx.length, 2); expect(flx['a'].numValue, 12); expect(flx[''].numValue, 45); }); test('complex map', () { var flx = complexMap(); expect(flx.length, 5); expect(flx['age'].numValue, 35); expect(flx['weight'].numValue, 72.5); expect(flx['name'].stringValue, 'Maxim'); expect(flx['flags'].length, 4); expect(flx['flags'][0].boolValue, true); expect(flx['flags'][1].boolValue, false); expect(flx['flags'][2].boolValue, true); expect(flx['flags'][3].boolValue, true); expect(flx['address'].length, 3); expect(flx['address']['city'].stringValue, 'Bla'); expect(flx['address']['zip'].stringValue, '12345'); expect(flx['address']['countryCode'].stringValue, 'XX'); expect( () => flx['address']['country'].stringValue, throwsA(predicate((dynamic e) => e is ArgumentError && e.message == 'Key: [country] is not applicable on: //address of: ValueType.Map'))); expect( () => flx['address']['countryCode'][0], throwsA(predicate((dynamic e) => e is ArgumentError && e.message == 'Key: [0] is not applicable on: //address/countryCode of: ValueType.String'))); expect( () => flx[1], throwsA(predicate((dynamic e) => e is ArgumentError && e.message == 'Key: [1] is not applicable on: / of: ValueType.Map'))); expect( () => flx['flags'][4], throwsA(predicate((dynamic e) => e is ArgumentError && e.message == 'Key: [4] is not applicable on: //flags of: ValueType.VectorBool length: 4'))); expect( () => flx['flags'][-1], throwsA(predicate((dynamic e) => e is ArgumentError && e.message == 'Key: [-1] is not applicable on: //flags of: ValueType.VectorBool length: 4'))); }); test('complex map to json', () { var flx = complexMap(); expect(flx.json, '{"address":{"city":"Bla","countryCode":"XX","zip":"12345"},"age":35,"flags":[true,false,true,true],"name":"Maxim","weight":72.5}'); }); test('complex map iterators', () { var flx = complexMap(); expect(flx.mapKeyIterable.map((e) => e).toList(), ['address', 'age', 'flags', 'name', 'weight']); expect(flx.mapValueIterable.map((e) => e.json).toList(), [ flx['address'].json, flx['age'].json, flx['flags'].json, flx['name'].json, flx['weight'].json ]); expect(flx['flags'].vectorIterable.map((e) => e.boolValue).toList(), [true, false, true, true]); }); test('bug where offest were stored as int instead of uint', () { const data = [ 99, 104, 97, 110, 110, 101, 108, 115, 95, 105, 110, 0, 100, 105, 108, 97, 116, 105, 111, 110, 95, 104, 101, 105, 103, 104, 116, 95, 102, 97, 99, 116, 111, 114, 0, 100, 105, 108, 97, 116, 105, 111, 110, 95, 119, 105, 100, 116, 104, 95, 102, 97, 99, 116, 111, 114, 0, 102, 117, 115, 101, 100, 95, 97, 99, 116, 105, 118, 97, 116, 105, 111, 110, 95, 102, 117, 110, 99, 116, 105, 111, 110, 0, 112, 97, 100, 95, 118, 97, 108, 117, 101, 115, 0, 112, 97, 100, 100, 105, 110, 103, 0, 115, 116, 114, 105, 100, 101, 95, 104, 101, 105, 103, 104, 116, 0, 115, 116, 114, 105, 100, 101, 95, 119, 105, 100, 116, 104, 0, 8, 130, 119, 97, 76, 51, 41, 34, 21, 8, 1, 8, 64, 1, 1, 1, 1, 0, 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 16, 36, 1 ]; var flx = Reference.fromBuffer(b(data)); expect(flx.json, '{"channels_in":64,"dilation_height_factor":1,"dilation_width_factor":1,"fused_activation_function":1,"pad_values":1,"padding":0,"stride_height":1,"stride_width":1}'); const object = { "channels_in": 64, "dilation_height_factor": 1, "dilation_width_factor": 1, "fused_activation_function": 1, "pad_values": 1, "padding": 0, "stride_height": 1, "stride_width": 1 }; var data1 = Builder.buildFromObject(object).asUint8List(); expect(data1.length, data.length); var flx1 = Reference.fromBuffer(b(data1)); expect(flx1.json, '{"channels_in":64,"dilation_height_factor":1,"dilation_width_factor":1,"fused_activation_function":1,"pad_values":1,"padding":0,"stride_height":1,"stride_width":1}'); }); } ByteBuffer b(List values) { var data = Uint8List.fromList(values); return data.buffer; } void testNumbers(List buffer, List numbers) { var flx = Reference.fromBuffer(b(buffer)); expect(flx.length, numbers.length); for (var i = 0; i < flx.length; i++) { expect(flx[i].numValue, closeTo(numbers[i], 0.001)); } } void testStrings(List buffer, List numbers) { var flx = Reference.fromBuffer(b(buffer)); expect(flx.length, numbers.length); for (var i = 0; i < flx.length; i++) { expect(flx[i].stringValue, numbers[i]); } } Reference complexMap() { // { // "age": 35, // "flags": [True, False, True, True], // "weight": 72.5, // "name": "Maxim", // "address": { // "city": "Bla", // "zip": "12345", // "countryCode": "XX", // } // } return Reference.fromBuffer(b([ 97, 100, 100, 114, 101, 115, 115, 0, 99, 105, 116, 121, 0, 3, 66, 108, 97, 0, 99, 111, 117, 110, 116, 114, 121, 67, 111, 100, 101, 0, 2, 88, 88, 0, 122, 105, 112, 0, 5, 49, 50, 51, 52, 53, 0, 3, 38, 29, 14, 3, 1, 3, 38, 22, 15, 20, 20, 20, 97, 103, 101, 0, 102, 108, 97, 103, 115, 0, 4, 1, 0, 1, 1, 110, 97, 109, 101, 0, 5, 77, 97, 120, 105, 109, 0, 119, 101, 105, 103, 104, 116, 0, 5, 93, 36, 33, 23, 12, 0, 0, 7, 0, 0, 0, 1, 0, 0, 0, 5, 0, 0, 0, 60, 0, 0, 0, 35, 0, 0, 0, 51, 0, 0, 0, 45, 0, 0, 0, 0, 0, 145, 66, 36, 4, 144, 20, 14, 25, 38, 1 ])); } flatbuffers-24.12.23/dart/test/flex_types_test.dart000066400000000000000000000207731473234705300222770ustar00rootroot00000000000000import 'package:flat_buffers/src/types.dart'; import 'package:test/test.dart'; void main() { test('is inline', () { expect(ValueTypeUtils.isInline(ValueType.Bool), isTrue); expect(ValueTypeUtils.isInline(ValueType.Int), isTrue); expect(ValueTypeUtils.isInline(ValueType.UInt), isTrue); expect(ValueTypeUtils.isInline(ValueType.Float), isTrue); expect(ValueTypeUtils.isInline(ValueType.Null), isTrue); expect(ValueTypeUtils.isInline(ValueType.String), isFalse); }); test('is type vector element', () { expect(ValueTypeUtils.isTypedVectorElement(ValueType.Bool), isTrue); expect(ValueTypeUtils.isTypedVectorElement(ValueType.Int), isTrue); expect(ValueTypeUtils.isTypedVectorElement(ValueType.UInt), isTrue); expect(ValueTypeUtils.isTypedVectorElement(ValueType.Float), isTrue); expect(ValueTypeUtils.isTypedVectorElement(ValueType.Key), isTrue); expect(ValueTypeUtils.isTypedVectorElement(ValueType.String), isTrue); expect(ValueTypeUtils.isTypedVectorElement(ValueType.Null), isFalse); expect(ValueTypeUtils.isTypedVectorElement(ValueType.Blob), isFalse); }); test('is typed vector', () { expect(ValueTypeUtils.isTypedVector(ValueType.VectorInt), isTrue); expect(ValueTypeUtils.isTypedVector(ValueType.VectorUInt), isTrue); expect(ValueTypeUtils.isTypedVector(ValueType.VectorFloat), isTrue); expect(ValueTypeUtils.isTypedVector(ValueType.VectorBool), isTrue); expect(ValueTypeUtils.isTypedVector(ValueType.VectorKey), isTrue); expect(ValueTypeUtils.isTypedVector(ValueType.VectorString), isTrue); expect(ValueTypeUtils.isTypedVector(ValueType.Vector), isFalse); expect(ValueTypeUtils.isTypedVector(ValueType.Map), isFalse); expect(ValueTypeUtils.isTypedVector(ValueType.Bool), isFalse); expect(ValueTypeUtils.isTypedVector(ValueType.VectorInt2), isFalse); }); test('is fixed typed vector', () { expect(ValueTypeUtils.isFixedTypedVector(ValueType.VectorInt2), isTrue); expect(ValueTypeUtils.isFixedTypedVector(ValueType.VectorInt3), isTrue); expect(ValueTypeUtils.isFixedTypedVector(ValueType.VectorInt4), isTrue); expect(ValueTypeUtils.isFixedTypedVector(ValueType.VectorUInt2), isTrue); expect(ValueTypeUtils.isFixedTypedVector(ValueType.VectorUInt3), isTrue); expect(ValueTypeUtils.isFixedTypedVector(ValueType.VectorUInt4), isTrue); expect(ValueTypeUtils.isFixedTypedVector(ValueType.VectorFloat2), isTrue); expect(ValueTypeUtils.isFixedTypedVector(ValueType.VectorFloat3), isTrue); expect(ValueTypeUtils.isFixedTypedVector(ValueType.VectorFloat4), isTrue); expect(ValueTypeUtils.isFixedTypedVector(ValueType.VectorInt), isFalse); }); test('to typed vector', () { expect(ValueTypeUtils.toTypedVector(ValueType.Int, 0), equals(ValueType.VectorInt)); expect(ValueTypeUtils.toTypedVector(ValueType.UInt, 0), equals(ValueType.VectorUInt)); expect(ValueTypeUtils.toTypedVector(ValueType.Bool, 0), equals(ValueType.VectorBool)); expect(ValueTypeUtils.toTypedVector(ValueType.Float, 0), equals(ValueType.VectorFloat)); expect(ValueTypeUtils.toTypedVector(ValueType.Key, 0), equals(ValueType.VectorKey)); expect(ValueTypeUtils.toTypedVector(ValueType.String, 0), equals(ValueType.VectorString)); expect(ValueTypeUtils.toTypedVector(ValueType.Int, 2), equals(ValueType.VectorInt2)); expect(ValueTypeUtils.toTypedVector(ValueType.UInt, 2), equals(ValueType.VectorUInt2)); expect(ValueTypeUtils.toTypedVector(ValueType.Float, 2), equals(ValueType.VectorFloat2)); expect(ValueTypeUtils.toTypedVector(ValueType.Int, 3), equals(ValueType.VectorInt3)); expect(ValueTypeUtils.toTypedVector(ValueType.UInt, 3), equals(ValueType.VectorUInt3)); expect(ValueTypeUtils.toTypedVector(ValueType.Float, 3), equals(ValueType.VectorFloat3)); expect(ValueTypeUtils.toTypedVector(ValueType.Int, 4), equals(ValueType.VectorInt4)); expect(ValueTypeUtils.toTypedVector(ValueType.UInt, 4), equals(ValueType.VectorUInt4)); expect(ValueTypeUtils.toTypedVector(ValueType.Float, 4), equals(ValueType.VectorFloat4)); }); test('typed vector element type', () { expect(ValueTypeUtils.typedVectorElementType(ValueType.VectorInt), equals(ValueType.Int)); expect(ValueTypeUtils.typedVectorElementType(ValueType.VectorUInt), equals(ValueType.UInt)); expect(ValueTypeUtils.typedVectorElementType(ValueType.VectorFloat), equals(ValueType.Float)); expect(ValueTypeUtils.typedVectorElementType(ValueType.VectorString), equals(ValueType.String)); expect(ValueTypeUtils.typedVectorElementType(ValueType.VectorKey), equals(ValueType.Key)); expect(ValueTypeUtils.typedVectorElementType(ValueType.VectorBool), equals(ValueType.Bool)); }); test('fixed typed vector element type', () { expect(ValueTypeUtils.fixedTypedVectorElementType(ValueType.VectorInt2), equals(ValueType.Int)); expect(ValueTypeUtils.fixedTypedVectorElementType(ValueType.VectorInt3), equals(ValueType.Int)); expect(ValueTypeUtils.fixedTypedVectorElementType(ValueType.VectorInt4), equals(ValueType.Int)); expect(ValueTypeUtils.fixedTypedVectorElementType(ValueType.VectorUInt2), equals(ValueType.UInt)); expect(ValueTypeUtils.fixedTypedVectorElementType(ValueType.VectorUInt3), equals(ValueType.UInt)); expect(ValueTypeUtils.fixedTypedVectorElementType(ValueType.VectorUInt4), equals(ValueType.UInt)); expect(ValueTypeUtils.fixedTypedVectorElementType(ValueType.VectorFloat2), equals(ValueType.Float)); expect(ValueTypeUtils.fixedTypedVectorElementType(ValueType.VectorFloat3), equals(ValueType.Float)); expect(ValueTypeUtils.fixedTypedVectorElementType(ValueType.VectorFloat4), equals(ValueType.Float)); }); test('fixed typed vector element size', () { expect(ValueTypeUtils.fixedTypedVectorElementSize(ValueType.VectorInt2), equals(2)); expect(ValueTypeUtils.fixedTypedVectorElementSize(ValueType.VectorInt3), equals(3)); expect(ValueTypeUtils.fixedTypedVectorElementSize(ValueType.VectorInt4), equals(4)); expect(ValueTypeUtils.fixedTypedVectorElementSize(ValueType.VectorUInt2), equals(2)); expect(ValueTypeUtils.fixedTypedVectorElementSize(ValueType.VectorUInt3), equals(3)); expect(ValueTypeUtils.fixedTypedVectorElementSize(ValueType.VectorUInt4), equals(4)); expect(ValueTypeUtils.fixedTypedVectorElementSize(ValueType.VectorFloat2), equals(2)); expect(ValueTypeUtils.fixedTypedVectorElementSize(ValueType.VectorFloat3), equals(3)); expect(ValueTypeUtils.fixedTypedVectorElementSize(ValueType.VectorFloat4), equals(4)); }); test('packed type', () { expect( ValueTypeUtils.packedType(ValueType.Null, BitWidth.width8), equals(0)); expect( ValueTypeUtils.packedType(ValueType.Null, BitWidth.width16), equals(1)); expect( ValueTypeUtils.packedType(ValueType.Null, BitWidth.width32), equals(2)); expect( ValueTypeUtils.packedType(ValueType.Null, BitWidth.width64), equals(3)); expect( ValueTypeUtils.packedType(ValueType.Int, BitWidth.width8), equals(4)); expect( ValueTypeUtils.packedType(ValueType.Int, BitWidth.width16), equals(5)); expect( ValueTypeUtils.packedType(ValueType.Int, BitWidth.width32), equals(6)); expect( ValueTypeUtils.packedType(ValueType.Int, BitWidth.width64), equals(7)); }); test('bit width', () { expect(BitWidthUtil.width(0), BitWidth.width8); expect(BitWidthUtil.width(-20), BitWidth.width8); expect(BitWidthUtil.width(127), BitWidth.width8); expect(BitWidthUtil.width(128), BitWidth.width16); expect(BitWidthUtil.width(128123), BitWidth.width32); expect(BitWidthUtil.width(12812324534), BitWidth.width64); expect(BitWidthUtil.width(-127), BitWidth.width8); expect(BitWidthUtil.width(-128), BitWidth.width16); expect(BitWidthUtil.width(-12812324534), BitWidth.width64); expect(BitWidthUtil.width(-0.1), BitWidth.width64); expect(BitWidthUtil.width(0.25), BitWidth.width32); }); test('padding size', () { expect(BitWidthUtil.paddingSize(10, 8), 6); expect(BitWidthUtil.paddingSize(10, 4), 2); expect(BitWidthUtil.paddingSize(15, 4), 1); expect(BitWidthUtil.paddingSize(15, 2), 1); expect(BitWidthUtil.paddingSize(15, 1), 0); expect(BitWidthUtil.paddingSize(16, 8), 0); expect(BitWidthUtil.paddingSize(17, 8), 7); }); } flatbuffers-24.12.23/dart/test/include_test1_generated.dart000066400000000000000000000051341473234705300236310ustar00rootroot00000000000000// automatically generated by the FlatBuffers compiler, do not modify // ignore_for_file: unused_import, unused_field, unused_element, unused_local_variable, constant_identifier_names import 'dart:typed_data' show Uint8List; import 'package:flat_buffers/flat_buffers.dart' as fb; import './include_test2_my_game.other_name_space_generated.dart' as my_game_other_name_space; class TableA { TableA._(this._bc, this._bcOffset); factory TableA(List bytes) { final rootRef = fb.BufferContext.fromBytes(bytes); return reader.read(rootRef, 0); } static const fb.Reader reader = _TableAReader(); final fb.BufferContext _bc; final int _bcOffset; my_game_other_name_space.TableB? get b => my_game_other_name_space.TableB.reader.vTableGetNullable(_bc, _bcOffset, 4); @override String toString() { return 'TableA{b: ${b}}'; } TableAT unpack() => TableAT( b: b?.unpack()); static int pack(fb.Builder fbBuilder, TableAT? object) { if (object == null) return 0; return object.pack(fbBuilder); } } class TableAT implements fb.Packable { my_game_other_name_space.TableBT? b; TableAT({ this.b}); @override int pack(fb.Builder fbBuilder) { final int? bOffset = b?.pack(fbBuilder); fbBuilder.startTable(1); fbBuilder.addOffset(0, bOffset); return fbBuilder.endTable(); } @override String toString() { return 'TableAT{b: ${b}}'; } } class _TableAReader extends fb.TableReader { const _TableAReader(); @override TableA createObject(fb.BufferContext bc, int offset) => TableA._(bc, offset); } class TableABuilder { TableABuilder(this.fbBuilder); final fb.Builder fbBuilder; void begin() { fbBuilder.startTable(1); } int addBOffset(int? offset) { fbBuilder.addOffset(0, offset); return fbBuilder.offset; } int finish() { return fbBuilder.endTable(); } } class TableAObjectBuilder extends fb.ObjectBuilder { final my_game_other_name_space.TableBObjectBuilder? _b; TableAObjectBuilder({ my_game_other_name_space.TableBObjectBuilder? b, }) : _b = b; /// Finish building, and store into the [fbBuilder]. @override int finish(fb.Builder fbBuilder) { final int? bOffset = _b?.getOrCreateOffset(fbBuilder); fbBuilder.startTable(1); fbBuilder.addOffset(0, bOffset); return fbBuilder.endTable(); } /// Convenience method to serialize to byte list. @override Uint8List toBytes([String? fileIdentifier]) { final fbBuilder = fb.Builder(deduplicateTables: false); fbBuilder.finish(finish(fbBuilder), fileIdentifier); return fbBuilder.buffer; } } flatbuffers-24.12.23/dart/test/include_test2_my_game.other_name_space_generated.dart000066400000000000000000000116221473234705300306220ustar00rootroot00000000000000// automatically generated by the FlatBuffers compiler, do not modify // ignore_for_file: unused_import, unused_field, unused_element, unused_local_variable, constant_identifier_names library my_game.other_name_space; import 'dart:typed_data' show Uint8List; import 'package:flat_buffers/flat_buffers.dart' as fb; import './include_test1_generated.dart'; enum FromInclude { IncludeVal(0); final int value; const FromInclude(this.value); factory FromInclude.fromValue(int value) { switch (value) { case 0: return FromInclude.IncludeVal; default: throw StateError('Invalid value $value for bit flag enum'); } } static FromInclude? _createOrNull(int? value) => value == null ? null : FromInclude.fromValue(value); static const int minValue = 0; static const int maxValue = 0; static const fb.Reader reader = _FromIncludeReader(); } class _FromIncludeReader extends fb.Reader { const _FromIncludeReader(); @override int get size => 8; @override FromInclude read(fb.BufferContext bc, int offset) => FromInclude.fromValue(const fb.Int64Reader().read(bc, offset)); } class Unused { Unused._(this._bc, this._bcOffset); static const fb.Reader reader = _UnusedReader(); final fb.BufferContext _bc; final int _bcOffset; int get a => const fb.Int32Reader().read(_bc, _bcOffset + 0); @override String toString() { return 'Unused{a: ${a}}'; } UnusedT unpack() => UnusedT( a: a); static int pack(fb.Builder fbBuilder, UnusedT? object) { if (object == null) return 0; return object.pack(fbBuilder); } } class UnusedT implements fb.Packable { int a; UnusedT({ required this.a}); @override int pack(fb.Builder fbBuilder) { fbBuilder.putInt32(a); return fbBuilder.offset; } @override String toString() { return 'UnusedT{a: ${a}}'; } } class _UnusedReader extends fb.StructReader { const _UnusedReader(); @override int get size => 4; @override Unused createObject(fb.BufferContext bc, int offset) => Unused._(bc, offset); } class UnusedBuilder { UnusedBuilder(this.fbBuilder); final fb.Builder fbBuilder; int finish(int a) { fbBuilder.putInt32(a); return fbBuilder.offset; } } class UnusedObjectBuilder extends fb.ObjectBuilder { final int _a; UnusedObjectBuilder({ required int a, }) : _a = a; /// Finish building, and store into the [fbBuilder]. @override int finish(fb.Builder fbBuilder) { fbBuilder.putInt32(_a); return fbBuilder.offset; } /// Convenience method to serialize to byte list. @override Uint8List toBytes([String? fileIdentifier]) { final fbBuilder = fb.Builder(deduplicateTables: false); fbBuilder.finish(finish(fbBuilder), fileIdentifier); return fbBuilder.buffer; } } class TableB { TableB._(this._bc, this._bcOffset); factory TableB(List bytes) { final rootRef = fb.BufferContext.fromBytes(bytes); return reader.read(rootRef, 0); } static const fb.Reader reader = _TableBReader(); final fb.BufferContext _bc; final int _bcOffset; TableA? get a => TableA.reader.vTableGetNullable(_bc, _bcOffset, 4); @override String toString() { return 'TableB{a: ${a}}'; } TableBT unpack() => TableBT( a: a?.unpack()); static int pack(fb.Builder fbBuilder, TableBT? object) { if (object == null) return 0; return object.pack(fbBuilder); } } class TableBT implements fb.Packable { TableAT? a; TableBT({ this.a}); @override int pack(fb.Builder fbBuilder) { final int? aOffset = a?.pack(fbBuilder); fbBuilder.startTable(1); fbBuilder.addOffset(0, aOffset); return fbBuilder.endTable(); } @override String toString() { return 'TableBT{a: ${a}}'; } } class _TableBReader extends fb.TableReader { const _TableBReader(); @override TableB createObject(fb.BufferContext bc, int offset) => TableB._(bc, offset); } class TableBBuilder { TableBBuilder(this.fbBuilder); final fb.Builder fbBuilder; void begin() { fbBuilder.startTable(1); } int addAOffset(int? offset) { fbBuilder.addOffset(0, offset); return fbBuilder.offset; } int finish() { return fbBuilder.endTable(); } } class TableBObjectBuilder extends fb.ObjectBuilder { final TableAObjectBuilder? _a; TableBObjectBuilder({ TableAObjectBuilder? a, }) : _a = a; /// Finish building, and store into the [fbBuilder]. @override int finish(fb.Builder fbBuilder) { final int? aOffset = _a?.getOrCreateOffset(fbBuilder); fbBuilder.startTable(1); fbBuilder.addOffset(0, aOffset); return fbBuilder.endTable(); } /// Convenience method to serialize to byte list. @override Uint8List toBytes([String? fileIdentifier]) { final fbBuilder = fb.Builder(deduplicateTables: false); fbBuilder.finish(finish(fbBuilder), fileIdentifier); return fbBuilder.buffer; } } flatbuffers-24.12.23/dart/test/keyword_test_keyword_test_generated.dart000066400000000000000000000222261473234705300264150ustar00rootroot00000000000000// automatically generated by the FlatBuffers compiler, do not modify // ignore_for_file: unused_import, unused_field, unused_element, unused_local_variable, constant_identifier_names library keyword_test; import 'dart:typed_data' show Uint8List; import 'package:flat_buffers/flat_buffers.dart' as fb; enum Abc { $void(0), where(1), stackalloc(2); final int value; const Abc(this.value); factory Abc.fromValue(int value) { switch (value) { case 0: return Abc.$void; case 1: return Abc.where; case 2: return Abc.stackalloc; default: throw StateError('Invalid value $value for bit flag enum'); } } static Abc? _createOrNull(int? value) => value == null ? null : Abc.fromValue(value); static const int minValue = 0; static const int maxValue = 2; static const fb.Reader reader = _AbcReader(); } class _AbcReader extends fb.Reader { const _AbcReader(); @override int get size => 4; @override Abc read(fb.BufferContext bc, int offset) => Abc.fromValue(const fb.Int32Reader().read(bc, offset)); } enum Public { NONE(0); final int value; const Public(this.value); factory Public.fromValue(int value) { switch (value) { case 0: return Public.NONE; default: throw StateError('Invalid value $value for bit flag enum'); } } static Public? _createOrNull(int? value) => value == null ? null : Public.fromValue(value); static const int minValue = 0; static const int maxValue = 0; static const fb.Reader reader = _PublicReader(); } class _PublicReader extends fb.Reader { const _PublicReader(); @override int get size => 4; @override Public read(fb.BufferContext bc, int offset) => Public.fromValue(const fb.Int32Reader().read(bc, offset)); } enum KeywordsInUnionTypeId { NONE(0), $static(1), internal(2); final int value; const KeywordsInUnionTypeId(this.value); factory KeywordsInUnionTypeId.fromValue(int value) { switch (value) { case 0: return KeywordsInUnionTypeId.NONE; case 1: return KeywordsInUnionTypeId.$static; case 2: return KeywordsInUnionTypeId.internal; default: throw StateError('Invalid value $value for bit flag enum'); } } static KeywordsInUnionTypeId? _createOrNull(int? value) => value == null ? null : KeywordsInUnionTypeId.fromValue(value); static const int minValue = 0; static const int maxValue = 2; static const fb.Reader reader = _KeywordsInUnionTypeIdReader(); } class _KeywordsInUnionTypeIdReader extends fb.Reader { const _KeywordsInUnionTypeIdReader(); @override int get size => 1; @override KeywordsInUnionTypeId read(fb.BufferContext bc, int offset) => KeywordsInUnionTypeId.fromValue(const fb.Uint8Reader().read(bc, offset)); } class KeywordsInTable { KeywordsInTable._(this._bc, this._bcOffset); factory KeywordsInTable(List bytes) { final rootRef = fb.BufferContext.fromBytes(bytes); return reader.read(rootRef, 0); } static const fb.Reader reader = _KeywordsInTableReader(); final fb.BufferContext _bc; final int _bcOffset; Abc get $is => Abc.fromValue(const fb.Int32Reader().vTableGet(_bc, _bcOffset, 4, 0)); Public get private => Public.fromValue(const fb.Int32Reader().vTableGet(_bc, _bcOffset, 6, 0)); int get type => const fb.Int32Reader().vTableGet(_bc, _bcOffset, 8, 0); bool get $default => const fb.BoolReader().vTableGet(_bc, _bcOffset, 10, false); @override String toString() { return 'KeywordsInTable{\$is: ${$is}, private: ${private}, type: ${type}, \$default: ${$default}}'; } KeywordsInTableT unpack() => KeywordsInTableT( $is: $is, private: private, type: type, $default: $default); static int pack(fb.Builder fbBuilder, KeywordsInTableT? object) { if (object == null) return 0; return object.pack(fbBuilder); } } class KeywordsInTableT implements fb.Packable { Abc $is; Public private; int type; bool $default; KeywordsInTableT({ this.$is = Abc.$void, this.private = Public.NONE, this.type = 0, this.$default = false}); @override int pack(fb.Builder fbBuilder) { fbBuilder.startTable(4); fbBuilder.addInt32(0, $is.value); fbBuilder.addInt32(1, private.value); fbBuilder.addInt32(2, type); fbBuilder.addBool(3, $default); return fbBuilder.endTable(); } @override String toString() { return 'KeywordsInTableT{\$is: ${$is}, private: ${private}, type: ${type}, \$default: ${$default}}'; } } class _KeywordsInTableReader extends fb.TableReader { const _KeywordsInTableReader(); @override KeywordsInTable createObject(fb.BufferContext bc, int offset) => KeywordsInTable._(bc, offset); } class KeywordsInTableBuilder { KeywordsInTableBuilder(this.fbBuilder); final fb.Builder fbBuilder; void begin() { fbBuilder.startTable(4); } int addIs(Abc? $is) { fbBuilder.addInt32(0, $is?.value); return fbBuilder.offset; } int addPrivate(Public? private) { fbBuilder.addInt32(1, private?.value); return fbBuilder.offset; } int addType(int? type) { fbBuilder.addInt32(2, type); return fbBuilder.offset; } int addDefault(bool? $default) { fbBuilder.addBool(3, $default); return fbBuilder.offset; } int finish() { return fbBuilder.endTable(); } } class KeywordsInTableObjectBuilder extends fb.ObjectBuilder { final Abc? _$is; final Public? _private; final int? _type; final bool? _$default; KeywordsInTableObjectBuilder({ Abc? $is, Public? private, int? type, bool? $default, }) : _$is = $is, _private = private, _type = type, _$default = $default; /// Finish building, and store into the [fbBuilder]. @override int finish(fb.Builder fbBuilder) { fbBuilder.startTable(4); fbBuilder.addInt32(0, _$is?.value); fbBuilder.addInt32(1, _private?.value); fbBuilder.addInt32(2, _type); fbBuilder.addBool(3, _$default); return fbBuilder.endTable(); } /// Convenience method to serialize to byte list. @override Uint8List toBytes([String? fileIdentifier]) { final fbBuilder = fb.Builder(deduplicateTables: false); fbBuilder.finish(finish(fbBuilder), fileIdentifier); return fbBuilder.buffer; } } class Table2 { Table2._(this._bc, this._bcOffset); factory Table2(List bytes) { final rootRef = fb.BufferContext.fromBytes(bytes); return reader.read(rootRef, 0); } static const fb.Reader reader = _Table2Reader(); final fb.BufferContext _bc; final int _bcOffset; KeywordsInUnionTypeId? get typeType => KeywordsInUnionTypeId._createOrNull(const fb.Uint8Reader().vTableGetNullable(_bc, _bcOffset, 4)); dynamic get type { switch (typeType?.value) { case 1: return KeywordsInTable.reader.vTableGetNullable(_bc, _bcOffset, 6); case 2: return KeywordsInTable.reader.vTableGetNullable(_bc, _bcOffset, 6); default: return null; } } @override String toString() { return 'Table2{typeType: ${typeType}, type: ${type}}'; } Table2T unpack() => Table2T( typeType: typeType, type: type); static int pack(fb.Builder fbBuilder, Table2T? object) { if (object == null) return 0; return object.pack(fbBuilder); } } class Table2T implements fb.Packable { KeywordsInUnionTypeId? typeType; dynamic type; Table2T({ this.typeType, this.type}); @override int pack(fb.Builder fbBuilder) { final int? typeOffset = type?.pack(fbBuilder); fbBuilder.startTable(2); fbBuilder.addUint8(0, typeType?.value); fbBuilder.addOffset(1, typeOffset); return fbBuilder.endTable(); } @override String toString() { return 'Table2T{typeType: ${typeType}, type: ${type}}'; } } class _Table2Reader extends fb.TableReader { const _Table2Reader(); @override Table2 createObject(fb.BufferContext bc, int offset) => Table2._(bc, offset); } class Table2Builder { Table2Builder(this.fbBuilder); final fb.Builder fbBuilder; void begin() { fbBuilder.startTable(2); } int addTypeType(KeywordsInUnionTypeId? typeType) { fbBuilder.addUint8(0, typeType?.value); return fbBuilder.offset; } int addTypeOffset(int? offset) { fbBuilder.addOffset(1, offset); return fbBuilder.offset; } int finish() { return fbBuilder.endTable(); } } class Table2ObjectBuilder extends fb.ObjectBuilder { final KeywordsInUnionTypeId? _typeType; final dynamic _type; Table2ObjectBuilder({ KeywordsInUnionTypeId? typeType, dynamic type, }) : _typeType = typeType, _type = type; /// Finish building, and store into the [fbBuilder]. @override int finish(fb.Builder fbBuilder) { final int? typeOffset = _type?.getOrCreateOffset(fbBuilder); fbBuilder.startTable(2); fbBuilder.addUint8(0, _typeType?.value); fbBuilder.addOffset(1, typeOffset); return fbBuilder.endTable(); } /// Convenience method to serialize to byte list. @override Uint8List toBytes([String? fileIdentifier]) { final fbBuilder = fb.Builder(deduplicateTables: false); fbBuilder.finish(finish(fbBuilder), fileIdentifier); return fbBuilder.buffer; } } flatbuffers-24.12.23/dart/test/monster_test.fbs000066400000000000000000000125511473234705300214170ustar00rootroot00000000000000// test schema file include "include_test1.fbs"; namespace MyGame; table InParentNamespace {} namespace MyGame.Example2; table Monster {} // Test having same name as below, but in different namespace. namespace MyGame.Example; attribute "priority"; /// Composite components of Monster color. enum Color:ubyte (bit_flags) { Red = 0, // color Red = (1u << 0) /// \brief color Green /// Green is bit_flag with value (1u << 1) Green, /// \brief color Blue (1u << 3) Blue = 3, } enum Race:byte { None = -1, Human = 0, Dwarf, Elf, } enum LongEnum:ulong (bit_flags) { LongOne = 1, LongTwo = 2, // Because this is a bitflag, 40 will be out of range of a 32-bit integer, // allowing us to exercise any logic special to big numbers. LongBig = 40, } union Any { Monster, TestSimpleTableWithEnum, MyGame.Example2.Monster } union AnyUniqueAliases { M: Monster, TS: TestSimpleTableWithEnum, M2: MyGame.Example2.Monster } union AnyAmbiguousAliases { M1: Monster, M2: Monster, M3: Monster } struct Test { a:short; b:byte; } table TestSimpleTableWithEnum (csharp_partial, private) { color: Color = Green; } struct Vec3 (force_align: 8) { x:float; y:float; z:float; test1:double; test2:Color; test3:Test; } struct Ability { id:uint(key); distance:uint; } struct StructOfStructs { a: Ability; b: Test; c: Ability; } struct StructOfStructsOfStructs { a: StructOfStructs; } table Stat { id:string; val:long; count:ushort (key); } table Referrable { id:ulong(key, hash:"fnv1a_64"); } /// an example documentation comment: "monster object" table Monster { pos:Vec3 (id: 0); hp:short = 100 (id: 2); mana:short = 150 (id: 1); name:string (id: 3, key); color:Color = Blue (id: 6); inventory:[ubyte] (id: 5); friendly:bool = false (deprecated, priority: 1, id: 4); /// an example documentation comment: this will end up in the generated code /// multiline too testarrayoftables:[Monster] (id: 11); testarrayofstring:[string] (id: 10); testarrayofstring2:[string] (id: 28); testarrayofbools:[bool] (id: 24); testarrayofsortedstruct:[Ability] (id: 29); enemy:MyGame.Example.Monster (id:12); // Test referring by full namespace. test:Any (id: 8); test4:[Test] (id: 9); test5:[Test] (id: 31); testnestedflatbuffer:[ubyte] (id:13, nested_flatbuffer: "Monster"); testempty:Stat (id:14); testbool:bool (id:15); testhashs32_fnv1:int (id:16, hash:"fnv1_32"); testhashu32_fnv1:uint (id:17, hash:"fnv1_32"); testhashs64_fnv1:long (id:18, hash:"fnv1_64"); testhashu64_fnv1:ulong (id:19, hash:"fnv1_64"); testhashs32_fnv1a:int (id:20, hash:"fnv1a_32"); testhashu32_fnv1a:uint (id:21, hash:"fnv1a_32", cpp_type:"Stat"); testhashs64_fnv1a:long (id:22, hash:"fnv1a_64"); testhashu64_fnv1a:ulong (id:23, hash:"fnv1a_64"); testf:float = 3.14159 (id:25); testf2:float = 3 (id:26); testf3:float (id:27); flex:[ubyte] (id:30, flexbuffer); vector_of_longs:[long] (id:32); vector_of_doubles:[double] (id:33); parent_namespace_test:InParentNamespace (id:34); vector_of_referrables:[Referrable](id:35); single_weak_reference:ulong(id:36, hash:"fnv1a_64", cpp_type:"ReferrableT"); vector_of_weak_references:[ulong](id:37, hash:"fnv1a_64", cpp_type:"ReferrableT"); vector_of_strong_referrables:[Referrable](id:38, cpp_ptr_type:"default_ptr_type"); //was shared_ptr co_owning_reference:ulong(id:39, hash:"fnv1a_64", cpp_type:"ReferrableT", cpp_ptr_type:"naked"); //was shared_ptr as well vector_of_co_owning_references:[ulong](id:40, hash:"fnv1a_64", cpp_type:"ReferrableT", cpp_ptr_type:"default_ptr_type", cpp_ptr_type_get:".get()"); //was shared_ptr non_owning_reference:ulong(id:41, hash:"fnv1a_64", cpp_type:"ReferrableT", cpp_ptr_type:"naked", cpp_ptr_type_get:""); //was weak_ptr vector_of_non_owning_references:[ulong](id:42, hash:"fnv1a_64", cpp_type:"ReferrableT", cpp_ptr_type:"naked", cpp_ptr_type_get:""); //was weak_ptr any_unique:AnyUniqueAliases(id:44); any_ambiguous:AnyAmbiguousAliases (id:46); vector_of_enums:[Color] (id:47); signed_enum:Race = None (id:48); testrequirednestedflatbuffer:[ubyte] (id:49, nested_flatbuffer: "Monster"); scalar_key_sorted_tables:[Stat] (id: 50); native_inline:Test (id: 51, native_inline); // The default value of this enum will be a numeric zero, which isn't a valid // enum value. long_enum_non_enum_default:LongEnum (id: 52); long_enum_normal_default:LongEnum = LongOne (id: 53); // Test that default values nan and +/-inf work. nan_default:float = nan (id: 54); inf_default:float = inf (id: 55); positive_inf_default:float = +inf (id: 56); infinity_default:float = infinity (id: 57); positive_infinity_default:float = +infinity (id: 58); negative_inf_default:float = -inf (id: 59); negative_infinity_default:float = -infinity (id: 60); double_inf_default:double = inf (id: 61); } table TypeAliases { i8:int8; u8:uint8; i16:int16; u16:uint16; i32:int32; u32:uint32; i64:int64; u64:uint64; f32:float32; f64:float64; v8:[int8]; vf64:[float64]; } rpc_service MonsterStorage { Store(Monster):Stat (streaming: "none"); Retrieve(Stat):Monster (streaming: "server", idempotent); GetMaxHitPoint(Monster):Stat (streaming: "client"); GetMinMaxHitPoints(Monster):Stat (streaming: "bidi"); } root_type Monster; file_identifier "MONS"; file_extension "mon"; flatbuffers-24.12.23/dart/test/monster_test_my_game.example2_generated.dart000066400000000000000000000036331473234705300270300ustar00rootroot00000000000000// automatically generated by the FlatBuffers compiler, do not modify // ignore_for_file: unused_import, unused_field, unused_element, unused_local_variable, constant_identifier_names library my_game.example2; import 'dart:typed_data' show Uint8List; import 'package:flat_buffers/flat_buffers.dart' as fb; import './monster_test_my_game_generated.dart' as my_game; import './monster_test_my_game.example_generated.dart' as my_game_example; import './include_test1_generated.dart'; class Monster { Monster._(this._bc, this._bcOffset); factory Monster(List bytes) { final rootRef = fb.BufferContext.fromBytes(bytes); return reader.read(rootRef, 0); } static const fb.Reader reader = _MonsterReader(); final fb.BufferContext _bc; final int _bcOffset; @override String toString() { return 'Monster{}'; } MonsterT unpack() => MonsterT(); static int pack(fb.Builder fbBuilder, MonsterT? object) { if (object == null) return 0; return object.pack(fbBuilder); } } class MonsterT implements fb.Packable { @override int pack(fb.Builder fbBuilder) { fbBuilder.startTable(0); return fbBuilder.endTable(); } @override String toString() { return 'MonsterT{}'; } } class _MonsterReader extends fb.TableReader { const _MonsterReader(); @override Monster createObject(fb.BufferContext bc, int offset) => Monster._(bc, offset); } class MonsterObjectBuilder extends fb.ObjectBuilder { MonsterObjectBuilder(); /// Finish building, and store into the [fbBuilder]. @override int finish(fb.Builder fbBuilder) { fbBuilder.startTable(0); return fbBuilder.endTable(); } /// Convenience method to serialize to byte list. @override Uint8List toBytes([String? fileIdentifier]) { final fbBuilder = fb.Builder(deduplicateTables: false); fbBuilder.finish(finish(fbBuilder), fileIdentifier); return fbBuilder.buffer; } } flatbuffers-24.12.23/dart/test/monster_test_my_game.example_generated.dart000066400000000000000000002355551473234705300267600ustar00rootroot00000000000000// automatically generated by the FlatBuffers compiler, do not modify // ignore_for_file: unused_import, unused_field, unused_element, unused_local_variable, constant_identifier_names library my_game.example; import 'dart:typed_data' show Uint8List; import 'package:flat_buffers/flat_buffers.dart' as fb; import './monster_test_my_game_generated.dart' as my_game; import './monster_test_my_game.example2_generated.dart' as my_game_example2; import './include_test1_generated.dart'; /// Composite components of Monster color. enum Color { Red(1), Green(2), Blue(8), _default(0); final int value; const Color(this.value); factory Color.fromValue(int value) { switch (value) { case 1: return Color.Red; case 2: return Color.Green; case 8: return Color.Blue; case 0: return Color._default; default: throw StateError('Invalid value $value for bit flag enum'); } } static Color? _createOrNull(int? value) => value == null ? null : Color.fromValue(value); static const fb.Reader reader = _ColorReader(); } class _ColorReader extends fb.Reader { const _ColorReader(); @override int get size => 1; @override Color read(fb.BufferContext bc, int offset) => Color.fromValue(const fb.Uint8Reader().read(bc, offset)); } enum Race { None(-1), Human(0), Dwarf(1), Elf(2); final int value; const Race(this.value); factory Race.fromValue(int value) { switch (value) { case -1: return Race.None; case 0: return Race.Human; case 1: return Race.Dwarf; case 2: return Race.Elf; default: throw StateError('Invalid value $value for bit flag enum'); } } static Race? _createOrNull(int? value) => value == null ? null : Race.fromValue(value); static const int minValue = -1; static const int maxValue = 2; static const fb.Reader reader = _RaceReader(); } class _RaceReader extends fb.Reader { const _RaceReader(); @override int get size => 1; @override Race read(fb.BufferContext bc, int offset) => Race.fromValue(const fb.Int8Reader().read(bc, offset)); } enum LongEnum { LongOne(2), LongTwo(4), LongBig(1099511627776), _default(0); final int value; const LongEnum(this.value); factory LongEnum.fromValue(int value) { switch (value) { case 2: return LongEnum.LongOne; case 4: return LongEnum.LongTwo; case 1099511627776: return LongEnum.LongBig; case 0: return LongEnum._default; default: throw StateError('Invalid value $value for bit flag enum'); } } static LongEnum? _createOrNull(int? value) => value == null ? null : LongEnum.fromValue(value); static const fb.Reader reader = _LongEnumReader(); } class _LongEnumReader extends fb.Reader { const _LongEnumReader(); @override int get size => 8; @override LongEnum read(fb.BufferContext bc, int offset) => LongEnum.fromValue(const fb.Uint64Reader().read(bc, offset)); } enum AnyTypeId { NONE(0), Monster(1), TestSimpleTableWithEnum(2), MyGame_Example2_Monster(3); final int value; const AnyTypeId(this.value); factory AnyTypeId.fromValue(int value) { switch (value) { case 0: return AnyTypeId.NONE; case 1: return AnyTypeId.Monster; case 2: return AnyTypeId.TestSimpleTableWithEnum; case 3: return AnyTypeId.MyGame_Example2_Monster; default: throw StateError('Invalid value $value for bit flag enum'); } } static AnyTypeId? _createOrNull(int? value) => value == null ? null : AnyTypeId.fromValue(value); static const int minValue = 0; static const int maxValue = 3; static const fb.Reader reader = _AnyTypeIdReader(); } class _AnyTypeIdReader extends fb.Reader { const _AnyTypeIdReader(); @override int get size => 1; @override AnyTypeId read(fb.BufferContext bc, int offset) => AnyTypeId.fromValue(const fb.Uint8Reader().read(bc, offset)); } enum AnyUniqueAliasesTypeId { NONE(0), M(1), TS(2), M2(3); final int value; const AnyUniqueAliasesTypeId(this.value); factory AnyUniqueAliasesTypeId.fromValue(int value) { switch (value) { case 0: return AnyUniqueAliasesTypeId.NONE; case 1: return AnyUniqueAliasesTypeId.M; case 2: return AnyUniqueAliasesTypeId.TS; case 3: return AnyUniqueAliasesTypeId.M2; default: throw StateError('Invalid value $value for bit flag enum'); } } static AnyUniqueAliasesTypeId? _createOrNull(int? value) => value == null ? null : AnyUniqueAliasesTypeId.fromValue(value); static const int minValue = 0; static const int maxValue = 3; static const fb.Reader reader = _AnyUniqueAliasesTypeIdReader(); } class _AnyUniqueAliasesTypeIdReader extends fb.Reader { const _AnyUniqueAliasesTypeIdReader(); @override int get size => 1; @override AnyUniqueAliasesTypeId read(fb.BufferContext bc, int offset) => AnyUniqueAliasesTypeId.fromValue(const fb.Uint8Reader().read(bc, offset)); } enum AnyAmbiguousAliasesTypeId { NONE(0), M1(1), M2(2), M3(3); final int value; const AnyAmbiguousAliasesTypeId(this.value); factory AnyAmbiguousAliasesTypeId.fromValue(int value) { switch (value) { case 0: return AnyAmbiguousAliasesTypeId.NONE; case 1: return AnyAmbiguousAliasesTypeId.M1; case 2: return AnyAmbiguousAliasesTypeId.M2; case 3: return AnyAmbiguousAliasesTypeId.M3; default: throw StateError('Invalid value $value for bit flag enum'); } } static AnyAmbiguousAliasesTypeId? _createOrNull(int? value) => value == null ? null : AnyAmbiguousAliasesTypeId.fromValue(value); static const int minValue = 0; static const int maxValue = 3; static const fb.Reader reader = _AnyAmbiguousAliasesTypeIdReader(); } class _AnyAmbiguousAliasesTypeIdReader extends fb.Reader { const _AnyAmbiguousAliasesTypeIdReader(); @override int get size => 1; @override AnyAmbiguousAliasesTypeId read(fb.BufferContext bc, int offset) => AnyAmbiguousAliasesTypeId.fromValue(const fb.Uint8Reader().read(bc, offset)); } class Test { Test._(this._bc, this._bcOffset); static const fb.Reader reader = _TestReader(); final fb.BufferContext _bc; final int _bcOffset; int get a => const fb.Int16Reader().read(_bc, _bcOffset + 0); int get b => const fb.Int8Reader().read(_bc, _bcOffset + 2); @override String toString() { return 'Test{a: ${a}, b: ${b}}'; } TestT unpack() => TestT( a: a, b: b); static int pack(fb.Builder fbBuilder, TestT? object) { if (object == null) return 0; return object.pack(fbBuilder); } } class TestT implements fb.Packable { int a; int b; TestT({ required this.a, required this.b}); @override int pack(fb.Builder fbBuilder) { fbBuilder.pad(1); fbBuilder.putInt8(b); fbBuilder.putInt16(a); return fbBuilder.offset; } @override String toString() { return 'TestT{a: ${a}, b: ${b}}'; } } class _TestReader extends fb.StructReader { const _TestReader(); @override int get size => 4; @override Test createObject(fb.BufferContext bc, int offset) => Test._(bc, offset); } class TestBuilder { TestBuilder(this.fbBuilder); final fb.Builder fbBuilder; int finish(int a, int b) { fbBuilder.pad(1); fbBuilder.putInt8(b); fbBuilder.putInt16(a); return fbBuilder.offset; } } class TestObjectBuilder extends fb.ObjectBuilder { final int _a; final int _b; TestObjectBuilder({ required int a, required int b, }) : _a = a, _b = b; /// Finish building, and store into the [fbBuilder]. @override int finish(fb.Builder fbBuilder) { fbBuilder.pad(1); fbBuilder.putInt8(_b); fbBuilder.putInt16(_a); return fbBuilder.offset; } /// Convenience method to serialize to byte list. @override Uint8List toBytes([String? fileIdentifier]) { final fbBuilder = fb.Builder(deduplicateTables: false); fbBuilder.finish(finish(fbBuilder), fileIdentifier); return fbBuilder.buffer; } } class TestSimpleTableWithEnum { TestSimpleTableWithEnum._(this._bc, this._bcOffset); factory TestSimpleTableWithEnum(List bytes) { final rootRef = fb.BufferContext.fromBytes(bytes); return reader.read(rootRef, 0); } static const fb.Reader reader = _TestSimpleTableWithEnumReader(); final fb.BufferContext _bc; final int _bcOffset; Color get color => Color.fromValue(const fb.Uint8Reader().vTableGet(_bc, _bcOffset, 4, 2)); @override String toString() { return 'TestSimpleTableWithEnum{color: ${color}}'; } TestSimpleTableWithEnumT unpack() => TestSimpleTableWithEnumT( color: color); static int pack(fb.Builder fbBuilder, TestSimpleTableWithEnumT? object) { if (object == null) return 0; return object.pack(fbBuilder); } } class TestSimpleTableWithEnumT implements fb.Packable { Color color; TestSimpleTableWithEnumT({ this.color = Color.Green}); @override int pack(fb.Builder fbBuilder) { fbBuilder.startTable(1); fbBuilder.addUint8(0, color.value); return fbBuilder.endTable(); } @override String toString() { return 'TestSimpleTableWithEnumT{color: ${color}}'; } } class _TestSimpleTableWithEnumReader extends fb.TableReader { const _TestSimpleTableWithEnumReader(); @override TestSimpleTableWithEnum createObject(fb.BufferContext bc, int offset) => TestSimpleTableWithEnum._(bc, offset); } class TestSimpleTableWithEnumBuilder { TestSimpleTableWithEnumBuilder(this.fbBuilder); final fb.Builder fbBuilder; void begin() { fbBuilder.startTable(1); } int addColor(Color? color) { fbBuilder.addUint8(0, color?.value); return fbBuilder.offset; } int finish() { return fbBuilder.endTable(); } } class TestSimpleTableWithEnumObjectBuilder extends fb.ObjectBuilder { final Color? _color; TestSimpleTableWithEnumObjectBuilder({ Color? color, }) : _color = color; /// Finish building, and store into the [fbBuilder]. @override int finish(fb.Builder fbBuilder) { fbBuilder.startTable(1); fbBuilder.addUint8(0, _color?.value); return fbBuilder.endTable(); } /// Convenience method to serialize to byte list. @override Uint8List toBytes([String? fileIdentifier]) { final fbBuilder = fb.Builder(deduplicateTables: false); fbBuilder.finish(finish(fbBuilder), fileIdentifier); return fbBuilder.buffer; } } class Vec3 { Vec3._(this._bc, this._bcOffset); static const fb.Reader reader = _Vec3Reader(); final fb.BufferContext _bc; final int _bcOffset; double get x => const fb.Float32Reader().read(_bc, _bcOffset + 0); double get y => const fb.Float32Reader().read(_bc, _bcOffset + 4); double get z => const fb.Float32Reader().read(_bc, _bcOffset + 8); double get test1 => const fb.Float64Reader().read(_bc, _bcOffset + 16); Color get test2 => Color.fromValue(const fb.Uint8Reader().read(_bc, _bcOffset + 24)); Test get test3 => Test.reader.read(_bc, _bcOffset + 26); @override String toString() { return 'Vec3{x: ${x}, y: ${y}, z: ${z}, test1: ${test1}, test2: ${test2}, test3: ${test3}}'; } Vec3T unpack() => Vec3T( x: x, y: y, z: z, test1: test1, test2: test2, test3: test3.unpack()); static int pack(fb.Builder fbBuilder, Vec3T? object) { if (object == null) return 0; return object.pack(fbBuilder); } } class Vec3T implements fb.Packable { double x; double y; double z; double test1; Color test2; TestT test3; Vec3T({ required this.x, required this.y, required this.z, required this.test1, required this.test2, required this.test3}); @override int pack(fb.Builder fbBuilder) { fbBuilder.pad(2); test3.pack(fbBuilder); fbBuilder.pad(1); fbBuilder.putUint8(test2.value); fbBuilder.putFloat64(test1); fbBuilder.pad(4); fbBuilder.putFloat32(z); fbBuilder.putFloat32(y); fbBuilder.putFloat32(x); return fbBuilder.offset; } @override String toString() { return 'Vec3T{x: ${x}, y: ${y}, z: ${z}, test1: ${test1}, test2: ${test2}, test3: ${test3}}'; } } class _Vec3Reader extends fb.StructReader { const _Vec3Reader(); @override int get size => 32; @override Vec3 createObject(fb.BufferContext bc, int offset) => Vec3._(bc, offset); } class Vec3Builder { Vec3Builder(this.fbBuilder); final fb.Builder fbBuilder; int finish(double x, double y, double z, double test1, Color test2, fb.StructBuilder test3) { fbBuilder.pad(2); test3(); fbBuilder.pad(1); fbBuilder.putUint8(test2.value); fbBuilder.putFloat64(test1); fbBuilder.pad(4); fbBuilder.putFloat32(z); fbBuilder.putFloat32(y); fbBuilder.putFloat32(x); return fbBuilder.offset; } } class Vec3ObjectBuilder extends fb.ObjectBuilder { final double _x; final double _y; final double _z; final double _test1; final Color _test2; final TestObjectBuilder _test3; Vec3ObjectBuilder({ required double x, required double y, required double z, required double test1, required Color test2, required TestObjectBuilder test3, }) : _x = x, _y = y, _z = z, _test1 = test1, _test2 = test2, _test3 = test3; /// Finish building, and store into the [fbBuilder]. @override int finish(fb.Builder fbBuilder) { fbBuilder.pad(2); _test3.finish(fbBuilder); fbBuilder.pad(1); fbBuilder.putUint8(_test2.value); fbBuilder.putFloat64(_test1); fbBuilder.pad(4); fbBuilder.putFloat32(_z); fbBuilder.putFloat32(_y); fbBuilder.putFloat32(_x); return fbBuilder.offset; } /// Convenience method to serialize to byte list. @override Uint8List toBytes([String? fileIdentifier]) { final fbBuilder = fb.Builder(deduplicateTables: false); fbBuilder.finish(finish(fbBuilder), fileIdentifier); return fbBuilder.buffer; } } class Ability { Ability._(this._bc, this._bcOffset); static const fb.Reader reader = _AbilityReader(); final fb.BufferContext _bc; final int _bcOffset; int get id => const fb.Uint32Reader().read(_bc, _bcOffset + 0); int get distance => const fb.Uint32Reader().read(_bc, _bcOffset + 4); @override String toString() { return 'Ability{id: ${id}, distance: ${distance}}'; } AbilityT unpack() => AbilityT( id: id, distance: distance); static int pack(fb.Builder fbBuilder, AbilityT? object) { if (object == null) return 0; return object.pack(fbBuilder); } } class AbilityT implements fb.Packable { int id; int distance; AbilityT({ required this.id, required this.distance}); @override int pack(fb.Builder fbBuilder) { fbBuilder.putUint32(distance); fbBuilder.putUint32(id); return fbBuilder.offset; } @override String toString() { return 'AbilityT{id: ${id}, distance: ${distance}}'; } } class _AbilityReader extends fb.StructReader { const _AbilityReader(); @override int get size => 8; @override Ability createObject(fb.BufferContext bc, int offset) => Ability._(bc, offset); } class AbilityBuilder { AbilityBuilder(this.fbBuilder); final fb.Builder fbBuilder; int finish(int id, int distance) { fbBuilder.putUint32(distance); fbBuilder.putUint32(id); return fbBuilder.offset; } } class AbilityObjectBuilder extends fb.ObjectBuilder { final int _id; final int _distance; AbilityObjectBuilder({ required int id, required int distance, }) : _id = id, _distance = distance; /// Finish building, and store into the [fbBuilder]. @override int finish(fb.Builder fbBuilder) { fbBuilder.putUint32(_distance); fbBuilder.putUint32(_id); return fbBuilder.offset; } /// Convenience method to serialize to byte list. @override Uint8List toBytes([String? fileIdentifier]) { final fbBuilder = fb.Builder(deduplicateTables: false); fbBuilder.finish(finish(fbBuilder), fileIdentifier); return fbBuilder.buffer; } } class StructOfStructs { StructOfStructs._(this._bc, this._bcOffset); static const fb.Reader reader = _StructOfStructsReader(); final fb.BufferContext _bc; final int _bcOffset; Ability get a => Ability.reader.read(_bc, _bcOffset + 0); Test get b => Test.reader.read(_bc, _bcOffset + 8); Ability get c => Ability.reader.read(_bc, _bcOffset + 12); @override String toString() { return 'StructOfStructs{a: ${a}, b: ${b}, c: ${c}}'; } StructOfStructsT unpack() => StructOfStructsT( a: a.unpack(), b: b.unpack(), c: c.unpack()); static int pack(fb.Builder fbBuilder, StructOfStructsT? object) { if (object == null) return 0; return object.pack(fbBuilder); } } class StructOfStructsT implements fb.Packable { AbilityT a; TestT b; AbilityT c; StructOfStructsT({ required this.a, required this.b, required this.c}); @override int pack(fb.Builder fbBuilder) { c.pack(fbBuilder); b.pack(fbBuilder); a.pack(fbBuilder); return fbBuilder.offset; } @override String toString() { return 'StructOfStructsT{a: ${a}, b: ${b}, c: ${c}}'; } } class _StructOfStructsReader extends fb.StructReader { const _StructOfStructsReader(); @override int get size => 20; @override StructOfStructs createObject(fb.BufferContext bc, int offset) => StructOfStructs._(bc, offset); } class StructOfStructsBuilder { StructOfStructsBuilder(this.fbBuilder); final fb.Builder fbBuilder; int finish(fb.StructBuilder a, fb.StructBuilder b, fb.StructBuilder c) { c(); b(); a(); return fbBuilder.offset; } } class StructOfStructsObjectBuilder extends fb.ObjectBuilder { final AbilityObjectBuilder _a; final TestObjectBuilder _b; final AbilityObjectBuilder _c; StructOfStructsObjectBuilder({ required AbilityObjectBuilder a, required TestObjectBuilder b, required AbilityObjectBuilder c, }) : _a = a, _b = b, _c = c; /// Finish building, and store into the [fbBuilder]. @override int finish(fb.Builder fbBuilder) { _c.finish(fbBuilder); _b.finish(fbBuilder); _a.finish(fbBuilder); return fbBuilder.offset; } /// Convenience method to serialize to byte list. @override Uint8List toBytes([String? fileIdentifier]) { final fbBuilder = fb.Builder(deduplicateTables: false); fbBuilder.finish(finish(fbBuilder), fileIdentifier); return fbBuilder.buffer; } } class StructOfStructsOfStructs { StructOfStructsOfStructs._(this._bc, this._bcOffset); static const fb.Reader reader = _StructOfStructsOfStructsReader(); final fb.BufferContext _bc; final int _bcOffset; StructOfStructs get a => StructOfStructs.reader.read(_bc, _bcOffset + 0); @override String toString() { return 'StructOfStructsOfStructs{a: ${a}}'; } StructOfStructsOfStructsT unpack() => StructOfStructsOfStructsT( a: a.unpack()); static int pack(fb.Builder fbBuilder, StructOfStructsOfStructsT? object) { if (object == null) return 0; return object.pack(fbBuilder); } } class StructOfStructsOfStructsT implements fb.Packable { StructOfStructsT a; StructOfStructsOfStructsT({ required this.a}); @override int pack(fb.Builder fbBuilder) { a.pack(fbBuilder); return fbBuilder.offset; } @override String toString() { return 'StructOfStructsOfStructsT{a: ${a}}'; } } class _StructOfStructsOfStructsReader extends fb.StructReader { const _StructOfStructsOfStructsReader(); @override int get size => 20; @override StructOfStructsOfStructs createObject(fb.BufferContext bc, int offset) => StructOfStructsOfStructs._(bc, offset); } class StructOfStructsOfStructsBuilder { StructOfStructsOfStructsBuilder(this.fbBuilder); final fb.Builder fbBuilder; int finish(fb.StructBuilder a) { a(); return fbBuilder.offset; } } class StructOfStructsOfStructsObjectBuilder extends fb.ObjectBuilder { final StructOfStructsObjectBuilder _a; StructOfStructsOfStructsObjectBuilder({ required StructOfStructsObjectBuilder a, }) : _a = a; /// Finish building, and store into the [fbBuilder]. @override int finish(fb.Builder fbBuilder) { _a.finish(fbBuilder); return fbBuilder.offset; } /// Convenience method to serialize to byte list. @override Uint8List toBytes([String? fileIdentifier]) { final fbBuilder = fb.Builder(deduplicateTables: false); fbBuilder.finish(finish(fbBuilder), fileIdentifier); return fbBuilder.buffer; } } class Stat { Stat._(this._bc, this._bcOffset); factory Stat(List bytes) { final rootRef = fb.BufferContext.fromBytes(bytes); return reader.read(rootRef, 0); } static const fb.Reader reader = _StatReader(); final fb.BufferContext _bc; final int _bcOffset; String? get id => const fb.StringReader().vTableGetNullable(_bc, _bcOffset, 4); int get val => const fb.Int64Reader().vTableGet(_bc, _bcOffset, 6, 0); int get count => const fb.Uint16Reader().vTableGet(_bc, _bcOffset, 8, 0); @override String toString() { return 'Stat{id: ${id}, val: ${val}, count: ${count}}'; } StatT unpack() => StatT( id: id, val: val, count: count); static int pack(fb.Builder fbBuilder, StatT? object) { if (object == null) return 0; return object.pack(fbBuilder); } } class StatT implements fb.Packable { String? id; int val; int count; StatT({ this.id, this.val = 0, this.count = 0}); @override int pack(fb.Builder fbBuilder) { final int? idOffset = id == null ? null : fbBuilder.writeString(id!); fbBuilder.startTable(3); fbBuilder.addOffset(0, idOffset); fbBuilder.addInt64(1, val); fbBuilder.addUint16(2, count); return fbBuilder.endTable(); } @override String toString() { return 'StatT{id: ${id}, val: ${val}, count: ${count}}'; } } class _StatReader extends fb.TableReader { const _StatReader(); @override Stat createObject(fb.BufferContext bc, int offset) => Stat._(bc, offset); } class StatBuilder { StatBuilder(this.fbBuilder); final fb.Builder fbBuilder; void begin() { fbBuilder.startTable(3); } int addIdOffset(int? offset) { fbBuilder.addOffset(0, offset); return fbBuilder.offset; } int addVal(int? val) { fbBuilder.addInt64(1, val); return fbBuilder.offset; } int addCount(int? count) { fbBuilder.addUint16(2, count); return fbBuilder.offset; } int finish() { return fbBuilder.endTable(); } } class StatObjectBuilder extends fb.ObjectBuilder { final String? _id; final int? _val; final int? _count; StatObjectBuilder({ String? id, int? val, int? count, }) : _id = id, _val = val, _count = count; /// Finish building, and store into the [fbBuilder]. @override int finish(fb.Builder fbBuilder) { final int? idOffset = _id == null ? null : fbBuilder.writeString(_id!); fbBuilder.startTable(3); fbBuilder.addOffset(0, idOffset); fbBuilder.addInt64(1, _val); fbBuilder.addUint16(2, _count); return fbBuilder.endTable(); } /// Convenience method to serialize to byte list. @override Uint8List toBytes([String? fileIdentifier]) { final fbBuilder = fb.Builder(deduplicateTables: false); fbBuilder.finish(finish(fbBuilder), fileIdentifier); return fbBuilder.buffer; } } class Referrable { Referrable._(this._bc, this._bcOffset); factory Referrable(List bytes) { final rootRef = fb.BufferContext.fromBytes(bytes); return reader.read(rootRef, 0); } static const fb.Reader reader = _ReferrableReader(); final fb.BufferContext _bc; final int _bcOffset; int get id => const fb.Uint64Reader().vTableGet(_bc, _bcOffset, 4, 0); @override String toString() { return 'Referrable{id: ${id}}'; } ReferrableT unpack() => ReferrableT( id: id); static int pack(fb.Builder fbBuilder, ReferrableT? object) { if (object == null) return 0; return object.pack(fbBuilder); } } class ReferrableT implements fb.Packable { int id; ReferrableT({ this.id = 0}); @override int pack(fb.Builder fbBuilder) { fbBuilder.startTable(1); fbBuilder.addUint64(0, id); return fbBuilder.endTable(); } @override String toString() { return 'ReferrableT{id: ${id}}'; } } class _ReferrableReader extends fb.TableReader { const _ReferrableReader(); @override Referrable createObject(fb.BufferContext bc, int offset) => Referrable._(bc, offset); } class ReferrableBuilder { ReferrableBuilder(this.fbBuilder); final fb.Builder fbBuilder; void begin() { fbBuilder.startTable(1); } int addId(int? id) { fbBuilder.addUint64(0, id); return fbBuilder.offset; } int finish() { return fbBuilder.endTable(); } } class ReferrableObjectBuilder extends fb.ObjectBuilder { final int? _id; ReferrableObjectBuilder({ int? id, }) : _id = id; /// Finish building, and store into the [fbBuilder]. @override int finish(fb.Builder fbBuilder) { fbBuilder.startTable(1); fbBuilder.addUint64(0, _id); return fbBuilder.endTable(); } /// Convenience method to serialize to byte list. @override Uint8List toBytes([String? fileIdentifier]) { final fbBuilder = fb.Builder(deduplicateTables: false); fbBuilder.finish(finish(fbBuilder), fileIdentifier); return fbBuilder.buffer; } } /// an example documentation comment: "monster object" class Monster { Monster._(this._bc, this._bcOffset); factory Monster(List bytes) { final rootRef = fb.BufferContext.fromBytes(bytes); return reader.read(rootRef, 0); } static const fb.Reader reader = _MonsterReader(); final fb.BufferContext _bc; final int _bcOffset; Vec3? get pos => Vec3.reader.vTableGetNullable(_bc, _bcOffset, 4); int get mana => const fb.Int16Reader().vTableGet(_bc, _bcOffset, 6, 150); int get hp => const fb.Int16Reader().vTableGet(_bc, _bcOffset, 8, 100); String? get name => const fb.StringReader().vTableGetNullable(_bc, _bcOffset, 10); List? get inventory => const fb.Uint8ListReader().vTableGetNullable(_bc, _bcOffset, 14); Color get color => Color.fromValue(const fb.Uint8Reader().vTableGet(_bc, _bcOffset, 16, 8)); AnyTypeId? get testType => AnyTypeId._createOrNull(const fb.Uint8Reader().vTableGetNullable(_bc, _bcOffset, 18)); dynamic get test { switch (testType?.value) { case 1: return Monster.reader.vTableGetNullable(_bc, _bcOffset, 20); case 2: return TestSimpleTableWithEnum.reader.vTableGetNullable(_bc, _bcOffset, 20); case 3: return my_game_example2.Monster.reader.vTableGetNullable(_bc, _bcOffset, 20); default: return null; } } List? get test4 => const fb.ListReader(Test.reader).vTableGetNullable(_bc, _bcOffset, 22); List? get testarrayofstring => const fb.ListReader(fb.StringReader()).vTableGetNullable(_bc, _bcOffset, 24); /// an example documentation comment: this will end up in the generated code /// multiline too List? get testarrayoftables => const fb.ListReader(Monster.reader).vTableGetNullable(_bc, _bcOffset, 26); Monster? get enemy => Monster.reader.vTableGetNullable(_bc, _bcOffset, 28); List? get testnestedflatbuffer => const fb.Uint8ListReader().vTableGetNullable(_bc, _bcOffset, 30); Stat? get testempty => Stat.reader.vTableGetNullable(_bc, _bcOffset, 32); bool get testbool => const fb.BoolReader().vTableGet(_bc, _bcOffset, 34, false); int get testhashs32Fnv1 => const fb.Int32Reader().vTableGet(_bc, _bcOffset, 36, 0); int get testhashu32Fnv1 => const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 38, 0); int get testhashs64Fnv1 => const fb.Int64Reader().vTableGet(_bc, _bcOffset, 40, 0); int get testhashu64Fnv1 => const fb.Uint64Reader().vTableGet(_bc, _bcOffset, 42, 0); int get testhashs32Fnv1a => const fb.Int32Reader().vTableGet(_bc, _bcOffset, 44, 0); int get testhashu32Fnv1a => const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 46, 0); int get testhashs64Fnv1a => const fb.Int64Reader().vTableGet(_bc, _bcOffset, 48, 0); int get testhashu64Fnv1a => const fb.Uint64Reader().vTableGet(_bc, _bcOffset, 50, 0); List? get testarrayofbools => const fb.ListReader(fb.BoolReader()).vTableGetNullable(_bc, _bcOffset, 52); double get testf => const fb.Float32Reader().vTableGet(_bc, _bcOffset, 54, 3.14159); double get testf2 => const fb.Float32Reader().vTableGet(_bc, _bcOffset, 56, 3.0); double get testf3 => const fb.Float32Reader().vTableGet(_bc, _bcOffset, 58, 0.0); List? get testarrayofstring2 => const fb.ListReader(fb.StringReader()).vTableGetNullable(_bc, _bcOffset, 60); List? get testarrayofsortedstruct => const fb.ListReader(Ability.reader).vTableGetNullable(_bc, _bcOffset, 62); List? get flex => const fb.Uint8ListReader().vTableGetNullable(_bc, _bcOffset, 64); List? get test5 => const fb.ListReader(Test.reader).vTableGetNullable(_bc, _bcOffset, 66); List? get vectorOfLongs => const fb.ListReader(fb.Int64Reader()).vTableGetNullable(_bc, _bcOffset, 68); List? get vectorOfDoubles => const fb.ListReader(fb.Float64Reader()).vTableGetNullable(_bc, _bcOffset, 70); my_game.InParentNamespace? get parentNamespaceTest => my_game.InParentNamespace.reader.vTableGetNullable(_bc, _bcOffset, 72); List? get vectorOfReferrables => const fb.ListReader(Referrable.reader).vTableGetNullable(_bc, _bcOffset, 74); int get singleWeakReference => const fb.Uint64Reader().vTableGet(_bc, _bcOffset, 76, 0); List? get vectorOfWeakReferences => const fb.ListReader(fb.Uint64Reader()).vTableGetNullable(_bc, _bcOffset, 78); List? get vectorOfStrongReferrables => const fb.ListReader(Referrable.reader).vTableGetNullable(_bc, _bcOffset, 80); int get coOwningReference => const fb.Uint64Reader().vTableGet(_bc, _bcOffset, 82, 0); List? get vectorOfCoOwningReferences => const fb.ListReader(fb.Uint64Reader()).vTableGetNullable(_bc, _bcOffset, 84); int get nonOwningReference => const fb.Uint64Reader().vTableGet(_bc, _bcOffset, 86, 0); List? get vectorOfNonOwningReferences => const fb.ListReader(fb.Uint64Reader()).vTableGetNullable(_bc, _bcOffset, 88); AnyUniqueAliasesTypeId? get anyUniqueType => AnyUniqueAliasesTypeId._createOrNull(const fb.Uint8Reader().vTableGetNullable(_bc, _bcOffset, 90)); dynamic get anyUnique { switch (anyUniqueType?.value) { case 1: return Monster.reader.vTableGetNullable(_bc, _bcOffset, 92); case 2: return TestSimpleTableWithEnum.reader.vTableGetNullable(_bc, _bcOffset, 92); case 3: return my_game_example2.Monster.reader.vTableGetNullable(_bc, _bcOffset, 92); default: return null; } } AnyAmbiguousAliasesTypeId? get anyAmbiguousType => AnyAmbiguousAliasesTypeId._createOrNull(const fb.Uint8Reader().vTableGetNullable(_bc, _bcOffset, 94)); dynamic get anyAmbiguous { switch (anyAmbiguousType?.value) { case 1: return Monster.reader.vTableGetNullable(_bc, _bcOffset, 96); case 2: return Monster.reader.vTableGetNullable(_bc, _bcOffset, 96); case 3: return Monster.reader.vTableGetNullable(_bc, _bcOffset, 96); default: return null; } } List? get vectorOfEnums => const fb.ListReader(Color.reader).vTableGetNullable(_bc, _bcOffset, 98); Race get signedEnum => Race.fromValue(const fb.Int8Reader().vTableGet(_bc, _bcOffset, 100, -1)); List? get testrequirednestedflatbuffer => const fb.Uint8ListReader().vTableGetNullable(_bc, _bcOffset, 102); List? get scalarKeySortedTables => const fb.ListReader(Stat.reader).vTableGetNullable(_bc, _bcOffset, 104); Test? get nativeInline => Test.reader.vTableGetNullable(_bc, _bcOffset, 106); LongEnum get longEnumNonEnumDefault => LongEnum.fromValue(const fb.Uint64Reader().vTableGet(_bc, _bcOffset, 108, 0)); LongEnum get longEnumNormalDefault => LongEnum.fromValue(const fb.Uint64Reader().vTableGet(_bc, _bcOffset, 110, 2)); double get nanDefault => const fb.Float32Reader().vTableGet(_bc, _bcOffset, 112, double.nan); double get infDefault => const fb.Float32Reader().vTableGet(_bc, _bcOffset, 114, double.infinity); double get positiveInfDefault => const fb.Float32Reader().vTableGet(_bc, _bcOffset, 116, double.infinity); double get infinityDefault => const fb.Float32Reader().vTableGet(_bc, _bcOffset, 118, double.infinity); double get positiveInfinityDefault => const fb.Float32Reader().vTableGet(_bc, _bcOffset, 120, double.infinity); double get negativeInfDefault => const fb.Float32Reader().vTableGet(_bc, _bcOffset, 122, double.negativeInfinity); double get negativeInfinityDefault => const fb.Float32Reader().vTableGet(_bc, _bcOffset, 124, double.negativeInfinity); double get doubleInfDefault => const fb.Float64Reader().vTableGet(_bc, _bcOffset, 126, double.infinity); @override String toString() { return 'Monster{pos: ${pos}, mana: ${mana}, hp: ${hp}, name: ${name}, inventory: ${inventory}, color: ${color}, testType: ${testType}, test: ${test}, test4: ${test4}, testarrayofstring: ${testarrayofstring}, testarrayoftables: ${testarrayoftables}, enemy: ${enemy}, testnestedflatbuffer: ${testnestedflatbuffer}, testempty: ${testempty}, testbool: ${testbool}, testhashs32Fnv1: ${testhashs32Fnv1}, testhashu32Fnv1: ${testhashu32Fnv1}, testhashs64Fnv1: ${testhashs64Fnv1}, testhashu64Fnv1: ${testhashu64Fnv1}, testhashs32Fnv1a: ${testhashs32Fnv1a}, testhashu32Fnv1a: ${testhashu32Fnv1a}, testhashs64Fnv1a: ${testhashs64Fnv1a}, testhashu64Fnv1a: ${testhashu64Fnv1a}, testarrayofbools: ${testarrayofbools}, testf: ${testf}, testf2: ${testf2}, testf3: ${testf3}, testarrayofstring2: ${testarrayofstring2}, testarrayofsortedstruct: ${testarrayofsortedstruct}, flex: ${flex}, test5: ${test5}, vectorOfLongs: ${vectorOfLongs}, vectorOfDoubles: ${vectorOfDoubles}, parentNamespaceTest: ${parentNamespaceTest}, vectorOfReferrables: ${vectorOfReferrables}, singleWeakReference: ${singleWeakReference}, vectorOfWeakReferences: ${vectorOfWeakReferences}, vectorOfStrongReferrables: ${vectorOfStrongReferrables}, coOwningReference: ${coOwningReference}, vectorOfCoOwningReferences: ${vectorOfCoOwningReferences}, nonOwningReference: ${nonOwningReference}, vectorOfNonOwningReferences: ${vectorOfNonOwningReferences}, anyUniqueType: ${anyUniqueType}, anyUnique: ${anyUnique}, anyAmbiguousType: ${anyAmbiguousType}, anyAmbiguous: ${anyAmbiguous}, vectorOfEnums: ${vectorOfEnums}, signedEnum: ${signedEnum}, testrequirednestedflatbuffer: ${testrequirednestedflatbuffer}, scalarKeySortedTables: ${scalarKeySortedTables}, nativeInline: ${nativeInline}, longEnumNonEnumDefault: ${longEnumNonEnumDefault}, longEnumNormalDefault: ${longEnumNormalDefault}, nanDefault: ${nanDefault}, infDefault: ${infDefault}, positiveInfDefault: ${positiveInfDefault}, infinityDefault: ${infinityDefault}, positiveInfinityDefault: ${positiveInfinityDefault}, negativeInfDefault: ${negativeInfDefault}, negativeInfinityDefault: ${negativeInfinityDefault}, doubleInfDefault: ${doubleInfDefault}}'; } MonsterT unpack() => MonsterT( pos: pos?.unpack(), mana: mana, hp: hp, name: name, inventory: const fb.Uint8ListReader(lazy: false).vTableGetNullable(_bc, _bcOffset, 14), color: color, testType: testType, test: test, test4: test4?.map((e) => e.unpack()).toList(), testarrayofstring: const fb.ListReader(fb.StringReader(), lazy: false).vTableGetNullable(_bc, _bcOffset, 24), testarrayoftables: testarrayoftables?.map((e) => e.unpack()).toList(), enemy: enemy?.unpack(), testnestedflatbuffer: const fb.Uint8ListReader(lazy: false).vTableGetNullable(_bc, _bcOffset, 30), testempty: testempty?.unpack(), testbool: testbool, testhashs32Fnv1: testhashs32Fnv1, testhashu32Fnv1: testhashu32Fnv1, testhashs64Fnv1: testhashs64Fnv1, testhashu64Fnv1: testhashu64Fnv1, testhashs32Fnv1a: testhashs32Fnv1a, testhashu32Fnv1a: testhashu32Fnv1a, testhashs64Fnv1a: testhashs64Fnv1a, testhashu64Fnv1a: testhashu64Fnv1a, testarrayofbools: const fb.ListReader(fb.BoolReader(), lazy: false).vTableGetNullable(_bc, _bcOffset, 52), testf: testf, testf2: testf2, testf3: testf3, testarrayofstring2: const fb.ListReader(fb.StringReader(), lazy: false).vTableGetNullable(_bc, _bcOffset, 60), testarrayofsortedstruct: testarrayofsortedstruct?.map((e) => e.unpack()).toList(), flex: const fb.Uint8ListReader(lazy: false).vTableGetNullable(_bc, _bcOffset, 64), test5: test5?.map((e) => e.unpack()).toList(), vectorOfLongs: const fb.ListReader(fb.Int64Reader(), lazy: false).vTableGetNullable(_bc, _bcOffset, 68), vectorOfDoubles: const fb.ListReader(fb.Float64Reader(), lazy: false).vTableGetNullable(_bc, _bcOffset, 70), parentNamespaceTest: parentNamespaceTest?.unpack(), vectorOfReferrables: vectorOfReferrables?.map((e) => e.unpack()).toList(), singleWeakReference: singleWeakReference, vectorOfWeakReferences: const fb.ListReader(fb.Uint64Reader(), lazy: false).vTableGetNullable(_bc, _bcOffset, 78), vectorOfStrongReferrables: vectorOfStrongReferrables?.map((e) => e.unpack()).toList(), coOwningReference: coOwningReference, vectorOfCoOwningReferences: const fb.ListReader(fb.Uint64Reader(), lazy: false).vTableGetNullable(_bc, _bcOffset, 84), nonOwningReference: nonOwningReference, vectorOfNonOwningReferences: const fb.ListReader(fb.Uint64Reader(), lazy: false).vTableGetNullable(_bc, _bcOffset, 88), anyUniqueType: anyUniqueType, anyUnique: anyUnique, anyAmbiguousType: anyAmbiguousType, anyAmbiguous: anyAmbiguous, vectorOfEnums: const fb.ListReader(Color.reader, lazy: false).vTableGetNullable(_bc, _bcOffset, 98), signedEnum: signedEnum, testrequirednestedflatbuffer: const fb.Uint8ListReader(lazy: false).vTableGetNullable(_bc, _bcOffset, 102), scalarKeySortedTables: scalarKeySortedTables?.map((e) => e.unpack()).toList(), nativeInline: nativeInline?.unpack(), longEnumNonEnumDefault: longEnumNonEnumDefault, longEnumNormalDefault: longEnumNormalDefault, nanDefault: nanDefault, infDefault: infDefault, positiveInfDefault: positiveInfDefault, infinityDefault: infinityDefault, positiveInfinityDefault: positiveInfinityDefault, negativeInfDefault: negativeInfDefault, negativeInfinityDefault: negativeInfinityDefault, doubleInfDefault: doubleInfDefault); static int pack(fb.Builder fbBuilder, MonsterT? object) { if (object == null) return 0; return object.pack(fbBuilder); } } /// an example documentation comment: "monster object" class MonsterT implements fb.Packable { Vec3T? pos; int mana; int hp; String? name; List? inventory; Color color; AnyTypeId? testType; dynamic test; List? test4; List? testarrayofstring; /// an example documentation comment: this will end up in the generated code /// multiline too List? testarrayoftables; MonsterT? enemy; List? testnestedflatbuffer; StatT? testempty; bool testbool; int testhashs32Fnv1; int testhashu32Fnv1; int testhashs64Fnv1; int testhashu64Fnv1; int testhashs32Fnv1a; int testhashu32Fnv1a; int testhashs64Fnv1a; int testhashu64Fnv1a; List? testarrayofbools; double testf; double testf2; double testf3; List? testarrayofstring2; List? testarrayofsortedstruct; List? flex; List? test5; List? vectorOfLongs; List? vectorOfDoubles; my_game.InParentNamespaceT? parentNamespaceTest; List? vectorOfReferrables; int singleWeakReference; List? vectorOfWeakReferences; List? vectorOfStrongReferrables; int coOwningReference; List? vectorOfCoOwningReferences; int nonOwningReference; List? vectorOfNonOwningReferences; AnyUniqueAliasesTypeId? anyUniqueType; dynamic anyUnique; AnyAmbiguousAliasesTypeId? anyAmbiguousType; dynamic anyAmbiguous; List? vectorOfEnums; Race signedEnum; List? testrequirednestedflatbuffer; List? scalarKeySortedTables; TestT? nativeInline; LongEnum longEnumNonEnumDefault; LongEnum longEnumNormalDefault; double nanDefault; double infDefault; double positiveInfDefault; double infinityDefault; double positiveInfinityDefault; double negativeInfDefault; double negativeInfinityDefault; double doubleInfDefault; MonsterT({ this.pos, this.mana = 150, this.hp = 100, this.name, this.inventory, this.color = Color.Blue, this.testType, this.test, this.test4, this.testarrayofstring, this.testarrayoftables, this.enemy, this.testnestedflatbuffer, this.testempty, this.testbool = false, this.testhashs32Fnv1 = 0, this.testhashu32Fnv1 = 0, this.testhashs64Fnv1 = 0, this.testhashu64Fnv1 = 0, this.testhashs32Fnv1a = 0, this.testhashu32Fnv1a = 0, this.testhashs64Fnv1a = 0, this.testhashu64Fnv1a = 0, this.testarrayofbools, this.testf = 3.14159, this.testf2 = 3.0, this.testf3 = 0.0, this.testarrayofstring2, this.testarrayofsortedstruct, this.flex, this.test5, this.vectorOfLongs, this.vectorOfDoubles, this.parentNamespaceTest, this.vectorOfReferrables, this.singleWeakReference = 0, this.vectorOfWeakReferences, this.vectorOfStrongReferrables, this.coOwningReference = 0, this.vectorOfCoOwningReferences, this.nonOwningReference = 0, this.vectorOfNonOwningReferences, this.anyUniqueType, this.anyUnique, this.anyAmbiguousType, this.anyAmbiguous, this.vectorOfEnums, this.signedEnum = Race.None, this.testrequirednestedflatbuffer, this.scalarKeySortedTables, this.nativeInline, this.longEnumNonEnumDefault = LongEnum._default, this.longEnumNormalDefault = LongEnum.LongOne, this.nanDefault = double.nan, this.infDefault = double.infinity, this.positiveInfDefault = double.infinity, this.infinityDefault = double.infinity, this.positiveInfinityDefault = double.infinity, this.negativeInfDefault = double.negativeInfinity, this.negativeInfinityDefault = double.negativeInfinity, this.doubleInfDefault = double.infinity}); @override int pack(fb.Builder fbBuilder) { final int? nameOffset = name == null ? null : fbBuilder.writeString(name!); final int? inventoryOffset = inventory == null ? null : fbBuilder.writeListUint8(inventory!); final int? testOffset = test?.pack(fbBuilder); int? test4Offset; if (test4 != null) { for (var e in test4!) { e.pack(fbBuilder); } test4Offset = fbBuilder.endStructVector(test4!.length); } final int? testarrayofstringOffset = testarrayofstring == null ? null : fbBuilder.writeList(testarrayofstring!.map(fbBuilder.writeString).toList()); final int? testarrayoftablesOffset = testarrayoftables == null ? null : fbBuilder.writeList(testarrayoftables!.map((b) => b.pack(fbBuilder)).toList()); final int? enemyOffset = enemy?.pack(fbBuilder); final int? testnestedflatbufferOffset = testnestedflatbuffer == null ? null : fbBuilder.writeListUint8(testnestedflatbuffer!); final int? testemptyOffset = testempty?.pack(fbBuilder); final int? testarrayofboolsOffset = testarrayofbools == null ? null : fbBuilder.writeListBool(testarrayofbools!); final int? testarrayofstring2Offset = testarrayofstring2 == null ? null : fbBuilder.writeList(testarrayofstring2!.map(fbBuilder.writeString).toList()); int? testarrayofsortedstructOffset; if (testarrayofsortedstruct != null) { for (var e in testarrayofsortedstruct!) { e.pack(fbBuilder); } testarrayofsortedstructOffset = fbBuilder.endStructVector(testarrayofsortedstruct!.length); } final int? flexOffset = flex == null ? null : fbBuilder.writeListUint8(flex!); int? test5Offset; if (test5 != null) { for (var e in test5!) { e.pack(fbBuilder); } test5Offset = fbBuilder.endStructVector(test5!.length); } final int? vectorOfLongsOffset = vectorOfLongs == null ? null : fbBuilder.writeListInt64(vectorOfLongs!); final int? vectorOfDoublesOffset = vectorOfDoubles == null ? null : fbBuilder.writeListFloat64(vectorOfDoubles!); final int? parentNamespaceTestOffset = parentNamespaceTest?.pack(fbBuilder); final int? vectorOfReferrablesOffset = vectorOfReferrables == null ? null : fbBuilder.writeList(vectorOfReferrables!.map((b) => b.pack(fbBuilder)).toList()); final int? vectorOfWeakReferencesOffset = vectorOfWeakReferences == null ? null : fbBuilder.writeListUint64(vectorOfWeakReferences!); final int? vectorOfStrongReferrablesOffset = vectorOfStrongReferrables == null ? null : fbBuilder.writeList(vectorOfStrongReferrables!.map((b) => b.pack(fbBuilder)).toList()); final int? vectorOfCoOwningReferencesOffset = vectorOfCoOwningReferences == null ? null : fbBuilder.writeListUint64(vectorOfCoOwningReferences!); final int? vectorOfNonOwningReferencesOffset = vectorOfNonOwningReferences == null ? null : fbBuilder.writeListUint64(vectorOfNonOwningReferences!); final int? anyUniqueOffset = anyUnique?.pack(fbBuilder); final int? anyAmbiguousOffset = anyAmbiguous?.pack(fbBuilder); final int? vectorOfEnumsOffset = vectorOfEnums == null ? null : fbBuilder.writeListUint8(vectorOfEnums!.map((f) => f.value).toList()); final int? testrequirednestedflatbufferOffset = testrequirednestedflatbuffer == null ? null : fbBuilder.writeListUint8(testrequirednestedflatbuffer!); final int? scalarKeySortedTablesOffset = scalarKeySortedTables == null ? null : fbBuilder.writeList(scalarKeySortedTables!.map((b) => b.pack(fbBuilder)).toList()); fbBuilder.startTable(62); if (pos != null) { fbBuilder.addStruct(0, pos!.pack(fbBuilder)); } fbBuilder.addInt16(1, mana); fbBuilder.addInt16(2, hp); fbBuilder.addOffset(3, nameOffset); fbBuilder.addOffset(5, inventoryOffset); fbBuilder.addUint8(6, color.value); fbBuilder.addUint8(7, testType?.value); fbBuilder.addOffset(8, testOffset); fbBuilder.addOffset(9, test4Offset); fbBuilder.addOffset(10, testarrayofstringOffset); fbBuilder.addOffset(11, testarrayoftablesOffset); fbBuilder.addOffset(12, enemyOffset); fbBuilder.addOffset(13, testnestedflatbufferOffset); fbBuilder.addOffset(14, testemptyOffset); fbBuilder.addBool(15, testbool); fbBuilder.addInt32(16, testhashs32Fnv1); fbBuilder.addUint32(17, testhashu32Fnv1); fbBuilder.addInt64(18, testhashs64Fnv1); fbBuilder.addUint64(19, testhashu64Fnv1); fbBuilder.addInt32(20, testhashs32Fnv1a); fbBuilder.addUint32(21, testhashu32Fnv1a); fbBuilder.addInt64(22, testhashs64Fnv1a); fbBuilder.addUint64(23, testhashu64Fnv1a); fbBuilder.addOffset(24, testarrayofboolsOffset); fbBuilder.addFloat32(25, testf); fbBuilder.addFloat32(26, testf2); fbBuilder.addFloat32(27, testf3); fbBuilder.addOffset(28, testarrayofstring2Offset); fbBuilder.addOffset(29, testarrayofsortedstructOffset); fbBuilder.addOffset(30, flexOffset); fbBuilder.addOffset(31, test5Offset); fbBuilder.addOffset(32, vectorOfLongsOffset); fbBuilder.addOffset(33, vectorOfDoublesOffset); fbBuilder.addOffset(34, parentNamespaceTestOffset); fbBuilder.addOffset(35, vectorOfReferrablesOffset); fbBuilder.addUint64(36, singleWeakReference); fbBuilder.addOffset(37, vectorOfWeakReferencesOffset); fbBuilder.addOffset(38, vectorOfStrongReferrablesOffset); fbBuilder.addUint64(39, coOwningReference); fbBuilder.addOffset(40, vectorOfCoOwningReferencesOffset); fbBuilder.addUint64(41, nonOwningReference); fbBuilder.addOffset(42, vectorOfNonOwningReferencesOffset); fbBuilder.addUint8(43, anyUniqueType?.value); fbBuilder.addOffset(44, anyUniqueOffset); fbBuilder.addUint8(45, anyAmbiguousType?.value); fbBuilder.addOffset(46, anyAmbiguousOffset); fbBuilder.addOffset(47, vectorOfEnumsOffset); fbBuilder.addInt8(48, signedEnum.value); fbBuilder.addOffset(49, testrequirednestedflatbufferOffset); fbBuilder.addOffset(50, scalarKeySortedTablesOffset); if (nativeInline != null) { fbBuilder.addStruct(51, nativeInline!.pack(fbBuilder)); } fbBuilder.addUint64(52, longEnumNonEnumDefault.value); fbBuilder.addUint64(53, longEnumNormalDefault.value); fbBuilder.addFloat32(54, nanDefault); fbBuilder.addFloat32(55, infDefault); fbBuilder.addFloat32(56, positiveInfDefault); fbBuilder.addFloat32(57, infinityDefault); fbBuilder.addFloat32(58, positiveInfinityDefault); fbBuilder.addFloat32(59, negativeInfDefault); fbBuilder.addFloat32(60, negativeInfinityDefault); fbBuilder.addFloat64(61, doubleInfDefault); return fbBuilder.endTable(); } @override String toString() { return 'MonsterT{pos: ${pos}, mana: ${mana}, hp: ${hp}, name: ${name}, inventory: ${inventory}, color: ${color}, testType: ${testType}, test: ${test}, test4: ${test4}, testarrayofstring: ${testarrayofstring}, testarrayoftables: ${testarrayoftables}, enemy: ${enemy}, testnestedflatbuffer: ${testnestedflatbuffer}, testempty: ${testempty}, testbool: ${testbool}, testhashs32Fnv1: ${testhashs32Fnv1}, testhashu32Fnv1: ${testhashu32Fnv1}, testhashs64Fnv1: ${testhashs64Fnv1}, testhashu64Fnv1: ${testhashu64Fnv1}, testhashs32Fnv1a: ${testhashs32Fnv1a}, testhashu32Fnv1a: ${testhashu32Fnv1a}, testhashs64Fnv1a: ${testhashs64Fnv1a}, testhashu64Fnv1a: ${testhashu64Fnv1a}, testarrayofbools: ${testarrayofbools}, testf: ${testf}, testf2: ${testf2}, testf3: ${testf3}, testarrayofstring2: ${testarrayofstring2}, testarrayofsortedstruct: ${testarrayofsortedstruct}, flex: ${flex}, test5: ${test5}, vectorOfLongs: ${vectorOfLongs}, vectorOfDoubles: ${vectorOfDoubles}, parentNamespaceTest: ${parentNamespaceTest}, vectorOfReferrables: ${vectorOfReferrables}, singleWeakReference: ${singleWeakReference}, vectorOfWeakReferences: ${vectorOfWeakReferences}, vectorOfStrongReferrables: ${vectorOfStrongReferrables}, coOwningReference: ${coOwningReference}, vectorOfCoOwningReferences: ${vectorOfCoOwningReferences}, nonOwningReference: ${nonOwningReference}, vectorOfNonOwningReferences: ${vectorOfNonOwningReferences}, anyUniqueType: ${anyUniqueType}, anyUnique: ${anyUnique}, anyAmbiguousType: ${anyAmbiguousType}, anyAmbiguous: ${anyAmbiguous}, vectorOfEnums: ${vectorOfEnums}, signedEnum: ${signedEnum}, testrequirednestedflatbuffer: ${testrequirednestedflatbuffer}, scalarKeySortedTables: ${scalarKeySortedTables}, nativeInline: ${nativeInline}, longEnumNonEnumDefault: ${longEnumNonEnumDefault}, longEnumNormalDefault: ${longEnumNormalDefault}, nanDefault: ${nanDefault}, infDefault: ${infDefault}, positiveInfDefault: ${positiveInfDefault}, infinityDefault: ${infinityDefault}, positiveInfinityDefault: ${positiveInfinityDefault}, negativeInfDefault: ${negativeInfDefault}, negativeInfinityDefault: ${negativeInfinityDefault}, doubleInfDefault: ${doubleInfDefault}}'; } } class _MonsterReader extends fb.TableReader { const _MonsterReader(); @override Monster createObject(fb.BufferContext bc, int offset) => Monster._(bc, offset); } class MonsterBuilder { MonsterBuilder(this.fbBuilder); final fb.Builder fbBuilder; void begin() { fbBuilder.startTable(62); } int addPos(int offset) { fbBuilder.addStruct(0, offset); return fbBuilder.offset; } int addMana(int? mana) { fbBuilder.addInt16(1, mana); return fbBuilder.offset; } int addHp(int? hp) { fbBuilder.addInt16(2, hp); return fbBuilder.offset; } int addNameOffset(int? offset) { fbBuilder.addOffset(3, offset); return fbBuilder.offset; } int addInventoryOffset(int? offset) { fbBuilder.addOffset(5, offset); return fbBuilder.offset; } int addColor(Color? color) { fbBuilder.addUint8(6, color?.value); return fbBuilder.offset; } int addTestType(AnyTypeId? testType) { fbBuilder.addUint8(7, testType?.value); return fbBuilder.offset; } int addTestOffset(int? offset) { fbBuilder.addOffset(8, offset); return fbBuilder.offset; } int addTest4Offset(int? offset) { fbBuilder.addOffset(9, offset); return fbBuilder.offset; } int addTestarrayofstringOffset(int? offset) { fbBuilder.addOffset(10, offset); return fbBuilder.offset; } int addTestarrayoftablesOffset(int? offset) { fbBuilder.addOffset(11, offset); return fbBuilder.offset; } int addEnemyOffset(int? offset) { fbBuilder.addOffset(12, offset); return fbBuilder.offset; } int addTestnestedflatbufferOffset(int? offset) { fbBuilder.addOffset(13, offset); return fbBuilder.offset; } int addTestemptyOffset(int? offset) { fbBuilder.addOffset(14, offset); return fbBuilder.offset; } int addTestbool(bool? testbool) { fbBuilder.addBool(15, testbool); return fbBuilder.offset; } int addTesthashs32Fnv1(int? testhashs32Fnv1) { fbBuilder.addInt32(16, testhashs32Fnv1); return fbBuilder.offset; } int addTesthashu32Fnv1(int? testhashu32Fnv1) { fbBuilder.addUint32(17, testhashu32Fnv1); return fbBuilder.offset; } int addTesthashs64Fnv1(int? testhashs64Fnv1) { fbBuilder.addInt64(18, testhashs64Fnv1); return fbBuilder.offset; } int addTesthashu64Fnv1(int? testhashu64Fnv1) { fbBuilder.addUint64(19, testhashu64Fnv1); return fbBuilder.offset; } int addTesthashs32Fnv1a(int? testhashs32Fnv1a) { fbBuilder.addInt32(20, testhashs32Fnv1a); return fbBuilder.offset; } int addTesthashu32Fnv1a(int? testhashu32Fnv1a) { fbBuilder.addUint32(21, testhashu32Fnv1a); return fbBuilder.offset; } int addTesthashs64Fnv1a(int? testhashs64Fnv1a) { fbBuilder.addInt64(22, testhashs64Fnv1a); return fbBuilder.offset; } int addTesthashu64Fnv1a(int? testhashu64Fnv1a) { fbBuilder.addUint64(23, testhashu64Fnv1a); return fbBuilder.offset; } int addTestarrayofboolsOffset(int? offset) { fbBuilder.addOffset(24, offset); return fbBuilder.offset; } int addTestf(double? testf) { fbBuilder.addFloat32(25, testf); return fbBuilder.offset; } int addTestf2(double? testf2) { fbBuilder.addFloat32(26, testf2); return fbBuilder.offset; } int addTestf3(double? testf3) { fbBuilder.addFloat32(27, testf3); return fbBuilder.offset; } int addTestarrayofstring2Offset(int? offset) { fbBuilder.addOffset(28, offset); return fbBuilder.offset; } int addTestarrayofsortedstructOffset(int? offset) { fbBuilder.addOffset(29, offset); return fbBuilder.offset; } int addFlexOffset(int? offset) { fbBuilder.addOffset(30, offset); return fbBuilder.offset; } int addTest5Offset(int? offset) { fbBuilder.addOffset(31, offset); return fbBuilder.offset; } int addVectorOfLongsOffset(int? offset) { fbBuilder.addOffset(32, offset); return fbBuilder.offset; } int addVectorOfDoublesOffset(int? offset) { fbBuilder.addOffset(33, offset); return fbBuilder.offset; } int addParentNamespaceTestOffset(int? offset) { fbBuilder.addOffset(34, offset); return fbBuilder.offset; } int addVectorOfReferrablesOffset(int? offset) { fbBuilder.addOffset(35, offset); return fbBuilder.offset; } int addSingleWeakReference(int? singleWeakReference) { fbBuilder.addUint64(36, singleWeakReference); return fbBuilder.offset; } int addVectorOfWeakReferencesOffset(int? offset) { fbBuilder.addOffset(37, offset); return fbBuilder.offset; } int addVectorOfStrongReferrablesOffset(int? offset) { fbBuilder.addOffset(38, offset); return fbBuilder.offset; } int addCoOwningReference(int? coOwningReference) { fbBuilder.addUint64(39, coOwningReference); return fbBuilder.offset; } int addVectorOfCoOwningReferencesOffset(int? offset) { fbBuilder.addOffset(40, offset); return fbBuilder.offset; } int addNonOwningReference(int? nonOwningReference) { fbBuilder.addUint64(41, nonOwningReference); return fbBuilder.offset; } int addVectorOfNonOwningReferencesOffset(int? offset) { fbBuilder.addOffset(42, offset); return fbBuilder.offset; } int addAnyUniqueType(AnyUniqueAliasesTypeId? anyUniqueType) { fbBuilder.addUint8(43, anyUniqueType?.value); return fbBuilder.offset; } int addAnyUniqueOffset(int? offset) { fbBuilder.addOffset(44, offset); return fbBuilder.offset; } int addAnyAmbiguousType(AnyAmbiguousAliasesTypeId? anyAmbiguousType) { fbBuilder.addUint8(45, anyAmbiguousType?.value); return fbBuilder.offset; } int addAnyAmbiguousOffset(int? offset) { fbBuilder.addOffset(46, offset); return fbBuilder.offset; } int addVectorOfEnumsOffset(int? offset) { fbBuilder.addOffset(47, offset); return fbBuilder.offset; } int addSignedEnum(Race? signedEnum) { fbBuilder.addInt8(48, signedEnum?.value); return fbBuilder.offset; } int addTestrequirednestedflatbufferOffset(int? offset) { fbBuilder.addOffset(49, offset); return fbBuilder.offset; } int addScalarKeySortedTablesOffset(int? offset) { fbBuilder.addOffset(50, offset); return fbBuilder.offset; } int addNativeInline(int offset) { fbBuilder.addStruct(51, offset); return fbBuilder.offset; } int addLongEnumNonEnumDefault(LongEnum? longEnumNonEnumDefault) { fbBuilder.addUint64(52, longEnumNonEnumDefault?.value); return fbBuilder.offset; } int addLongEnumNormalDefault(LongEnum? longEnumNormalDefault) { fbBuilder.addUint64(53, longEnumNormalDefault?.value); return fbBuilder.offset; } int addNanDefault(double? nanDefault) { fbBuilder.addFloat32(54, nanDefault); return fbBuilder.offset; } int addInfDefault(double? infDefault) { fbBuilder.addFloat32(55, infDefault); return fbBuilder.offset; } int addPositiveInfDefault(double? positiveInfDefault) { fbBuilder.addFloat32(56, positiveInfDefault); return fbBuilder.offset; } int addInfinityDefault(double? infinityDefault) { fbBuilder.addFloat32(57, infinityDefault); return fbBuilder.offset; } int addPositiveInfinityDefault(double? positiveInfinityDefault) { fbBuilder.addFloat32(58, positiveInfinityDefault); return fbBuilder.offset; } int addNegativeInfDefault(double? negativeInfDefault) { fbBuilder.addFloat32(59, negativeInfDefault); return fbBuilder.offset; } int addNegativeInfinityDefault(double? negativeInfinityDefault) { fbBuilder.addFloat32(60, negativeInfinityDefault); return fbBuilder.offset; } int addDoubleInfDefault(double? doubleInfDefault) { fbBuilder.addFloat64(61, doubleInfDefault); return fbBuilder.offset; } int finish() { return fbBuilder.endTable(); } } class MonsterObjectBuilder extends fb.ObjectBuilder { final Vec3ObjectBuilder? _pos; final int? _mana; final int? _hp; final String? _name; final List? _inventory; final Color? _color; final AnyTypeId? _testType; final dynamic _test; final List? _test4; final List? _testarrayofstring; final List? _testarrayoftables; final MonsterObjectBuilder? _enemy; final List? _testnestedflatbuffer; final StatObjectBuilder? _testempty; final bool? _testbool; final int? _testhashs32Fnv1; final int? _testhashu32Fnv1; final int? _testhashs64Fnv1; final int? _testhashu64Fnv1; final int? _testhashs32Fnv1a; final int? _testhashu32Fnv1a; final int? _testhashs64Fnv1a; final int? _testhashu64Fnv1a; final List? _testarrayofbools; final double? _testf; final double? _testf2; final double? _testf3; final List? _testarrayofstring2; final List? _testarrayofsortedstruct; final List? _flex; final List? _test5; final List? _vectorOfLongs; final List? _vectorOfDoubles; final my_game.InParentNamespaceObjectBuilder? _parentNamespaceTest; final List? _vectorOfReferrables; final int? _singleWeakReference; final List? _vectorOfWeakReferences; final List? _vectorOfStrongReferrables; final int? _coOwningReference; final List? _vectorOfCoOwningReferences; final int? _nonOwningReference; final List? _vectorOfNonOwningReferences; final AnyUniqueAliasesTypeId? _anyUniqueType; final dynamic _anyUnique; final AnyAmbiguousAliasesTypeId? _anyAmbiguousType; final dynamic _anyAmbiguous; final List? _vectorOfEnums; final Race? _signedEnum; final List? _testrequirednestedflatbuffer; final List? _scalarKeySortedTables; final TestObjectBuilder? _nativeInline; final LongEnum? _longEnumNonEnumDefault; final LongEnum? _longEnumNormalDefault; final double? _nanDefault; final double? _infDefault; final double? _positiveInfDefault; final double? _infinityDefault; final double? _positiveInfinityDefault; final double? _negativeInfDefault; final double? _negativeInfinityDefault; final double? _doubleInfDefault; MonsterObjectBuilder({ Vec3ObjectBuilder? pos, int? mana, int? hp, String? name, List? inventory, Color? color, AnyTypeId? testType, dynamic test, List? test4, List? testarrayofstring, List? testarrayoftables, MonsterObjectBuilder? enemy, List? testnestedflatbuffer, StatObjectBuilder? testempty, bool? testbool, int? testhashs32Fnv1, int? testhashu32Fnv1, int? testhashs64Fnv1, int? testhashu64Fnv1, int? testhashs32Fnv1a, int? testhashu32Fnv1a, int? testhashs64Fnv1a, int? testhashu64Fnv1a, List? testarrayofbools, double? testf, double? testf2, double? testf3, List? testarrayofstring2, List? testarrayofsortedstruct, List? flex, List? test5, List? vectorOfLongs, List? vectorOfDoubles, my_game.InParentNamespaceObjectBuilder? parentNamespaceTest, List? vectorOfReferrables, int? singleWeakReference, List? vectorOfWeakReferences, List? vectorOfStrongReferrables, int? coOwningReference, List? vectorOfCoOwningReferences, int? nonOwningReference, List? vectorOfNonOwningReferences, AnyUniqueAliasesTypeId? anyUniqueType, dynamic anyUnique, AnyAmbiguousAliasesTypeId? anyAmbiguousType, dynamic anyAmbiguous, List? vectorOfEnums, Race? signedEnum, List? testrequirednestedflatbuffer, List? scalarKeySortedTables, TestObjectBuilder? nativeInline, LongEnum? longEnumNonEnumDefault, LongEnum? longEnumNormalDefault, double? nanDefault, double? infDefault, double? positiveInfDefault, double? infinityDefault, double? positiveInfinityDefault, double? negativeInfDefault, double? negativeInfinityDefault, double? doubleInfDefault, }) : _pos = pos, _mana = mana, _hp = hp, _name = name, _inventory = inventory, _color = color, _testType = testType, _test = test, _test4 = test4, _testarrayofstring = testarrayofstring, _testarrayoftables = testarrayoftables, _enemy = enemy, _testnestedflatbuffer = testnestedflatbuffer, _testempty = testempty, _testbool = testbool, _testhashs32Fnv1 = testhashs32Fnv1, _testhashu32Fnv1 = testhashu32Fnv1, _testhashs64Fnv1 = testhashs64Fnv1, _testhashu64Fnv1 = testhashu64Fnv1, _testhashs32Fnv1a = testhashs32Fnv1a, _testhashu32Fnv1a = testhashu32Fnv1a, _testhashs64Fnv1a = testhashs64Fnv1a, _testhashu64Fnv1a = testhashu64Fnv1a, _testarrayofbools = testarrayofbools, _testf = testf, _testf2 = testf2, _testf3 = testf3, _testarrayofstring2 = testarrayofstring2, _testarrayofsortedstruct = testarrayofsortedstruct, _flex = flex, _test5 = test5, _vectorOfLongs = vectorOfLongs, _vectorOfDoubles = vectorOfDoubles, _parentNamespaceTest = parentNamespaceTest, _vectorOfReferrables = vectorOfReferrables, _singleWeakReference = singleWeakReference, _vectorOfWeakReferences = vectorOfWeakReferences, _vectorOfStrongReferrables = vectorOfStrongReferrables, _coOwningReference = coOwningReference, _vectorOfCoOwningReferences = vectorOfCoOwningReferences, _nonOwningReference = nonOwningReference, _vectorOfNonOwningReferences = vectorOfNonOwningReferences, _anyUniqueType = anyUniqueType, _anyUnique = anyUnique, _anyAmbiguousType = anyAmbiguousType, _anyAmbiguous = anyAmbiguous, _vectorOfEnums = vectorOfEnums, _signedEnum = signedEnum, _testrequirednestedflatbuffer = testrequirednestedflatbuffer, _scalarKeySortedTables = scalarKeySortedTables, _nativeInline = nativeInline, _longEnumNonEnumDefault = longEnumNonEnumDefault, _longEnumNormalDefault = longEnumNormalDefault, _nanDefault = nanDefault, _infDefault = infDefault, _positiveInfDefault = positiveInfDefault, _infinityDefault = infinityDefault, _positiveInfinityDefault = positiveInfinityDefault, _negativeInfDefault = negativeInfDefault, _negativeInfinityDefault = negativeInfinityDefault, _doubleInfDefault = doubleInfDefault; /// Finish building, and store into the [fbBuilder]. @override int finish(fb.Builder fbBuilder) { final int? nameOffset = _name == null ? null : fbBuilder.writeString(_name!); final int? inventoryOffset = _inventory == null ? null : fbBuilder.writeListUint8(_inventory!); final int? testOffset = _test?.getOrCreateOffset(fbBuilder); final int? test4Offset = _test4 == null ? null : fbBuilder.writeListOfStructs(_test4!); final int? testarrayofstringOffset = _testarrayofstring == null ? null : fbBuilder.writeList(_testarrayofstring!.map(fbBuilder.writeString).toList()); final int? testarrayoftablesOffset = _testarrayoftables == null ? null : fbBuilder.writeList(_testarrayoftables!.map((b) => b.getOrCreateOffset(fbBuilder)).toList()); final int? enemyOffset = _enemy?.getOrCreateOffset(fbBuilder); final int? testnestedflatbufferOffset = _testnestedflatbuffer == null ? null : fbBuilder.writeListUint8(_testnestedflatbuffer!); final int? testemptyOffset = _testempty?.getOrCreateOffset(fbBuilder); final int? testarrayofboolsOffset = _testarrayofbools == null ? null : fbBuilder.writeListBool(_testarrayofbools!); final int? testarrayofstring2Offset = _testarrayofstring2 == null ? null : fbBuilder.writeList(_testarrayofstring2!.map(fbBuilder.writeString).toList()); final int? testarrayofsortedstructOffset = _testarrayofsortedstruct == null ? null : fbBuilder.writeListOfStructs(_testarrayofsortedstruct!); final int? flexOffset = _flex == null ? null : fbBuilder.writeListUint8(_flex!); final int? test5Offset = _test5 == null ? null : fbBuilder.writeListOfStructs(_test5!); final int? vectorOfLongsOffset = _vectorOfLongs == null ? null : fbBuilder.writeListInt64(_vectorOfLongs!); final int? vectorOfDoublesOffset = _vectorOfDoubles == null ? null : fbBuilder.writeListFloat64(_vectorOfDoubles!); final int? parentNamespaceTestOffset = _parentNamespaceTest?.getOrCreateOffset(fbBuilder); final int? vectorOfReferrablesOffset = _vectorOfReferrables == null ? null : fbBuilder.writeList(_vectorOfReferrables!.map((b) => b.getOrCreateOffset(fbBuilder)).toList()); final int? vectorOfWeakReferencesOffset = _vectorOfWeakReferences == null ? null : fbBuilder.writeListUint64(_vectorOfWeakReferences!); final int? vectorOfStrongReferrablesOffset = _vectorOfStrongReferrables == null ? null : fbBuilder.writeList(_vectorOfStrongReferrables!.map((b) => b.getOrCreateOffset(fbBuilder)).toList()); final int? vectorOfCoOwningReferencesOffset = _vectorOfCoOwningReferences == null ? null : fbBuilder.writeListUint64(_vectorOfCoOwningReferences!); final int? vectorOfNonOwningReferencesOffset = _vectorOfNonOwningReferences == null ? null : fbBuilder.writeListUint64(_vectorOfNonOwningReferences!); final int? anyUniqueOffset = _anyUnique?.getOrCreateOffset(fbBuilder); final int? anyAmbiguousOffset = _anyAmbiguous?.getOrCreateOffset(fbBuilder); final int? vectorOfEnumsOffset = _vectorOfEnums == null ? null : fbBuilder.writeListUint8(_vectorOfEnums!.map((f) => f.value).toList()); final int? testrequirednestedflatbufferOffset = _testrequirednestedflatbuffer == null ? null : fbBuilder.writeListUint8(_testrequirednestedflatbuffer!); final int? scalarKeySortedTablesOffset = _scalarKeySortedTables == null ? null : fbBuilder.writeList(_scalarKeySortedTables!.map((b) => b.getOrCreateOffset(fbBuilder)).toList()); fbBuilder.startTable(62); if (_pos != null) { fbBuilder.addStruct(0, _pos!.finish(fbBuilder)); } fbBuilder.addInt16(1, _mana); fbBuilder.addInt16(2, _hp); fbBuilder.addOffset(3, nameOffset); fbBuilder.addOffset(5, inventoryOffset); fbBuilder.addUint8(6, _color?.value); fbBuilder.addUint8(7, _testType?.value); fbBuilder.addOffset(8, testOffset); fbBuilder.addOffset(9, test4Offset); fbBuilder.addOffset(10, testarrayofstringOffset); fbBuilder.addOffset(11, testarrayoftablesOffset); fbBuilder.addOffset(12, enemyOffset); fbBuilder.addOffset(13, testnestedflatbufferOffset); fbBuilder.addOffset(14, testemptyOffset); fbBuilder.addBool(15, _testbool); fbBuilder.addInt32(16, _testhashs32Fnv1); fbBuilder.addUint32(17, _testhashu32Fnv1); fbBuilder.addInt64(18, _testhashs64Fnv1); fbBuilder.addUint64(19, _testhashu64Fnv1); fbBuilder.addInt32(20, _testhashs32Fnv1a); fbBuilder.addUint32(21, _testhashu32Fnv1a); fbBuilder.addInt64(22, _testhashs64Fnv1a); fbBuilder.addUint64(23, _testhashu64Fnv1a); fbBuilder.addOffset(24, testarrayofboolsOffset); fbBuilder.addFloat32(25, _testf); fbBuilder.addFloat32(26, _testf2); fbBuilder.addFloat32(27, _testf3); fbBuilder.addOffset(28, testarrayofstring2Offset); fbBuilder.addOffset(29, testarrayofsortedstructOffset); fbBuilder.addOffset(30, flexOffset); fbBuilder.addOffset(31, test5Offset); fbBuilder.addOffset(32, vectorOfLongsOffset); fbBuilder.addOffset(33, vectorOfDoublesOffset); fbBuilder.addOffset(34, parentNamespaceTestOffset); fbBuilder.addOffset(35, vectorOfReferrablesOffset); fbBuilder.addUint64(36, _singleWeakReference); fbBuilder.addOffset(37, vectorOfWeakReferencesOffset); fbBuilder.addOffset(38, vectorOfStrongReferrablesOffset); fbBuilder.addUint64(39, _coOwningReference); fbBuilder.addOffset(40, vectorOfCoOwningReferencesOffset); fbBuilder.addUint64(41, _nonOwningReference); fbBuilder.addOffset(42, vectorOfNonOwningReferencesOffset); fbBuilder.addUint8(43, _anyUniqueType?.value); fbBuilder.addOffset(44, anyUniqueOffset); fbBuilder.addUint8(45, _anyAmbiguousType?.value); fbBuilder.addOffset(46, anyAmbiguousOffset); fbBuilder.addOffset(47, vectorOfEnumsOffset); fbBuilder.addInt8(48, _signedEnum?.value); fbBuilder.addOffset(49, testrequirednestedflatbufferOffset); fbBuilder.addOffset(50, scalarKeySortedTablesOffset); if (_nativeInline != null) { fbBuilder.addStruct(51, _nativeInline!.finish(fbBuilder)); } fbBuilder.addUint64(52, _longEnumNonEnumDefault?.value); fbBuilder.addUint64(53, _longEnumNormalDefault?.value); fbBuilder.addFloat32(54, _nanDefault); fbBuilder.addFloat32(55, _infDefault); fbBuilder.addFloat32(56, _positiveInfDefault); fbBuilder.addFloat32(57, _infinityDefault); fbBuilder.addFloat32(58, _positiveInfinityDefault); fbBuilder.addFloat32(59, _negativeInfDefault); fbBuilder.addFloat32(60, _negativeInfinityDefault); fbBuilder.addFloat64(61, _doubleInfDefault); return fbBuilder.endTable(); } /// Convenience method to serialize to byte list. @override Uint8List toBytes([String? fileIdentifier]) { final fbBuilder = fb.Builder(deduplicateTables: false); fbBuilder.finish(finish(fbBuilder), fileIdentifier); return fbBuilder.buffer; } } class TypeAliases { TypeAliases._(this._bc, this._bcOffset); factory TypeAliases(List bytes) { final rootRef = fb.BufferContext.fromBytes(bytes); return reader.read(rootRef, 0); } static const fb.Reader reader = _TypeAliasesReader(); final fb.BufferContext _bc; final int _bcOffset; int get i8 => const fb.Int8Reader().vTableGet(_bc, _bcOffset, 4, 0); int get u8 => const fb.Uint8Reader().vTableGet(_bc, _bcOffset, 6, 0); int get i16 => const fb.Int16Reader().vTableGet(_bc, _bcOffset, 8, 0); int get u16 => const fb.Uint16Reader().vTableGet(_bc, _bcOffset, 10, 0); int get i32 => const fb.Int32Reader().vTableGet(_bc, _bcOffset, 12, 0); int get u32 => const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 14, 0); int get i64 => const fb.Int64Reader().vTableGet(_bc, _bcOffset, 16, 0); int get u64 => const fb.Uint64Reader().vTableGet(_bc, _bcOffset, 18, 0); double get f32 => const fb.Float32Reader().vTableGet(_bc, _bcOffset, 20, 0.0); double get f64 => const fb.Float64Reader().vTableGet(_bc, _bcOffset, 22, 0.0); List? get v8 => const fb.Int8ListReader().vTableGetNullable(_bc, _bcOffset, 24); List? get vf64 => const fb.ListReader(fb.Float64Reader()).vTableGetNullable(_bc, _bcOffset, 26); @override String toString() { return 'TypeAliases{i8: ${i8}, u8: ${u8}, i16: ${i16}, u16: ${u16}, i32: ${i32}, u32: ${u32}, i64: ${i64}, u64: ${u64}, f32: ${f32}, f64: ${f64}, v8: ${v8}, vf64: ${vf64}}'; } TypeAliasesT unpack() => TypeAliasesT( i8: i8, u8: u8, i16: i16, u16: u16, i32: i32, u32: u32, i64: i64, u64: u64, f32: f32, f64: f64, v8: const fb.Int8ListReader(lazy: false).vTableGetNullable(_bc, _bcOffset, 24), vf64: const fb.ListReader(fb.Float64Reader(), lazy: false).vTableGetNullable(_bc, _bcOffset, 26)); static int pack(fb.Builder fbBuilder, TypeAliasesT? object) { if (object == null) return 0; return object.pack(fbBuilder); } } class TypeAliasesT implements fb.Packable { int i8; int u8; int i16; int u16; int i32; int u32; int i64; int u64; double f32; double f64; List? v8; List? vf64; TypeAliasesT({ this.i8 = 0, this.u8 = 0, this.i16 = 0, this.u16 = 0, this.i32 = 0, this.u32 = 0, this.i64 = 0, this.u64 = 0, this.f32 = 0.0, this.f64 = 0.0, this.v8, this.vf64}); @override int pack(fb.Builder fbBuilder) { final int? v8Offset = v8 == null ? null : fbBuilder.writeListInt8(v8!); final int? vf64Offset = vf64 == null ? null : fbBuilder.writeListFloat64(vf64!); fbBuilder.startTable(12); fbBuilder.addInt8(0, i8); fbBuilder.addUint8(1, u8); fbBuilder.addInt16(2, i16); fbBuilder.addUint16(3, u16); fbBuilder.addInt32(4, i32); fbBuilder.addUint32(5, u32); fbBuilder.addInt64(6, i64); fbBuilder.addUint64(7, u64); fbBuilder.addFloat32(8, f32); fbBuilder.addFloat64(9, f64); fbBuilder.addOffset(10, v8Offset); fbBuilder.addOffset(11, vf64Offset); return fbBuilder.endTable(); } @override String toString() { return 'TypeAliasesT{i8: ${i8}, u8: ${u8}, i16: ${i16}, u16: ${u16}, i32: ${i32}, u32: ${u32}, i64: ${i64}, u64: ${u64}, f32: ${f32}, f64: ${f64}, v8: ${v8}, vf64: ${vf64}}'; } } class _TypeAliasesReader extends fb.TableReader { const _TypeAliasesReader(); @override TypeAliases createObject(fb.BufferContext bc, int offset) => TypeAliases._(bc, offset); } class TypeAliasesBuilder { TypeAliasesBuilder(this.fbBuilder); final fb.Builder fbBuilder; void begin() { fbBuilder.startTable(12); } int addI8(int? i8) { fbBuilder.addInt8(0, i8); return fbBuilder.offset; } int addU8(int? u8) { fbBuilder.addUint8(1, u8); return fbBuilder.offset; } int addI16(int? i16) { fbBuilder.addInt16(2, i16); return fbBuilder.offset; } int addU16(int? u16) { fbBuilder.addUint16(3, u16); return fbBuilder.offset; } int addI32(int? i32) { fbBuilder.addInt32(4, i32); return fbBuilder.offset; } int addU32(int? u32) { fbBuilder.addUint32(5, u32); return fbBuilder.offset; } int addI64(int? i64) { fbBuilder.addInt64(6, i64); return fbBuilder.offset; } int addU64(int? u64) { fbBuilder.addUint64(7, u64); return fbBuilder.offset; } int addF32(double? f32) { fbBuilder.addFloat32(8, f32); return fbBuilder.offset; } int addF64(double? f64) { fbBuilder.addFloat64(9, f64); return fbBuilder.offset; } int addV8Offset(int? offset) { fbBuilder.addOffset(10, offset); return fbBuilder.offset; } int addVf64Offset(int? offset) { fbBuilder.addOffset(11, offset); return fbBuilder.offset; } int finish() { return fbBuilder.endTable(); } } class TypeAliasesObjectBuilder extends fb.ObjectBuilder { final int? _i8; final int? _u8; final int? _i16; final int? _u16; final int? _i32; final int? _u32; final int? _i64; final int? _u64; final double? _f32; final double? _f64; final List? _v8; final List? _vf64; TypeAliasesObjectBuilder({ int? i8, int? u8, int? i16, int? u16, int? i32, int? u32, int? i64, int? u64, double? f32, double? f64, List? v8, List? vf64, }) : _i8 = i8, _u8 = u8, _i16 = i16, _u16 = u16, _i32 = i32, _u32 = u32, _i64 = i64, _u64 = u64, _f32 = f32, _f64 = f64, _v8 = v8, _vf64 = vf64; /// Finish building, and store into the [fbBuilder]. @override int finish(fb.Builder fbBuilder) { final int? v8Offset = _v8 == null ? null : fbBuilder.writeListInt8(_v8!); final int? vf64Offset = _vf64 == null ? null : fbBuilder.writeListFloat64(_vf64!); fbBuilder.startTable(12); fbBuilder.addInt8(0, _i8); fbBuilder.addUint8(1, _u8); fbBuilder.addInt16(2, _i16); fbBuilder.addUint16(3, _u16); fbBuilder.addInt32(4, _i32); fbBuilder.addUint32(5, _u32); fbBuilder.addInt64(6, _i64); fbBuilder.addUint64(7, _u64); fbBuilder.addFloat32(8, _f32); fbBuilder.addFloat64(9, _f64); fbBuilder.addOffset(10, v8Offset); fbBuilder.addOffset(11, vf64Offset); return fbBuilder.endTable(); } /// Convenience method to serialize to byte list. @override Uint8List toBytes([String? fileIdentifier]) { final fbBuilder = fb.Builder(deduplicateTables: false); fbBuilder.finish(finish(fbBuilder), fileIdentifier); return fbBuilder.buffer; } } flatbuffers-24.12.23/dart/test/monster_test_my_game_generated.dart000066400000000000000000000041301473234705300253050ustar00rootroot00000000000000// automatically generated by the FlatBuffers compiler, do not modify // ignore_for_file: unused_import, unused_field, unused_element, unused_local_variable, constant_identifier_names library my_game; import 'dart:typed_data' show Uint8List; import 'package:flat_buffers/flat_buffers.dart' as fb; import './monster_test_my_game.example_generated.dart' as my_game_example; import './monster_test_my_game.example2_generated.dart' as my_game_example2; import './include_test1_generated.dart'; class InParentNamespace { InParentNamespace._(this._bc, this._bcOffset); factory InParentNamespace(List bytes) { final rootRef = fb.BufferContext.fromBytes(bytes); return reader.read(rootRef, 0); } static const fb.Reader reader = _InParentNamespaceReader(); final fb.BufferContext _bc; final int _bcOffset; @override String toString() { return 'InParentNamespace{}'; } InParentNamespaceT unpack() => InParentNamespaceT(); static int pack(fb.Builder fbBuilder, InParentNamespaceT? object) { if (object == null) return 0; return object.pack(fbBuilder); } } class InParentNamespaceT implements fb.Packable { @override int pack(fb.Builder fbBuilder) { fbBuilder.startTable(0); return fbBuilder.endTable(); } @override String toString() { return 'InParentNamespaceT{}'; } } class _InParentNamespaceReader extends fb.TableReader { const _InParentNamespaceReader(); @override InParentNamespace createObject(fb.BufferContext bc, int offset) => InParentNamespace._(bc, offset); } class InParentNamespaceObjectBuilder extends fb.ObjectBuilder { InParentNamespaceObjectBuilder(); /// Finish building, and store into the [fbBuilder]. @override int finish(fb.Builder fbBuilder) { fbBuilder.startTable(0); return fbBuilder.endTable(); } /// Convenience method to serialize to byte list. @override Uint8List toBytes([String? fileIdentifier]) { final fbBuilder = fb.Builder(deduplicateTables: false); fbBuilder.finish(finish(fbBuilder), fileIdentifier); return fbBuilder.buffer; } } flatbuffers-24.12.23/dart/test/monsterdata_test.mon000066400000000000000000000011301473234705300222570ustar00rootroot00000000000000xMONSl”,048<@DHpxLP€ˆTX\`dhllP€?@@@@¤”,ÜÄAÉyŨAÉyŨq¤Žq¤Ž¨ˆā4,‘{ṑn‘{ṑnņŨgĮÜHųCņŨgĮÜHųC(miss    hit- °˙˙˙Fredtest2test1 ( (  Fred˙˙˙˙˙˙ī˙˙˙˙˙˙˙īd'@Báõ MyMonsterflatbuffers-24.12.23/docs/000077500000000000000000000000001473234705300152105ustar00rootroot00000000000000flatbuffers-24.12.23/docs/footer.html000066400000000000000000000007041473234705300173750ustar00rootroot00000000000000 flatbuffers-24.12.23/docs/header.html000066400000000000000000000045021473234705300173270ustar00rootroot00000000000000 $projectname: $title $title $treeview $search $mathjax $extrastylesheet
$projectname  $projectnumber
An open source project by FPL.
$projectbrief
$projectbrief
$searchbox
flatbuffers-24.12.23/docs/images/000077500000000000000000000000001473234705300164555ustar00rootroot00000000000000flatbuffers-24.12.23/docs/images/fpl_logo_small.png000066400000000000000000000117211473234705300221560ustar00rootroot00000000000000‰PNG  IHDR@Aa5ĸ{sRGBŽÎé pHYsgŸŌRYiTXtXML:com.adobe.xmp 1 LÂ'YIDATxŊ[{Œ]Åy˙sû^ŋÖģ~Æk0æeF1ZJh”Ļ *"ŠPK)UQŌ6Tm…RU•JĨųŖŠ*5i”&UH‰@"Ĩ­\P M"h…cŒ‰€qjŠmlŗ~íîŨģģ÷žsúûÍÜšįÜs{īŨ%#ī=gž™ų^ķÍ7ß|gėE,ø%•vIyž÷KâČ~”$pƒAČŋ  Á¤r'ĸ´īŪõ"á3™ |?çoŪ?H…xdhI-@čĘårõ/ zû\HËMĨ/5âųRHš\ŲlÖ(h)'mÉr†KĨJķ%3Û@Te–b°æҌ}ŲAã>nŽ2žl.‡|>O ņ›!ęžhˆššš9ĖĪĪķ–°ú÷ęGŠ”I ===U%wKoQ (QčY ¯Ų''šôg3ͨzšéļVu)Ū÷|ôôöe´ęÛĒ­+HāŲŲYcōvMK„önÅL7mR„|C___WËĸcČÁ‹3œõxwøã$ĩƒ…”+ÚYŽ !•āŅúúûŖ2:))@ëŧXœ5ø[oÕ1Ŗ ™1rō§'Īfö›į“õHĀ ņU€Ôz{{鄡ŊŌļäčæfįjlŌģĮ . ŧf=—¸ĪãĐۈ¸kx7\Eŧ„Ī— ×ønŠEĄqŽRD;Ĩ­ŊDÂkͧŊUrk‹Ų–*ŌĨŌ*á{9;—gũã3nũÂÛŋ€đoŸÎ]úzhėĶEe]Ũ’OĒō[×§° Xŗ/š5Ö%g•adÛŪ:đĪŋ…čŲŊĀĩÛF{xípÛnø_˙"ŧ›¯ŊĢkĩšVPũĒC*]*9GģHŗEiŠ9ŧBaϞ4›‘jŨ5‰Û|ŅO~†đ×ce¸eŒk?ā;ķ\§i§'á˙ā1xŸ¸ %›(Á!]ø)cęīī7QdŗŪM ­ŽP(TŧŊ†Û}Ū™Ŋdō ĶSœę)š_7SƤ´āų—|ꏁĢ׃ũˆöM°īEūiäJx7­â+…~uüī˙=ŧû?JŸ@įØÂ1r`ÅÃāā@Ķ-˛Šfffû|=X`ۖލYķ=ˆžđļ‡iōrŽ=š üûëj#`ôęQ„OŊŒĢéŧö€ŋ÷ûđîēŒ´ååŗŲúë… ¤Ąâuoį´áȅ€˛?žę0I+úŨŋ@ôÂQ`ĶpvŲĮöėFÄxŪPx¯ŧŠōī}ŨĀā3˛ û‘yîo€ĩ#Æ'D´kqRĩĩ›vš“?P ¤đ9]ęvu–um< ]r•â“—hßkˆūíiā&Žų7ŪAöÉ/÷ū*BŗŨ…fņ„TDt÷GāķO?N+æķU„Īũ˜H,]ũēå' pŖAģ˜ Ų58Qę áÕ҆¸ļ§ÕšˆÖ’MÖ]Ú*ôîŅLáŋžH=ûáķđ¸‹Ūūf„\^4=vĒĮ÷ˆÎ6úđ-˜|ø“ĀËgā]č?^ĻШcĶ2ÖÖ¯Ĩa&V>%Uj0Kp™ŋOŊļ‰Åžd=VMĨqД€cīۇ]|Ū=ˇ"b”f„Wģ+ĸG‘ĄÅ{nÂû8„köÔY.Ą)Ģ€ZŌndO;PĒÃ[Ú j ķŧ4•`­ Íģ’ą\Ļ?"z7 0ŠkÍXl˙ąd•ˇ:ëz40%nÖ0ŽãvÆwũ­āádd-zũŠ8Šķ(!ČíG†;Ī>>}‡íČŽ_O­')× “Ļ˜ė™nĢ­ÛtŊ2IFĘÛץKtčÃĩ=*ã4‹\kŪU[{ė§ŦĻđeŌĸpí8Våļ —Lņ ™-™PŲ^˙OŸۉˆuˆdŽŽt=“m@*üT{rËex,? āJ,^úMÛc=Ė))æąŌGZŗ–V  vG!u)–NÎĄ˙ü–M–á–!… gÜģ4Ėúx<Ä‹Ō@ĖŗHÛ"%X8éŌ^1ÄuŽ' ‰ĒQŋxDåM‡!ƒą›€7˜đ0WĶ-"ĸŪ2Olķœyv÷zrđÎŋ‰ÜoŪ Oģ…”X!–Ü…jtTąĐę%OVŋÎ!t„§ŨΚŅm[IfŗõF”EJČqYč°3o„-0­D€ŌŠŗŊÔĀŽŽ^…OŠĨØm07~5œŧĻz KŦWéGB:Ķ{ë×w\É´ã&9?)A ȟšŋįŖđ¯Ü‚HÉRŗ#´ĸœæ$]Oķlë˛|MŧU@bLēģšÜDˇĘkŖŪq/9 -fĒk;ˇ@ÆõŲ:’ņļų§ ČīÜÎŗÁŠ"ū)7MUE"m…ŒŒĸŠŠiã9\ z;–db „đŪ9„O˙ ĸ'Ÿ ōčlĢ8 ::âKí{čøŪĮHrÍ"“"uTĒĨË<ÆQaē ƒ¨6,úEΏ§žčț?ũgĀņˇ-[8Ŗž ėR„N‘7Âę+đŽŖ5§TYO;Ú Á. (@\$‰ŠŽ’†Ųē~MŠđ8õ‚m˸ l[ŽhšëY&ĮŲmU")‰˜ŧ!foŪ™Ūŋ ˙Čđ6}ˆ)ųĮG+,­Ú*ãÉK?w?Īą—$caŽÅ"o3-÷ž@UæG1îëEø'éÜĻ(@?’üëKÔrđ‹Œ Ūå.pI“ĢGˆŖˆč™o%ŅmIIÔUœĶŪ+āĨõÂ-ĮÅėNđ™GāũīĘ'#Xs-Ę7­§"fĐûŌĪ+LĐG(=ÎđĮ2Å ‡!âÜŽkŦ[ŽÜĄ÷9ąŸįƒkmY…Ė“ ŗ ÷Ë´LŲMāQģ>2i‚I˛-HW΍‰ĐčėŧO`vųJ˙ô ôŨz#ōĢW"ŧ<…Ų§Ÿƒ§Ā‹'@ŋŸ`:K ‹čˆ5+ųßēŊ#+L\ÄėĪ"ûÕĮŅû_/":vūmģ˜9ᨴŲ6áy!°Âî ¸ۖ8 ‹aąJŒOĻĩŧwßåÜž ˙Į‡°âĒí–iŪÂÚ1äųœ™Åé˛é¯Ątū<vîDīæqKˆ9 9ŧė†5„mDáú˜Ųų NO،ąáiÁа¸Züēƒ_Ö yúRϤ™b%žÅŌ„m‹čØ7ĻŽ9Ŗ ëũäe \s%ã};ŗ>3úfŽÁĀõ7`zß+˜üæˇá­\"÷üå~Æ ÉĶķįGW#TÅ@hāĘ­(üĪ˜!šB¯Ön ĄÚkĸ 4š e–ėæģ€nyĖņĖ­ IJ,fÜÚæZ•u‘Ā: ­’ ’ž{÷} ĢžųÍ{? .zâā“įüđ’ÃČjŒ~é_ŗÆZŽņ‚TČĩīŧ…ŖĶŨĶãĒ ĖdsŠBHĖVĐXvCŖQS#˜cHWÜĒ Hč#ČĀ<˙ūCFfÍ‚K“ˆŠE'™2_;ŠėĻMNFáđa*ŒA”Š&… ÄTģˇnŜy]ÅS1 ˜xjŠa*KĢ™5:ũBĻŊ‚Cû<õ-Žo2(nÅTĀtšL=׃ųƒá ŅQōxŧ6ƒá? oĮ.ú kEKĮ—=  šī…F’IŅ`Ykˇę¤í´žkarŒnUÆ &úșž‚ŌWFyÆ_Áƒ%īŌÛČ~ņīāĄnSûöav˙äöŋˆū1..™ž/SaĖ +aOžØmR´Ģ=jaœk3ûú`Ē"Ë2%ËuV+oZxuĢ…9áÕķ—č#eŌ”ŋķD‡^ᇑcę+5ķŅ™Sđ7xvŲwaôsŋƒėAtîOÛ¸ö ŠãļKŖžĩ0ĐtéREüWˇÁ–šŌ„˜ĐÄB6é”[u#s˙ÈčäŧUËŠ~ÎŽ)´‚a֍ŋ➸ĪĮ‘y÷zļ^ōļŋ„ŋë^cĩŗĪĻã'†¤‰7ŽËÂ%̊,¸j ԐūtäĐÄq€ƒ´ų¤dīū8˛ŋqĸÃO#šāŊ éi&>×ķøwøô(§‚NîõÂ;ÂĖđąoŖoĘR˛PÁbÖãŲtā˛0?ēŲfō€”Õ•ĒĐCS´ŸŽŦ¸ÎÄcm׎yûšZ#mOËT‚5ŊĘ ¤„=īÆÛÍÖæØ ˙Ø[<ė< œų,0ž Ūfū-cd8ļ8ņ,üŅŨ7íæh–Jp8EĢĶb˜¨ ŠĖö—ÄĢ‚Đ ŗ¤ąÄēĩä%d-ĖÖc˜EŦzĻÁrbˇ"sû¯!7ČŦOæüUôˇđŌÄäYZÁ1D7~ū2~.įa‰_†WŽÛ Ö,‰Ž~-/˛l“§ŒÉRŨP''yW'a&Ž­ë§xĐ,Îā?ņGŦ@GČéExĮ˜˙[ö$oĖ\âq™ŸčÆv ŲĖũ?N‰ …ĩ8+AIXģEŠ˙!nŗn˙wãj,ĀäČ(¸.!ëcIíēˇvāvôÔ2āōŠŪ>Jgx‚153Éø`|&?ķ˙÷]äŽ?†LūJ×|ŧ"ŧÎū1ŊĻ-0nmū&$|ž  /“ĨÎ\ãåËd$å5­ļkũ‚ú ☊gÄqm[\ÍHŖ„ÆäyŽ˙˙Fnâ{ˆÆ)ėđZdĪ<Á{W0Hzs×Q~ąË.ļŋŠĀ˖ņ(Ũ ÔX@˛]‚ûbd…@ĩÚKÖcAã>1L˜ ×7‚ąqDģ?oÃ823{õ¯EĐ?E0J…äÅčRoię Ņė‚”zÔzAX¤5™Ë•0Í-KÎŖŗ+ĄfœĀ%fxŧ>”Æ˙Kaå{ø!„Éɐ‡Ÿm0XŠ×}ÍXS‘J›āŽëŦ % Τų—Lq”wnēÜ]—S€¤ŨÁ™S<ŧË72åxw¯pš“˙ŒŌúOr Ŧä*‘pí Ø‚6—m™ßuST‰O­‚f;iĶ%ā´%rŠē=â`ŽMëÜq Š^küŽ%ųôBæūŠį™|‰xykC§ŗ%ø %ŧŽÄ‰w•f›6Îj[*×­QYBžņšķI1…$YōF0ÁMQ#ĪáäEF}ƒ<h™ĩŊo~E19FW`æÍ„ ōÆI;ĨФk-IŖķ$`–GJÜ´đÃâˇŧœš€÷…#âl–ŒŠéŸĀháNx‹_Â+ÉŅŽđÂŅÔÔŽk •õ%É$™VjĶ€bÉ7ōī ‡ž%tiū2yÅ,“&ƒ<ãkšvR:R€™ų Aíējĸ˙ĸĸŲ3˙mÅPÖlؙŅo“š¯ōXĩĻ…:VGØ ŽąēīŖkhČFyŽĮT÷ĻՎ ,IEĻŗŠŧ *)uŽPjÍzĢ€ĻTŅāˇ÷|BcōÎŲ%yk—DĮ H#ÖŲA[Ĩš_Lh6ôßŲbHčĻN ËB¸T”ĩ’ :šöŅ'‰ŪbĘĸÔ¸ÖĄ,B>BpųˆŒ’T ˙ĩa’0^4ŖĒ––˛¸.OĄ5.GįOōЍ"ĨG0ɄŪe R„Ö§;/(S,ķ•`&~€‰b,†cU”¸ĐnŦ‚°ô˙MŌL éøuIā¨Ļ™R]ˇą¤ ŨBÕŲB–búi™f>)ˇb )Č,!-#:V™šūãtōhžĻáhwû\R8&Z1Šļ䟯XːuØ?‡'ųl…3Ų¯Ķ÷˙{ËĒ$=Ô´IENDŽB`‚flatbuffers-24.12.23/docs/images/ftv2mnode.png000066400000000000000000000020301473234705300210620ustar00rootroot00000000000000‰PNG  IHDRÉĒ|tEXtSoftwareAdobe ImageReadyqÉe<#iTXtXML:com.adobe.xmp *Æ(‹IDATxÚbú˙˙?%˜‰B0j `Aæ())=RxÔßŧwīž>°0¯€Ļ¯Rģqh^ ”ßOLäņ4ąO@\JT mš¤ZĐ„Ģ€âĪąĀJĪØ0@ī‚( > ÔlBN4fņ? ÎĀŦøršĸĸĸ/ĄÜˆĶ Ŗ™i(`DŠ‚āĖ‚°IENDŽB`‚flatbuffers-24.12.23/docs/images/ftv2pnode.png000066400000000000000000000020251473234705300210710ustar00rootroot00000000000000‰PNG  IHDRÉĒ|tEXtSoftwareAdobe ImageReadyqÉe<#iTXtXML:com.adobe.xmp öAˆIDATxÚbü˙˙?%€‰B0jšJJJ÷Ø›(ņ !€X‘/øņu !Ĩ„ `DNH@ ØRÕ ÎŧwīŪrQˆ ÷%א l.،M’ÆŸ@\ ÔØĪt\lâB æû„œ‡nĀ ÎjÜJl:`ÍÎÃÁ€sį)`IENDŽB`‚flatbuffers-24.12.23/docs/source/000077500000000000000000000000001473234705300165105ustar00rootroot00000000000000flatbuffers-24.12.23/docs/source/Benchmarks.md000066400000000000000000000115221473234705300211100ustar00rootroot00000000000000C++ Benchmarks {#flatbuffers_benchmarks} ========== Comparing against other serialization solutions, running on Windows 7 64bit. We use the LITE runtime for Protocol Buffers (less code / lower overhead), Rapid JSON (one of the fastest C++ JSON parsers around), and pugixml, also one of the fastest XML parsers. We also compare against code that doesn't use a serialization library at all (the column "Raw structs"), which is what you get if you write hardcoded code that just writes structs. This is the fastest possible, but of course is not cross platform nor has any kind of forwards / backwards compatibility. We compare against Flatbuffers with the binary wire format (as intended), and also with JSON as the wire format with the optional JSON parser (which, using a schema, parses JSON into a binary buffer that can then be accessed as before). The benchmark object is a set of about 10 objects containing an array, 4 strings, and a large variety of int/float scalar values of all sizes, meant to be representative of game data, e.g. a scene format. | | FlatBuffers (binary) | Protocol Buffers LITE | Rapid JSON | FlatBuffers (JSON) | pugixml | Raw structs | |--------------------------------------------------------|-----------------------|-----------------------|-----------------------|------------------------| ----------------------| ----------------------| | Decode + Traverse + Dealloc (1 million times, seconds) | 0.08 | 302 | 583 | 105 | 196 | 0.02 | | Decode / Traverse / Dealloc (breakdown) | 0 / 0.08 / 0 | 220 / 0.15 / 81 | 294 / 0.9 / 287 | 70 / 0.08 / 35 | 41 / 3.9 / 150 | 0 / 0.02 / 0 | | Encode (1 million times, seconds) | 3.2 | 185 | 650 | 169 | 273 | 0.15 | | Wire format size (normal / zlib, bytes) | 344 / 220 | 228 / 174 | 1475 / 322 | 1029 / 298 | 1137 / 341 | 312 / 187 | | Memory needed to store decoded wire (bytes / blocks) | 0 / 0 | 760 / 20 | 65689 / 4 | 328 / 1 | 34194 / 3 | 0 / 0 | | Transient memory allocated during decode (KB) | 0 | 1 | 131 | 4 | 34 | 0 | | Generated source code size (KB) | 4 | 61 | 0 | 4 | 0 | 0 | | Field access in handwritten traversal code | typed accessors | typed accessors | manual error checking | typed accessors | manual error checking | typed but no safety | | Library source code (KB) | 15 | some subset of 3800 | 87 | 43 | 327 | 0 | ### Some other serialization systems we compared against but did not benchmark (yet), in rough order of applicability: - Cap'n'Proto promises to reduce Protocol Buffers much like FlatBuffers does, though with a more complicated binary encoding and less flexibility (no optional fields to allow deprecating fields or serializing with missing fields for which defaults exist). It currently also isn't fully cross-platform portable (lack of VS support). - msgpack: has very minimal forwards/backwards compatibility support when used with the typed C++ interface. Also lacks VS2010 support. - Thrift: very similar to Protocol Buffers, but appears to be less efficient, and have more dependencies. - YAML: a superset of JSON and otherwise very similar. Used by e.g. Unity. - C# comes with built-in serialization functionality, as used by Unity also. Being tied to the language, and having no automatic versioning support limits its applicability. - Project Anarchy (the free mobile engine by Havok) comes with a serialization system, that however does no automatic versioning (have to code around new fields manually), is very much tied to the rest of the engine, and works without a schema to generate code (tied to your C++ class definition). ### Code for benchmarks Code for these benchmarks sits in `benchmarks/` in git branch `benchmarks`. It sits in its own branch because it has submodule dependencies that the main project doesn't need, and the code standards do not meet those of the main project. Please read `benchmarks/cpp/README.txt` before working with the code.
flatbuffers-24.12.23/docs/source/Building.md000066400000000000000000000137651473234705300206030ustar00rootroot00000000000000Building {#flatbuffers_guide_building} ======== ## Building with CMake The distribution comes with a `cmake` file that should allow you to build project/make files for any platform. For details on `cmake`, see . In brief, depending on your platform, use one of e.g.: cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release cmake -G "Visual Studio 10" -DCMAKE_BUILD_TYPE=Release cmake -G "Xcode" -DCMAKE_BUILD_TYPE=Release Then, build as normal for your platform. This should result in a `flatc` executable, essential for the next steps. Note that to use clang instead of gcc, you may need to set up your environment variables, e.g. `CC=/usr/bin/clang CXX=/usr/bin/clang++ cmake -G "Unix Makefiles"`. Optionally, run the `flattests` executable from the root `flatbuffers/` directory to ensure everything is working correctly on your system. If this fails, please contact us! Building should also produce two sample executables, `flatsamplebinary` and `flatsampletext`, see the corresponding `.cpp` files in the `flatbuffers/samples` directory. *Note that you MUST be in the root of the FlatBuffers distribution when you run 'flattests' or `flatsampletext`, or it will fail to load its files.* ### Make all warnings into errors By default all Flatbuffers `cmake` targets are **not** built with the `-Werror` (or `/WX` for MSVC) flag that treats any warning as an error. This allows more flexibility for users of Flatbuffers to use newer compilers and toolsets that may add new warnings that would cause a build failure. To enable a stricter build that does treat warnings as errors, set the `FLATBUFFERS_STRICT_MODE` `cmake` compliation flag to `ON`. ``` cmake . -DFLATBUFFERS_STRICT_MODE=ON ``` Our CI builds run with strict mode on, ensuring the code that is committed to the project is as portable and warning free as possible. Thus developers contributing to the project should enable strict mode locally before making a PR. ## Building with VCPKG You can download and install flatbuffers using the [vcpkg](https://github.com/Microsoft/vcpkg/) dependency manager: git clone https://github.com/Microsoft/vcpkg.git cd vcpkg ./bootstrap-vcpkg.sh ./vcpkg integrate install ./vcpkg install flatbuffers The flatbuffers port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository. ## Downloading binaries You can download the binaries from the [GitHub release page](https://github.com/google/flatbuffers/releases). We generate [SLSA3 signatures](slsa.dev) using the OpenSSF's [slsa-framework/slsa-github-generator](https://github.com/slsa-framework/slsa-github-generator). To verify the binaries: 1. Install the verification tool from [slsa-framework/slsa-verifier#installation](https://github.com/slsa-framework/slsa-verifier#installation) 1. Download the file named `attestation.intoto.jsonl` from the GitHub release 1. Run: ```shell $ slsa-verifier -artifact-path -provenance attestation.intoto.jsonl -source github.com/google/flatbuffers -tag PASSED: Verified SLSA provenance ## Building for Android There is a `flatbuffers/android` directory that contains all you need to build the test executable on android (use the included `build_apk.sh` script, or use `ndk_build` / `adb` etc. as usual). Upon running, it will output to the log if tests succeeded or not. You may also run an android sample from inside the `flatbuffers/samples`, by running the `android_sample.sh` script. Optionally, you may go to the `flatbuffers/samples/android` folder and build the sample with the `build_apk.sh` script or `ndk_build` / `adb` etc. ## Using FlatBuffers in your own projects For C++, there is usually no runtime to compile, as the code consists of a single header, `include/flatbuffers/flatbuffers.h`. You should add the `include` folder to your include paths. If you wish to be able to load schemas and/or parse text into binary buffers at runtime, you additionally need the other headers in `include/flatbuffers`. You must also compile/link `src/idl_parser.cpp` (and `src/idl_gen_text.cpp` if you also want to be able convert binary to text). To see how to include FlatBuffers in any of our supported languages, please view the [Tutorial](@ref flatbuffers_guide_tutorial) and select your appropriate language using the radio buttons. ### Using in CMake-based projects If you want to use FlatBuffers in a project which already uses CMake, then a more robust and flexible approach is to build FlatBuffers as part of that project directly. This is done by making the FlatBuffers source code available to the main build and adding it using CMake's `add_subdirectory()` command. This has the significant advantage that the same compiler and linker settings are used between FlatBuffers and the rest of your project, so issues associated with using incompatible libraries (eg debug/release), etc. are avoided. This is particularly useful on Windows. Suppose you put FlatBuffers source code in directory `${FLATBUFFERS_SRC_DIR}`. To build it as part of your project, add following code to your `CMakeLists.txt` file: ```cmake # Add FlatBuffers directly to our build. This defines the `flatbuffers` target. add_subdirectory(${FLATBUFFERS_SRC_DIR} ${CMAKE_CURRENT_BINARY_DIR}/flatbuffers-build EXCLUDE_FROM_ALL) # Now simply link against flatbuffers as needed to your already declared target. # The flatbuffers target carry header search path automatically if CMake > 2.8.11. target_link_libraries(own_project_target PRIVATE flatbuffers) ``` When build your project the `flatbuffers` library will be compiled and linked to a target as part of your project. #### Override default depth limit of nested objects To override [the depth limit of recursion](@ref flatbuffers_guide_use_cpp), add this directive: ```cmake set(FLATBUFFERS_MAX_PARSING_DEPTH 16) ``` to `CMakeLists.txt` file before `add_subdirectory(${FLATBUFFERS_SRC_DIR})` line. flatbuffers-24.12.23/docs/source/CONTRIBUTING.md000077700000000000000000000000001473234705300236132../../CONTRIBUTING.mdustar00rootroot00000000000000flatbuffers-24.12.23/docs/source/CUsage.md000066400000000000000000000201361473234705300202030ustar00rootroot00000000000000Use in C {#flatbuffers_guide_use_c} ========== The C language binding exists in a separate project named [FlatCC](https://github.com/dvidelabs/flatcc). The `flatcc` C schema compiler can generate code offline as well as online via a C library. It can also generate buffer verifiers and fast JSON parsers, printers. Great care has been taken to ensure compatibility with the main `flatc` project. ## General Documention - [Tutorial](@ref flatbuffers_guide_tutorial) - select C as language when scrolling down - [FlatCC Guide](https://github.com/dvidelabs/flatcc#flatcc-flatbuffers-in-c-for-c) - [The C Builder Interface](https://github.com/dvidelabs/flatcc/blob/master/doc/builder.md#the-builder-interface) - [The Monster Sample in C](https://github.com/dvidelabs/flatcc/blob/master/samples/monster/monster.c) - [GitHub](https://github.com/dvidelabs/flatcc) ## Supported Platforms - Ubuntu (clang / gcc, ninja / gnu make) - OS-X (clang / gcc, ninja / gnu make) - Windows MSVC 2010, 2013, 2015 CI builds recent versions of gcc, clang and MSVC on OS-X, Ubuntu, and Windows, and occasionally older compiler versions. See main project [Status](https://github.com/dvidelabs/flatcc#status). Other platforms may well work, including Centos, but are not tested regularly. The monster sample project was specifically written for C99 in order to follow the C++ version and for that reason it will not work with MSVC 2010. ## Modular Object Creation In the tutorial we used the call `Monster_create_as_root` to create the root buffer object since this is easier in simple use cases. Sometimes we need more modularity so we can reuse a function to create nested tables and root tables the same way. For this we need the `flatcc_builder_buffer_create_call`. It is best to keep `flatcc_builder` calls isolated at the top driver level, so we get:
~~~{.c} ns(Monster_ref_t) create_orc(flatcc_builder_t *B) { // ... same as in the tutorial. return s(Monster_create(B, ...)); } void create_monster_buffer() { uint8_t *buf; size_t size; flatcc_builder_t builder, *B; // Initialize the builder object. B = &builder; flatcc_builder_init(B); // Only use `buffer_create` without `create/start/end_as_root`. flatcc_builder_buffer_create(create_orc(B)); // Allocate and copy buffer to user memory. buf = flatcc_builder_finalize_buffer(B, &size); // ... write the buffer to disk or network, or something. free(buf); flatcc_builder_clear(B); } ~~~
The same principle applies with `start/end` vs `start/end_as_root` in the top-down approach. ## Top Down Example The tutorial uses a bottom up approach. In C it is also possible to use a top-down approach by starting and ending objects nested within each other. In the tutorial there is no deep nesting, so the difference is limited, but it shows the idea:

~~~{.c} uint8_t treasure[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; size_t treasure_count = c_vec_len(treasure); ns(Weapon_ref_t) axe; // NOTE: if we use end_as_root, we MUST also start as root. ns(Monster_start_as_root(B)); ns(Monster_pos_create(B, 1.0f, 2.0f, 3.0f)); ns(Monster_hp_add(B, 300)); ns(Monster_mana_add(B, 150)); // We use create_str instead of add because we have no existing string reference. ns(Monster_name_create_str(B, "Orc")); // Again we use create because we no existing vector object, only a C-array. ns(Monster_inventory_create(B, treasure, treasure_count)); ns(Monster_color_add(B, ns(Color_Red))); if (1) { ns(Monster_weapons_start(B)); ns(Monster_weapons_push_create(B, flatbuffers_string_create_str(B, "Sword"), 3)); // We reuse the axe object later. Note that we dereference a pointer // because push always returns a short-term pointer to the stored element. // We could also have created the axe object first and simply pushed it. axe = *ns(Monster_weapons_push_create(B, flatbuffers_string_create_str(B, "Axe"), 5)); ns(Monster_weapons_end(B)); } else { // We can have more control with the table elements added to a vector: // ns(Monster_weapons_start(B)); ns(Monster_weapons_push_start(B)); ns(Weapon_name_create_str(B, "Sword")); ns(Weapon_damage_add(B, 3)); ns(Monster_weapons_push_end(B)); ns(Monster_weapons_push_start(B)); ns(Monster_weapons_push_start(B)); ns(Weapon_name_create_str(B, "Axe")); ns(Weapon_damage_add(B, 5)); axe = *ns(Monster_weapons_push_end(B)); ns(Monster_weapons_end(B)); } // Unions can get their type by using a type-specific add/create/start method. ns(Monster_equipped_Weapon_add(B, axe)); ns(Monster_end_as_root(B)); ~~~
## Basic Reflection The C-API does support reading binary schema (.bfbs) files via code generated from the `reflection.fbs` schema, and an [example usage](https://github.com/dvidelabs/flatcc/tree/master/samples/reflection) shows how to use this. The reflection schema files are pre-generated in the [runtime distribution](https://github.com/dvidelabs/flatcc/tree/master/include/flatcc/reflection). ## Mutations and Reflection The C-API does not support mutating reflection like C++ does, nor does the reader interface support mutating scalars (and it is generally unsafe to do so even after verification). The generated reader interface supports sorting vectors in-place after casting them to a mutating type because it is not practical to do so while building a buffer. This is covered in the builder documentation. The reflection example makes use of this feature to look up objects by name. It is possible to build new buffers using complex objects from existing buffers as source. This can be very efficient due to direct copy semantics without endian conversion or temporary stack allocation. Scalars, structs and strings can be used as source, as well vectors of these. It is currently not possible to use an existing table or vector of table as source, but it would be possible to add support for this at some point. ## Namespaces The `FLATBUFFERS_WRAP_NAMESPACE` approach used in the tutorial is convenient when each function has a very long namespace prefix. But it isn't always the best approach. If the namespace is absent, or simple and informative, we might as well use the prefix directly. The [reflection example](https://github.com/dvidelabs/flatcc/blob/master/samples/reflection/bfbs2json.c) mentioned above uses this approach. ## Checking for Present Members Not all languages support testing if a field is present, but in C we can elaborate the reader section of the tutorial with tests for this. Recall that `mana` was set to the default value `150` and therefore shouldn't be present.
~~~{.c} int hp_present = ns(Monster_hp_is_present(monster)); // 1 int mana_present = ns(Monster_mana_is_present(monster)); // 0 ~~~
## Alternative ways to add a Union In the tutorial we used a single call to add a union. Here we show different ways to accomplish the same thing. The last form is rarely used, but is the low-level way to do it. It can be used to group small values together in the table by adding type and data at different points in time.
~~~{.c} ns(Equipment_union_ref_t) equipped = ns(Equipment_as_Weapon(axe)); ns(Monster_equipped_add(B, equipped)); // or alternatively ns(Monster_equipped_Weapon_add(B, axe); // or alternatively ns(Monster_equipped_add_type(B, ns(Equipment_Weapon)); ns(Monster_equipped_add_member(B, axe)); ~~~
## Why not integrate with the `flatc` tool? [It was considered how the C code generator could be integrated into the `flatc` tool](https://github.com/dvidelabs/flatcc/issues/1), but it would either require that the standalone C implementation of the schema compiler was dropped, or it would lead to excessive code duplication, or a complicated intermediate representation would have to be invented. Neither of these alternatives are very attractive, and it isn't a big deal to use the `flatcc` tool instead of `flatc` given that the FlatBuffers C runtime library needs to be made available regardless. flatbuffers-24.12.23/docs/source/Compiler.md000066400000000000000000000250741473234705300206140ustar00rootroot00000000000000Using the schema compiler {#flatbuffers_guide_using_schema_compiler} ========================= Usage: flatc [ GENERATOR OPTIONS ] [ -o PATH ] [ -I PATH ] FILES... [ -- FILES...] The files are read and parsed in order, and can contain either schemas or data (see below). Data files are processed according to the definitions of the most recent schema specified. `--` indicates that the following files are binary files in FlatBuffer format conforming to the schema indicated before it. Depending on the flags passed, additional files may be generated for each file processed: For any schema input files, one or more generators can be specified: - `--cpp`, `-c` : Generate a C++ header for all definitions in this file (as `filename_generated.h`). - `--java`, `-j` : Generate Java code. - `--kotlin` , `--kotlin-kmp` : Generate Kotlin code. - `--csharp`, `-n` : Generate C# code. - `--go`, `-g` : Generate Go code. - `--python`, `-p` : Generate Python code. - `--js`, `-s` : Generate JavaScript code. - `--ts`, `-T` : Generate TypeScript code. - `--php` : Generate PHP code. - `--grpc` : Generate RPC stub code for GRPC. - `--dart`, `-d` : Generate Dart code. - `--lua`, `-l` : Generate Lua code. - `--lobster` : Generate Lobster code. - `--rust`, `-r` : Generate Rust code. - `--swift` : Generate Swift code. - `--nim` : Generate Nim code. For any data input files: - `--binary`, `-b` : If data is contained in this file, generate a `filename.bin` containing the binary flatbuffer (or a different extension if one is specified in the schema). - `--json`, `-t` : If data is contained in this file, generate a `filename.json` representing the data in the flatbuffer. - `--jsonschema` : Generate Json schema Additional options: - `-o PATH` : Output all generated files to PATH (either absolute, or relative to the current directory). If omitted, PATH will be the current directory. PATH should end in your systems path separator, e.g. `/` or `\`. - `-I PATH` : when encountering `include` statements, attempt to load the files from this path. Paths will be tried in the order given, and if all fail (or none are specified) it will try to load relative to the path of the schema file being parsed. - `-M` : Print make rules for generated files. - `--strict-json` : Require & generate strict JSON (field names are enclosed in quotes, no trailing commas in tables/vectors). By default, no quotes are required/generated, and trailing commas are allowed. - `--allow-non-utf8` : Pass non-UTF-8 input through parser and emit nonstandard \x escapes in JSON. (Default is to raise parse error on non-UTF-8 input.) - `--natural-utf8` : Output strings with UTF-8 as human-readable strings. By default, UTF-8 characters are printed as \uXXXX escapes." - `--defaults-json` : Output fields whose value is equal to the default value when writing JSON text. - `--no-prefix` : Don't prefix enum values in generated C++ by their enum type. - `--scoped-enums` : Use C++11 style scoped and strongly typed enums in generated C++. This also implies `--no-prefix`. - `--no-emit-min-max-enum-values` : Disable generation of MIN and MAX enumerated values for scoped enums and prefixed enums. - `--gen-includes` : (deprecated), this is the default behavior. If the original behavior is required (no include statements) use `--no-includes.` - `--no-includes` : Don't generate include statements for included schemas the generated file depends on (C++ / Python). - `--gen-mutable` : Generate additional non-const accessors for mutating FlatBuffers in-place. - `--gen-onefile` : Generate single output file for C#, Go, and Python. - `--gen-name-strings` : Generate type name functions for C++. - `--gen-object-api` : Generate an additional object-based API. This API is more convenient for object construction and mutation than the base API, at the cost of efficiency (object allocation). Recommended only to be used if other options are insufficient. - `--gen-compare` : Generate operator== for object-based API types. - `--gen-nullable` : Add Clang \_Nullable for C++ pointer. or @Nullable for Java. - `--gen-generated` : Add @Generated annotation for Java. - `--gen-jvmstatic` : Add @JvmStatic annotation for Kotlin methods in companion object for interop from Java to Kotlin. - `--gen-all` : Generate not just code for the current schema files, but for all files it includes as well. If the language uses a single file for output (by default the case for C++ and JS), all code will end up in this one file. - `--cpp-include` : Adds an #include in generated file - `--cpp-ptr-type T` : Set object API pointer type (default std::unique_ptr) - `--cpp-str-type T` : Set object API string type (default std::string) T::c_str(), T::length() and T::empty() must be supported. The custom type also needs to be constructible from std::string (see the --cpp-str-flex-ctor option to change this behavior). - `--cpp-str-flex-ctor` : Don't construct custom string types by passing std::string from Flatbuffers, but (char* + length). This allows efficient construction of custom string types, including zero-copy construction. - `--no-cpp-direct-copy` : Don't generate direct copy methods for C++ object-based API. - `--cpp-std CPP_STD` : Generate a C++ code using features of selected C++ standard. Supported `CPP_STD` values: * `c++0x` - generate code compatible with old compilers (VS2010), * `c++11` - use C++11 code generator (default), * `c++17` - use C++17 features in generated code (experimental). - `--object-prefix` : Customise class prefix for C++ object-based API. - `--object-suffix` : Customise class suffix for C++ object-based API. - `--go-namespace` : Generate the overrided namespace in Golang. - `--go-import` : Generate the overrided import for flatbuffers in Golang. (default is "github.com/google/flatbuffers/go"). - `--raw-binary` : Allow binaries without a file_indentifier to be read. This may crash flatc given a mismatched schema. - `--size-prefixed` : Input binaries are size prefixed buffers. - `--proto`: Expect input files to be .proto files (protocol buffers). Output the corresponding .fbs file. Currently supports: `package`, `message`, `enum`, nested declarations, `import` (use `-I` for paths), `extend`, `oneof`, `group`. Does not support, but will skip without error: `option`, `service`, `extensions`, and most everything else. - `--oneof-union` : Translate .proto oneofs to flatbuffer unions. - `--grpc` : Generate GRPC interfaces for the specified languages. - `--schema`: Serialize schemas instead of JSON (use with -b). This will output a binary version of the specified schema that itself corresponds to the reflection/reflection.fbs schema. Loading this binary file is the basis for reflection functionality. - `--bfbs-comments`: Add doc comments to the binary schema files. - `--conform FILE` : Specify a schema the following schemas should be an evolution of. Gives errors if not. Useful to check if schema modifications don't break schema evolution rules. - `--conform-includes PATH` : Include path for the schema given with `--conform PATH`. - `--filename-suffix SUFFIX` : The suffix appended to the generated file names. Default is '\_generated'. - `--filename-ext EXTENSION` : The extension appended to the generated file names. Default is language-specific (e.g. "h" for C++). This should not be used when multiple languages are specified. - `--include-prefix PATH` : Prefix this path to any generated include statements. - `--keep-prefix` : Keep original prefix of schema include statement. - `--reflect-types` : Add minimal type reflection to code generation. - `--reflect-names` : Add minimal type/name reflection. - `--root-type T` : Select or override the default root_type. - `--require-explicit-ids` : When parsing schemas, require explicit ids (id: x). - `--force-defaults` : Emit default values in binary output from JSON. - `--force-empty` : When serializing from object API representation, force strings and vectors to empty rather than null. - `--force-empty-vectors` : When serializing from object API representation, force vectors to empty rather than null. - `--flexbuffers` : Used with "binary" and "json" options, it generates data using schema-less FlexBuffers. - `--no-warnings` : Inhibit all warning messages. - `--cs-global-alias` : Prepend `global::` to all user generated csharp classes and structs. - `--json-nested-bytes` : Allow a nested_flatbuffer field to be parsed as a vector of bytes in JSON, which is unsafe unless checked by a verifier afterwards. - `--python-no-type-prefix-suffix` : Skip emission of Python functions that are prefixed with typenames - `--python-typing` : Generate Python type annotations Additional gRPC options: - `--grpc-filename-suffix`: `[C++]` An optional suffix for the generated files' names. For example, compiling gRPC for C++ with `--grpc-filename-suffix=.fbs` will generate `{name}.fbs.h` and `{name}.fbs.cc` files. - `--grpc-additional-header`: `[C++]` Additional headers to include in the generated files. - `--grpc-search-path`: `[C++]` An optional prefix for the gRPC runtime path. For example, compiling gRPC for C++ with `--grpc-search-path=some/path` will generate the following includes: ```cpp #include "some/path/grpcpp/impl/codegen/async_stream.h" #include "some/path/grpcpp/impl/codegen/async_unary_call.h" #include "some/path/grpcpp/impl/codegen/method_handler.h" ... ``` - `--grpc-use-system-headers`: `[C++]` Whether to generate `#include
` instead of `#include "header.h"` for all headers when compiling gRPC for C++. For example, compiling gRPC for C++ with `--grpc-use-system-headers` will generate the following includes: ```cpp #include #include #include ... ``` NOTE: This option can be negated with `--no-grpc-use-system-headers`. - `--grpc-python-typed-handlers`: `[Python]` Whether to generate the typed handlers that use the generated Python classes instead of raw bytes for requests/responses. NOTE: short-form options for generators are deprecated, use the long form whenever possible. flatbuffers-24.12.23/docs/source/CppUsage.md000066400000000000000000000655111473234705300205510ustar00rootroot00000000000000Use in C++ {#flatbuffers_guide_use_cpp} ========== ## Before you get started Before diving into the FlatBuffers usage in C++, it should be noted that the [Tutorial](@ref flatbuffers_guide_tutorial) page has a complete guide to general FlatBuffers usage in all of the supported languages (including C++). This page is designed to cover the nuances of FlatBuffers usage, specific to C++. #### Prerequisites This page assumes you have written a FlatBuffers schema and compiled it with the Schema Compiler. If you have not, please see [Using the schema compiler](@ref flatbuffers_guide_using_schema_compiler) and [Writing a schema](@ref flatbuffers_guide_writing_schema). Assuming you wrote a schema, say `mygame.fbs` (though the extension doesn't matter), you've generated a C++ header called `mygame_generated.h` using the compiler (e.g. `flatc -c mygame.fbs`), you can now start using this in your program by including the header. As noted, this header relies on `flatbuffers/flatbuffers.h`, which should be in your include path. ## FlatBuffers C++ library code location The code for the FlatBuffers C++ library can be found at `flatbuffers/include/flatbuffers`. You can browse the library code on the [FlatBuffers GitHub page](https://github.com/google/flatbuffers/tree/master/include/flatbuffers). ## Testing the FlatBuffers C++ library The code to test the C++ library can be found at `flatbuffers/tests`. The test code itself is located in [test.cpp](https://github.com/google/flatbuffers/blob/master/tests/test.cpp). This test file is built alongside `flatc`. To review how to build the project, please read the [Building](@ref flatbuffers_guide_building) documentation. To run the tests, execute `flattests` from the root `flatbuffers/` directory. For example, on [Linux](https://en.wikipedia.org/wiki/Linux), you would simply run: `./flattests`. ## Using the FlatBuffers C++ library *Note: See [Tutorial](@ref flatbuffers_guide_tutorial) for a more in-depth example of how to use FlatBuffers in C++.* FlatBuffers supports both reading and writing FlatBuffers in C++. To use FlatBuffers in your code, first generate the C++ classes from your schema with the `--cpp` option to `flatc`. Then you can include both FlatBuffers and the generated code to read or write FlatBuffers. For example, here is how you would read a FlatBuffer binary file in C++: First, include the library and generated code. Then read the file into a `char *` array, which you pass to `GetMonster()`. ```cpp #include "flatbuffers/flatbuffers.h" #include "monster_test_generate.h" #include // C++ header file for printing #include // C++ header file for file access std::ifstream infile; infile.open("monsterdata_test.mon", std::ios::binary | std::ios::in); infile.seekg(0,std::ios::end); int length = infile.tellg(); infile.seekg(0,std::ios::beg); char *data = new char[length]; infile.read(data, length); infile.close(); auto monster = GetMonster(data); ``` `monster` is of type `Monster *`, and points to somewhere *inside* your buffer (root object pointers are not the same as `buffer_pointer` \!). If you look in your generated header, you'll see it has convenient accessors for all fields, e.g. `hp()`, `mana()`, etc: ```cpp std::cout << "hp : " << monster->hp() << std::endl; // '80' std::cout << "mana : " << monster->mana() << std::endl; // default value of '150' std::cout << "name : " << monster->name()->c_str() << std::endl; // "MyMonster" ``` *Note: That we never stored a `mana` value, so it will return the default.* The following attributes are supported: - `shared` (on a field): For string fields, this enables the usage of string pooling (i.e. `CreateSharedString`) as default serialization behavior. Specifically, `CreateXxxDirect` functions and `Pack` functions for object based API (see below) will use `CreateSharedString` to create strings. ## Object based API {#flatbuffers_cpp_object_based_api} FlatBuffers is all about memory efficiency, which is why its base API is written around using as little as possible of it. This does make the API clumsier (requiring pre-order construction of all data, and making mutation harder). For times when efficiency is less important a more convenient object based API can be used (through `--gen-object-api`) that is able to unpack & pack a FlatBuffer into objects and standard STL containers, allowing for convenient construction, access and mutation. To use: ```cpp // Autogenerated class from table Monster. MonsterT monsterobj; // Deserialize from buffer into object. GetMonster(flatbuffer)->UnPackTo(&monsterobj); // Update object directly like a C++ class instance. cout << monsterobj.name; // This is now a std::string! monsterobj.name = "Bob"; // Change the name. // Serialize into new flatbuffer. FlatBufferBuilder fbb; fbb.Finish(Monster::Pack(fbb, &monsterobj)); ``` The following attributes are specific to the object-based API code generation: - `native_inline` (on a field): Because FlatBuffer tables and structs are optionally present in a given buffer, they are best represented as pointers (specifically std::unique_ptrs) in the native class since they can be null. This attribute changes the member declaration to use the type directly rather than wrapped in a unique_ptr. - `native_default("value")` (on a field): For members that are declared "native_inline", the value specified with this attribute will be included verbatim in the class constructor initializer list for this member. - `native_custom_alloc("custom_allocator")` (on a table or struct): When using the object-based API all generated NativeTables that are allocated when unpacking your flatbuffer will use "custom allocator". The allocator is also used by any std::vector that appears in a table defined with `native_custom_alloc`. This can be used to provide allocation from a pool for example, for faster unpacking when using the object-based API. Minimal Example: schema: ```cpp table mytable(native_custom_alloc:"custom_allocator") { ... } ``` with `custom_allocator` defined before `flatbuffers.h` is included, as: ```cpp template struct custom_allocator : public std::allocator { typedef T *pointer; template struct rebind { typedef custom_allocator other; }; pointer allocate(const std::size_t n) { return std::allocator::allocate(n); } void deallocate(T* ptr, std::size_t n) { return std::allocator::deallocate(ptr,n); } custom_allocator() throw() {} template custom_allocator(const custom_allocator&) throw() {} }; ``` - `native_type("type")` (on a struct): In some cases, a more optimal C++ data type exists for a given struct. For example, the following schema: ```cpp struct Vec2 { x: float; y: float; } ``` generates the following Object-Based API class: ```cpp struct Vec2T : flatbuffers::NativeTable { float x; float y; }; ``` However, it can be useful to instead use a user-defined C++ type since it can provide more functionality, eg. ```cpp struct vector2 { float x = 0, y = 0; vector2 operator+(vector2 rhs) const { ... } vector2 operator-(vector2 rhs) const { ... } float length() const { ... } // etc. }; ``` The `native_type` attribute will replace the usage of the generated class with the given type. So, continuing with the example, the generated code would use `vector2` in place of `Vec2T` for all generated code of the Object-Based API. However, because the `native_type` is unknown to flatbuffers, the user must provide the following functions to aide in the serialization process: ```cpp namespace flatbuffers { Vec2 Pack(const vector2& obj); vector2 UnPack(const Vec2& obj); } ``` - `native_type_pack_name("name")` (on a struct when `native_type` is specified, too): when you want to use the same `native_type` multiple times (e. g. with different precision) you must make the names of the Pack/UnPack functions unique, otherwise you will run into compile errors. This attribute appends a name to the expected Pack/UnPack functions. So when you specify `native_type_pack_name("Vec2")` in the above example you now need to implement these serialization functions instead: ```cpp namespace flatbuffers { Vec2 PackVec2(const vector2& obj); vector2 UnPackVec2(const Vec2& obj); } ``` Finally, the following top-level attributes: - `native_include("path")` (at file level): Because the `native_type` attribute can be used to introduce types that are unknown to flatbuffers, it may be necessary to include "external" header files in the generated code. This attribute can be used to directly add an #include directive to the top of the generated code that includes the specified path directly. - `force_align`: this attribute may not be respected in the object API, depending on the aligned of the allocator used with `new`. # External references An additional feature of the object API is the ability to allow you to load multiple independent FlatBuffers, and have them refer to eachothers objects using hashes which are then represented as typed pointers in the object API. To make this work have a field in the objects you want to referred to which is using the string hashing feature (see `hash` attribute in the [schema](@ref flatbuffers_guide_writing_schema) documentation). Then you have a similar hash in the field referring to it, along with a `cpp_type` attribute specifying the C++ type this will refer to (this can be any C++ type, and will get a `*` added). Then, in JSON or however you create these buffers, make sure they use the same string (or hash). When you call `UnPack` (or `Create`), you'll need a function that maps from hash to the object (see `resolver_function_t` for details). # Using different pointer types By default the object tree is built out of `std::unique_ptr`, but you can influence this either globally (using the `--cpp-ptr-type` argument to `flatc`) or per field (using the `cpp_ptr_type` attribute) to by any smart pointer type (`my_ptr`), or by specifying `naked` as the type to get `T *` pointers. Unlike the smart pointers, naked pointers do not manage memory for you, so you'll have to manage their lifecycles manually. To reference the pointer type specified by the `--cpp-ptr-type` argument to `flatc` from a flatbuffer field set the `cpp_ptr_type` attribute to `default_ptr_type`. # Using different string type By default the object tree is built out of `std::string`, but you can influence this either globally (using the `--cpp-str-type` argument to `flatc`) or per field using the `cpp_str_type` attribute. The type must support `T::c_str()`, `T::length()` and `T::empty()` as member functions. Further, the type must be constructible from std::string, as by default a std::string instance is constructed and then used to initialize the custom string type. This behavior impedes efficient and zero-copy construction of custom string types; the `--cpp-str-flex-ctor` argument to `flatc` or the per field attribute `cpp_str_flex_ctor` can be used to change this behavior, so that the custom string type is constructed by passing the pointer and length of the FlatBuffers String. The custom string class will require a constructor in the following format: `custom_str_class(const char *, size_t)`. Please note that the character array is not guaranteed to be NULL terminated, you should always use the provided size to determine end of string. ## Reflection (& Resizing) There is experimental support for reflection in FlatBuffers, allowing you to read and write data even if you don't know the exact format of a buffer, and even allows you to change sizes of strings and vectors in-place. The way this works is very elegant; there is actually a FlatBuffer schema that describes schemas (\!) which you can find in `reflection/reflection.fbs`. The compiler, `flatc`, can write out any schemas it has just parsed as a binary FlatBuffer, corresponding to this meta-schema. Loading in one of these binary schemas at runtime allows you traverse any FlatBuffer data that corresponds to it without knowing the exact format. You can query what fields are present, and then read/write them after. For convenient field manipulation, you can include the header `flatbuffers/reflection.h` which includes both the generated code from the meta schema, as well as a lot of helper functions. And example of usage, for the time being, can be found in `test.cpp/ReflectionTest()`. ## Mini Reflection A more limited form of reflection is available for direct inclusion in generated code, which doesn't do any (binary) schema access at all. It was designed to keep the overhead of reflection as low as possible (on the order of 2-6 bytes per field added to your executable), but doesn't contain all the information the (binary) schema contains. You add this information to your generated code by specifying `--reflect-types` (or instead `--reflect-names` if you also want field / enum names). You can now use this information, for example to print a FlatBuffer to text: auto s = flatbuffers::FlatBufferToString(flatbuf, MonsterTypeTable()); `MonsterTypeTable()` is declared in the generated code for each type. The string produced is very similar to the JSON produced by the `Parser` based text generator. You'll need `flatbuffers/minireflect.h` for this functionality. In there is also a convenient visitor/iterator so you can write your own output / functionality based on the mini reflection tables without having to know the FlatBuffers or reflection encoding. ## Storing maps / dictionaries in a FlatBuffer FlatBuffers doesn't support maps natively, but there is support to emulate their behavior with vectors and binary search, which means you can have fast lookups directly from a FlatBuffer without having to unpack your data into a `std::map` or similar. To use it: - Designate one of the fields in a table as they "key" field. You do this by setting the `key` attribute on this field, e.g. `name:string (key)`. You may only have one key field, and it must be of string or scalar type. - Write out tables of this type as usual, collect their offsets in an array or vector. - Instead of `CreateVector`, call `CreateVectorOfSortedTables`, which will first sort all offsets such that the tables they refer to are sorted by the key field, then serialize it. - Now when you're accessing the FlatBuffer, you can use `Vector::LookupByKey` instead of just `Vector::Get` to access elements of the vector, e.g.: `myvector->LookupByKey("Fred")`, which returns a pointer to the corresponding table type, or `nullptr` if not found. `LookupByKey` performs a binary search, so should have a similar speed to `std::map`, though may be faster because of better caching. `LookupByKey` only works if the vector has been sorted, it will likely not find elements if it hasn't been sorted. ## Direct memory access As you can see from the above examples, all elements in a buffer are accessed through generated accessors. This is because everything is stored in little endian format on all platforms (the accessor performs a swap operation on big endian machines), and also because the layout of things is generally not known to the user. For structs, layout is deterministic and guaranteed to be the same across platforms (scalars are aligned to their own size, and structs themselves to their largest member), and you are allowed to access this memory directly by using `sizeof()` and `memcpy` on the pointer to a struct, or even an array of structs. To compute offsets to sub-elements of a struct, make sure they are a structs themselves, as then you can use the pointers to figure out the offset without having to hardcode it. This is handy for use of arrays of structs with calls like `glVertexAttribPointer` in OpenGL or similar APIs. It is important to note is that structs are still little endian on all machines, so only use tricks like this if you can guarantee you're not shipping on a big endian machine (an `assert(FLATBUFFERS_LITTLEENDIAN)` would be wise). ## Access of untrusted buffers The generated accessor functions access fields over offsets, which is very quick. These offsets are not verified at run-time, so a malformed buffer could cause a program to crash by accessing random memory. When you're processing large amounts of data from a source you know (e.g. your own generated data on disk), this is acceptable, but when reading data from the network that can potentially have been modified by an attacker, this is undesirable. For this reason, you can optionally use a buffer verifier before you access the data. This verifier will check all offsets, all sizes of fields, and null termination of strings to ensure that when a buffer is accessed, all reads will end up inside the buffer. Each root type will have a verification function generated for it, e.g. for `Monster`, you can call: ```cpp bool ok = VerifyMonsterBuffer(Verifier(buf, len)); ``` if `ok` is true, the buffer is safe to read. Besides untrusted data, this function may be useful to call in debug mode, as extra insurance against data being corrupted somewhere along the way. While verifying a buffer isn't "free", it is typically faster than a full traversal (since any scalar data is not actually touched), and since it may cause the buffer to be brought into cache before reading, the actual overhead may be even lower than expected. In specialized cases where a denial of service attack is possible, the verifier has two additional constructor arguments that allow you to limit the nesting depth and total amount of tables the verifier may encounter before declaring the buffer malformed. The default is `Verifier(buf, len, 64 /* max depth */, 1000000, /* max tables */)` which should be sufficient for most uses. ## Text & schema parsing Using binary buffers with the generated header provides a super low overhead use of FlatBuffer data. There are, however, times when you want to use text formats, for example because it interacts better with source control, or you want to give your users easy access to data. Another reason might be that you already have a lot of data in JSON format, or a tool that generates JSON, and if you can write a schema for it, this will provide you an easy way to use that data directly. (see the schema documentation for some specifics on the JSON format accepted). Schema evolution compatibility for the JSON format follows the same rules as the binary format (JSON formatted data will be forwards/backwards compatible with schemas that evolve in a compatible way). There are two ways to use text formats: #### Using the compiler as a conversion tool This is the preferred path, as it doesn't require you to add any new code to your program, and is maximally efficient since you can ship with binary data. The disadvantage is that it is an extra step for your users/developers to perform, though you might be able to automate it. flatc -b myschema.fbs mydata.json This will generate the binary file `mydata_wire.bin` which can be loaded as before. #### Making your program capable of loading text directly This gives you maximum flexibility. You could even opt to support both, i.e. check for both files, and regenerate the binary from text when required, otherwise just load the binary. This option is currently only available for C++, or Java through JNI. As mentioned in the section "Building" above, this technique requires you to link a few more files into your program, and you'll want to include `flatbuffers/idl.h`. Load text (either a schema or json) into an in-memory buffer (there is a convenient `LoadFile()` utility function in `flatbuffers/util.h` if you wish). Construct a parser: ```cpp flatbuffers::Parser parser; ``` Now you can parse any number of text files in sequence: ```cpp parser.Parse(text_file.c_str()); ``` This works similarly to how the command-line compiler works: a sequence of files parsed by the same `Parser` object allow later files to reference definitions in earlier files. Typically this means you first load a schema file (which populates `Parser` with definitions), followed by one or more JSON files. As optional argument to `Parse`, you may specify a null-terminated list of include paths. If not specified, any include statements try to resolve from the current directory. If there were any parsing errors, `Parse` will return `false`, and `Parser::error_` contains a human readable error string with a line number etc, which you should present to the creator of that file. After each JSON file, the `Parser::fbb` member variable is the `FlatBufferBuilder` that contains the binary buffer version of that file, that you can access as described above. `samples/sample_text.cpp` is a code sample showing the above operations. ## Threading Reading a FlatBuffer does not touch any memory outside the original buffer, and is entirely read-only (all const), so is safe to access from multiple threads even without synchronisation primitives. Creating a FlatBuffer is not thread safe. All state related to building a FlatBuffer is contained in a FlatBufferBuilder instance, and no memory outside of it is touched. To make this thread safe, either do not share instances of FlatBufferBuilder between threads (recommended), or manually wrap it in synchronisation primitives. There's no automatic way to accomplish this, by design, as we feel multithreaded construction of a single buffer will be rare, and synchronisation overhead would be costly. ## Advanced union features The C++ implementation currently supports vectors of unions (i.e. you can declare a field as `[T]` where `T` is a union type instead of a table type). It also supports structs and strings in unions, besides tables. For an example of these features, see `tests/union_vector`, and `UnionVectorTest` in `test.cpp`. Since these features haven't been ported to other languages yet, if you choose to use them, you won't be able to use these buffers in other languages (`flatc` will refuse to compile a schema that uses these features). These features reduce the amount of "table wrapping" that was previously needed to use unions. To use scalars, simply wrap them in a struct. ## Depth limit of nested objects and stack-overflow control The parser of Flatbuffers schema or json-files is kind of recursive parser. To avoid stack-overflow problem the parser has a built-in limiter of recursion depth. Number of nested declarations in a schema or number of nested json-objects is limited. By default, this depth limit set to `64`. It is possible to override this limit with `FLATBUFFERS_MAX_PARSING_DEPTH` definition. This definition can be helpful for testing purposes or embedded applications. For details see [build](@ref flatbuffers_guide_building) of CMake-based projects. ## Dependence from C-locale {#flatbuffers_locale_cpp} The Flatbuffers [grammar](@ref flatbuffers grammar) uses ASCII character set for identifiers, alphanumeric literals, reserved words. Internal implementation of the Flatbuffers depends from functions which depend from C-locale: `strtod()` or `strtof()`, for example. The library expects the dot `.` symbol as the separator of an integer part from the fractional part of a float number. Another separator symbols (`,` for example) will break the compatibility and may lead to an error while parsing a Flatbuffers schema or a json file. The Standard C locale is a global resource, there is only one locale for the entire application. Some modern compilers and platforms have locale-independent or locale-narrow functions `strtof_l`, `strtod_l`, `strtoll_l`, `strtoull_l` to resolve this dependency. These functions use specified locale rather than the global or per-thread locale instead. They are part of POSIX-2008 but not part of the C/C++ standard library, therefore, may be missing on some platforms. The Flatbuffers library try to detect these functions at configuration and compile time: - CMake `"CMakeLists.txt"`: - Check existence of `strtol_l` and `strtod_l` in the ``. - Compile-time `"/include/base.h"`: - `_MSC_VER >= 1900`: MSVC2012 or higher if build with MSVC. - `_XOPEN_SOURCE>=700`: POSIX-2008 if build with GCC/Clang. After detection, the definition `FLATBUFFERS_LOCALE_INDEPENDENT` will be set to `0` or `1`. To override or stop this detection use CMake `-DFLATBUFFERS_LOCALE_INDEPENDENT={0|1}` or predefine `FLATBUFFERS_LOCALE_INDEPENDENT` symbol. To test the compatibility of the Flatbuffers library with a specific locale use the environment variable `FLATBUFFERS_TEST_LOCALE`: ```sh >FLATBUFFERS_TEST_LOCALE="" ./flattests >FLATBUFFERS_TEST_LOCALE="ru_RU.CP1251" ./flattests ``` ## Support of floating-point numbers The Flatbuffers library assumes that a C++ compiler and a CPU are compatible with the `IEEE-754` floating-point standard. The schema and json parser may fail if `fast-math` or `/fp:fast` mode is active. ### Support of hexadecimal and special floating-point numbers According to the [grammar](@ref flatbuffers_grammar) `fbs` and `json` files may use hexadecimal and special (`NaN`, `Inf`) floating-point literals. The Flatbuffers uses `strtof` and `strtod` functions to parse floating-point literals. The Flatbuffers library has a code to detect a compiler compatibility with the literals. If necessary conditions are met the preprocessor constant `FLATBUFFERS_HAS_NEW_STRTOD` will be set to `1`. The support of floating-point literals will be limited at compile time if `FLATBUFFERS_HAS_NEW_STRTOD` constant is less than `1`. In this case, schemas with hexadecimal or special literals cannot be used. ### Comparison of floating-point NaN values The floating-point `NaN` (`not a number`) is special value which representing an undefined or unrepresentable value. `NaN` may be explicitly assigned to variables, typically as a representation for missing values or may be a result of a mathematical operation. The `IEEE-754` defines two kind of `NaNs`: - Quiet NaNs, or `qNaNs`. - Signaling NaNs, or `sNaNs`. According to the `IEEE-754`, a comparison with `NaN` always returns an unordered result even when compared with itself. As a result, a whole Flatbuffers object will be not equal to itself if has one or more `NaN`. Flatbuffers scalar fields that have the default value are not actually stored in the serialized data but are generated in code (see [Writing a schema](@ref flatbuffers_guide_writing_schema)). Scalar fields with `NaN` defaults break this behavior. If a schema has a lot of `NaN` defaults the Flatbuffers can override the unordered comparison by the ordered: `(NaN==NaN)->true`. This ordered comparison is enabled when compiling a program with the symbol `FLATBUFFERS_NAN_DEFAULTS` defined. Additional computations added by `FLATBUFFERS_NAN_DEFAULTS` are very cheap if GCC or Clang used. These compilers have a compile-time implementation of `isnan` checking which MSVC does not.
flatbuffers-24.12.23/docs/source/CsharpUsage.md000066400000000000000000000252421473234705300212440ustar00rootroot00000000000000Use in C# {#flatbuffers_guide_use_c-sharp} ============== ## Before you get started Before diving into the FlatBuffers usage in C#, it should be noted that the [Tutorial](@ref flatbuffers_guide_tutorial) page has a complete guide to general FlatBuffers usage in all of the supported languages (including C#). This page is designed to cover the nuances of FlatBuffers usage, specific to C#. You should also have read the [Building](@ref flatbuffers_guide_building) documentation to build `flatc` and should be familiar with [Using the schema compiler](@ref flatbuffers_guide_using_schema_compiler) and [Writing a schema](@ref flatbuffers_guide_writing_schema). ## FlatBuffers C# code location The code for the FlatBuffers C# library can be found at `flatbuffers/net/FlatBuffers`. You can browse the library on the [FlatBuffers GitHub page](https://github.com/google/flatbuffers/tree/master/net/ FlatBuffers). ## Building the FlatBuffers C# library The `FlatBuffers.csproj` project contains multitargeting for .NET Standard 2.1, .NET 6 and .NET 8. You can build for a specific framework target when using the cross-platform [.NET Core SDK](https://dotnet.microsoft.com/download) by adding the `-f` command line option: ~~~{.sh} dotnet build -f netstandard2.1 "FlatBuffers.csproj" ~~~ The `FlatBuffers.csproj` project also provides support for defining various conditional compilation symbols (see "Conditional compilation symbols" section below) using the `-p` command line option: ~~~{.sh} dotnet build -f netstandard2.1 -p:ENABLE_SPAN_T=true -p:UNSAFE_BYTEBUFFER=true "FlatBuffers.csproj" ~~~ ## Testing the FlatBuffers C# library The code to test the libraries can be found at `flatbuffers/tests`. The test code for C# is located in the [FlatBuffers.Test](https://github.com/ google/flatbuffers/tree/master/tests/FlatBuffers.Test) subfolder. To run the tests, open `FlatBuffers.Test.csproj` in [Visual Studio]( https://www.visualstudio.com), and compile/run the project. Optionally, you can run this using [Mono](http://www.mono-project.com/) instead. Once you have installed Mono, you can run the tests from the command line by running the following commands from inside the `FlatBuffers.Test` folder: ~~~{.sh} mcs *.cs ../MyGame/Example/*.cs ../../net/FlatBuffers/*.cs mono Assert.exe ~~~ ## Using the FlatBuffers C# library *Note: See [Tutorial](@ref flatbuffers_guide_tutorial) for a more in-depth example of how to use FlatBuffers in C#.* FlatBuffers supports reading and writing binary FlatBuffers in C#. To use FlatBuffers in your own code, first generate C# classes from your schema with the `--csharp` option to `flatc`. Then you can include both FlatBuffers and the generated code to read or write a FlatBuffer. For example, here is how you would read a FlatBuffer binary file in C#: First, import the library and generated code. Then, you read a FlatBuffer binary file into a `byte[]`. You then turn the `byte[]` into a `ByteBuffer`, which you pass to the `GetRootAsMyRootType` function: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cs} using MyGame.Example; using Google.FlatBuffers; // This snippet ignores exceptions for brevity. byte[] data = File.ReadAllBytes("monsterdata_test.mon"); ByteBuffer bb = new ByteBuffer(data); Monster monster = Monster.GetRootAsMonster(bb); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Now you can access the data from the `Monster monster`: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cs} short hp = monster.Hp; Vec3 pos = monster.Pos; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C# code naming follows standard C# style with PascalCasing identifiers, e.g. `GetRootAsMyRootType`. Also, values (except vectors and unions) are available as properties instead of parameterless accessor methods. The performance-enhancing methods to which you can pass an already created object are prefixed with `Get`, e.g.: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cs} // property var pos = monster.Pos; // method filling a preconstructed object var preconstructedPos = new Vec3(); monster.GetPos(preconstructedPos); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ## Storing dictionaries in a FlatBuffer FlatBuffers doesn't support dictionaries natively, but there is support to emulate their behavior with vectors and binary search, which means you can have fast lookups directly from a FlatBuffer without having to unpack your data into a `Dictionary` or similar. To use it: - Designate one of the fields in a table as the "key" field. You do this by setting the `key` attribute on this field, e.g. `name:string (key)`. You may only have one key field, and it must be of string or scalar type. - Write out tables of this type as usual, collect their offsets in an array. - Instead of calling standard generated method, e.g.: `Monster.createTestarrayoftablesVector`, call `CreateSortedVectorOfMonster` in C# which will first sort all offsets such that the tables they refer to are sorted by the key field, then serialize it. - Now when you're accessing the FlatBuffer, you can use the `ByKey` accessor to access elements of the vector, e.g.: `monster.TestarrayoftablesByKey("Frodo")` in C#, which returns an object of the corresponding table type, or `null` if not found. `ByKey` performs a binary search, so should have a similar speed to `Dictionary`, though may be faster because of better caching. `ByKey` only works if the vector has been sorted, it will likely not find elements if it hasn't been sorted. ## Buffer verification As mentioned in [C++ Usage](@ref flatbuffers_guide_use_cpp) buffer accessor functions do not verify buffer offsets at run-time. If it is necessary, you can optionally use a buffer verifier before you access the data. This verifier will check all offsets, all sizes of fields, and null termination of strings to ensure that when a buffer is accessed, all reads will end up inside the buffer. Each root type will have a verification function generated for it, e.g. `Monster.VerifyMonster`. This can be called as shown: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cs} var ok = Monster.VerifyMonster(buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if `ok` is true, the buffer is safe to read. For a more detailed control of verification `MonsterVerify.Verify` for `Monster` type can be used: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cs} # Sequence of calls FlatBuffers.Verifier verifier = new FlatBuffers.Verifier(buf); var ok = verifier.VerifyBuffer("MONS", false, MonsterVerify.Verify); # Or single line call var ok = new FlatBuffers.Verifier(bb).setStringCheck(true).\ VerifyBuffer("MONS", false, MonsterVerify.Verify); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if `ok` is true, the buffer is safe to read. A second parameter of `verifyBuffer` specifies whether buffer content is size prefixed or not. In the example above, the buffer is assumed to not include size prefix (`false`). Verifier supports options that can be set using appropriate fluent methods: * SetMaxDepth - limit the nesting depth. Default: 1000000 * SetMaxTables - total amount of tables the verifier may encounter. Default: 64 * SetAlignmentCheck - check content alignment. Default: True * SetStringCheck - check if strings contain termination '0' character. Default: true ## Text parsing There currently is no support for parsing text (Schema's and JSON) directly from C#, though you could use the C++ parser through native call interfaces available to each language. Please see the C++ documentation for more on text parsing. ## Object based API FlatBuffers is all about memory efficiency, which is why its base API is written around using as little as possible of it. This does make the API clumsier (requiring pre-order construction of all data, and making mutation harder). For times when efficiency is less important a more convenient object based API can be used (through `--gen-object-api`) that is able to unpack & pack a FlatBuffer into objects and standard `System.Collections.Generic` containers, allowing for convenient construction, access and mutation. To use: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cs} // Deserialize from buffer into object. MonsterT monsterobj = GetMonster(flatbuffer).UnPack(); // Update object directly like a C# class instance. Console.WriteLine(monsterobj.Name); monsterobj.Name = "Bob"; // Change the name. // Serialize into new flatbuffer. FlatBufferBuilder fbb = new FlatBufferBuilder(1); fbb.Finish(Monster.Pack(fbb, monsterobj).Value); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ### Json Serialization An additional feature of the object API is the ability to allow you to serialize & deserialize a JSON text. To use Json Serialization, add `--cs-gen-json-serializer` option to `flatc` and add `Newtonsoft.Json` nuget package to csproj. This requires explicitly setting the `--gen-object-api` option as well. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cs} // Deserialize MonsterT from json string jsonText = File.ReadAllText(@"Resources/monsterdata_test.json"); MonsterT mon = MonsterT.DeserializeFromJson(jsonText); // Serialize MonsterT to json string jsonText2 = mon.SerializeToJson(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Limitation * `hash` attribute currently not supported. * NuGet package Dependency * [Newtonsoft.Json](https://github.com/JamesNK/Newtonsoft.Json) ## Conditional compilation symbols There are three conditional compilation symbols that have an impact on performance/features of the C# `ByteBuffer` implementation. * `UNSAFE_BYTEBUFFER` This will use unsafe code to manipulate the underlying byte array. This can yield a reasonable performance increase. * `BYTEBUFFER_NO_BOUNDS_CHECK` This will disable the bounds check asserts to the byte array. This can yield a small performance gain in normal code. * `ENABLE_SPAN_T` This will enable reading and writing blocks of memory with a `Span` instead of just `T[]`. You can also enable writing directly to shared memory or other types of memory by providing a custom implementation of `ByteBufferAllocator`. `ENABLE_SPAN_T` also requires `UNSAFE_BYTEBUFFER` to be defined, or .NET Standard 2.1. Using `UNSAFE_BYTEBUFFER` and `BYTEBUFFER_NO_BOUNDS_CHECK` together can yield a performance gain of ~15% for some operations, however doing so is potentially dangerous. Do so at your own risk!
flatbuffers-24.12.23/docs/source/DartUsage.md000066400000000000000000000137571473234705300207260ustar00rootroot00000000000000Use in Dart {#flatbuffers_guide_use_dart} =========== ## Before you get started Before diving into the FlatBuffers usage in Dart, it should be noted that the [Tutorial](@ref flatbuffers_guide_tutorial) page has a complete guide to general FlatBuffers usage in all of the supported languages (including Dart). This page is designed to cover the nuances of FlatBuffers usage, specific to Dart. You should also have read the [Building](@ref flatbuffers_guide_building) documentation to build `flatc` and should be familiar with [Using the schema compiler](@ref flatbuffers_guide_using_schema_compiler) and [Writing a schema](@ref flatbuffers_guide_writing_schema). ## FlatBuffers Dart library code location The code for the FlatBuffers Dart library can be found at `flatbuffers/dart`. You can browse the library code on the [FlatBuffers GitHub page](https://github.com/google/flatbuffers/tree/master/dart). ## Testing the FlatBuffers Dart library The code to test the Dart library can be found at `flatbuffers/tests`. The test code itself is located in [dart_test.dart](https://github.com/google/ flatbuffers/blob/master/tests/dart_test.dart). To run the tests, use the [DartTest.sh](https://github.com/google/flatbuffers/ blob/master/tests/DartTest.sh) shell script. *Note: The shell script requires the [Dart SDK](https://www.dartlang.org/tools/sdk) to be installed.* ## Using the FlatBuffers Dart library *Note: See [Tutorial](@ref flatbuffers_guide_tutorial) for a more in-depth example of how to use FlatBuffers in Dart.* FlatBuffers supports reading and writing binary FlatBuffers in Dart. To use FlatBuffers in your own code, first generate Dart classes from your schema with the `--dart` option to `flatc`. Then you can include both FlatBuffers and the generated code to read or write a FlatBuffer. For example, here is how you would read a FlatBuffer binary file in Dart: First, include the library and generated code. Then read a FlatBuffer binary file into a `List`, which you pass to the factory constructor for `Monster`: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.dart} import 'dart:io' as io; import 'package:flat_buffers/flat_buffers.dart' as fb; import './monster_my_game.sample_generated.dart' as myGame; List data = await new io.File('monster.dat').readAsBytes(); var monster = new myGame.Monster(data); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Now you can access values like this: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.dart} var hp = monster.hp; var pos = monster.pos; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ## Differences from the Dart SDK Front End flat_buffers The work in this repository is signfiicantly based on the implementation used internally by the Dart SDK in the front end/analyzer package. Several significant changes have been made. 1. Support for packed boolean lists has been removed. This is not standard in other implementations and is not compatible with them. Do note that, like in the JavaScript implementation, __null values in boolean lists will be treated as false__. It is also still entirely possible to pack data in a single scalar field, but that would have to be done on the application side. 2. The SDK implementation supports enums with regular Dart enums, which works if enums are always indexed at 1; however, FlatBuffers does not require that. This implementation uses specialized enum-like classes to ensure proper mapping from FlatBuffers to Dart and other platforms. 3. The SDK implementation does not appear to support FlatBuffer structs or vectors of structs - it treated everything as a built-in scalar or a table. This implementation treats structs in a way that is compatible with other non-Dart implementations, and properly handles vectors of structs. Many of the methods prefixed with 'low' have been prepurposed to support this. 4. The SDK implementation treats int64 and uint64 as float64s. This implementation does not. This may cause problems with JavaScript compatibility - however, it should be possible to use the JavaScript implementation, or to do a customized implementation that treats all 64 bit numbers as floats. Supporting the Dart VM and Flutter was a more important goal of this implementation. Support for 16 bit integers was also added. 5. The code generation in this offers an "ObjectBuilder", which generates code very similar to the SDK classes that consume FlatBuffers, as well as Builder classes, which produces code which more closely resembles the builders in other languages. The ObjectBuilder classes are easier to use, at the cost of additional references allocated. ## Text Parsing There currently is no support for parsing text (Schema's and JSON) directly from Dart, though you could use the C++ parser through Dart Native Extensions. Please see the C++ documentation for more on text parsing (note that this is not currently an option in Flutter - follow [this issue](https://github.com/flutter/flutter/issues/7053) for the latest). ## Object based API FlatBuffers is all about memory efficiency, which is why its base API is written around using as little as possible of it. This does make the API clumsier (requiring pre-order construction of all data, and making mutation harder). For times when efficiency is less important a more convenient object based API can be used (through `--gen-object-api`) that is able to unpack & pack a FlatBuffer into objects and lists, allowing for convenient construction, access and mutation. To use: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.dart} // Deserialize from buffer into object. MonsterT monster = Monster(flatbuffer).unpack(); // Update object directly like a Dart class instance. print(monster.Name); monster.Name = "Bob"; // Change the name. // Serialize into new flatbuffer. final fbb = Builder(); fbb.Finish(monster.pack(fbb)); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ flatbuffers-24.12.23/docs/source/FlatBuffers.md000066400000000000000000000226721473234705300212460ustar00rootroot00000000000000FlatBuffers {#flatbuffers_index} =========== # Overview {#flatbuffers_overview} [FlatBuffers](@ref flatbuffers_overview) is an efficient cross platform serialization library for C++, C#, C, Go, Java, Kotlin, JavaScript, Lobster, Lua, TypeScript, PHP, Python, Rust and Swift. It was originally created at Google for game development and other performance-critical applications. It is available as Open Source on [GitHub](http://github.com/google/flatbuffers) under the Apache license, v2 (see LICENSE). ## Why use FlatBuffers? - **Access to serialized data without parsing/unpacking** - What sets FlatBuffers apart is that it represents hierarchical data in a flat binary buffer in such a way that it can still be accessed directly without parsing/unpacking, while also still supporting data structure evolution (forwards/backwards compatibility). - **Memory efficiency and speed** - The only memory needed to access your data is that of the buffer. It requires 0 additional allocations (in C++, other languages may vary). FlatBuffers is also very suitable for use with mmap (or streaming), requiring only part of the buffer to be in memory. Access is close to the speed of raw struct access with only one extra indirection (a kind of vtable) to allow for format evolution and optional fields. It is aimed at projects where spending time and space (many memory allocations) to be able to access or construct serialized data is undesirable, such as in games or any other performance sensitive applications. See the [benchmarks](@ref flatbuffers_benchmarks) for details. - **Flexible** - Optional fields means not only do you get great forwards and backwards compatibility (increasingly important for long-lived games: don't have to update all data with each new version!). It also means you have a lot of choice in what data you write and what data you don't, and how you design data structures. - **Tiny code footprint** - Small amounts of generated code, and just a single small header as the minimum dependency, which is very easy to integrate. Again, see the benchmark section for details. - **Strongly typed** - Errors happen at compile time rather than manually having to write repetitive and error prone run-time checks. Useful code can be generated for you. - **Convenient to use** - Generated C++ code allows for terse access & construction code. Then there's optional functionality for parsing schemas and JSON-like text representations at runtime efficiently if needed (faster and more memory efficient than other JSON parsers). Java, Kotlin and Go code supports object-reuse. C# has efficient struct based accessors. - **Cross platform code with no dependencies** - C++ code will work with any recent gcc/clang and VS2010. Comes with build files for the tests & samples (Android .mk files, and cmake for all other platforms). ### Why not use Protocol Buffers, or .. ? Protocol Buffers is indeed relatively similar to FlatBuffers, with the primary difference being that FlatBuffers does not need a parsing/ unpacking step to a secondary representation before you can access data, often coupled with per-object memory allocation. The code is an order of magnitude bigger, too. Protocol Buffers has no optional text import/export. ### But all the cool kids use JSON! JSON is very readable (which is why we use it as our optional text format) and very convenient when used together with dynamically typed languages (such as JavaScript). When serializing data from statically typed languages, however, JSON not only has the obvious drawback of runtime inefficiency, but also forces you to write *more* code to access data (counterintuitively) due to its dynamic-typing serialization system. In this context, it is only a better choice for systems that have very little to no information ahead of time about what data needs to be stored. If you do need to store data that doesn't fit a schema, FlatBuffers also offers a schema-less (self-describing) version! Read more about the "why" of FlatBuffers in the [white paper](@ref flatbuffers_white_paper). ### Who uses FlatBuffers? - [Cocos2d-x](http://www.cocos2d-x.org/), the #1 open source mobile game engine, uses it to serialize all their [game data](http://www.cocos2d-x.org/reference/native-cpp/V3.5/d7/d2d/namespaceflatbuffers.html). - [Facebook](http://facebook.com/) uses it for client-server communication in their Android app. They have a nice [article](https://code.facebook.com/posts/872547912839369/improving-facebook-s-performance-on-android-with-flatbuffers/) explaining how it speeds up loading their posts. - [Fun Propulsion Labs](https://developers.google.com/games/#Tools) at Google uses it extensively in all their libraries and games. ## Usage in brief This section is a quick rundown of how to use this system. Subsequent sections provide a more in-depth usage guide. - Write a schema file that allows you to define the data structures you may want to serialize. Fields can have a scalar type (ints/floats of all sizes), or they can be a: string; array of any type; reference to yet another object; or, a set of possible objects (unions). Fields are optional and have defaults, so they don't need to be present for every object instance. - Use `flatc` (the FlatBuffer compiler) to generate a C++ header (or Java/Kotlin/C#/Go/Python.. classes) with helper classes to access and construct serialized data. This header (say `mydata_generated.h`) only depends on `flatbuffers.h`, which defines the core functionality. - Use the `FlatBufferBuilder` class to construct a flat binary buffer. The generated functions allow you to add objects to this buffer recursively, often as simply as making a single function call. - Store or send your buffer somewhere! - When reading it back, you can obtain the pointer to the root object from the binary buffer, and from there traverse it conveniently in-place with `object->field()`. ## In-depth documentation - How to [build the compiler](@ref flatbuffers_guide_building) and samples on various platforms. - How to [use the compiler](@ref flatbuffers_guide_using_schema_compiler). - How to [write a schema](@ref flatbuffers_guide_writing_schema). - How to [use the generated C++ code](@ref flatbuffers_guide_use_cpp) in your own programs. - How to [use the generated Java code](@ref flatbuffers_guide_use_java) in your own programs. - How to [use the generated C# code](@ref flatbuffers_guide_use_c-sharp) in your own programs. - How to [use the generated Kotlin code](@ref flatbuffers_guide_use_kotlin) in your own programs. - How to [use the generated Go code](@ref flatbuffers_guide_use_go) in your own programs. - How to [use the generated Lua code](@ref flatbuffers_guide_use_lua) in your own programs. - How to [use the generated JavaScript code](@ref flatbuffers_guide_use_javascript) in your own programs. - How to [use the generated TypeScript code](@ref flatbuffers_guide_use_typescript) in your own programs. - How to [use FlatBuffers in C with `flatcc`](@ref flatbuffers_guide_use_c) in your own programs. - How to [use the generated Lobster code](@ref flatbuffers_guide_use_lobster) in your own programs. - How to [use the generated Rust code](@ref flatbuffers_guide_use_rust) in your own programs. - How to [use the generated Swift code](@ref flatbuffers_guide_use_swift) in your own programs. - [Support matrix](@ref flatbuffers_support) for platforms/languages/features. - Some [benchmarks](@ref flatbuffers_benchmarks) showing the advantage of using FlatBuffers. - A [white paper](@ref flatbuffers_white_paper) explaining the "why" of FlatBuffers. - How to use the [schema-less](@ref flexbuffers) version of FlatBuffers. - A description of the [internals](@ref flatbuffers_internals) of FlatBuffers. - A formal [grammar](@ref flatbuffers_grammar) of the schema language. ## Online resources - [GitHub repository](http://github.com/google/flatbuffers) - [Landing page](http://google.github.io/flatbuffers) - [FlatBuffers Google Group](https://groups.google.com/forum/#!forum/flatbuffers) - [Discord](https://discord.gg/6qgKs3R) and [Gitter](https://gitter.im/lobster_programming_language/community) chat. - [FlatBuffers Issues Tracker](http://github.com/google/flatbuffers/issues) - Independent implementations & tools: - [FlatCC](https://github.com/dvidelabs/flatcc) Alternative FlatBuffers parser, code generator and runtime all in C. - Videos: - Colt's [DevByte](https://www.youtube.com/watch?v=iQTxMkSJ1dQ). - GDC 2015 [Lightning Talk](https://www.youtube.com/watch?v=olmL1fUnQAQ). - FlatBuffers for [Go](https://www.youtube.com/watch?v=-BPVId_lA5w). - Evolution of FlatBuffers [visualization](https://www.youtube.com/watch?v=a0QE0xS8rKM). - Useful documentation created by others: - [FlatBuffers in Go](https://rwinslow.com/tags/flatbuffers/) - [FlatBuffers in Android](http://frogermcs.github.io/flatbuffers-in-android-introdution/) - [Parsing JSON to FlatBuffers in Java](http://frogermcs.github.io/json-parsing-with-flatbuffers-in-android/) - [FlatBuffers in Unity](http://exiin.com/blog/flatbuffers-for-unity-sample-code/) - [FlexBuffers C#](https://github.com/mzaks/FlexBuffers-CSharp) and [article](https://medium.com/@icex33/flexbuffers-for-unity3d-4d1ab5c53fbe?) on its use. flatbuffers-24.12.23/docs/source/FlexBuffers.md000066400000000000000000000203121473234705300212430ustar00rootroot00000000000000FlexBuffers {#flexbuffers} ========== FlatBuffers was designed around schemas, because when you want maximum performance and data consistency, strong typing is helpful. There are however times when you want to store data that doesn't fit a schema, because you can't know ahead of time what all needs to be stored. For this, FlatBuffers has a dedicated format, called FlexBuffers. This is a binary format that can be used in conjunction with FlatBuffers (by storing a part of a buffer in FlexBuffers format), or also as its own independent serialization format. While it loses the strong typing, you retain the most unique advantage FlatBuffers has over other serialization formats (schema-based or not): FlexBuffers can also be accessed without parsing / copying / object allocation. This is a huge win in efficiency / memory friendly-ness, and allows unique use cases such as mmap-ing large amounts of free-form data. FlexBuffers' design and implementation allows for a very compact encoding, combining automatic pooling of strings with automatic sizing of containers to their smallest possible representation (8/16/32/64 bits). Many values and offsets can be encoded in just 8 bits. While a schema-less representation is usually more bulky because of the need to be self-descriptive, FlexBuffers generates smaller binaries for many cases than regular FlatBuffers. FlexBuffers is still slower than regular FlatBuffers though, so we recommend to only use it if you need it. # Usage in C++ Include the header `flexbuffers.h`, which in turn depends on `flatbuffers.h` and `util.h`. To create a buffer: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp} flexbuffers::Builder fbb; fbb.Int(13); fbb.Finish(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ You create any value, followed by `Finish`. Unlike FlatBuffers which requires the root value to be a table, here any value can be the root, including a lonely int value. You can now access the `std::vector` that contains the encoded value as `fbb.GetBuffer()`. Write it, send it, or store it in a parent FlatBuffer. In this case, the buffer is just 3 bytes in size. To read this value back, you could just say: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp} auto root = flexbuffers::GetRoot(my_buffer); int64_t i = root.AsInt64(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FlexBuffers stores ints only as big as needed, so it doesn't differentiate between different sizes of ints. You can ask for the 64 bit version, regardless of what you put in. In fact, since you demand to read the root as an int, if you supply a buffer that actually contains a float, or a string with numbers in it, it will convert it for you on the fly as well, or return 0 if it can't. If instead you actually want to know what is inside the buffer before you access it, you can call `root.GetType()` or `root.IsInt()` etc. Here's a slightly more complex value you could write instead of `fbb.Int` above: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp} fbb.Map([&]() { fbb.Vector("vec", [&]() { fbb.Int(-100); fbb.String("Fred"); fbb.IndirectFloat(4.0f); }); fbb.UInt("foo", 100); }); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This stores the equivalent of the JSON value `{ vec: [ -100, "Fred", 4.0 ], foo: 100 }`. The root is a dictionary that has just two key-value pairs, with keys `vec` and `foo`. Unlike FlatBuffers, it actually has to store these keys in the buffer (which it does only once if you store multiple such objects, by pooling key values), but also unlike FlatBuffers it has no restriction on the keys (fields) that you use. The map constructor uses a C++11 Lambda to group its children, but you can also use more conventional start/end calls if you prefer. The first value in the map is a vector. You'll notice that unlike FlatBuffers, you can use mixed types. There is also a `TypedVector` variant that only allows a single type, and uses a bit less memory. `IndirectFloat` is an interesting feature that allows you to store values by offset rather than inline. Though that doesn't make any visible change to the user, the consequence is that large values (especially doubles or 64 bit ints) that occur more than once can be shared (see ReuseValue). Another use case is inside of vectors, where the largest element makes up the size of all elements (e.g. a single double forces all elements to 64bit), so storing a lot of small integers together with a double is more efficient if the double is indirect. Accessing it: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp} auto map = flexbuffers::GetRoot(my_buffer).AsMap(); map.size(); // 2 auto vec = map["vec"].AsVector(); vec.size(); // 3 vec[0].AsInt64(); // -100; vec[1].AsString().c_str(); // "Fred"; vec[1].AsInt64(); // 0 (Number parsing failed). vec[2].AsDouble(); // 4.0 vec[2].AsString().IsTheEmptyString(); // true (Wrong Type). vec[2].AsString().c_str(); // "" (This still works though). vec[2].ToString().c_str(); // "4" (Or have it converted). map["foo"].AsUInt8(); // 100 map["unknown"].IsNull(); // true ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Usage in Java Java implementation follows the C++ one, closely. For creating the equivalent of the same JSON `{ vec: [ -100, "Fred", 4.0 ], foo: 100 }`, one could use the following code: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.java} FlexBuffersBuilder builder = new FlexBuffersBuilder(ByteBuffer.allocate(512), FlexBuffersBuilder.BUILDER_FLAG_SHARE_KEYS_AND_STRINGS); int smap = builder.startMap(); int svec = builder.startVector(); builder.putInt(-100); builder.putString("Fred"); builder.putFloat(4.0); builder.endVector("vec", svec, false, false); builder.putInt("foo", 100); builder.endMap(null, smap); ByteBuffer bb = builder.finish(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Similarly, to read the data, just: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.java} FlexBuffers.Map map = FlexBuffers.getRoot(bb).asMap(); map.size(); // 2 FlexBuffers.Vector vec = map.get("vec").asVector(); vec.size(); // 3 vec.get(0).asLong(); // -100; vec.get(1).asString(); // "Fred"; vec.get(1).asLong(); // 0 (Number parsing failed). vec.get(2).asFloat(); // 4.0 vec.get(2).asString().isEmpty(); // true (Wrong Type). vec.get(2).asString(); // "" (This still works though). vec.get(2).toString(); // "4.0" (Or have it converted). map.get("foo").asUInt(); // 100 map.get("unknown").isNull(); // true ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Binary encoding A description of how FlexBuffers are encoded is in the [internals](@ref flatbuffers_internals) document. # Nesting inside a FlatBuffer You can mark a field as containing a FlexBuffer, e.g. a:[ubyte] (flexbuffer); A special accessor will be generated that allows you to access the root value directly, e.g. `a_flexbuffer_root().AsInt64()`. # Efficiency tips * Vectors generally are a lot more efficient than maps, so prefer them over maps when possible for small objects. Instead of a map with keys `x`, `y` and `z`, use a vector. Better yet, use a typed vector. Or even better, use a fixed size typed vector. * Maps are backwards compatible with vectors, and can be iterated as such. You can iterate either just the values (`map.Values()`), or in parallel with the keys vector (`map.Keys()`). If you intend to access most or all elements, this is faster than looking up each element by key, since that involves a binary search of the key vector. * When possible, don't mix values that require a big bit width (such as double) in a large vector of smaller values, since all elements will take on this width. Use `IndirectDouble` when this is a possibility. Note that integers automatically use the smallest width possible, i.e. if you ask to serialize an int64_t whose value is actually small, you will use less bits. Doubles are represented as floats whenever possible losslessly, but this is only possible for few values. Since nested vectors/maps are stored over offsets, they typically don't affect the vector width. * To store large arrays of byte data, use a blob. If you'd use a typed vector, the bit width of the size field may make it use more space than expected, and may not be compatible with `memcpy`. Similarly, large arrays of (u)int16_t may be better off stored as a binary blob if their size could exceed 64k elements. Construction and use are otherwise similar to strings. flatbuffers-24.12.23/docs/source/GoApi.md000066400000000000000000000022661473234705300200370ustar00rootroot00000000000000Go API ====== \addtogroup flatbuffers_go_api \snippet GoApi_generated.txt Go API flatbuffers-24.12.23/docs/source/GoApi_generated.txt000066400000000000000000000110071473234705300222650ustar00rootroot00000000000000// This file was generated using `godoc` and customized for use with the // API Reference documentation. To recreate this file, use the `godoc` tool // (http://godoc.org) with the files in the `flatbuffers/go` folder. // // Note: You may need to ensure that copies of the files exist in the // `src/` subfolder at the path set by the `$GOROOT` environment variable. // You can either move the files to `$GOROOT/src/flatbuffers` manually, if // `$GOROOT` is already set, otherwise you will need to manually set the // `$GOROOT` variable to a path and create `src/flatbuffers` subfolders at that // path. Then copy these files into `$GOROOT/src/flatbuffers`. (Some versions of // `godoc` include a `-path` flag. This could be used instead, if available). // // Once the files exist at the `$GOROOT/src/flatbuffers` location, you can // regenerate this doc using the following command: // `godoc flatbuffers > GoApi_generated.txt`. // // After the documentation is generated, you will have to manually remove any // non-user facing documentation from this file. /// [Go API] PACKAGE DOCUMENTATION package flatbuffers Package flatbuffers provides facilities to read and write flatbuffers objects. TYPES type Builder struct { // `Bytes` gives raw access to the buffer. Most users will want to use // FinishedBytes() instead. Bytes []byte } Builder is a state machine for creating FlatBuffer objects. Use a Builder to construct object(s) starting from leaf nodes. A Builder constructs byte buffers in a last-first manner for simplicity and performance. FUNCTIONS func NewBuilder(initialSize int) *Builder NewBuilder initializes a Builder of size `initial_size`. The internal buffer is grown as needed. func (b *Builder) CreateByteString(s []byte) UOffsetT CreateByteString writes a byte slice as a string (null-terminated). func (b *Builder) CreateByteVector(v []byte) UOffsetT CreateByteVector writes a ubyte vector func (b *Builder) CreateString(s string) UOffsetT CreateString writes a null-terminated string as a vector. func (b *Builder) EndVector(vectorNumElems int) UOffsetT EndVector writes data necessary to finish vector construction. func (b *Builder) Finish(rootTable UOffsetT) Finish finalizes a buffer, pointing to the given `rootTable`. func (b *Builder) FinishedBytes() []byte FinishedBytes returns a pointer to the written data in the byte buffer. Panics if the builder is not in a finished state (which is caused by calling `Finish()`). func (b *Builder) Head() UOffsetT Head gives the start of useful data in the underlying byte buffer. Note: unlike other functions, this value is interpreted as from the left. func (b *Builder) PrependBool(x bool) PrependBool prepends a bool to the Builder buffer. Aligns and checks for space. func (b *Builder) PrependByte(x byte) PrependByte prepends a byte to the Builder buffer. Aligns and checks for space. func (b *Builder) PrependFloat32(x float32) PrependFloat32 prepends a float32 to the Builder buffer. Aligns and checks for space. func (b *Builder) PrependFloat64(x float64) PrependFloat64 prepends a float64 to the Builder buffer. Aligns and checks for space. func (b *Builder) PrependInt16(x int16) PrependInt16 prepends a int16 to the Builder buffer. Aligns and checks for space. func (b *Builder) PrependInt32(x int32) PrependInt32 prepends a int32 to the Builder buffer. Aligns and checks for space. func (b *Builder) PrependInt64(x int64) PrependInt64 prepends a int64 to the Builder buffer. Aligns and checks for space. func (b *Builder) PrependInt8(x int8) PrependInt8 prepends a int8 to the Builder buffer. Aligns and checks for space. func (b *Builder) PrependUOffsetT(off UOffsetT) PrependUOffsetT prepends an UOffsetT, relative to where it will be written. func (b *Builder) PrependUint16(x uint16) PrependUint16 prepends a uint16 to the Builder buffer. Aligns and checks for space. func (b *Builder) PrependUint32(x uint32) PrependUint32 prepends a uint32 to the Builder buffer. Aligns and checks for space. func (b *Builder) PrependUint64(x uint64) PrependUint64 prepends a uint64 to the Builder buffer. Aligns and checks for space. func (b *Builder) PrependUint8(x uint8) PrependUint8 prepends a uint8 to the Builder buffer. Aligns and checks for space. func (b *Builder) Reset() Reset truncates the underlying Builder buffer, facilitating alloc-free reuse of a Builder. It also resets bookkeeping data. /// [Go API] flatbuffers-24.12.23/docs/source/GoUsage.md000066400000000000000000000072751473234705300203770ustar00rootroot00000000000000Use in Go {#flatbuffers_guide_use_go} ========= ## Before you get started Before diving into the FlatBuffers usage in Go, it should be noted that the [Tutorial](@ref flatbuffers_guide_tutorial) page has a complete guide to general FlatBuffers usage in all of the supported languages (including Go). This page is designed to cover the nuances of FlatBuffers usage, specific to Go. You should also have read the [Building](@ref flatbuffers_guide_building) documentation to build `flatc` and should be familiar with [Using the schema compiler](@ref flatbuffers_guide_using_schema_compiler) and [Writing a schema](@ref flatbuffers_guide_writing_schema). ## FlatBuffers Go library code location The code for the FlatBuffers Go library can be found at `flatbuffers/go`. You can browse the library code on the [FlatBuffers GitHub page](https://github.com/google/flatbuffers/tree/master/go). ## Testing the FlatBuffers Go library The code to test the Go library can be found at `flatbuffers/tests`. The test code itself is located in [go_test.go](https://github.com/google/ flatbuffers/blob/master/tests/go_test.go). To run the tests, use the [GoTest.sh](https://github.com/google/flatbuffers/ blob/master/tests/GoTest.sh) shell script. *Note: The shell script requires [Go](https://golang.org/doc/install) to be installed.* ## Using the FlatBuffers Go library *Note: See [Tutorial](@ref flatbuffers_guide_tutorial) for a more in-depth example of how to use FlatBuffers in Go.* FlatBuffers supports reading and writing binary FlatBuffers in Go. To use FlatBuffers in your own code, first generate Go classes from your schema with the `--go` option to `flatc`. Then you can include both FlatBuffers and the generated code to read or write a FlatBuffer. For example, here is how you would read a FlatBuffer binary file in Go: First, include the library and generated code. Then read a FlatBuffer binary file into a `[]byte`, which you pass to the `GetRootAsMonster` function: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.go} import ( example "MyGame/Example" flatbuffers "github.com/google/flatbuffers/go" "os" ) buf, err := os.ReadFile("monster.dat") // handle err monster := example.GetRootAsMonster(buf, 0) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Now you can access values like this: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.go} hp := monster.Hp() pos := monster.Pos(nil) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In some cases it's necessary to modify values in an existing FlatBuffer in place (without creating a copy). For this reason, scalar fields of a Flatbuffer table or struct can be mutated. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.go} monster := example.GetRootAsMonster(buf, 0) // Set table field. if ok := monster.MutateHp(10); !ok { panic("failed to mutate Hp") } // Set struct field. monster.Pos().MutateZ(4) // This mutation will fail because the mana field is not available in // the buffer. It should be set when creating the buffer. if ok := monster.MutateMana(20); !ok { panic("failed to mutate Hp") } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The term `mutate` is used instead of `set` to indicate that this is a special use case. All mutate functions return a boolean value which is false if the field we're trying to mutate is not available in the buffer. ## Text Parsing There currently is no support for parsing text (Schema's and JSON) directly from Go, though you could use the C++ parser through cgo. Please see the C++ documentation for more on text parsing.
flatbuffers-24.12.23/docs/source/Grammar.md000066400000000000000000000043131473234705300204210ustar00rootroot00000000000000Grammar of the schema language {#flatbuffers_grammar} ============================== schema = include* ( namespace\_decl | type\_decl | enum\_decl | root\_decl | file_extension_decl | file_identifier_decl | attribute\_decl | rpc\_decl | object )* include = `include` string\_constant `;` namespace\_decl = `namespace` ident ( `.` ident )* `;` attribute\_decl = `attribute` ident | `"` ident `"` `;` type\_decl = ( `table` | `struct` ) ident metadata `{` field\_decl+ `}` enum\_decl = ( `enum` ident `:` type | `union` ident ) metadata `{` commasep( enumval\_decl ) `}` root\_decl = `root_type` ident `;` field\_decl = ident `:` type [ `=` scalar ] metadata `;` rpc\_decl = `rpc_service` ident `{` rpc\_method+ `}` rpc\_method = ident `(` ident `)` `:` ident metadata `;` type = `bool` | `byte` | `ubyte` | `short` | `ushort` | `int` | `uint` | `float` | `long` | `ulong` | `double` | `int8` | `uint8` | `int16` | `uint16` | `int32` | `uint32`| `int64` | `uint64` | `float32` | `float64` | `string` | `[` type `]` | ident enumval\_decl = ident [ `=` integer\_constant ] metadata metadata = [ `(` commasep( ident [ `:` single\_value ] ) `)` ] scalar = boolean\_constant | integer\_constant | float\_constant object = `{` commasep( ident `:` value ) `}` single\_value = scalar | string\_constant value = single\_value | object | `[` commasep( value ) `]` commasep(x) = [ x ( `,` x )\* ] file_extension_decl = `file_extension` string\_constant `;` file_identifier_decl = `file_identifier` string\_constant `;` string\_constant = `\".*?\"` ident = `[a-zA-Z_][a-zA-Z0-9_]*` `[:digit:]` = `[0-9]` `[:xdigit:]` = `[0-9a-fA-F]` dec\_integer\_constant = `[-+]?[:digit:]+` hex\_integer\_constant = `[-+]?0[xX][:xdigit:]+` integer\_constant = dec\_integer\_constant | hex\_integer\_constant dec\_float\_constant = `[-+]?(([.][:digit:]+)|([:digit:]+[.][:digit:]*)|([:digit:]+))([eE][-+]?[:digit:]+)?` hex\_float\_constant = `[-+]?0[xX](([.][:xdigit:]+)|([:xdigit:]+[.][:xdigit:]*)|([:xdigit:]+))([pP][-+]?[:digit:]+)` special\_float\_constant = `[-+]?(nan|inf|infinity)` float\_constant = dec\_float\_constant | hex\_float\_constant | special\_float\_constant boolean\_constant = `true` | `false` flatbuffers-24.12.23/docs/source/IntermediateRepresentation.md000066400000000000000000000030141473234705300243650ustar00rootroot00000000000000# Flatbuffers Intermediate Representation {#intermediate_representation} We use [reflection.fbs](https://github.com/google/flatbuffers/blob/master/reflection/reflection.fbs) as our intermediate representation. `flatc` parses `.fbs` files, checks them for errors and stores the resulting data in this IR, outputting `.bfbs` files. Since this IR is a Flatbuffer, you can load and use it at runtime for runtime reflection purposes. There are some quirks: - Tables and Structs are serialized as `Object`s. - Unions and Enums are serialized as `Enum`s. - It is the responsibility of the code generator to check the `advanced_features` field of `Schema`. These mark the presence of new, backwards incompatible, schema features. Code generators must error if generating a schema with unrecognized advanced features. - Filenames are relative to a "project root" denoted by "//" in the path. This may be specified in flatc with `--bfbs-filenames=$PROJECT_ROOT`, or it will be inferred to be the directory containing the first provided schema file. ## Invocation You can invoke it like so ```{.sh} flatc -b --schema ${your_fbs_files} ``` This generates `.bfbs` (binary flatbuffer schema) files. Some information is not included by default. See the `--bfbs-filenames` and `--bfbs-comments` flags. These may be necessary for code-generators, so they can add documentation and maybe name generated files (depending on the generator). TODO(cneo): Flags to output bfbs as flexbuffers or json. TODO(cneo): Tutorial for building a flatc plugin. flatbuffers-24.12.23/docs/source/Internals.md000066400000000000000000000503211473234705300207720ustar00rootroot00000000000000FlatBuffer Internals {#flatbuffers_internals} ==================== This section is entirely optional for the use of FlatBuffers. In normal usage, you should never need the information contained herein. If you're interested however, it should give you more of an appreciation of why FlatBuffers is both efficient and convenient. ### Format components A FlatBuffer is a binary file and in-memory format consisting mostly of scalars of various sizes, all aligned to their own size. Each scalar is also always represented in little-endian format, as this corresponds to all commonly used CPUs today. FlatBuffers will also work on big-endian machines, but will be slightly slower because of additional byte-swap intrinsics. It is assumed that the following conditions are met, to ensure cross-platform interoperability: - The binary `IEEE-754` format is used for floating-point numbers. - The `two's complemented` representation is used for signed integers. - The endianness is the same for floating-point numbers as for integers. On purpose, the format leaves a lot of details about where exactly things live in memory undefined, e.g. fields in a table can have any order, and objects to some extent can be stored in many orders. This is because the format doesn't need this information to be efficient, and it leaves room for optimization and extension (for example, fields can be packed in a way that is most compact). Instead, the format is defined in terms of offsets and adjacency only. This may mean two different implementations may produce different binaries given the same input values, and this is perfectly valid. ### Format identification The format also doesn't contain information for format identification and versioning, which is also by design. FlatBuffers is a statically typed system, meaning the user of a buffer needs to know what kind of buffer it is. FlatBuffers can of course be wrapped inside other containers where needed, or you can use its union feature to dynamically identify multiple possible sub-objects stored. Additionally, it can be used together with the schema parser if full reflective capabilities are desired. Versioning is something that is intrinsically part of the format (the optionality / extensibility of fields), so the format itself does not need a version number (it's a meta-format, in a sense). We're hoping that this format can accommodate all data needed. If format breaking changes are ever necessary, it would become a new kind of format rather than just a variation. ### Offsets The most important and generic offset type (see `flatbuffers.h`) is `uoffset_t`, which is currently always a `uint32_t`, and is used to refer to all tables/unions/strings/vectors (these are never stored in-line). 32bit is intentional, since we want to keep the format binary compatible between 32 and 64bit systems, and a 64bit offset would bloat the size for almost all uses. A version of this format with 64bit (or 16bit) offsets is easy to set when needed. Unsigned means they can only point in one direction, which typically is forward (towards a higher memory location). Any backwards offsets will be explicitly marked as such. The format starts with an `uoffset_t` to the root table in the buffer. We have two kinds of objects, structs and tables. ### Structs These are the simplest, and as mentioned, intended for simple data that benefits from being extra efficient and doesn't need versioning / extensibility. They are always stored inline in their parent (a struct, table, or vector) for maximum compactness. Structs define a consistent memory layout where all components are aligned to their size, and structs aligned to their largest scalar member. This is done independent of the alignment rules of the underlying compiler to guarantee a cross platform compatible layout. This layout is then enforced in the generated code. ### Tables Unlike structs, these are not stored in inline in their parent, but are referred to by offset. They start with an `soffset_t` to a vtable. This is a signed version of `uoffset_t`, since vtables may be stored anywhere relative to the object. This offset is subtracted (not added) from the object start to arrive at the vtable start. This offset is followed by all the fields as aligned scalars (or offsets). Unlike structs, not all fields need to be present. There is no set order and layout. A table may contain field offsets that point to the same value if the user explicitly serializes the same offset twice. To be able to access fields regardless of these uncertainties, we go through a vtable of offsets. Vtables are shared between any objects that happen to have the same vtable values. The elements of a vtable are all of type `voffset_t`, which is a `uint16_t`. The first element is the size of the vtable in bytes, including the size element. The second one is the size of the object, in bytes (including the vtable offset). This size could be used for streaming, to know how many bytes to read to be able to access all *inline* fields of the object. The remaining elements are the N offsets, where N is the amount of fields declared in the schema when the code that constructed this buffer was compiled (thus, the size of the table is N + 2). All accessor functions in the generated code for tables contain the offset into this table as a constant. This offset is checked against the first field (the number of elements), to protect against newer code reading older data. If this offset is out of range, or the vtable entry is 0, that means the field is not present in this object, and the default value is return. Otherwise, the entry is used as offset to the field to be read. ### Unions Unions are encoded as the combination of two fields: an enum representing the union choice and the offset to the actual element. FlatBuffers reserves the enumeration constant `NONE` (encoded as 0) to mean that the union field is not set. ### Strings and Vectors Strings are simply a vector of bytes, and are always null-terminated. Vectors are stored as contiguous aligned scalar elements prefixed by a 32bit element count (not including any null termination). Neither is stored inline in their parent, but are referred to by offset. A vector may consist of more than one offset pointing to the same value if the user explicitly serializes the same offset twice. ### Construction The current implementation constructs these buffers backwards (starting at the highest memory address of the buffer), since that significantly reduces the amount of bookkeeping and simplifies the construction API. ### Code example Here's an example of the code that gets generated for the `samples/monster.fbs`. What follows is the entire file, broken up by comments: // automatically generated, do not modify #include "flatbuffers/flatbuffers.h" namespace MyGame { namespace Sample { Nested namespace support. enum { Color_Red = 0, Color_Green = 1, Color_Blue = 2, }; inline const char **EnumNamesColor() { static const char *names[] = { "Red", "Green", "Blue", nullptr }; return names; } inline const char *EnumNameColor(int e) { return EnumNamesColor()[e]; } Enums and convenient reverse lookup. enum { Any_NONE = 0, Any_Monster = 1, }; inline const char **EnumNamesAny() { static const char *names[] = { "NONE", "Monster", nullptr }; return names; } inline const char *EnumNameAny(int e) { return EnumNamesAny()[e]; } Unions share a lot with enums. struct Vec3; struct Monster; Predeclare all data types since circular references between types are allowed (circular references between object are not, though). FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) Vec3 { private: float x_; float y_; float z_; public: Vec3(float x, float y, float z) : x_(flatbuffers::EndianScalar(x)), y_(flatbuffers::EndianScalar(y)), z_(flatbuffers::EndianScalar(z)) {} float x() const { return flatbuffers::EndianScalar(x_); } float y() const { return flatbuffers::EndianScalar(y_); } float z() const { return flatbuffers::EndianScalar(z_); } }; FLATBUFFERS_STRUCT_END(Vec3, 12); These ugly macros do a couple of things: they turn off any padding the compiler might normally do, since we add padding manually (though none in this example), and they enforce alignment chosen by FlatBuffers. This ensures the layout of this struct will look the same regardless of compiler and platform. Note that the fields are private: this is because these store little endian scalars regardless of platform (since this is part of the serialized data). `EndianScalar` then converts back and forth, which is a no-op on all current mobile and desktop platforms, and a single machine instruction on the few remaining big endian platforms. struct Monster : private flatbuffers::Table { const Vec3 *pos() const { return GetStruct(4); } int16_t mana() const { return GetField(6, 150); } int16_t hp() const { return GetField(8, 100); } const flatbuffers::String *name() const { return GetPointer(10); } const flatbuffers::Vector *inventory() const { return GetPointer *>(14); } int8_t color() const { return GetField(16, 2); } }; Tables are a bit more complicated. A table accessor struct is used to point at the serialized data for a table, which always starts with an offset to its vtable. It derives from `Table`, which contains the `GetField` helper functions. GetField takes a vtable offset, and a default value. It will look in the vtable at that offset. If the offset is out of bounds (data from an older version) or the vtable entry is 0, the field is not present and the default is returned. Otherwise, it uses the entry as an offset into the table to locate the field. struct MonsterBuilder { flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; void add_pos(const Vec3 *pos) { fbb_.AddStruct(4, pos); } void add_mana(int16_t mana) { fbb_.AddElement(6, mana, 150); } void add_hp(int16_t hp) { fbb_.AddElement(8, hp, 100); } void add_name(flatbuffers::Offset name) { fbb_.AddOffset(10, name); } void add_inventory(flatbuffers::Offset> inventory) { fbb_.AddOffset(14, inventory); } void add_color(int8_t color) { fbb_.AddElement(16, color, 2); } MonsterBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } flatbuffers::Offset Finish() { return flatbuffers::Offset(fbb_.EndTable(start_, 7)); } }; `MonsterBuilder` is the base helper struct to construct a table using a `FlatBufferBuilder`. You can add the fields in any order, and the `Finish` call will ensure the correct vtable gets generated. inline flatbuffers::Offset CreateMonster(flatbuffers::FlatBufferBuilder &_fbb, const Vec3 *pos, int16_t mana, int16_t hp, flatbuffers::Offset name, flatbuffers::Offset> inventory, int8_t color) { MonsterBuilder builder_(_fbb); builder_.add_inventory(inventory); builder_.add_name(name); builder_.add_pos(pos); builder_.add_hp(hp); builder_.add_mana(mana); builder_.add_color(color); return builder_.Finish(); } `CreateMonster` is a convenience function that calls all functions in `MonsterBuilder` above for you. Note that if you pass values which are defaults as arguments, it will not actually construct that field, so you can probably use this function instead of the builder class in almost all cases. inline const Monster *GetMonster(const void *buf) { return flatbuffers::GetRoot(buf); } This function is only generated for the root table type, to be able to start traversing a FlatBuffer from a raw buffer pointer. }; // namespace MyGame }; // namespace Sample ### Encoding example. Below is a sample encoding for the following JSON corresponding to the above schema: { pos: { x: 1, y: 2, z: 3 }, name: "fred", hp: 50 } Resulting in this binary buffer: // Start of the buffer: uint32_t 20 // Offset to the root table. // Start of the vtable. Not shared in this example, but could be: uint16_t 16 // Size of table, starting from here. uint16_t 22 // Size of object inline data. uint16_t 4, 0, 20, 16, 0, 0 // Offsets to fields from start of (root) table, 0 for not present. // Start of the root table: int32_t 16 // Offset to vtable used (default negative direction) float 1, 2, 3 // the Vec3 struct, inline. uint32_t 8 // Offset to the name string. int16_t 50 // hp field. int16_t 0 // Padding for alignment. // Start of name string: uint32_t 4 // Length of string. int8_t 'f', 'r', 'e', 'd', 0, 0, 0, 0 // Text + 0 termination + padding. Note that this not the only possible encoding, since the writer has some flexibility in which of the children of root object to write first (though in this case there's only one string), and what order to write the fields in. Different orders may also cause different alignments to happen. ### Additional reading. The author of the C language implementation has made a similar [document](https://github.com/dvidelabs/flatcc/blob/master/doc/binary-format.md#flatbuffers-binary-format) that may further help clarify the format. # FlexBuffers The [schema-less](@ref flexbuffers) version of FlatBuffers have their own encoding, detailed here. It shares many properties mentioned above, in that all data is accessed over offsets, all scalars are aligned to their own size, and all data is always stored in little endian format. One difference is that FlexBuffers are built front to back, so children are stored before parents, and the root of the data starts at the last byte. Another difference is that scalar data is stored with a variable number of bits (8/16/32/64). The current width is always determined by the *parent*, i.e. if the scalar sits in a vector, the vector determines the bit width for all elements at once. Selecting the minimum bit width for a particular vector is something the encoder does automatically and thus is typically of no concern to the user, though being aware of this feature (and not sticking a double in the same vector as a bunch of byte sized elements) is helpful for efficiency. Unlike FlatBuffers there is only one kind of offset, and that is an unsigned integer indicating the number of bytes in a negative direction from the address of itself (where the offset is stored). ### Vectors The representation of the vector is at the core of how FlexBuffers works (since maps are really just a combination of 2 vectors), so it is worth starting there. As mentioned, a vector is governed by a single bit width (supplied by its parent). This includes the size field. For example, a vector that stores the integer values `1, 2, 3` is encoded as follows: uint8_t 3, 1, 2, 3, 4, 4, 4 The first `3` is the size field, and is placed before the vector (an offset from the parent to this vector points to the first element, not the size field, so the size field is effectively at index -1). Since this is an untyped vector `SL_VECTOR`, it is followed by 3 type bytes (one per element of the vector), which are always following the vector, and are always a uint8_t even if the vector is made up of bigger scalars. A vector may include more than one offset pointing to the same value if the user explicitly serializes the same offset twice. ### Types A type byte is made up of 2 components (see flexbuffers.h for exact values): * 2 lower bits representing the bit-width of the child (8, 16, 32, 64). This is only used if the child is accessed over an offset, such as a child vector. It is ignored for inline types. * 6 bits representing the actual type (see flexbuffers.h). Thus, in this example `4` means 8 bit child (value 0, unused, since the value is in-line), type `SL_INT` (value 1). ### Typed Vectors These are like the Vectors above, but omit the type bytes. The type is instead determined by the vector type supplied by the parent. Typed vectors are only available for a subset of types for which these savings can be significant, namely inline signed/unsigned integers (`TYPE_VECTOR_INT` / `TYPE_VECTOR_UINT`), floats (`TYPE_VECTOR_FLOAT`), and keys (`TYPE_VECTOR_KEY`, see below). Additionally, for scalars, there are fixed length vectors of sizes 2 / 3 / 4 that don't store the size (`TYPE_VECTOR_INT2` etc.), for an additional savings in space when storing common vector or color data. ### Scalars FlexBuffers supports integers (`TYPE_INT` and `TYPE_UINT`) and floats (`TYPE_FLOAT`), available in the bit-widths mentioned above. They can be stored both inline and over an offset (`TYPE_INDIRECT_*`). The offset version is useful to encode costly 64bit (or even 32bit) quantities into vectors / maps of smaller sizes, and to share / repeat a value multiple times. ### Booleans and Nulls Booleans (`TYPE_BOOL`) and nulls (`TYPE_NULL`) are encoded as inlined unsigned integers. ### Blobs, Strings and Keys. A blob (`TYPE_BLOB`) is encoded similar to a vector, with one difference: the elements are always `uint8_t`. The parent bit width only determines the width of the size field, allowing blobs to be large without the elements being large. Strings (`TYPE_STRING`) are similar to blobs, except they have an additional 0 termination byte for convenience, and they MUST be UTF-8 encoded (since an accessor in a language that does not support pointers to UTF-8 data may have to convert them to a native string type). A "Key" (`TYPE_KEY`) is similar to a string, but doesn't store the size field. They're so named because they are used with maps, which don't care for the size, and can thus be even more compact. Unlike strings, keys cannot contain bytes of value 0 as part of their data (size can only be determined by `strlen`), so while you can use them outside the context of maps if you so desire, you're usually better off with strings. ### Maps A map (`TYPE_MAP`) is like an (untyped) vector, but with 2 prefixes before the size field: | index | field | | ----: | :----------------------------------------------------------- | | -3 | An offset to the keys vector (may be shared between tables). | | -2 | Byte width of the keys vector. | | -1 | Size (from here on it is compatible with `TYPE_VECTOR`) | | 0 | Elements. | | Size | Types. | Since a map is otherwise the same as a vector, it can be iterated like a vector (which is probably faster than lookup by key). The keys vector is a typed vector of keys. Both the keys and corresponding values *have* to be stored in sorted order (as determined by `strcmp`), such that lookups can be made using binary search. The reason the key vector is a separate structure from the value vector is such that it can be shared between multiple value vectors, and also to allow it to be treated as its own individual vector in code. An example map { foo: 13, bar: 14 } would be encoded as: 0 : uint8_t 'b', 'a', 'r', 0 4 : uint8_t 'f', 'o', 'o', 0 8 : uint8_t 2 // key vector of size 2 // key vector offset points here 9 : uint8_t 9, 6 // offsets to bar_key and foo_key 11: uint8_t 2, 1 // offset to key vector, and its byte width 13: uint8_t 2 // value vector of size // value vector offset points here 14: uint8_t 14, 13 // values 16: uint8_t 4, 4 // types ### The root As mentioned, the root starts at the end of the buffer. The last uint8_t is the width in bytes of the root (normally the parent determines the width, but the root has no parent). The uint8_t before this is the type of the root, and the bytes before that are the root value (of the number of bytes specified by the last byte). So for example, the integer value `13` as root would be: uint8_t 13, 4, 1 // Value, type, root byte width.
flatbuffers-24.12.23/docs/source/JavaScriptUsage.md000066400000000000000000000066041473234705300220730ustar00rootroot00000000000000Use in JavaScript {#flatbuffers_guide_use_javascript} ================= ## Before you get started Before diving into the FlatBuffers usage in JavaScript, it should be noted that the [Tutorial](@ref flatbuffers_guide_tutorial) page has a complete guide to general FlatBuffers usage in all of the supported languages (including JavaScript). This page is specifically designed to cover the nuances of FlatBuffers usage in JavaScript. You should also have read the [Building](@ref flatbuffers_guide_building) documentation to build `flatc` and should be familiar with [Using the schema compiler](@ref flatbuffers_guide_using_schema_compiler) and [Writing a schema](@ref flatbuffers_guide_writing_schema). ## FlatBuffers JavaScript library code location The generated code for the FlatBuffers JavaScript library can be found at https://www.npmjs.com/package/flatbuffers. To use it from sources: 1. Run `npm run compile` from the main folder to generate JS files from TS. 1. In your project, install it as a normal dependency, using the flatbuffers folder as the source. ## Using the FlatBuffers JavaScript library *Note: See [Tutorial](@ref flatbuffers_guide_tutorial) for a more in-depth example of how to use FlatBuffers.* Due to the complexity related with large amounts of JS flavors and module types, native JS support has been replaced in 2.0 by transpilation from TypeScript. Please look at [TypeScript usage](@ref flatbuffers_guide_use_typescript) and transpile your sources to desired JS flavor. The minimal steps to get up and running with JS are: 1. Generate TS files from `*.fbs` by using the `--ts` option. 1. Transpile resulting TS files to desired JS flavor using `tsc` (see https://www.typescriptlang.org/download for installation instructions). ~~~{.js} // Note: These require functions are an example - use your desired module flavor. var fs = require('fs'); var flatbuffers = require('../flatbuffers').flatbuffers; var MyGame = require('./monster_generated').MyGame; var data = new Uint8Array(fs.readFileSync('monster.dat')); var buf = new flatbuffers.ByteBuffer(data); var monster = MyGame.Example.Monster.getRootAsMonster(buf); //--------------------------------------------------------------------------// // Note: This code is an example of browser-based HTML/JavaScript. See above // for the code using JavaScript module loaders (e.g. Node.js). // Open the HTML file in a browser and select "monster.dat" from with the // field. ~~~ Now you can access values like this: ~~~{.js} var hp = monster.hp(); var pos = monster.pos(); ~~~ ## Text parsing FlatBuffers in JavaScript There currently is no support for parsing text (Schema's and JSON) directly from JavaScript. flatbuffers-24.12.23/docs/source/JavaUsage.md000066400000000000000000000112571473234705300207060ustar00rootroot00000000000000Use in Java {#flatbuffers_guide_use_java} ============== ## Before you get started Before diving into the FlatBuffers usage in Java, it should be noted that the [Tutorial](@ref flatbuffers_guide_tutorial) page has a complete guide to general FlatBuffers usage in all of the supported languages (including Java). This page is designed to cover the nuances of FlatBuffers usage, specific to Java. You should also have read the [Building](@ref flatbuffers_guide_building) documentation to build `flatc` and should be familiar with [Using the schema compiler](@ref flatbuffers_guide_using_schema_compiler) and [Writing a schema](@ref flatbuffers_guide_writing_schema). ## FlatBuffers Java code location The code for the FlatBuffers Java library can be found at `flatbuffers/java/com/google/flatbuffers`. You can browse the library on the [FlatBuffers GitHub page](https://github.com/google/flatbuffers/tree/master/ java/com/google/flatbuffers). ## Testing the FlatBuffers Java libraries The code to test the libraries can be found at `flatbuffers/tests`. The test code for Java is located in [JavaTest.java](https://github.com/google /flatbuffers/blob/master/tests/JavaTest.java). To run the tests, use either [JavaTest.sh](https://github.com/google/ flatbuffers/blob/master/tests/JavaTest.sh) or [JavaTest.bat](https://github.com/ google/flatbuffers/blob/master/tests/JavaTest.bat), depending on your operating system. *Note: These scripts require that [Java](https://www.oracle.com/java/index.html) is installed.* ## Using the FlatBuffers Java library *Note: See [Tutorial](@ref flatbuffers_guide_tutorial) for a more in-depth example of how to use FlatBuffers in Java.* FlatBuffers supports reading and writing binary FlatBuffers in Java. To use FlatBuffers in your own code, first generate Java classes from your schema with the `--java` option to `flatc`. Then you can include both FlatBuffers and the generated code to read or write a FlatBuffer. For example, here is how you would read a FlatBuffer binary file in Java: First, import the library and generated code. Then, you read a FlatBuffer binary file into a `byte[]`. You then turn the `byte[]` into a `ByteBuffer`, which you pass to the `getRootAsMyRootType` function: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.java} import MyGame.Example.*; import com.google.flatbuffers.FlatBufferBuilder; // This snippet ignores exceptions for brevity. File file = new File("monsterdata_test.mon"); RandomAccessFile f = new RandomAccessFile(file, "r"); byte[] data = new byte[(int)f.length()]; f.readFully(data); f.close(); ByteBuffer bb = ByteBuffer.wrap(data); Monster monster = Monster.getRootAsMonster(bb); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Now you can access the data from the `Monster monster`: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.java} short hp = monster.hp(); Vec3 pos = monster.pos(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ## Storing dictionaries in a FlatBuffer FlatBuffers doesn't support dictionaries natively, but there is support to emulate their behavior with vectors and binary search, which means you can have fast lookups directly from a FlatBuffer without having to unpack your data into a `Dictionary` or similar. To use it: - Designate one of the fields in a table as the "key" field. You do this by setting the `key` attribute on this field, e.g. `name:string (key)`. You may only have one key field, and it must be of string or scalar type. - Write out tables of this type as usual, collect their offsets in an array. - Instead of calling standard generated method, e.g.: `Monster.createTestarrayoftablesVector`, call `createSortedVectorOfTables` (from the `FlatBufferBuilder` object). which will first sort all offsets such that the tables they refer to are sorted by the key field, then serialize it. - Now when you're accessing the FlatBuffer, you can use the `ByKey` accessor to access elements of the vector, e.g.: `monster.testarrayoftablesByKey("Frodo")`. which returns an object of the corresponding table type, or `null` if not found. `ByKey` performs a binary search, so should have a similar speed to `Dictionary`, though may be faster because of better caching. `ByKey` only works if the vector has been sorted, it will likely not find elements if it hasn't been sorted. ## Text parsing There currently is no support for parsing text (Schema's and JSON) directly from Java, though you could use the C++ parser through native call interfaces available to each language. Please see the C++ documentation for more on text parsing.
flatbuffers-24.12.23/docs/source/KotlinUsage.md000066400000000000000000000072761473234705300212730ustar00rootroot00000000000000Use in Kotlin {#flatbuffers_guide_use_kotlin} ============== ## Before you get started Before diving into the FlatBuffers usage in Kotlin, it should be noted that the [Tutorial](@ref flatbuffers_guide_tutorial) page has a complete guide to general FlatBuffers usage in all of the supported languages (including K). This page is designed to cover the nuances of FlatBuffers usage, specific to Kotlin. You should also have read the [Building](@ref flatbuffers_guide_building) documentation to build `flatc` and should be familiar with [Using the schema compiler](@ref flatbuffers_guide_using_schema_compiler) and [Writing a schema](@ref flatbuffers_guide_writing_schema). ## Kotlin and FlatBuffers Java code location Code generated for Kotlin currently uses the flatbuffers java runtime library. That means that Kotlin generated code can only have Java virtual machine as target architecture (which includes Android). Kotlin Native and Kotlin.js are currently not supported. The code for the FlatBuffers Java library can be found at `flatbuffers/java/com/google/flatbuffers`. You can browse the library on the [FlatBuffers GitHub page](https://github.com/google/flatbuffers/tree/master/ java/com/google/flatbuffers). ## Testing FlatBuffers Kotlin The test code for Java is located in [KotlinTest.java](https://github.com/google /flatbuffers/blob/master/tests/KotlinTest.kt). To run the tests, use [KotlinTest.sh](https://github.com/google/ flatbuffers/blob/master/tests/KotlinTest.sh) shell script. *Note: These scripts require that [Kotlin](https://kotlinlang.org/) is installed.* ## Using the FlatBuffers Kotlin library *Note: See [Tutorial](@ref flatbuffers_guide_tutorial) for a more in-depth example of how to use FlatBuffers in Kotlin.* FlatBuffers supports reading and writing binary FlatBuffers in Kotlin. To use FlatBuffers in your own code, first generate Java classes from your schema with the `--kotlin` option to `flatc`. Then you can include both FlatBuffers and the generated code to read or write a FlatBuffer. For example, here is how you would read a FlatBuffer binary file in Kotlin: First, import the library and generated code. Then, you read a FlatBuffer binary file into a `ByteArray`. You then turn the `ByteArray` into a `ByteBuffer`, which you pass to the `getRootAsMyRootType` function: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.kt} import MyGame.Example.* import com.google.flatbuffers.FlatBufferBuilder // This snippet ignores exceptions for brevity. val data = RandomAccessFile(File("monsterdata_test.mon"), "r").use { val temp = ByteArray(it.length().toInt()) it.readFully(temp) temp } val bb = ByteBuffer.wrap(data) val monster = Monster.getRootAsMonster(bb) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Now you can access the data from the `Monster monster`: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.kt} val hp = monster.hp val pos = monster.pos!!; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ## Differences between Kotlin and Java code Kotlin generated code was designed to be as close as possible to the java counterpart, as for now, we only support kotlin on java virtual machine. So the differences in implementation and usage are basically the ones introduced by the Kotlin language itself. You can find more in-depth information [here](https://kotlinlang.org/docs/reference/comparison-to-java.html). The most obvious ones are: * Fields as accessed as Kotlin [properties](https://kotlinlang.org/docs/reference/properties.html) * Static methods are accessed in [companion object](https://kotlinlang.org/docs/reference/classes.html#companion-objects)flatbuffers-24.12.23/docs/source/LobsterUsage.md000066400000000000000000000064701473234705300214400ustar00rootroot00000000000000Use in Lobster {#flatbuffers_guide_use_lobster} ============== ## Before you get started Before diving into the FlatBuffers usage in Lobster, it should be noted that the [Tutorial](@ref flatbuffers_guide_tutorial) page has a complete guide to general FlatBuffers usage in all of the supported languages (including Lobster). This page is designed to cover the nuances of FlatBuffers usage, specific to Lobster. You should also have read the [Building](@ref flatbuffers_guide_building) documentation to build `flatc` and should be familiar with [Using the schema compiler](@ref flatbuffers_guide_using_schema_compiler) and [Writing a schema](@ref flatbuffers_guide_writing_schema). ## FlatBuffers Lobster library code location The code for the FlatBuffers Lobster library can be found at `flatbuffers/lobster`. You can browse the library code on the [FlatBuffers GitHub page](https://github.com/google/flatbuffers/tree/master/ lobster). ## Testing the FlatBuffers Lobster library The code to test the Lobster library can be found at `flatbuffers/tests`. The test code itself is located in [lobstertest.lobster](https://github.com/google/ flatbuffers/blob/master/tests/lobstertest.lobster). To run the tests, run `lobster lobstertest.lobster`. To obtain Lobster itself, go to the [Lobster homepage](http://strlen.com/lobster) or [github](https://github.com/aardappel/lobster) to learn how to build it for your platform. ## Using the FlatBuffers Lobster library *Note: See [Tutorial](@ref flatbuffers_guide_tutorial) for a more in-depth example of how to use FlatBuffers in Lobster.* There is support for both reading and writing FlatBuffers in Lobster. To use FlatBuffers in your own code, first generate Lobster classes from your schema with the `--lobster` option to `flatc`. Then you can include both FlatBuffers and the generated code to read or write a FlatBuffer. For example, here is how you would read a FlatBuffer binary file in Lobster: First, import the library and the generated code. Then read a FlatBuffer binary file into a string, which you pass to the `GetRootAsMonster` function: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.lobster} include "monster_generated.lobster" let fb = read_file("monsterdata_test.mon") assert fb let monster = MyGame_Example_GetRootAsMonster(fb) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Now you can access values like this: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.lobster} let hp = monster.hp let pos = monster.pos ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ As you can see, even though `hp` and `pos` are functions that access FlatBuffer data in-place in the string buffer, they appear as field accesses. ## Speed Using FlatBuffers in Lobster should be relatively fast, as the implementation makes use of native support for writing binary values, and access of vtables. Both generated code and the runtime library are therefore small and fast. Actual speed will depend on whether you use Lobster as bytecode VM or compiled to C++. ## Text Parsing Lobster has full support for parsing JSON into FlatBuffers, or generating JSON from FlatBuffers. See `samples/sample_test.lobster` for an example. This uses the C++ parser and generator underneath, so should be both fast and conformant.
flatbuffers-24.12.23/docs/source/LuaUsage.md000066400000000000000000000060561473234705300205470ustar00rootroot00000000000000Use in Lua {#flatbuffers_guide_use_lua} ============= ## Before you get started Before diving into the FlatBuffers usage in Lua, it should be noted that the [Tutorial](@ref flatbuffers_guide_tutorial) page has a complete guide to general FlatBuffers usage in all of the supported languages (including Lua). This page is designed to cover the nuances of FlatBuffers usage, specific to Lua. You should also have read the [Building](@ref flatbuffers_guide_building) documentation to build `flatc` and should be familiar with [Using the schema compiler](@ref flatbuffers_guide_using_schema_compiler) and [Writing a schema](@ref flatbuffers_guide_writing_schema). ## FlatBuffers Lua library code location The code for the FlatBuffers Lua library can be found at `flatbuffers/lua`. You can browse the library code on the [FlatBuffers GitHub page](https://github.com/google/flatbuffers/tree/master/lua). ## Testing the FlatBuffers Lua library The code to test the Lua library can be found at `flatbuffers/tests`. The test code itself is located in [luatest.lua](https://github.com/google/ flatbuffers/blob/master/tests/luatest.lua). To run the tests, use the [LuaTest.sh](https://github.com/google/flatbuffers/ blob/master/tests/LuaTest.sh) shell script. *Note: This script requires [Lua 5.3](https://www.lua.org/) and [LuaJIT](http://luajit.org/) to be installed.* ## Using the FlatBuffers Lua library *Note: See [Tutorial](@ref flatbuffers_guide_tutorial) for a more in-depth example of how to use FlatBuffers in Lua.* There is support for both reading and writing FlatBuffers in Lua. To use FlatBuffers in your own code, first generate Lua classes from your schema with the `--lua` option to `flatc`. Then you can include both FlatBuffers and the generated code to read or write a FlatBuffer. For example, here is how you would read a FlatBuffer binary file in Lua: First, require the module and the generated code. Then read a FlatBuffer binary file into a `string`, which you pass to the `GetRootAsMonster` function: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.lua} -- require the library local flatbuffers = require("flatbuffers") -- require the generated code local monster = require("MyGame.Sample.Monster") -- read the flatbuffer from a file into a string local f = io.open('monster.dat', 'rb') local buf = f:read('*a') f:close() -- parse the flatbuffer to get an instance to the root monster local monster1 = monster.GetRootAsMonster(buf, 0) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Now you can access values like this: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.lua} -- use the : notation to access member data local hp = monster1:Hp() local pos = monster1:Pos() ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ## Text Parsing There currently is no support for parsing text (Schema's and JSON) directly from Lua, though you could use the C++ parser through SWIG or ctypes. Please see the C++ documentation for more on text parsing.
flatbuffers-24.12.23/docs/source/PHPUsage.md000066400000000000000000000064401473234705300204520ustar00rootroot00000000000000Use in PHP {#flatbuffers_guide_use_php} ========== ## Before you get started Before diving into the FlatBuffers usage in PHP, it should be noted that the [Tutorial](@ref flatbuffers_guide_tutorial) page has a complete guide to general FlatBuffers usage in all of the supported languages (including PHP). This page is specifically designed to cover the nuances of FlatBuffers usage in PHP. You should also have read the [Building](@ref flatbuffers_guide_building) documentation to build `flatc` and should be familiar with [Using the schema compiler](@ref flatbuffers_guide_using_schema_compiler) and [Writing a schema](@ref flatbuffers_guide_writing_schema). ## FlatBuffers PHP library code location The code for FlatBuffers PHP library can be found at `flatbuffers/php`. You can browse the library code on the [FlatBuffers GitHub page](https://github.com/google/flatbuffers/tree/master/php). ## Testing the FlatBuffers JavaScript library The code to test the PHP library can be found at `flatbuffers/tests`. The test code itself is located in [phpTest.php](https://github.com/google/ flatbuffers/blob/master/tests/phpTest.php). You can run the test with `php phpTest.php` from the command line. *Note: The PHP test file requires [PHP](http://php.net/manual/en/install.php) to be installed.* ## Using theFlatBuffers PHP library *Note: See [Tutorial](@ref flatbuffers_guide_tutorial) for a more in-depth example of how to use FlatBuffers in PHP.* FlatBuffers supports both reading and writing FlatBuffers in PHP. To use FlatBuffers in your own code, first generate PHP classes from your schema with the `--php` option to `flatc`. Then you can include both FlatBuffers and the generated code to read or write a FlatBuffer. For example, here is how you would read a FlatBuffer binary file in PHP: First, include the library and generated code (using the PSR `autoload` function). Then you can read a FlatBuffer binary file, which you pass the contents of to the `GetRootAsMonster` function: ~~~{.php} // It is recommended that your use PSR autoload when using FlatBuffers in PHP. // Here is an example: function __autoload($class_name) { // The last segment of the class name matches the file name. $class = substr($class_name, strrpos($class_name, "\\") + 1); $root_dir = join(DIRECTORY_SEPARATOR, array(dirname(dirname(__FILE__)))); // `flatbuffers` root. // Contains the `*.php` files for the FlatBuffers library and the `flatc` generated files. $paths = array(join(DIRECTORY_SEPARATOR, array($root_dir, "php")), join(DIRECTORY_SEPARATOR, array($root_dir, "tests", "MyGame", "Example"))); foreach ($paths as $path) { $file = join(DIRECTORY_SEPARATOR, array($path, $class . ".php")); if (file_exists($file)) { require($file); break; } } // Read the contents of the FlatBuffer binary file. $filename = "monster.dat"; $handle = fopen($filename, "rb"); $contents = $fread($handle, filesize($filename)); fclose($handle); // Pass the contents to `GetRootAsMonster`. $monster = \MyGame\Example\Monster::GetRootAsMonster($contents); ~~~ Now you can access values like this: ~~~{.php} $hp = $monster->GetHp(); $pos = $monster->GetPos(); ~~~ ## Text Parsing There currently is no support for parsing text (Schema's and JSON) directly from PHP. flatbuffers-24.12.23/docs/source/PythonUsage.md000066400000000000000000000076351473234705300213130ustar00rootroot00000000000000Use in Python {#flatbuffers_guide_use_python} ============= ## Before you get started Before diving into the FlatBuffers usage in Python, it should be noted that the [Tutorial](@ref flatbuffers_guide_tutorial) page has a complete guide to general FlatBuffers usage in all of the supported languages (including Python). This page is designed to cover the nuances of FlatBuffers usage, specific to Python. You should also have read the [Building](@ref flatbuffers_guide_building) documentation to build `flatc` and should be familiar with [Using the schema compiler](@ref flatbuffers_guide_using_schema_compiler) and [Writing a schema](@ref flatbuffers_guide_writing_schema). ## FlatBuffers Python library code location The code for the FlatBuffers Python library can be found at `flatbuffers/python/flatbuffers`. You can browse the library code on the [FlatBuffers GitHub page](https://github.com/google/flatbuffers/tree/master/ python). ## Testing the FlatBuffers Python library The code to test the Python library can be found at `flatbuffers/tests`. The test code itself is located in [py_test.py](https://github.com/google/ flatbuffers/blob/master/tests/py_test.py). To run the tests, use the [PythonTest.sh](https://github.com/google/flatbuffers/ blob/master/tests/PythonTest.sh) shell script. *Note: This script requires [python](https://www.python.org/) to be installed.* ## Using the FlatBuffers Python library *Note: See [Tutorial](@ref flatbuffers_guide_tutorial) for a more in-depth example of how to use FlatBuffers in Python.* There is support for both reading and writing FlatBuffers in Python. To use FlatBuffers in your own code, first generate Python classes from your schema with the `--python` option to `flatc`. Then you can include both FlatBuffers and the generated code to read or write a FlatBuffer. For example, here is how you would read a FlatBuffer binary file in Python: First, import the library and the generated code. Then read a FlatBuffer binary file into a `bytearray`, which you pass to the `GetRootAsMonster` function: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.py} import MyGame.Example as example import flatbuffers buf = open('monster.dat', 'rb').read() buf = bytearray(buf) monster = example.GetRootAsMonster(buf, 0) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Now you can access values like this: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.py} hp = monster.Hp() pos = monster.Pos() ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ## Support for Numpy arrays The Flatbuffers python library also has support for accessing scalar vectors as numpy arrays. This can be orders of magnitude faster than iterating over the vector one element at a time, and is particularly useful when unpacking large nested flatbuffers. The generated code for a scalar vector will have a method `AsNumpy()`. In the case of the Monster example, you could access the inventory vector like this: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.py} inventory = monster.InventoryAsNumpy() # inventory is a numpy array of type np.dtype('uint8') ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ instead of ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.py} inventory = [] for i in range(monster.InventoryLength()): inventory.append(int(monster.Inventory(i))) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Numpy is not a requirement. If numpy is not installed on your system, then attempting to access one of the `*asNumpy()` methods will result in a `NumpyRequiredForThisFeature` exception. ## Text Parsing There currently is no support for parsing text (Schema's and JSON) directly from Python, though you could use the C++ parser through SWIG or ctypes. Please see the C++ documentation for more on text parsing.
flatbuffers-24.12.23/docs/source/README_TO_GENERATE_DOCS.md000066400000000000000000000020441473234705300224530ustar00rootroot00000000000000## Prerequisites To generate the docs for FlatBuffers from the source files, you will first need to install two programs. 1. You will need to install `doxygen`. See [Download Doxygen](https://doxygen.nl/download.html). 2. You will need to install `doxypypy` to format python comments appropriately. Install it from [here](https://github.com/Feneric/doxypypy). *Note: You will need both `doxygen` and `doxypypy` to be in your [PATH](https://en.wikipedia.org/wiki/PATH_(variable)) environment variable.* After you have both of those files installed and in your path, you need to set up the `py_filter` to invoke `doxypypy` from `doxygen`. Follow the steps [here](https://github.com/Feneric/doxypypy#invoking-doxypypy-from-doxygen). ## Generating Docs Run the following commands to generate the docs: `cd flatbuffers/docs/source` `doxygen` The output is placed in `flatbuffers/docs/html`. *Note: The Go API Reference code must be generated ahead of time. For instructions on how to regenerated this file, please read the comments in `GoApi.md`.* flatbuffers-24.12.23/docs/source/RustUsage.md000066400000000000000000000211001473234705300207460ustar00rootroot00000000000000Use in Rust {#flatbuffers_guide_use_rust} ========== ## Before you get started Before diving into the FlatBuffers usage in Rust, it should be noted that the [Tutorial](@ref flatbuffers_guide_tutorial) page has a complete guide to general FlatBuffers usage in all of the supported languages (including Rust). This page is designed to cover the nuances of FlatBuffers usage, specific to Rust. #### Prerequisites This page assumes you have written a FlatBuffers schema and compiled it with the Schema Compiler. If you have not, please see [Using the schema compiler](@ref flatbuffers_guide_using_schema_compiler) and [Writing a schema](@ref flatbuffers_guide_writing_schema). Assuming you wrote a schema, say `mygame.fbs` (though the extension doesn't matter), you've generated a Rust file called `mygame_generated.rs` using the compiler (e.g. `flatc --rust mygame.fbs` or via helpers listed in "Useful tools created by others" section bellow), you can now start using this in your program by including the file. As noted, this header relies on the crate `flatbuffers`, which should be in your include `Cargo.toml`. ## FlatBuffers Rust library code location The code for the FlatBuffers Rust library can be found at `flatbuffers/rust`. You can browse the library code on the [FlatBuffers GitHub page](https://github.com/google/flatbuffers/tree/master/rust). ## Testing the FlatBuffers Rust library The code to test the Rust library can be found at `flatbuffers/tests/rust_usage_test`. The test code itself is located in [integration_test.rs](https://github.com/google/flatbuffers/blob/master/tests/rust_usage_test/tests/integration_test.rs) This test file requires `flatc` to be present. To review how to build the project, please read the [Building](@ref flatbuffers_guide_building) documentation. To run the tests, execute `RustTest.sh` from the `flatbuffers/tests` directory. For example, on [Linux](https://en.wikipedia.org/wiki/Linux), you would simply run: `cd tests && ./RustTest.sh`. *Note: The shell script requires [Rust](https://www.rust-lang.org) to be installed.* ## Using the FlatBuffers Rust library *Note: See [Tutorial](@ref flatbuffers_guide_tutorial) for a more in-depth example of how to use FlatBuffers in Rust.* FlatBuffers supports both reading and writing FlatBuffers in Rust. To use FlatBuffers in your code, first generate the Rust modules from your schema with the `--rust` option to `flatc`. Then you can import both FlatBuffers and the generated code to read or write FlatBuffers. For example, here is how you would read a FlatBuffer binary file in Rust: First, include the library and generated code. Then read the file into a `u8` vector, which you pass, as a byte slice, to `root_as_monster()`. This full example program is available in the Rust test suite: [monster_example.rs](https://github.com/google/flatbuffers/blob/master/tests/rust_usage_test/bin/monster_example.rs) It can be run by `cd`ing to the `rust_usage_test` directory and executing: `cargo run monster_example`. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.rs} extern crate flatbuffers; #[allow(dead_code, unused_imports)] #[path = "../../monster_test_generated.rs"] mod monster_test_generated; pub use monster_test_generated::my_game; use std::io::Read; fn main() { let mut f = std::fs::File::open("../monsterdata_test.mon").unwrap(); let mut buf = Vec::new(); f.read_to_end(&mut buf).expect("file reading failed"); let monster = my_game::example::root_as_monster(&buf[..]); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ `monster` is of type `Monster`, and points to somewhere *inside* your buffer (root object pointers are not the same as `buffer_pointer` !). If you look in your generated header, you'll see it has convenient accessors for all fields, e.g. `hp()`, `mana()`, etc: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.rs} println!("{}", monster.hp()); // `80` println!("{}", monster.mana()); // default value of `150` println!("{:?}", monster.name()); // Some("MyMonster") } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *Note: That we never stored a `mana` value, so it will return the default.* ## Direct memory access As you can see from the above examples, all elements in a buffer are accessed through generated accessors. This is because everything is stored in little endian format on all platforms (the accessor performs a swap operation on big endian machines), and also because the layout of things is generally not known to the user. For structs, layout is deterministic and guaranteed to be the same across platforms (scalars are aligned to their own size, and structs themselves to their largest member), and you are allowed to access this memory directly by using `safe_slice` on the reference to a struct, or even an array of structs. To compute offsets to sub-elements of a struct, make sure they are structs themselves, as then you can use the pointers to figure out the offset without having to hardcode it. This is handy for use of arrays of structs with calls like `glVertexAttribPointer` in OpenGL or similar APIs. It is important to note is that structs are still little endian on all machines, so the functions to enable tricks like this are only exposed on little endian machines. If you also ship on big endian machines, using an `#[cfg(target_endian = "little")]` attribute would be wise or your code will not compile. The special function `safe_slice` is implemented on Vector objects that are represented in memory the same way as they are represented on the wire. This function is always available on vectors of struct, bool, u8, and i8. It is conditionally-compiled on little-endian systems for all the remaining scalar types. The FlatBufferBuilder function `create_vector_direct` is implemented for all types that are endian-safe to write with a `memcpy`. It is the write-equivalent of `safe_slice`. ## Access of untrusted buffers The safe Rust functions to interpret a slice as a table (`root`, `size_prefixed_root`, `root_with_opts`, and `size_prefixed_root_with_opts`) verify the data first. This has some performance cost, but is intended to be safe for use on flatbuffers from untrusted sources. There are corresponding `unsafe` versions with names ending in `_unchecked` which skip this verification, and may access arbitrary memory. The generated accessor functions access fields over offsets, which is very quick. The current implementation uses these to access memory without any further bounds checking. All of the safe Rust APIs ensure the verifier is run over these flatbuffers before accessing them. When you're processing large amounts of data from a source you know (e.g. your own generated data on disk), the `_unchecked` versions are acceptable, but when reading data from the network that can potentially have been modified by an attacker, it is desirable to use the safe versions which use the verifier. ## Threading Reading a FlatBuffer does not touch any memory outside the original buffer, and is entirely read-only (all immutable), so is safe to access from multiple threads even without synchronisation primitives. Creating a FlatBuffer is not thread safe. All state related to building a FlatBuffer is contained in a FlatBufferBuilder instance, and no memory outside of it is touched. To make this thread safe, either do not share instances of FlatBufferBuilder between threads (recommended), or manually wrap it in synchronisation primitives. There's no automatic way to accomplish this, by design, as we feel multithreaded construction of a single buffer will be rare, and synchronisation overhead would be costly. Unlike most other languages, in Rust these properties are exposed to and enforced by the type system. `flatbuffers::Table` and the generated table types are `Send + Sync`, indicating they may be freely shared across threads and data may be accessed from any thread which receives a const (aka shared) reference. There are no functions which require a mutable (aka exclusive) reference, which means all the available functions may be called like this. `flatbuffers::FlatBufferBuilder` is also `Send + Sync`, but all of the mutating functions require a mutable (aka exclusive) reference which can only be created when no other references to the `FlatBufferBuilder` exist, and may not be copied within the same thread, let alone to a second thread. ## Useful tools created by others * [flatc-rust](https://github.com/frol/flatc-rust) - FlatBuffers compiler (flatc) as API for transparent `.fbs` to `.rs` code-generation via Cargo build scripts integration.
flatbuffers-24.12.23/docs/source/Schemas.md000066400000000000000000000713461473234705300204300ustar00rootroot00000000000000Writing a schema {#flatbuffers_guide_writing_schema} ================ The syntax of the schema language (aka IDL, [Interface Definition Language][]) should look quite familiar to users of any of the C family of languages, and also to users of other IDLs. Let's look at an example first: // example IDL file namespace MyGame; attribute "priority"; enum Color : byte { Red = 1, Green, Blue } union Any { Monster, Weapon, Pickup } struct Vec3 { x:float; y:float; z:float; } table Monster { pos:Vec3; mana:short = 150; hp:short = 100; name:string; friendly:bool = false (deprecated, priority: 1); inventory:[ubyte]; color:Color = Blue; test:Any; } root_type Monster; (`Weapon` & `Pickup` not defined as part of this example). ### Tables Tables are the main way of defining objects in FlatBuffers, and consist of a name (here `Monster`) and a list of fields. Each field has a name, a type, and optionally a default value. If the default value is not specified in the schema, it will be `0` for scalar types, or `null` for other types. Some languages support setting a scalar's default to `null`. This makes the scalar optional. Fields do not have to appear in the wire representation, and you can choose to omit fields when constructing an object. You have the flexibility to add fields without fear of bloating your data. This design is also FlatBuffer's mechanism for forward and backwards compatibility. Note that: - You can add new fields in the schema ONLY at the end of a table definition. Older data will still read correctly, and give you the default value when read. Older code will simply ignore the new field. If you want to have flexibility to use any order for fields in your schema, you can manually assign ids (much like Protocol Buffers), see the `id` attribute below. - You cannot delete fields you don't use anymore from the schema, but you can simply stop writing them into your data for almost the same effect. Additionally you can mark them as `deprecated` as in the example above, which will prevent the generation of accessors in the generated C++, as a way to enforce the field not being used any more. (careful: this may break code!). - You may change field names and table names, if you're ok with your code breaking until you've renamed them there too. See "Schema evolution examples" below for more on this topic. ### Structs Similar to a table, only now none of the fields are optional (so no defaults either), and fields may not be added or be deprecated. Structs may only contain scalars or other structs. Use this for simple objects where you are very sure no changes will ever be made (as quite clear in the example `Vec3`). Structs use less memory than tables and are even faster to access (they are always stored in-line in their parent object, and use no virtual table). ### Types Built-in scalar types are - 8 bit: `byte` (`int8`), `ubyte` (`uint8`), `bool` - 16 bit: `short` (`int16`), `ushort` (`uint16`) - 32 bit: `int` (`int32`), `uint` (`uint32`), `float` (`float32`) - 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: - Vector of any other type (denoted with `[type]`). Nesting vectors is not supported, instead you can wrap the inner vector in a table. - `string`, which may only hold UTF-8 or 7-bit ASCII. For other text encodings or general binary data use vectors (`[byte]` or `[ubyte]`) instead. - References to other tables or structs, enums or unions (see below). You can't change types of fields once they're used, with the exception of same-size data where a `reinterpret_cast` would give you a desirable result, e.g. you could change a `uint` to an `int` if no values in current data use the high bit yet. ### Arrays Arrays are a convenience short-hand for a fixed-length collection of elements. Arrays can be used to replace the following schema: struct Vec3 { x:float; y:float; z:float; } with the following schema: struct Vec3 { v:[float:3]; } Both representations are binary equivalent. Arrays are currently only supported in a `struct`. ### Default, Optional and Required Values There are three, mutually exclusive, reactions to the non-presence of a table's field in the binary data: 1. Default valued fields will return the default value (as defined in the schema). 2. Optional valued fields will return some form of `null` depending on the local language. (In a sense, `null` is the default value). 3. Required fields will cause an error. Flatbuffer verifiers would consider the whole buffer invalid. See the `required` tag below. When writing a schema, values are a sequence of digits. Values may be optionally followed by a decimal point (`.`) and more digits, for float constants, or optionally prefixed by a `-`. Floats may also be in scientific notation; optionally ending with an `e` or `E`, followed by a `+` or `-` and more digits. Values can also be the keyword `null`. Only scalar values can have defaults, non-scalar (string/vector/table) fields default to `null` when not present. You generally do not want to change default values after they're initially defined. Fields that have the default value are not actually stored in the serialized data (see also Gotchas below). Values explicitly written by code generated by the old schema old version, if they happen to be the default, will be read as a different value by code generated with the new schema. This is slightly less bad when converting an optional scalar into a default valued scalar since non-presence would not be overloaded with a previous default value. There are situations, however, where this may be desirable, especially if you can ensure a simultaneous rebuild of all code. ### Enums Define a sequence of named constants, each with a given value, or increasing by one from the previous one. The default first value is `0`. As you can see in the enum declaration, you specify the underlying integral type of the enum with `:` (in this case `byte`), which then determines the type of any fields declared with this enum type. Only integer types are allowed, i.e. `byte`, `ubyte`, `short` `ushort`, `int`, `uint`, `long` and `ulong`. Typically, enum values should only ever be added, never removed (there is no deprecation for enums). This requires code to handle forwards compatibility itself, by handling unknown enum values. ### Unions Unions share a lot of properties with enums, but instead of new names for constants, you use names of tables. You can then declare a union field, which can hold a reference to any of those types, and additionally a field with the suffix `_type` is generated that holds the corresponding enum value, allowing you to know which type to cast to at runtime. It's possible to give an alias name to a type union. This way a type can even be used to mean different things depending on the name used: table PointPosition { x:uint; y:uint; } table MarkerPosition {} union Position { Start:MarkerPosition, Point:PointPosition, Finish:MarkerPosition } Unions contain a special `NONE` marker to denote that no value is stored so that name cannot be used as an alias. Unions are a good way to be able to send multiple message types as a FlatBuffer. Note that because a union field is really two fields, it must always be part of a table, it cannot be the root of a FlatBuffer by itself. If you have a need to distinguish between different FlatBuffers in a more open-ended way, for example for use as files, see the file identification feature below. There is an experimental support only in C++ for a vector of unions (and types). In the example IDL file above, use [Any] to add a vector of Any to Monster table. There is also experimental support for other types besides tables in unions, in particular structs and strings. There's no direct support for scalars in unions, but they can be wrapped in a struct at no space cost. ### Namespaces These will generate the corresponding namespace in C++ for all helper code, and packages in Java. You can use `.` to specify nested namespaces / packages. ### Includes You can include other schemas files in your current one, e.g.: include "mydefinitions.fbs"; This makes it easier to refer to types defined elsewhere. `include` automatically ensures each file is parsed just once, even when referred to more than once. When using the `flatc` compiler to generate code for schema definitions, only definitions in the current file will be generated, not those from the included files (those you still generate separately). ### Root type This declares what you consider to be the root table of the serialized data. This is particularly important for parsing JSON data, which doesn't include object type information. ### File identification and extension Typically, a FlatBuffer binary buffer is not self-describing, i.e. it needs you to know its schema to parse it correctly. But if you want to use a FlatBuffer as a file format, it would be convenient to be able to have a "magic number" in there, like most file formats have, to be able to do a sanity check to see if you're reading the kind of file you're expecting. Now, you can always prefix a FlatBuffer with your own file header, but FlatBuffers has a built-in way to add an identifier to a FlatBuffer that takes up minimal space, and keeps the buffer compatible with buffers that don't have such an identifier. You can specify in a schema, similar to `root_type`, that you intend for this type of FlatBuffer to be used as a file format: file_identifier "MYFI"; Identifiers must always be exactly 4 characters long. These 4 characters will end up as bytes at offsets 4-7 (inclusive) in the buffer. For any schema that has such an identifier, `flatc` will automatically add the identifier to any binaries it generates (with `-b`), and generated calls like `FinishMonsterBuffer` also add the identifier. If you have specified an identifier and wish to generate a buffer without one, you can always still do so by calling `FlatBufferBuilder::Finish` explicitly. After loading a buffer, you can use a call like `MonsterBufferHasIdentifier` to check if the identifier is present. Note that this is best for open-ended uses such as files. If you simply wanted to send one of a set of possible messages over a network for example, you'd be better off with a union. Additionally, by default `flatc` will output binary files as `.bin`. This declaration in the schema will change that to whatever you want: file_extension "ext"; ### RPC interface declarations You can declare RPC calls in a schema, that define a set of functions that take a FlatBuffer as an argument (the request) and return a FlatBuffer as the response (both of which must be table types): rpc_service MonsterStorage { Store(Monster):StoreResponse; Retrieve(MonsterId):Monster; } What code this produces and how it is used depends on language and RPC system used, there is preliminary support for GRPC through the `--grpc` code generator, see `grpc/tests` for an example. ### Comments & documentation May be written as in most C-based languages. Additionally, a triple comment (`///`) on a line by itself signals that a comment is documentation for whatever is declared on the line after it (table/struct/field/enum/union/element), and the comment is output in the corresponding C++ code. Multiple such lines per item are allowed. ### Attributes Attributes may be attached to a declaration, behind a field/enum value, or after the name of a table/struct/enum/union. These may either have a value or not. Some attributes like `deprecated` are understood by the compiler; user defined ones need to be declared with the attribute declaration (like `priority` in the example above), and are available to query if you parse the schema at runtime. This is useful if you write your own code generators/editors etc., and you wish to add additional information specific to your tool (such as a help text). Current understood attributes: - `id: n` (on a table field): manually set the field identifier to `n`. If you use this attribute, you must use it on ALL fields of this table, and the numbers must be a contiguous range from 0 onwards. Additionally, since a union type effectively adds two fields, its id must be that of the second field (the first field is the type field and not explicitly declared in the schema). For example, if the last field before the union field had id 6, the union field should have id 8, and the unions type field will implicitly be 7. IDs allow the fields to be placed in any order in the schema. When a new field is added to the schema it must use the next available ID. - `deprecated` (on a field): do not generate accessors for this field anymore, code should stop using this data. Old data may still contain this field, but it won't be accessible anymore by newer code. Note that if you deprecate a field that was previous required, old code may fail to validate new data (when using the optional verifier). - `required` (on a non-scalar table field): this field must always be set. By default, fields do not need to be present in the binary. This is desirable, as it helps with forwards/backwards compatibility, and flexibility of data structures. By specifying this attribute, you make non- presence in an error for both reader and writer. The reading code may access the field directly, without checking for null. If the constructing code does not initialize this field, they will get an assert, and also the verifier will fail on buffers that have missing required fields. Both adding and removing this attribute may be forwards/backwards incompatible as readers will be unable read old or new data, respectively, unless the data happens to always have the field set. - `force_align: size` (on a struct): force the alignment of this struct to be something higher than what it is naturally aligned to. Causes these structs to be aligned to that amount inside a buffer, IF that buffer is allocated with that alignment (which is not necessarily the case for buffers accessed directly inside a `FlatBufferBuilder`). Note: currently not guaranteed to have an effect when used with `--object-api`, since that may allocate objects at alignments less than what you specify with `force_align`. - `force_align: size` (on a vector): force the alignment of this vector to be something different than what the element size would normally dictate. Note: Now only work for generated C++ code. - `bit_flags` (on an unsigned enum): the values of this field indicate bits, meaning that any unsigned value N specified in the schema will end up representing 1< ### Testing whether a field is present in a table Most serialization formats (e.g. JSON or Protocol Buffers) make it very explicit in the format whether a field is present in an object or not, allowing you to use this as "extra" information. FlatBuffers will not write fields that are equal to their default value, sometimes resulting in significant space savings. However, this also means we cannot disambiguate the meaning of non-presence as "written default value" or "not written at all". This only applies to scalar fields since only they support default values. Unless otherwise specified, their default is 0. If you care about the presence of scalars, most languages support "optional scalars." You can set `null` as the default value in the schema. `null` is a value that's outside of all types, so we will always write if `add_field` is called. The generated field accessor should use the local language's canonical optional type. Some `FlatBufferBuilder` implementations have an option called `force_defaults` that circumvents this "not writing defaults" behavior you can then use `IsFieldPresent` to query presence. / Another option that works in all languages is to wrap a scalar field in a struct. This way it will return null if it is not present. This will be slightly less ergonomic but structs don't take up any more space than the scalar they represent. [Interface Definition Language]: https://en.wikipedia.org/wiki/Interface_description_language ## Writing your own code generator. See [our intermediate representation](@ref intermediate_representation). flatbuffers-24.12.23/docs/source/Support.md000066400000000000000000000075711473234705300205200ustar00rootroot00000000000000Platform / Language / Feature support {#flatbuffers_support} ===================================== FlatBuffers is actively being worked on, which means that certain platform / language / feature combinations may not be available yet. This page tries to track those issues, to make informed decisions easier. In general: * Languages: language support beyond the ones created by the original FlatBuffer authors typically depends on community contributions. * Features: C++ was the first language supported, since our original target was high performance game development. It thus has the richest feature set, and is likely most robust. Other languages are catching up however. * Platforms: All language implementations are typically portable to most platforms, unless where noted otherwise. NOTE: this table is a start, it needs to be extended. Feature | C++ | Java | C# | Go | Python | JS | TS | C | PHP | Dart | Lobster | Rust | Swift ------------------------------ | ------ | ----- | -------- | ----- | ------ | ----- | --- | ------ | --- | ------- | ------- | ------ | ------ Codegen for all basic features | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | WiP | Yes | Yes | Yes | Yes JSON parsing | Yes | No | No | No | No | No | No | Yes | No | No | Yes | No | No Simple mutation | Yes | Yes | Yes | Yes | No | No | No | No | No | No | No | No | Yes Reflection | Yes | No | No | No | No | No | No | Basic | No | No | No | No | No Buffer verifier | Yes | No | No | No | No | No | No | Yes | No | No | No | No | No Native Object API | Yes | No | Yes | Yes | Yes | Yes | Yes | No | No | Yes | No | No | No Optional Scalars | Yes | Yes | Yes | No | No | Yes | Yes | Yes | No | No | Yes | Yes | Yes Flexbuffers | Yes | Yes | ? | ? | ? | ? | ? | ? | ? | ? | ? | Yes | ? Testing: basic | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | ? | Yes | Yes | Yes | Yes Testing: fuzz | Yes | No | No | Yes | Yes | No | No | No | ? | No | No | Yes | No Performance: | Superb | Great | Great | Great | Ok | ? | ? | Superb | ? | ? | Great | Superb | Great Platform: Windows | VS2010 | Yes | Yes | ? | ? | ? | Yes | VS2010 | ? | Yes | Yes | Yes | No Platform: Linux | GCC282 | Yes | ? | Yes | Yes | ? | Yes | Yes | ? | Yes | Yes | Yes | Yes Platform: OS X | Xcode4 | ? | ? | ? | Yes | ? | Yes | Yes | ? | Yes | Yes | Yes | Yes Platform: Android | NDK10d | Yes | ? | ? | ? | ? | ? | ? | ? | Flutter | Yes | ? | No Platform: iOS | ? | ? | ? | ? | ? | ? | ? | ? | ? | Flutter | Yes | ? | Yes Engine: Unity | ? | ? | Yes | ? | ? | ? | ? | ? | ? | ? | No | ? | No Primary authors (github) | aard | aard | ev/js/df | rw | rw | ew/ev | kr | mik | ch | df | aard | rw/cn | mi/mz Above | Github username ----- | ----------------------------- aard | aardappel (previously: gwvo) ch | chobie cn | caspern df | dnfield ev | evolutional ew | evanw js | jonsimantov kr | krojew mi | mustiikhalil mik | mikkelfj mz | mzaks rw | rw
flatbuffers-24.12.23/docs/source/SwiftUsage.md000066400000000000000000000106211473234705300211130ustar00rootroot00000000000000Use in Swift {#flatbuffers_guide_use_swift} ========= ## Before you get started Before diving into the FlatBuffers usage in Swift, it should be noted that the [Tutorial](@ref flatbuffers_guide_tutorial) page has a complete guide to general FlatBuffers usage in all of the supported languages (including Swift). This page is designed to cover the nuances of FlatBuffers usage, specific to Swift. You should also have read the [Building](@ref flatbuffers_guide_building) documentation to build `flatc` and should be familiar with [Using the schema compiler](@ref flatbuffers_guide_using_schema_compiler) and [Writing a schema](@ref flatbuffers_guide_writing_schema). ## FlatBuffers Swift library code location The code for the FlatBuffers Swift library can be found at `flatbuffers/swift`. You can browse the library code on the [FlatBuffers GitHub page](https://github.com/google/flatbuffers/tree/master/swift). ## Testing the FlatBuffers Swift library The code to test the Swift library can be found at `flatbuffers/tests/swift/tests`. The test code itself is located in [flatbuffers/tests/swift/tests](https://github.com/google/flatbuffers/blob/master/tests/swift/tests). To run the tests, use the [SwiftTest.sh](https://github.com/google/flatbuffers/blob/master/tests/swift/tests/SwiftTest.sh) shell script. *Note: The shell script requires [Swift](https://swift.org) to be installed.* ## Using the FlatBuffers Swift library *Note: See [Tutorial](@ref flatbuffers_guide_tutorial) for a more in-depth example of how to use FlatBuffers in Swift.* FlatBuffers supports reading and writing binary FlatBuffers in Swift. To use FlatBuffers in your own code, first generate Swift structs from your schema with the `--swift` option to `flatc`. Then include FlatBuffers using `SPM` in by adding the path to `FlatBuffers/swift` into it. The generated code should also be added to xcode or the path of the package you will be using. Note: sometimes xcode cant and wont see the generated files, so it's better that you copy them to xcode. For example, here is how you would read a FlatBuffer binary file in Swift: First, include the library and copy thegenerated code. Then read a FlatBuffer binary file or a data object from the server, which you can pass into the `GetRootAsMonster` function. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.swift} import FlatBuffers typealias Monster1 = MyGame.Sample.Monster typealias Vec3 = MyGame.Sample.Vec3 let path = FileManager.default.currentDirectoryPath let url = URL(fileURLWithPath: path, isDirectory: true).appendingPathComponent("monsterdata_test").appendingPathExtension("mon") guard let data = try? Data(contentsOf: url) else { return } let monster = Monster.getRootAsMonster(bb: ByteBuffer(data: data)) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Now you can access values like this: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.swift} let hp = monster.hp let pos = monster.pos // uses native swift structs let pos = monster.mutablePos // uses flatbuffers structs ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In some cases it's necessary to modify values in an existing FlatBuffer in place (without creating a copy). For this reason, scalar fields of a Flatbuffer table or struct can be mutated. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.swift} var byteBuffer = ByteBuffer(bytes: data) // Get an accessor to the root object inside the buffer. let monster: Monster = try! getCheckedRoot(byteBuffer: &byteBuffer) // let monster: Monster = getRoot(byteBuffer: &byteBuffer) if !monster.mutate(hp: 10) { fatalError("couldn't mutate") } // mutate a struct field using flatbuffers struct // DONT use monster.pos to mutate since swift copy on write // will not mutate the value in the buffer let vec = monster.mutablePos.mutate(z: 4) // This mutation will fail because the mana field is not available in // the buffer. It should be set when creating the buffer. if !monster.mutate(mana: 20) { fatalError("couldn't mutate") } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The term `mutate` is used instead of `set` to indicate that this is a special use case. All mutate functions return a boolean value which is false if the field we're trying to mutate is not available in the buffer.
flatbuffers-24.12.23/docs/source/Tutorial.md000066400000000000000000003356701473234705300206530ustar00rootroot00000000000000Tutorial {#flatbuffers_guide_tutorial} ======== ## Overview This tutorial provides a basic example of how to work with [FlatBuffers](@ref flatbuffers_overview). We will step through a simple example application, which shows you how to: - Write a FlatBuffer `schema` file. - Use the `flatc` FlatBuffer compiler. - Parse [JSON](http://json.org) files that conform to a schema into FlatBuffer binary files. - Use the generated files in many of the supported languages (such as C++, Java, and more.) During this example, imagine that you are creating a game where the main character, the hero of the story, needs to slay some `orc`s. We will walk through each step necessary to create this monster type using FlatBuffers. Please select your desired language for our quest: \htmlonly
C++ Java Kotlin C# Go Python JavaScript TypeScript PHP C Dart Lua Lobster Rust Swift
\endhtmlonly \htmlonly \endhtmlonly ## Where to Find the Example Code Samples demonstating the concepts in this example are located in the source code package, under the `samples` directory. You can browse the samples on GitHub [here](https://github.com/google/flatbuffers/tree/master/samples).
*Note: The above does not apply to C, instead [look here](https://github.com/dvidelabs/flatcc/tree/master/samples).*
For your chosen language, please cross-reference with:
[sample_binary.cpp](https://github.com/google/flatbuffers/blob/master/samples/sample_binary.cpp)
[SampleBinary.java](https://github.com/google/flatbuffers/blob/master/samples/SampleBinary.java)
[SampleBinary.kt](https://github.com/google/flatbuffers/blob/master/samples/SampleBinary.kt)
[SampleBinary.cs](https://github.com/google/flatbuffers/blob/master/samples/SampleBinary.cs)
[sample_binary.go](https://github.com/google/flatbuffers/blob/master/samples/sample_binary.go)
[sample_binary.py](https://github.com/google/flatbuffers/blob/master/samples/sample_binary.py)
No sample binary is provided, since JS needs to be transpiled from TypeScript. Please see TypeScript support.
none yet
[SampleBinary.php](https://github.com/google/flatbuffers/blob/master/samples/SampleBinary.php)
[monster.c](https://github.com/dvidelabs/flatcc/blob/master/samples/monster/monster.c)
[example.dart](https://github.com/google/flatbuffers/blob/master/dart/example/example.dart)
[sample_binary.lua](https://github.com/google/flatbuffers/blob/master/samples/sample_binary.lua)
[sample_binary.lobster](https://github.com/google/flatbuffers/blob/master/samples/sample_binary.lobster)
[sample_binary.rs](https://github.com/google/flatbuffers/blob/master/samples/sample_binary.rs)
[sample_binary.swift](https://github.com/google/flatbuffers/blob/master/samples/sample_binary.swift)
## Writing the Monsters' FlatBuffer Schema To start working with FlatBuffers, you first need to create a `schema` file, which defines the format for each data structure you wish to serialize. Here is the `schema` that defines the template for our monsters: ~~~ // Example IDL file for our monster's schema. namespace MyGame.Sample; enum Color:byte { Red = 0, Green, Blue = 2 } union Equipment { Weapon } // Optionally add more tables. struct Vec3 { x:float; y:float; z:float; } table Monster { pos:Vec3; // Struct. mana:short = 150; hp:short = 100; name:string; friendly:bool = false (deprecated); inventory:[ubyte]; // Vector of scalars. color:Color = Blue; // Enum. weapons:[Weapon]; // Vector of tables. equipped:Equipment; // Union. path:[Vec3]; // Vector of structs. } table Weapon { name:string; damage:short; } root_type Monster; ~~~ As you can see, the syntax for the `schema` [Interface Definition Language (IDL)](https://en.wikipedia.org/wiki/Interface_description_language) is similar to those of the C family of languages, and other IDL languages. Let's examine each part of this `schema` to determine what it does. The `schema` starts with a `namespace` declaration. This determines the corresponding package/namespace for the generated code. In our example, we have the `Sample` namespace inside of the `MyGame` namespace. Next, we have an `enum` definition. In this example, we have an `enum` of type `byte`, named `Color`. We have three values in this `enum`: `Red`, `Green`, and `Blue`. We specify `Red = 0` and `Blue = 2`, but we do not specify an explicit value for `Green`. Since the behavior of an `enum` is to increment if unspecified, `Green` will receive the implicit value of `1`. Following the `enum` is a `union`. The `union` in this example is not very useful, as it only contains the one `table` (named `Weapon`). If we had created multiple tables that we would want the `union` to be able to reference, we could add more elements to the `union Equipment`. After the `union` comes a `struct Vec3`, which represents a floating point vector with `3` dimensions. We use a `struct` here, over a `table`, because `struct`s are ideal for data structures that will not change, since they use less memory and have faster lookup. The `Monster` table is the main object in our FlatBuffer. This will be used as the template to store our `orc` monster. We specify some default values for fields, such as `mana:short = 150`. If unspecified, scalar fields (like `int`, `uint`, or `float`) will be given a default of `0` while strings and tables will be given a default of `null`. Another thing to note is the line `friendly:bool = false (deprecated);`. Since you cannot delete fields from a `table` (to support backwards compatibility), you can set fields as `deprecated`, which will prevent the generation of accessors for this field in the generated code. Be careful when using `deprecated`, however, as it may break legacy code that used this accessor. The `Weapon` table is a sub-table used within our FlatBuffer. It is used twice: once within the `Monster` table and once within the `Equipment` union. For our `Monster`, it is used to populate a `vector of tables` via the `weapons` field within our `Monster`. It is also the only table referenced by the `Equipment` union. 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 [Writing a schema](@ref flatbuffers_guide_writing_schema) section of the Programmer's Guide. You can also view the formal [Grammar of the schema language](@ref flatbuffers_grammar). ## Compiling the Monsters' Schema After you have written the FlatBuffers schema, the next step is to compile it. If you have not already done so, please follow [these instructions](@ref flatbuffers_guide_building) to build `flatc`, the FlatBuffer compiler. Once `flatc` is built successfully, compile the schema for your language:
*Note: If you're working in C, you need to use the separate project [FlatCC](https://github.com/dvidelabs/flatcc) which contains a schema compiler and runtime library in C for C.*
See [flatcc build instructions](https://github.com/dvidelabs/flatcc#building).
Please be aware of the difference between `flatc` and `flatcc` tools.
~~~{.sh} cd flatbuffers/samples ./../flatc --cpp monster.fbs ~~~
~~~{.sh} cd flatbuffers/samples ./../flatc --java monster.fbs ~~~
~~~{.sh} cd flatbuffers/samples ./../flatc --kotlin monster.fbs ~~~
~~~{.sh} cd flatbuffers/samples ./../flatc --csharp monster.fbs ~~~
~~~{.sh} cd flatbuffers/samples ./../flatc --go monster.fbs ~~~
~~~{.sh} cd flatbuffers/samples ./../flatc --python monster.fbs ~~~
~~~{.sh} cd flatbuffers/samples ./../flatc --ts-flat-files --ts monster.fbs # produces ts/js modules and js bundle monster_generated.js ~~~
~~~{.sh} cd flatbuffers/samples ./../flatc --ts monster.fbs ~~~
~~~{.sh} cd flatbuffers/sample ./../flatc --php monster.fbs ~~~
~~~{.sh} cd flatcc mkdir -p build/tmp/samples/monster bin/flatcc -a -o build/tmp/samples/monster samples/monster/monster.fbs # or just flatcc/samples/monster/build.sh ~~~
~~~{.sh} cd flatbuffers/samples ./../flatc --dart monster.fbs ~~~
~~~{.sh} cd flatbuffers/samples ./../flatc --lua monster.fbs ~~~
~~~{.sh} cd flatbuffers/samples ./../flatc --lobster monster.fbs ~~~
~~~{.sh} cd flatbuffers/samples ./../flatc --rust monster.fbs ~~~
~~~{.sh} cd flatbuffers/samples ./../flatc --swift monster.fbs ~~~
For a more complete guide to using the `flatc` compiler, please read the [Using the schema compiler](@ref flatbuffers_guide_using_schema_compiler) section of the Programmer's Guide. ## Reading and Writing Monster FlatBuffers Now that we have compiled the schema for our programming language, we can start creating some monsters and serializing/deserializing them from FlatBuffers. #### Creating and Writing Orc FlatBuffers The first step is to import/include the library, generated files, etc.
~~~{.cpp} #include "monster_generated.h" // This was generated by `flatc`. using namespace MyGame::Sample; // Specified in the schema. ~~~
~~~{.java} import MyGame.Sample.*; //The `flatc` generated files. (Monster, Vec3, etc.) import com.google.flatbuffers.FlatBufferBuilder; ~~~
~~~{.kotlin} import MyGame.Sample.* //The `flatc` generated files. (Monster, Vec3, etc.) import com.google.flatbuffers.FlatBufferBuilder ~~~
~~~{.cs} using Google.FlatBuffers; using MyGame.Sample; // The `flatc` generated files. (Monster, Vec3, etc.) ~~~
~~~{.go} import ( flatbuffers "github.com/google/flatbuffers/go" sample "MyGame/Sample" ) ~~~
~~~{.py} import flatbuffers # Generated by `flatc`. import MyGame.Sample.Color import MyGame.Sample.Equipment import MyGame.Sample.Monster import MyGame.Sample.Vec3 import MyGame.Sample.Weapon ~~~
~~~{.js} // The following code is an example - use your desired module flavor by transpiling from TS. var flatbuffers = require('/js/flatbuffers').flatbuffers; var MyGame = require('./monster_generated').MyGame; // Generated by `flatc`. //--------------------------------------------------------------------------// // The following code is for browser-based HTML/JavaScript. Use the above code // for JavaScript module loaders (e.g. Node.js). // Generated by `flatc`. ~~~
~~~{.ts} // note: import flatbuffers with your desired import method import { MyGame } from './monster_generated'; ~~~
~~~{.php} // It is recommended that your use PSR autoload when using FlatBuffers in PHP. // Here is an example from `SampleBinary.php`: function __autoload($class_name) { // The last segment of the class name matches the file name. $class = substr($class_name, strrpos($class_name, "\\") + 1); $root_dir = join(DIRECTORY_SEPARATOR, array(dirname(dirname(__FILE__)))); // `flatbuffers` root. // Contains the `*.php` files for the FlatBuffers library and the `flatc` generated files. $paths = array(join(DIRECTORY_SEPARATOR, array($root_dir, "php")), join(DIRECTORY_SEPARATOR, array($root_dir, "samples", "MyGame", "Sample"))); foreach ($paths as $path) { $file = join(DIRECTORY_SEPARATOR, array($path, $class . ".php")); if (file_exists($file)) { require($file); break; } } } ~~~
~~~{.c} #include "monster_builder.h" // Generated by `flatcc`. // Convenient namespace macro to manage long namespace prefix. #undef ns #define ns(x) FLATBUFFERS_WRAP_NAMESPACE(MyGame_Sample, x) // Specified in the schema. // A helper to simplify creating vectors from C-arrays. #define c_vec_len(V) (sizeof(V)/sizeof((V)[0])) ~~~
~~~{.dart} import 'package:flat_buffers/flat_buffers.dart' as fb; // Generated by `flatc`. import 'monster_my_game.sample_generated.dart' as myGame; ~~~
~~~{.lua} -- require the flatbuffers module local flatbuffers = require("flatbuffers") -- require the generated files from `flatc`. local color = require("MyGame.Sample.Color") local equipment = require("MyGame.Sample.Equipment") local monster = require("MyGame.Sample.Monster") local vec3 = require("MyGame.Sample.Vec3") local weapon = require("MyGame.Sample.Weapon") ~~~
~~~{.lobster} import from "../lobster/" // Where to find flatbuffers.lobster import monster_generated ~~~
~~~{.rs} // import the flatbuffers runtime library extern crate flatbuffers; // import the generated code #[allow(dead_code, unused_imports)] #[path = "./monster_generated.rs"] mod monster_generated; pub use monster_generated::my_game::sample::{root_as_monster, Color, Equipment, Monster, MonsterArgs, Vec3, Weapon, WeaponArgs}; ~~~
~~~{.swift} /** // make sure that monster_generated.swift is included in your project */ import Flatbuffers // typealiases for convenience typealias Monster = MyGame1_Sample_Monster typealias Weapon = MyGame1_Sample_Weapon typealias Color = MyGame1_Sample_Color typealias Vec3 = MyGame1_Sample_Vec3 ~~~
Now we are ready to start building some buffers. In order to start, we need to create an instance of the `FlatBufferBuilder`, which will contain the buffer as it grows. You can pass an initial size of the buffer (here 1024 bytes), which will grow automatically if needed:
~~~{.cpp} // Create a `FlatBufferBuilder`, which will be used to create our // monsters' FlatBuffers. flatbuffers::FlatBufferBuilder builder(1024); ~~~
~~~{.java} // Create a `FlatBufferBuilder`, which will be used to create our // monsters' FlatBuffers. FlatBufferBuilder builder = new FlatBufferBuilder(1024); ~~~
~~~{.kt} // Create a `FlatBufferBuilder`, which will be used to create our // monsters' FlatBuffers. val builder = FlatBufferBuilder(1024) ~~~
~~~{.cs} // Create a `FlatBufferBuilder`, which will be used to create our // monsters' FlatBuffers. var builder = new FlatBufferBuilder(1024); ~~~
~~~{.go} // Create a `FlatBufferBuilder`, which will be used to create our // monsters' FlatBuffers. builder := flatbuffers.NewBuilder(1024) ~~~
~~~{.py} # Create a `FlatBufferBuilder`, which will be used to create our # monsters' FlatBuffers. builder = flatbuffers.Builder(1024) ~~~
~~~{.js} // Create a `flatbuffer.Builder`, which will be used to create our // monsters' FlatBuffers. var builder = new flatbuffers.Builder(1024); ~~~
~~~{.ts} // Create a `flatbuffer.Builder`, which will be used to create our // monsters' FlatBuffers. let builder = new flatbuffers.Builder(1024); ~~~
~~~{.php} // Create a `FlatBufferBuilder`, which will be used to create our // monsters' FlatBuffers. $builder = new Google\FlatBuffers\FlatbufferBuilder(1024); ~~~
~~~{.c} flatcc_builder_t builder, *B; B = &builder; // Initialize the builder object. flatcc_builder_init(B); ~~~
~~~{.dart} // Create the fb.Builder object that will be used by our generated builders // Note that if you are only planning to immediately get the byte array this builder would create, // you can use the convenience method `toBytes()` on the generated builders. // For example, you could do something like `new myGame.MonsterBuilder(...).toBytes()` var builder = new fb.Builder(initialSize: 1024); ~~~
~~~{.lua} -- get access to the builder, providing an array of size 1024 local builder = flatbuffers.Builder(1024) ~~~
~~~{.lobster} // get access to the builder let builder = flatbuffers_builder {} ~~~
~~~{.rs} // Build up a serialized buffer algorithmically. // Initialize it with a capacity of 1024 bytes. let mut builder = flatbuffers::FlatBufferBuilder::with_capacity(1024); ~~~
~~~{.swift} // create a `FlatBufferBuilder`, which will be used to serialize objects let builder = FlatBufferBuilder(initialSize: 1024) ~~~
After creating the `builder`, we can start serializing our data. Before we make our `orc` Monster, let's create some `Weapon`s: a `Sword` and an `Axe`.
~~~{.cpp} auto weapon_one_name = builder.CreateString("Sword"); short weapon_one_damage = 3; auto weapon_two_name = builder.CreateString("Axe"); short weapon_two_damage = 5; // Use the `CreateWeapon` shortcut to create Weapons with all the fields set. auto sword = CreateWeapon(builder, weapon_one_name, weapon_one_damage); auto axe = CreateWeapon(builder, weapon_two_name, weapon_two_damage); ~~~
~~~{.java} int weaponOneName = builder.createString("Sword") short weaponOneDamage = 3; int weaponTwoName = builder.createString("Axe"); short weaponTwoDamage = 5; // Use the `createWeapon()` helper function to create the weapons, since we set every field. int sword = Weapon.createWeapon(builder, weaponOneName, weaponOneDamage); int axe = Weapon.createWeapon(builder, weaponTwoName, weaponTwoDamage); ~~~
~~~{.kt} val weaponOneName = builder.createString("Sword") val weaponOneDamage: Short = 3; val weaponTwoName = builder.createString("Axe") val weaponTwoDamage: Short = 5; // Use the `createWeapon()` helper function to create the weapons, since we set every field. val sword = Weapon.createWeapon(builder, weaponOneName, weaponOneDamage) val axe = Weapon.createWeapon(builder, weaponTwoName, weaponTwoDamage) ~~~
~~~{.cs} var weaponOneName = builder.CreateString("Sword"); var weaponOneDamage = 3; var weaponTwoName = builder.CreateString("Axe"); var weaponTwoDamage = 5; // Use the `CreateWeapon()` helper function to create the weapons, since we set every field. var sword = Weapon.CreateWeapon(builder, weaponOneName, (short)weaponOneDamage); var axe = Weapon.CreateWeapon(builder, weaponTwoName, (short)weaponTwoDamage); ~~~
~~~{.go} weaponOne := builder.CreateString("Sword") weaponTwo := builder.CreateString("Axe") // Create the first `Weapon` ("Sword"). sample.WeaponStart(builder) sample.WeaponAddName(builder, weaponOne) sample.WeaponAddDamage(builder, 3) sword := sample.WeaponEnd(builder) // Create the second `Weapon` ("Axe"). sample.WeaponStart(builder) sample.WeaponAddName(builder, weaponTwo) sample.WeaponAddDamage(builder, 5) axe := sample.WeaponEnd(builder) ~~~
~~~{.py} weapon_one = builder.CreateString('Sword') weapon_two = builder.CreateString('Axe') # Create the first `Weapon` ('Sword'). MyGame.Sample.Weapon.Start(builder) MyGame.Sample.Weapon.AddName(builder, weapon_one) MyGame.Sample.Weapon.AddDamage(builder, 3) sword = MyGame.Sample.Weapon.End(builder) # Create the second `Weapon` ('Axe'). MyGame.Sample.Weapon.Start(builder) MyGame.Sample.Weapon.AddName(builder, weapon_two) MyGame.Sample.Weapon.AddDamage(builder, 5) axe = MyGame.Sample.Weapon.End(builder) ~~~
~~~{.js} var weaponOne = builder.createString('Sword'); var weaponTwo = builder.createString('Axe'); // Create the first `Weapon` ('Sword'). MyGame.Sample.Weapon.startWeapon(builder); MyGame.Sample.Weapon.addName(builder, weaponOne); MyGame.Sample.Weapon.addDamage(builder, 3); var sword = MyGame.Sample.Weapon.endWeapon(builder); // Create the second `Weapon` ('Axe'). MyGame.Sample.Weapon.startWeapon(builder); MyGame.Sample.Weapon.addName(builder, weaponTwo); MyGame.Sample.Weapon.addDamage(builder, 5); var axe = MyGame.Sample.Weapon.endWeapon(builder); ~~~
~~~{.ts} let weaponOne = builder.createString('Sword'); let weaponTwo = builder.createString('Axe'); // Create the first `Weapon` ('Sword'). MyGame.Sample.Weapon.startWeapon(builder); MyGame.Sample.Weapon.addName(builder, weaponOne); MyGame.Sample.Weapon.addDamage(builder, 3); let sword = MyGame.Sample.Weapon.endWeapon(builder); // Create the second `Weapon` ('Axe'). MyGame.Sample.Weapon.startWeapon(builder); MyGame.Sample.Weapon.addName(builder, weaponTwo); MyGame.Sample.Weapon.addDamage(builder, 5); let axe = MyGame.Sample.Weapon.endWeapon(builder); ~~~
~~~{.php} // Create the `Weapon`s using the `createWeapon()` helper function. $weapon_one_name = $builder->createString("Sword"); $sword = \MyGame\Sample\Weapon::CreateWeapon($builder, $weapon_one_name, 3); $weapon_two_name = $builder->createString("Axe"); $axe = \MyGame\Sample\Weapon::CreateWeapon($builder, $weapon_two_name, 5); // Create an array from the two `Weapon`s and pass it to the // `CreateWeaponsVector()` method to create a FlatBuffer vector. $weaps = array($sword, $axe); $weapons = \MyGame\Sample\Monster::CreateWeaponsVector($builder, $weaps); ~~~
~~~{.c} flatbuffers_string_ref_t weapon_one_name = flatbuffers_string_create_str(B, "Sword"); uint16_t weapon_one_damage = 3; flatbuffers_string_ref_t weapon_two_name = flatbuffers_string_create_str(B, "Axe"); uint16_t weapon_two_damage = 5; ns(Weapon_ref_t) sword = ns(Weapon_create(B, weapon_one_name, weapon_one_damage)); ns(Weapon_ref_t) axe = ns(Weapon_create(B, weapon_two_name, weapon_two_damage)); ~~~
~~~{.dart} // The generated Builder classes work much like in other languages, final int weaponOneName = builder.writeString("Sword"); final int weaponOneDamage = 3; final int weaponTwoName = builder.writeString("Axe"); final int weaponTwoDamage = 5; final swordBuilder = new myGame.WeaponBuilder(builder) ..begin() ..addNameOffset(weaponOneName) ..addDamage(weaponOneDamage); final int sword = swordBuilder.finish(); final axeBuilder = new myGame.WeaponBuilder(builder) ..begin() ..addNameOffset(weaponTwoName) ..addDamage(weaponTwoDamage); final int axe = axeBuilder.finish(); // The generated ObjectBuilder classes offer an easier to use alternative // at the cost of requiring some additional reference allocations. If memory // usage is critical, or if you'll be working with especially large messages // or tables, you should prefer using the generated Builder classes. // The following code would produce an identical buffer as above. final String weaponOneName = "Sword"; final int weaponOneDamage = 3; final String weaponTwoName = "Axe"; final int weaponTwoDamage = 5; final myGame.WeaponBuilder sword = new myGame.WeaponObjectBuilder( name: weaponOneName, damage: weaponOneDamage, ); final myGame.WeaponBuilder axe = new myGame.WeaponObjectBuilder( name: weaponTwoName, damage: weaponTwoDamage, ); ~~~
~~~{.lua} local weaponOne = builder:CreateString("Sword") local weaponTwo = builder:CreateString("Axe") -- Create the first 'Weapon' weapon.Start(builder) weapon.AddName(builder, weaponOne) weapon.AddDamage(builder, 3) local sword = weapon.End(builder) -- Create the second 'Weapon' weapon.Start(builder) weapon.AddName(builder, weaponTwo) weapon.AddDamage(builder, 5) local axe = weapon.End(builder) ~~~
~~~{.lobster} let weapon_names = [ "Sword", "Axe" ] let weapon_damages = [ 3, 5 ] let weapon_offsets = map(weapon_names) name, i: let ns = builder.CreateString(name) MyGame_Sample_WeaponBuilder { b } .start() .add_name(ns) .add_damage(weapon_damages[i]) .end() ~~~
~~~{.rs} // Serialize some weapons for the Monster: A 'sword' and an 'axe'. let weapon_one_name = builder.create_string("Sword"); let weapon_two_name = builder.create_string("Axe"); // Use the `Weapon::create` shortcut to create Weapons with named field // arguments. let sword = Weapon::create(&mut builder, &WeaponArgs{ name: Some(weapon_one_name), damage: 3, }); let axe = Weapon::create(&mut builder, &WeaponArgs{ name: Some(weapon_two_name), damage: 5, }); ~~~
~~~{.swift} let weapon1Name = builder.create(string: "Sword") let weapon2Name = builder.create(string: "Axe") // start creating the weapon by calling startWeapon let weapon1Start = Weapon.startWeapon(&builder) Weapon.add(name: weapon1Name, &builder) Weapon.add(damage: 3, &builder) // end the object by passing the start point for the weapon 1 let sword = Weapon.endWeapon(&builder, start: weapon1Start) let weapon2Start = Weapon.startWeapon(&builder) Weapon.add(name: weapon2Name, &builder) Weapon.add(damage: 5, &builder) let axe = Weapon.endWeapon(&builder, start: weapon2Start) ~~~
Now let's create our monster, the `orc`. For this `orc`, lets make him `red` with rage, positioned at `(1.0, 2.0, 3.0)`, and give him a large pool of hit points with `300`. We can give him a vector of weapons to choose from (our `Sword` and `Axe` from earlier). In this case, we will equip him with the `Axe`, since it is the most powerful of the two. Lastly, let's fill his inventory with some potential treasures that can be taken once he is defeated. Before we serialize a monster, we need to first serialize any objects that are contained therein, i.e. we serialize the data tree using depth-first, pre-order traversal. This is generally easy to do on any tree structures.
~~~{.cpp} // Serialize a name for our monster, called "Orc". auto name = builder.CreateString("Orc"); // Create a `vector` representing the inventory of the Orc. Each number // could correspond to an item that can be claimed after he is slain. unsigned char treasure[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; auto inventory = builder.CreateVector(treasure, 10); ~~~
~~~{.java} // Serialize a name for our monster, called "Orc". int name = builder.createString("Orc"); // Create a `vector` representing the inventory of the Orc. Each number // could correspond to an item that can be claimed after he is slain. byte[] treasure = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; int inv = Monster.createInventoryVector(builder, treasure); ~~~
~~~{.kt} // Serialize a name for our monster, called "Orc". val name = builder.createString("Orc") // Create a `vector` representing the inventory of the Orc. Each number // could correspond to an item that can be claimed after he is slain. val treasure = byteArrayOf(0, 1, 2, 3, 4, 5, 6, 7, 8, 9) val inv = Monster.createInventoryVector(builder, treasure) ~~~
~~~{.cs} // Serialize a name for our monster, called "Orc". var name = builder.CreateString("Orc"); // Create a `vector` representing the inventory of the Orc. Each number // could correspond to an item that can be claimed after he is slain. // Note: Since we prepend the bytes, this loop iterates in reverse order. Monster.StartInventoryVector(builder, 10); for (int i = 9; i >= 0; i--) { builder.AddByte((byte)i); } var inv = builder.EndVector(); ~~~
~~~{.go} // Serialize a name for our monster, called "Orc". name := builder.CreateString("Orc") // Create a `vector` representing the inventory of the Orc. Each number // could correspond to an item that can be claimed after he is slain. // Note: Since we prepend the bytes, this loop iterates in reverse. sample.MonsterStartInventoryVector(builder, 10) for i := 9; i >= 0; i-- { builder.PrependByte(byte(i)) } inv := builder.EndVector(10) ~~~
~~~{.py} # Serialize a name for our monster, called "Orc". name = builder.CreateString("Orc") # Create a `vector` representing the inventory of the Orc. Each number # could correspond to an item that can be claimed after he is slain. # Note: Since we prepend the bytes, this loop iterates in reverse. MyGame.Sample.Monster.StartInventoryVector(builder, 10) for i in reversed(range(0, 10)): builder.PrependByte(i) inv = builder.EndVector() ~~~
~~~{.js} // Serialize a name for our monster, called 'Orc'. var name = builder.createString('Orc'); // Create a `vector` representing the inventory of the Orc. Each number // could correspond to an item that can be claimed after he is slain. var treasure = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; var inv = MyGame.Sample.Monster.createInventoryVector(builder, treasure); ~~~
~~~{.ts} // Serialize a name for our monster, called 'Orc'. let name = builder.createString('Orc'); // Create a `vector` representing the inventory of the Orc. Each number // could correspond to an item that can be claimed after he is slain. let treasure = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; let inv = MyGame.Sample.Monster.createInventoryVector(builder, treasure); ~~~
~~~{.php} // Serialize a name for our monster, called "Orc". $name = $builder->createString("Orc"); // Create a `vector` representing the inventory of the Orc. Each number // could correspond to an item that can be claimed after he is slain. $treasure = array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9); $inv = \MyGame\Sample\Monster::CreateInventoryVector($builder, $treasure); ~~~
~~~{.c} // Serialize a name for our monster, called "Orc". // The _str suffix indicates the source is an ascii-z string. flatbuffers_string_ref_t name = flatbuffers_string_create_str(B, "Orc"); // Create a `vector` representing the inventory of the Orc. Each number // could correspond to an item that can be claimed after he is slain. uint8_t treasure[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; flatbuffers_uint8_vec_ref_t inventory; // `c_vec_len` is the convenience macro we defined earlier. inventory = flatbuffers_uint8_vec_create(B, treasure, c_vec_len(treasure)); ~~~
~~~{.dart} // Serialize a name for our monster, called "Orc". final int name = builder.writeString('Orc'); // Create a list representing the inventory of the Orc. Each number // could correspond to an item that can be claimed after he is slain. final List treasure = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; final inventory = builder.writeListUint8(treasure); // The following code should be used instead if you intend to use the // ObjectBuilder classes: // Serialize a name for our monster, called "Orc". final String name = 'Orc'; // Create a list representing the inventory of the Orc. Each number // could correspond to an item that can be claimed after he is slain. final List treasure = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; ~~~
~~~{.py} -- Serialize a name for our monster, called 'orc' local name = builder:CreateString("Orc") -- Create a `vector` representing the inventory of the Orc. Each number -- could correspond to an item that can be claimed after he is slain. -- Note: Since we prepend the bytes, this loop iterates in reverse. monster.StartInventoryVector(builder, 10) for i=10,1,-1 do builder:PrependByte(i) end local inv = builder:EndVector(10) ~~~
~~~{.lobster} // Name of the monster. let name = builder.CreateString("Orc") // Inventory. let inv = builder.MyGame_Sample_MonsterCreateInventoryVector(map(10): _) ~~~
~~~{.rs} // Name of the Monster. let name = builder.create_string("Orc"); // Inventory. let inventory = builder.create_vector(&[0u8, 1, 2, 3, 4, 5, 6, 7, 8, 9]); ~~~
~~~{.swift} // Name of the Monster. let name = builder.create(string: "Orc") // create inventory let inventory: [Byte] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] let inventoryOffset = builder.createVector(inventory) ~~~
We serialized two built-in data types (`string` and `vector`) and captured their return values. These values are offsets into the serialized data, indicating where they are stored, such that we can refer to them below when adding fields to our monster. *Note: To create a `vector` of nested objects (e.g. `table`s, `string`s, or other `vector`s), collect their offsets into a temporary data structure, and then create an additional `vector` containing their offsets.* If instead of creating a vector from an existing array you serialize elements individually one by one, take care to note that this happens in reverse order, as buffers are built back to front. For example, take a look at the two `Weapon`s that we created earlier (`Sword` and `Axe`). These are both FlatBuffer `table`s, whose offsets we now store in memory. Therefore we can create a FlatBuffer `vector` to contain these offsets.
~~~{.cpp} // Place the weapons into a `std::vector`, then convert that into a FlatBuffer `vector`. std::vector> weapons_vector; weapons_vector.push_back(sword); weapons_vector.push_back(axe); auto weapons = builder.CreateVector(weapons_vector); ~~~
~~~{.java} // Place the two weapons into an array, and pass it to the `createWeaponsVector()` method to // create a FlatBuffer vector. int[] weaps = new int[2]; weaps[0] = sword; weaps[1] = axe; // Pass the `weaps` array into the `createWeaponsVector()` method to create a FlatBuffer vector. int weapons = Monster.createWeaponsVector(builder, weaps); ~~~
~~~{.kt} // Place the two weapons into an array, and pass it to the `createWeaponsVector()` method to // create a FlatBuffer vector. val weaps = intArrayOf(sword, axe) // Pass the `weaps` array into the `createWeaponsVector()` method to create a FlatBuffer vector. val weapons = Monster.createWeaponsVector(builder, weaps) ~~~
~~~{.cs} var weaps = new Offset[2]; weaps[0] = sword; weaps[1] = axe; // Pass the `weaps` array into the `CreateWeaponsVector()` method to create a FlatBuffer vector. var weapons = Monster.CreateWeaponsVector(builder, weaps); ~~~
~~~{.go} // Create a FlatBuffer vector and prepend the weapons. // Note: Since we prepend the data, prepend them in reverse order. sample.MonsterStartWeaponsVector(builder, 2) builder.PrependUOffsetT(axe) builder.PrependUOffsetT(sword) weapons := builder.EndVector(2) ~~~
~~~{.py} # Create a FlatBuffer vector and prepend the weapons. # Note: Since we prepend the data, prepend them in reverse order. MyGame.Sample.Monster.StartWeaponsVector(builder, 2) builder.PrependUOffsetTRelative(axe) builder.PrependUOffsetTRelative(sword) weapons = builder.EndVector() ~~~
~~~{.js} // Create an array from the two `Weapon`s and pass it to the // `createWeaponsVector()` method to create a FlatBuffer vector. var weaps = [sword, axe]; var weapons = MyGame.Sample.Monster.createWeaponsVector(builder, weaps); ~~~
~~~{.ts} // Create an array from the two `Weapon`s and pass it to the // `createWeaponsVector()` method to create a FlatBuffer vector. let weaps = [sword, axe]; let weapons = MyGame.Sample.Monster.createWeaponsVector(builder, weaps); ~~~
~~~{.php} // Create an array from the two `Weapon`s and pass it to the // `CreateWeaponsVector()` method to create a FlatBuffer vector. $weaps = array($sword, $axe); $weapons = \MyGame\Sample\Monster::CreateWeaponsVector($builder, $weaps); ~~~
~~~{.c} // We use the internal builder stack to implement a dynamic vector. ns(Weapon_vec_start(B)); ns(Weapon_vec_push(B, sword)); ns(Weapon_vec_push(B, axe)); ns(Weapon_vec_ref_t) weapons = ns(Weapon_vec_end(B)); ~~~
~~~{.dart} // If using the Builder classes, serialize the `[sword,axe]` final weapons = builder.writeList([sword, axe]); // If using the ObjectBuilders, just create an array from the two `Weapon`s final List weaps = [sword, axe]; ~~~
~~~{.lua} -- Create a FlatBuffer vector and prepend the weapons. -- Note: Since we prepend the data, prepend them in reverse order. monster.StartWeaponsVector(builder, 2) builder:PrependUOffsetTRelative(axe) builder:PrependUOffsetTRelative(sword) local weapons = builder:EndVector(2) ~~~
~~~{.lobster} let weapons = builder.MyGame_Sample_MonsterCreateWeaponsVector(weapon_offsets) ~~~
~~~{.rs} // Create a FlatBuffer `vector` that contains offsets to the sword and axe // we created above. let weapons = builder.create_vector(&[sword, axe]); ~~~
~~~{.swift} // Create a FlatBuffer `vector` that contains offsets to the sword and axe // we created above. let weaponsOffset = builder.createVector(ofOffsets: [sword, axe]) ~~~

Note there are additional convenience overloads of `CreateVector`, allowing you to work with data that's not in a `std::vector` or allowing you to generate elements by calling a lambda. For the common case of `std::vector` there's also `CreateVectorOfStrings`.
Note that vectors of structs are serialized differently from tables, since structs are stored in-line in the vector. For example, to create a vector for the `path` field above:
~~~{.cpp} Vec3 points[] = { Vec3(1.0f, 2.0f, 3.0f), Vec3(4.0f, 5.0f, 6.0f) }; auto path = builder.CreateVectorOfStructs(points, 2); ~~~
~~~{.java} Monster.startPathVector(fbb, 2); Vec3.createVec3(builder, 1.0f, 2.0f, 3.0f); Vec3.createVec3(builder, 4.0f, 5.0f, 6.0f); int path = fbb.endVector(); ~~~
~~~{.kt} Monster.startPathVector(fbb, 2) Vec3.createVec3(builder, 1.0f, 2.0f, 3.0f) Vec3.createVec3(builder, 4.0f, 5.0f, 6.0f) val path = fbb.endVector() ~~~
~~~{.cs} Monster.StartPathVector(fbb, 2); Vec3.CreateVec3(builder, 1.0f, 2.0f, 3.0f); Vec3.CreateVec3(builder, 4.0f, 5.0f, 6.0f); var path = fbb.EndVector(); ~~~
~~~{.go} sample.MonsterStartPathVector(builder, 2) sample.CreateVec3(builder, 1.0, 2.0, 3.0) sample.CreateVec3(builder, 4.0, 5.0, 6.0) path := builder.EndVector(2) ~~~
~~~{.py} MyGame.Sample.Monster.StartPathVector(builder, 2) MyGame.Sample.Vec3.CreateVec3(builder, 1.0, 2.0, 3.0) MyGame.Sample.Vec3.CreateVec3(builder, 4.0, 5.0, 6.0) path = builder.EndVector() ~~~
~~~{.js} MyGame.Sample.Monster.startPathVector(builder, 2); MyGame.Sample.Vec3.createVec3(builder, 1.0, 2.0, 3.0); MyGame.Sample.Vec3.createVec3(builder, 4.0, 5.0, 6.0); var path = builder.endVector(); ~~~
~~~{.ts} MyGame.Sample.Monster.startPathVector(builder, 2); MyGame.Sample.Vec3.createVec3(builder, 1.0, 2.0, 3.0); MyGame.Sample.Vec3.createVec3(builder, 4.0, 5.0, 6.0); let path = builder.endVector(); ~~~
~~~{.php} \MyGame\Example\Monster::StartPathVector($builder, 2); \MyGame\Sample\Vec3::CreateVec3($builder, 1.0, 2.0, 3.0); \MyGame\Sample\Vec3::CreateVec3($builder, 1.0, 2.0, 3.0); $path = $builder->endVector(); ~~~
~~~{.c} // TBD ~~~
~~~{.dart} // Using the Builder classes, you can write a list of structs like so: // Note that the intended order should be reversed if order is important. final vec3Builder = new myGame.Vec3Builder(builder); vec3Builder.finish(4.0, 5.0, 6.0); vec3Builder.finish(1.0, 2.0, 3.0); final int path = builder.endStructVector(2); // the length of the vector // Otherwise, using the ObjectBuilder classes: // The dart implementation provides a simple interface for writing vectors // of structs, in `writeListOfStructs`. This method takes // `List` and is used by the generated builder classes. final List path = [ new myGame.Vec3ObjectBuilder(x: 1.0, y: 2.0, z: 3.0), new myGame.Vec3ObjectBuilder(x: 4.0, y: 5.0, z: 6.0) ]; ~~~
~~~{.lua} -- Create a FlatBuffer vector and prepend the path locations. -- Note: Since we prepend the data, prepend them in reverse order. monster.StartPathVector(builder, 2) vec3.CreateVec3(builder, 1.0, 2.0, 3.0) vec3.CreateVec3(builder, 4.0, 5.0, 6.0) local path = builder:EndVector(2) ~~~
~~~{.lobster} builder.MyGame_Sample_MonsterStartPathVector(2) builder.MyGame_Sample_CreateVec3(1.0, 2.0, 3.0) builder.MyGame_Sample_CreateVec3(4.0, 5.0, 6.0) let path = builder.EndVector(2) ~~~
~~~{.rs} // Create the path vector of Vec3 objects. let x = Vec3::new(1.0, 2.0, 3.0); let y = Vec3::new(4.0, 5.0, 6.0); let path = builder.create_vector(&[x, y]); // Note that, for convenience, it is also valid to create a vector of // references to structs, like this: // let path = builder.create_vector(&[&x, &y]); ~~~
~~~{.swift} // let points = fbb.createVector(ofStructs: [ Vec3(x: 1, y: 2, z: 3), Vec3(x: 4, y: 5, z: 6) ]) // OR var vec3 = [ Vec3(x: 1, y: 2, z: 3), Vec3(x: 4, y: 5, z: 6) ] Monster.startVectorOfVec3(2, in: &fbb) for i in obj { _ = create(struct: i) } let points = fbb.endVector(len: size) ~~~
We have now serialized the non-scalar components of the orc, so we can serialize the monster itself:
~~~{.cpp} // Create the position struct auto position = Vec3(1.0f, 2.0f, 3.0f); // Set his hit points to 300 and his mana to 150. int hp = 300; int mana = 150; // Finally, create the monster using the `CreateMonster` helper function // to set all fields. auto orc = CreateMonster(builder, &position, mana, hp, name, inventory, Color_Red, weapons, Equipment_Weapon, axe.Union(), path); ~~~
~~~{.java} // Create our monster using `startMonster()` and `endMonster()`. Monster.startMonster(builder); Monster.addPos(builder, Vec3.createVec3(builder, 1.0f, 2.0f, 3.0f)); Monster.addName(builder, name); Monster.addColor(builder, Color.Red); Monster.addHp(builder, (short)300); Monster.addInventory(builder, inv); Monster.addWeapons(builder, weapons); Monster.addEquippedType(builder, Equipment.Weapon); Monster.addEquipped(builder, axe); Monster.addPath(builder, path); int orc = Monster.endMonster(builder); ~~~
~~~{.kt} // Create our monster using `startMonster()` and `endMonster()`. Monster.startMonster(builder) Monster.addPos(builder, Vec3.createVec3(builder, 1.0f, 2.0f, 3.0f)) Monster.addName(builder, name) Monster.addColor(builder, Color.Red) Monster.addHp(builder, 300.toShort()) Monster.addInventory(builder, inv) Monster.addWeapons(builder, weapons) Monster.addEquippedType(builder, Equipment.Weapon) Monster.addEquipped(builder, axe) Monster.addPath(builder, path) val orc = Monster.endMonster(builder) ~~~
~~~{.cs} // Create our monster using `StartMonster()` and `EndMonster()`. Monster.StartMonster(builder); Monster.AddPos(builder, Vec3.CreateVec3(builder, 1.0f, 2.0f, 3.0f)); Monster.AddHp(builder, (short)300); Monster.AddName(builder, name); Monster.AddInventory(builder, inv); Monster.AddColor(builder, Color.Red); Monster.AddWeapons(builder, weapons); Monster.AddEquippedType(builder, Equipment.Weapon); Monster.AddEquipped(builder, axe.Value); // Axe Monster.AddPath(builder, path); var orc = Monster.EndMonster(builder); ~~~
~~~{.go} // Create our monster using `MonsterStart()` and `MonsterEnd()`. sample.MonsterStart(builder) sample.MonsterAddPos(builder, sample.CreateVec3(builder, 1.0, 2.0, 3.0)) sample.MonsterAddHp(builder, 300) sample.MonsterAddName(builder, name) sample.MonsterAddInventory(builder, inv) sample.MonsterAddColor(builder, sample.ColorRed) sample.MonsterAddWeapons(builder, weapons) sample.MonsterAddEquippedType(builder, sample.EquipmentWeapon) sample.MonsterAddEquipped(builder, axe) sample.MonsterAddPath(builder, path) orc := sample.MonsterEnd(builder) ~~~
~~~{.py} # Create our monster by using `Monster.Start()` and `Monster.End()`. MyGame.Sample.Monster.Start(builder) MyGame.Sample.Monster.AddPos(builder, MyGame.Sample.Vec3.CreateVec3(builder, 1.0, 2.0, 3.0)) MyGame.Sample.Monster.AddHp(builder, 300) MyGame.Sample.Monster.AddName(builder, name) MyGame.Sample.Monster.AddInventory(builder, inv) MyGame.Sample.Monster.AddColor(builder, MyGame.Sample.Color.Color().Red) MyGame.Sample.Monster.AddWeapons(builder, weapons) MyGame.Sample.Monster.AddEquippedType( builder, MyGame.Sample.Equipment.Equipment().Weapon) MyGame.Sample.Monster.AddEquipped(builder, axe) MyGame.Sample.Monster.AddPath(builder, path) orc = MyGame.Sample.Monster.End(builder) ~~~
~~~{.js} // Create our monster by using `startMonster()` and `endMonster()`. MyGame.Sample.Monster.startMonster(builder); MyGame.Sample.Monster.addPos(builder, MyGame.Sample.Vec3.createVec3(builder, 1.0, 2.0, 3.0)); MyGame.Sample.Monster.addHp(builder, 300); MyGame.Sample.Monster.addColor(builder, MyGame.Sample.Color.Red) MyGame.Sample.Monster.addName(builder, name); MyGame.Sample.Monster.addInventory(builder, inv); MyGame.Sample.Monster.addWeapons(builder, weapons); MyGame.Sample.Monster.addEquippedType(builder, MyGame.Sample.Equipment.Weapon); MyGame.Sample.Monster.addEquipped(builder, axe); MyGame.Sample.Monster.addPath(builder, path); var orc = MyGame.Sample.Monster.endMonster(builder); ~~~
~~~{.ts} // Create our monster by using `startMonster()` and `endMonster()`. MyGame.Sample.Monster.startMonster(builder); MyGame.Sample.Monster.addPos(builder, MyGame.Sample.Vec3.createVec3(builder, 1.0, 2.0, 3.0)); MyGame.Sample.Monster.addHp(builder, 300); MyGame.Sample.Monster.addColor(builder, MyGame.Sample.Color.Red) MyGame.Sample.Monster.addName(builder, name); MyGame.Sample.Monster.addInventory(builder, inv); MyGame.Sample.Monster.addWeapons(builder, weapons); MyGame.Sample.Monster.addEquippedType(builder, MyGame.Sample.Equipment.Weapon); MyGame.Sample.Monster.addEquipped(builder, axe); MyGame.Sample.Monster.addPath(builder, path); let orc = MyGame.Sample.Monster.endMonster(builder); ~~~
~~~{.php} // Create our monster by using `StartMonster()` and `EndMonster()`. \MyGame\Sample\Monster::StartMonster($builder); \MyGame\Sample\Monster::AddPos($builder, \MyGame\Sample\Vec3::CreateVec3($builder, 1.0, 2.0, 3.0)); \MyGame\Sample\Monster::AddHp($builder, 300); \MyGame\Sample\Monster::AddName($builder, $name); \MyGame\Sample\Monster::AddInventory($builder, $inv); \MyGame\Sample\Monster::AddColor($builder, \MyGame\Sample\Color::Red); \MyGame\Sample\Monster::AddWeapons($builder, $weapons); \MyGame\Sample\Monster::AddEquippedType($builder, \MyGame\Sample\Equipment::Weapon); \MyGame\Sample\Monster::AddEquipped($builder, $axe); \MyGame\Sample\Monster::AddPath($builder, $path); $orc = \MyGame\Sample\Monster::EndMonster($builder); ~~~
~~~{.c} // Set his hit points to 300 and his mana to 150. uint16_t hp = 300; uint16_t mana = 150; // Define an equipment union. `create` calls in C has a single // argument for unions where C++ has both a type and a data argument. ns(Equipment_union_ref_t) equipped = ns(Equipment_as_Weapon(axe)); ns(Vec3_t) pos = { 1.0f, 2.0f, 3.0f }; ns(Monster_create_as_root(B, &pos, mana, hp, name, inventory, ns(Color_Red), weapons, equipped, path)); ~~~
~~~{.dart} // Using the Builder API: // Set his hit points to 300 and his mana to 150. final int hp = 300; final int mana = 150; final monster = new myGame.MonsterBuilder(builder) ..begin() ..addNameOffset(name) ..addInventoryOffset(inventory) ..addWeaponsOffset(weapons) ..addEquippedType(myGame.EquipmentTypeId.Weapon) ..addEquippedOffset(axe) ..addHp(hp) ..addMana(mana) ..addPos(vec3Builder.finish(1.0, 2.0, 3.0)) ..addPathOffset(path) ..addColor(myGame.Color.Red); final int orc = monster.finish(); // -Or- using the ObjectBuilder API: // Set his hit points to 300 and his mana to 150. final int hp = 300; final int mana = 150; // Note that these parameters are optional - it is not necessary to set // all of them. // Also note that it is not necessary to `finish` the builder helpers above // - the generated code will automatically reuse offsets if the same object // is used in more than one place (e.g. the axe appearing in `weapons` and // `equipped`). final myGame.MonsterBuilder orcBuilder = new myGame.MonsterBuilder( name: name, inventory: treasure, weapons: weaps, equippedType: myGame.EquipmentTypeId.Weapon, equipped: axe, path: path, hp: hp, mana: mana, pos: new myGame.Vec3Builder(x: 1.0, y: 2.0, z: 3.0), color: myGame.Color.Red, path: [ new myGame.Vec3ObjectBuilder(x: 1.0, y: 2.0, z: 3.0), new myGame.Vec3ObjectBuilder(x: 4.0, y: 5.0, z: 6.0) ]); final int orc = orcBuilder.finish(builder); ~~~
~~~{.lua} -- Create our monster by using Start() andEnd() monster.Start(builder) monster.AddPos(builder, vec3.CreateVec3(builder, 1.0, 2.0, 3.0)) monster.AddHp(builder, 300) monster.AddName(builder, name) monster.AddInventory(builder, inv) monster.AddColor(builder, color.Red) monster.AddWeapons(builder, weapons) monster.AddEquippedType(builder, equipment.Weapon) monster.AddEquipped(builder, axe) monster.AddPath(builder, path) local orc = monster.End(builder) ~~~
~~~{.lobster} let orc = MyGame_Sample_MonsterBuilder { b } .start() .add_pos(b.MyGame_Sample_CreateVec3(1.0, 2.0, 3.0)) .add_hp(300) .add_name(name) .add_inventory(inv) .add_color(MyGame_Sample_Color_Red) .add_weapons(weapons) .add_equipped_type(MyGame_Sample_Equipment_Weapon) .add_equipped(weapon_offsets[1]) .add_path(path) .end() ~~~
~~~{.rs} // Create the monster using the `Monster::create` helper function. This // function accepts a `MonsterArgs` struct, which supplies all of the data // needed to build a `Monster`. To supply empty/default fields, just use the // Rust built-in `Default::default()` function, as demonstrated below. let orc = Monster::create(&mut builder, &MonsterArgs{ pos: Some(&Vec3::new(1.0f32, 2.0f32, 3.0f32)), mana: 150, hp: 80, name: Some(name), inventory: Some(inventory), color: Color::Red, weapons: Some(weapons), equipped_type: Equipment::Weapon, equipped: Some(axe.as_union_value()), path: Some(path), ..Default::default() }); ~~~
~~~{.swift} let orc = Monster.createMonster( &builder, pos: MyGame_Sample_Vec3(x: 1, y: 2, z: 3), hp: 300, nameOffset: name, inventoryVectorOffset: inventoryOffset, color: .red, weaponsVectorOffset: weaponsOffset, equippedType: .weapon, equippedOffset: axe) ~~~
Note how we create `Vec3` struct in-line in the table. Unlike tables, structs are simple combinations of scalars that are always stored inline, just like scalars themselves. **Important**: Unlike structs, you should not nest tables or other objects, which is why we created all the strings/vectors/tables that this monster refers to before `start`. If you try to create any of them between `start` and `end`, you will get an assert/exception/panic depending on your language. *Note: Since we are passing `150` as the `mana` field, which happens to be the default value, the field will not actually be written to the buffer, since the default value will be returned on query anyway. This is a nice space savings, especially if default values are common in your data. It also means that you do not need to be worried about adding a lot of fields that are only used in a small number of instances, as it will not bloat the buffer if unused.*

If you do not wish to set every field in a `table`, it may be more convenient to manually set each field of your monster, instead of calling `CreateMonster()`. The following snippet is functionally equivalent to the above code, but provides a bit more flexibility.
~~~{.cpp} // You can use this code instead of `CreateMonster()`, to create our orc // manually. MonsterBuilder monster_builder(builder); monster_builder.add_pos(&position); monster_builder.add_hp(hp); monster_builder.add_name(name); monster_builder.add_inventory(inventory); monster_builder.add_color(Color_Red); monster_builder.add_weapons(weapons); monster_builder.add_equipped_type(Equipment_Weapon); monster_builder.add_equipped(axe.Union()); auto orc = monster_builder.Finish(); ~~~
If you do not wish to set every field in a `table`, it may be more convenient to manually set each field of your monster, instead of calling `create_monster_as_root()`. The following snippet is functionally equivalent to the above code, but provides a bit more flexibility.
~~~{.c} // It is important to pair `start_as_root` with `end_as_root`. ns(Monster_start_as_root(B)); ns(Monster_pos_create(B, 1.0f, 2.0f, 3.0f)); // or alternatively //ns(Monster_pos_add(&pos); ns(Monster_hp_add(B, hp)); // Notice that `Monser_name_add` adds a string reference unlike the // add_str and add_strn variants. ns(Monster_name_add(B, name)); ns(Monster_inventory_add(B, inventory)); ns(Monster_color_add(B, ns(Color_Red))); ns(Monster_weapons_add(B, weapons)); ns(Monster_equipped_add(B, equipped)); // Complete the monster object and make it the buffer root object. ns(Monster_end_as_root(B)); ~~~
~~~{.swift} let start = Monster.startMonster(&builder) Monster.add(pos: Vec3(x: 1, y: 2, z: 3), &builder) Monster.add(hp: 300, &builder) Monster.add(name: name, &builder) Monster.addVectorOf(inventory: inventoryOffset, &builder) Monster.add(color: .red, &builder) Monster.addVectorOf(weapons: weaponsOffset, &builder) Monster.add(equippedType: .weapon, &builder) Monster.add(equipped: axe, &builder) var orc = Monster.endMonster(&builder, start: start) ~~~
Before finishing the serialization, let's take a quick look at FlatBuffer `union Equipped`. There are two parts to each FlatBuffer `union`. The first is a hidden field `_type` that is generated to hold the type of `table` referred to by the `union`. This allows you to know which type to cast to at runtime. Second is the `union`'s data. In our example, the last two things we added to our `Monster` were the `Equipped Type` and the `Equipped` union itself. Here is a repetition of these lines, to help highlight them more clearly:
~~~{.cpp} monster_builder.add_equipped_type(Equipment_Weapon); // Union type monster_builder.add_equipped(axe.Union()); // Union data ~~~
~~~{.java} Monster.addEquippedType(builder, Equipment.Weapon); // Union type Monster.addEquipped(axe); // Union data ~~~
~~~{.kt} Monster.addEquippedType(builder, Equipment.Weapon) // Union type Monster.addEquipped(axe) // Union data ~~~
~~~{.cs} Monster.AddEquippedType(builder, Equipment.Weapon); // Union type Monster.AddEquipped(builder, axe.Value); // Union data ~~~
~~~{.go} sample.MonsterAddEquippedType(builder, sample.EquipmentWeapon) // Union type sample.MonsterAddEquipped(builder, axe) // Union data ~~~
~~~{.py} MyGame.Sample.Monster.AddEquippedType( # Union type builder, MyGame.Sample.Equipment.Equipment().Weapon) MyGame.Sample.Monster.AddEquipped(builder, axe) # Union data ~~~
~~~{.js} MyGame.Sample.Monster.addEquippedType(builder, MyGame.Sample.Equipment.Weapon); // Union type MyGame.Sample.Monster.addEquipped(builder, axe); // Union data ~~~
~~~{.ts} MyGame.Sample.Monster.addEquippedType(builder, MyGame.Sample.Equipment.Weapon); // Union type MyGame.Sample.Monster.addEquipped(builder, axe); // Union data ~~~
~~~{.php} \MyGame\Sample\Monster::AddEquippedType($builder, \MyGame\Sample\Equipment::Weapon); // Union type \MyGame\Sample\Monster::AddEquipped($builder, $axe); // Union data ~~~
~~~{.c} // Add union type and data simultaneously. ns(Monster_equipped_Weapon_add(B, axe)); ~~~
~~~{.dart} // using the builder API: ..addEquippedType(myGame.EquipmentTypeId.Weapon) ..addEquippedOffset(axe) // in the ObjectBuilder API: equippedTypeId: myGame.EquipmentTypeId.Weapon, // Union type equipped: axe, // Union data ~~~
~~~{.lua} monster.AddEquippedType(builder, equipment.Weapon) -- Union type monster.AddEquipped(builder, axe) -- Union data ~~~
~~~{.lobster} .add_equipped_type(MyGame_Sample_Equipment_Weapon) .add_equipped(axe) ~~~
~~~{.rs} // You need to call `as_union_value` to turn an object into a type that // can be used as a union value. monster_builder.add_equipped_type(Equipment::Weapon); // Union type monster_builder.add_equipped(axe.as_union_value()); // Union data ~~~
~~~{.swift} Monster.add(equippedType: .weapon, builder) // Type of union Monster.add(equipped: axe, builder) // Union data ~~~
After you have created your buffer, you will have the offset to the root of the data in the `orc` variable, so you can finish the buffer by calling the appropriate `finish` method.
~~~{.cpp} // Call `Finish()` to instruct the builder that this monster is complete. // Note: Regardless of how you created the `orc`, you still need to call // `Finish()` on the `FlatBufferBuilder`. builder.Finish(orc); // You could also call `FinishMonsterBuffer(builder, orc);`. ~~~
~~~{.java} // Call `finish()` to instruct the builder that this monster is complete. builder.finish(orc); // You could also call `Monster.finishMonsterBuffer(builder, orc);`. ~~~
~~~{.kt} // Call `finish()` to instruct the builder that this monster is complete. builder.finish(orc) // You could also call `Monster.finishMonsterBuffer(builder, orc);`. ~~~
~~~{.cs} // Call `Finish()` to instruct the builder that this monster is complete. builder.Finish(orc.Value); // You could also call `Monster.FinishMonsterBuffer(builder, orc);`. ~~~
~~~{.go} // Call `Finish()` to instruct the builder that this monster is complete. builder.Finish(orc) ~~~
~~~{.py} # Call `Finish()` to instruct the builder that this monster is complete. builder.Finish(orc) ~~~
~~~{.js} // Call `finish()` to instruct the builder that this monster is complete. builder.finish(orc); // You could also call `MyGame.Sample.Monster.finishMonsterBuffer(builder, orc);`. ~~~
~~~{.ts} // Call `finish()` to instruct the builder that this monster is complete. builder.finish(orc); // You could also call `MyGame.Sample.Monster.finishMonsterBuffer(builder, orc);`. ~~~
~~~{.php} // Call `finish()` to instruct the builder that this monster is complete. $builder->finish($orc); // You may also call `\MyGame\Sample\Monster::FinishMonsterBuffer($builder, $orc);`. ~~~
~~~{.c} // Because we used `Monster_create_as_root`, we do not need a `finish` call in C`. ~~~
~~~{.dart} // Call `finish()` to instruct the builder that this monster is complete. // See the next code section, as in Dart `finish` will also return the byte array. ~~~
~~~{.lua} -- Call 'Finish()' to instruct the builder that this monster is complete. builder:Finish(orc) ~~~
~~~{.lobster} // Call `Finish()` to instruct the builder that this monster is complete. builder.Finish(orc) ~~~
~~~{.rs} // Call `finish()` to instruct the builder that this monster is complete. builder.finish(orc, None); ~~~
~~~{.swift} // Call `finish(offset:)` to instruct the builder that this monster is complete. builder.finish(offset: orc) ~~~
The buffer is now ready to be stored somewhere, sent over the network, be compressed, or whatever you'd like to do with it. You can access the buffer like so:
~~~{.cpp} // This must be called after `Finish()`. uint8_t *buf = builder.GetBufferPointer(); int size = builder.GetSize(); // Returns the size of the buffer that // `GetBufferPointer()` points to. ~~~
~~~{.java} // This must be called after `finish()`. java.nio.ByteBuffer buf = builder.dataBuffer(); // The data in this ByteBuffer does NOT start at 0, but at buf.position(). // The number of bytes is buf.remaining(). // Alternatively this copies the above data out of the ByteBuffer for you: byte[] buf = builder.sizedByteArray(); ~~~
~~~{.kt} // This must be called after `finish()`. val buf = builder.dataBuffer() // The data in this ByteBuffer does NOT start at 0, but at buf.position(). // The number of bytes is buf.remaining(). // Alternatively this copies the above data out of the ByteBuffer for you: val buf = builder.sizedByteArray() ~~~
~~~{.cs} // This must be called after `Finish()`. var buf = builder.DataBuffer; // Of type `FlatBuffers.ByteBuffer`. // The data in this ByteBuffer does NOT start at 0, but at buf.Position. // The end of the data is marked by buf.Length, so the size is // buf.Length - buf.Position. // Alternatively this copies the above data out of the ByteBuffer for you: byte[] buf = builder.SizedByteArray(); ~~~
~~~{.go} // This must be called after `Finish()`. buf := builder.FinishedBytes() // Of type `byte[]`. ~~~
~~~{.py} # This must be called after `Finish()`. buf = builder.Output() // Of type `bytearray`. ~~~
~~~{.js} // This must be called after `finish()`. var buf = builder.asUint8Array(); // Of type `Uint8Array`. ~~~
~~~{.ts} // This must be called after `finish()`. let buf = builder.asUint8Array(); // Of type `Uint8Array`. ~~~
~~~{.php} // This must be called after `finish()`. $buf = $builder->dataBuffer(); // Of type `Google\FlatBuffers\ByteBuffer` // The data in this ByteBuffer does NOT start at 0, but at buf->getPosition(). // The end of the data is marked by buf->capacity(), so the size is // buf->capacity() - buf->getPosition(). ~~~
~~~{.c} uint8_t *buf; size_t size; // Allocate and extract a readable buffer from internal builder heap. // The returned buffer must be deallocated using `free`. // NOTE: Finalizing the buffer does NOT change the builder, it // just creates a snapshot of the builder content. buf = flatcc_builder_finalize_buffer(B, &size); // use buf free(buf); // Optionally reset builder to reuse builder without deallocating // internal stack and heap. flatcc_builder_reset(B); // build next buffer. // ... // Cleanup. flatcc_builder_clear(B); ~~~
~~~{.dart} final Uint8List buf = builder.finish(orc); ~~~
~~~{.lua} -- Get the flatbuffer as a string containing the binary data local bufAsString = builder:Output() ~~~
~~~{.lobster} // This must be called after `Finish()`. let buf = builder.SizedCopy() // Of type `string`. ~~~
~~~{.rs} // This must be called after `finish()`. // `finished_data` returns a byte slice. let buf = builder.finished_data(); // Of type `&[u8]` ~~~
~~~{.swift} // This must be called after `finish()`. // `sizedByteArray` returns the finished buf of type [UInt8]. let buf = builder.sizedByteArray // or you can use to get an object of type Data let bufData = ByteBuffer(data: builder.data) ~~~
Now you can write the bytes to a file or send them over the network. **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, which will lead to hard to find problems when you read the buffer.
For example, in Node you can simply do: ~~~{.js} writeFileSync('monster.bin', buf, 'binary'); ~~~
For example, in Node you can simply do: ~~~{.ts} writeFileSync('monster.bin', buf, 'binary'); ~~~
#### Reading Orc FlatBuffers Now that we have successfully created an `Orc` FlatBuffer, the monster data can be saved, sent over a network, etc. Let's now adventure into the inverse, and access a FlatBuffer. This section requires the same import/include, namespace, etc. requirements as before:
~~~{.cpp} #include "monster_generated.h" // This was generated by `flatc`. using namespace MyGame::Sample; // Specified in the schema. ~~~
~~~{.java} import MyGame.Sample.*; //The `flatc` generated files. (Monster, Vec3, etc.) import com.google.flatbuffers.FlatBufferBuilder; ~~~
~~~{.kt} import MyGame.Sample.* //The `flatc` generated files. (Monster, Vec3, etc.) import com.google.flatbuffers.FlatBufferBuilder ~~~
~~~{.cs} using Google.FlatBuffers; using MyGame.Sample; // The `flatc` generated files. (Monster, Vec3, etc.) ~~~
~~~{.go} import ( flatbuffers "github.com/google/flatbuffers/go" sample "MyGame/Sample" ) ~~~
~~~{.py} import flatbuffers # Generated by `flatc`. import MyGame.Sample.Any import MyGame.Sample.Color import MyGame.Sample.Monster import MyGame.Sample.Vec3 ~~~
~~~{.js} // The following code is an example - use your desired module flavor by transpiling from TS. var flatbuffers = require('/js/flatbuffers').flatbuffers; var MyGame = require('./monster_generated').MyGame; // Generated by `flatc`. //--------------------------------------------------------------------------// // The following code an example for browser-based HTML/JavaScript. Use the above code // for JavaScript module loaders (e.g. Node.js). // Generated by `flatc`. ~~~
~~~{.ts} // note: import flatbuffers with your desired import method // note: the `./monster_generated.js` file was previously generated by `flatc` above using the `monster.fbs` schema import { MyGame } from './monster_generated'; ~~~
~~~{.php} // It is recommended that your use PSR autoload when using FlatBuffers in PHP. // Here is an example from `SampleBinary.php`: function __autoload($class_name) { // The last segment of the class name matches the file name. $class = substr($class_name, strrpos($class_name, "\\") + 1); $root_dir = join(DIRECTORY_SEPARATOR, array(dirname(dirname(__FILE__)))); // `flatbuffers` root. // Contains the `*.php` files for the FlatBuffers library and the `flatc` generated files. $paths = array(join(DIRECTORY_SEPARATOR, array($root_dir, "php")), join(DIRECTORY_SEPARATOR, array($root_dir, "samples", "MyGame", "Sample"))); foreach ($paths as $path) { $file = join(DIRECTORY_SEPARATOR, array($path, $class . ".php")); if (file_exists($file)) { require($file); break; } } } ~~~
~~~{.c} // Only needed if we don't have `#include "monster_builder.h"`. #include "monster_reader.h" #undef ns #define ns(x) FLATBUFFERS_WRAP_NAMESPACE(MyGame_Sample, x) // Specified in the schema. ~~~
~~~{.dart} import 'package:flat_buffers/flat_buffers.dart' as fb; import './monster_my_game.sample_generated.dart' as myGame; ~~~
~~~{.lua} -- require the flatbuffers module local flatbuffers = require("flatbuffers") -- require the generated files from `flatc`. local color = require("MyGame.Sample.Color") local equipment = require("MyGame.Sample.Equipment") local monster = require("MyGame.Sample.Monster") local vec3 = require("MyGame.Sample.Vec3") local weapon = require("MyGame.Sample.Weapon") ~~~
~~~{.lobster} import from "../lobster/" // Where to find flatbuffers.lobster import monster_generated ~~~
~~~{.rs} // import the flatbuffers runtime library extern crate flatbuffers; // import the generated code #[allow(dead_code, unused_imports)] #[path = "./monster_generated.rs"] mod monster_generated; pub use monster_generated::my_game::sample::{root_as_monster, Color, Equipment, Monster, MonsterArgs, Vec3, Weapon, WeaponArgs}; ~~~
Then, assuming you have a buffer of bytes received from disk, network, etc., you can start accessing the buffer like so: **Again, make sure you read the bytes in BINARY mode, otherwise the code below won't work.**
~~~{.cpp} uint8_t *buffer_pointer = /* the data you just read */; // Get a pointer to the root object inside the buffer. auto monster = GetMonster(buffer_pointer); // `monster` is of type `Monster *`. // Note: root object pointers are NOT the same as `buffer_pointer`. // `GetMonster` is a convenience function that calls `GetRoot`, // the latter is also available for non-root types. ~~~
~~~{.java} byte[] bytes = /* the data you just read */ java.nio.ByteBuffer buf = java.nio.ByteBuffer.wrap(bytes); // Get an accessor to the root object inside the buffer. Monster monster = Monster.getRootAsMonster(buf); ~~~
~~~{.kt} val bytes = /* the data you just read */ val buf = java.nio.ByteBuffer.wrap(bytes) // Get an accessor to the root object inside the buffer. Monster monster = Monster.getRootAsMonster(buf) ~~~
~~~{.cs} byte[] bytes = /* the data you just read */ var buf = new ByteBuffer(bytes); // Get an accessor to the root object inside the buffer. var monster = Monster.GetRootAsMonster(buf); ~~~
~~~{.go} var buf []byte = /* the data you just read */ // Get an accessor to the root object inside the buffer. monster := sample.GetRootAsMonster(buf, 0) // Note: We use `0` for the offset here, which is typical for most buffers // you would read. If you wanted to read from `builder.Bytes` directly, you // would need to pass in the offset of `builder.Head()`, as the builder // constructs the buffer backwards, so may not start at offset 0. ~~~
~~~{.py} buf = /* the data you just read, in an object of type "bytearray" */ // Get an accessor to the root object inside the buffer. monster = MyGame.Sample.Monster.Monster.GetRootAs(buf, 0) # Note: We use `0` for the offset here, which is typical for most buffers # you would read. If you wanted to read from the `builder.Bytes` directly, # you would need to pass in the offset of `builder.Head()`, as the builder # constructs the buffer backwards, so may not start at offset 0. ~~~
~~~{.js} // the data you just read, as a `Uint8Array` // Note that the example here uses `readFileSync` from the built-in `fs` module, // but other methods for accessing the file contents will also work. var bytes = new Uint8Array(readFileSync('./monsterdata.bin')); var buf = new flatbuffers.ByteBuffer(bytes); // Get an accessor to the root object inside the buffer. var monster = MyGame.Sample.Monster.getRootAsMonster(buf); ~~~
~~~{.ts} // the data you just read, as a `Uint8Array`. // Note that the example here uses `readFileSync` from the built-in `fs` module, // but other methods for accessing the file contents will also work. let bytes = new Uint8Array(readFileSync('./monsterdata.bin')); let buf = new flatbuffers.ByteBuffer(bytes); // Get an accessor to the root object inside the buffer. let monster = MyGame.Sample.Monster.getRootAsMonster(buf); ~~~
~~~{.php} $bytes = /* the data you just read, in a string */ $buf = Google\FlatBuffers\ByteBuffer::wrap($bytes); // Get an accessor to the root object inside the buffer. $monster = \MyGame\Sample\Monster::GetRootAsMonster($buf); ~~~
~~~{.c} // Note that we use the `table_t` suffix when reading a table object // as opposed to the `ref_t` suffix used during the construction of // the buffer. ns(Monster_table_t) monster = ns(Monster_as_root(buffer)); // Note: root object pointers are NOT the same as the `buffer` pointer. ~~~
~~~{.dart} List data = ... // the data, e.g. from file or network // A generated factory constructor that will read the data. myGame.Monster monster = new myGame.Monster(data); ~~~
~~~{.lua} local bufAsString = -- The data you just read in -- Convert the string representation into binary array Lua structure local buf = flatbuffers.binaryArray.New(bufAsString) -- Get an accessor to the root object insert the buffer local mon = monster.GetRootAsMonster(buf, 0) ~~~
~~~{.lobster} buf = /* the data you just read, in a string */ // Get an accessor to the root object inside the buffer. let monster = MyGame_Sample_GetRootAsMonster(buf) ~~~
~~~{.rs} let buf = /* the data you just read, in a &[u8] */ // Get an accessor to the root object inside the buffer. let monster = root_as_monster(buf).unwrap(); ~~~
~~~{.swift} // create a ByteBuffer(:) from an [UInt8] or Data() var buf = // Get your data // Get an accessor to the root object inside the buffer. let monster: Monster = try! getCheckedRoot(byteBuffer: &byteBuffer) // let monster: Monster = getRoot(byteBuffer: &byteBuffer) ~~~
If you look in the generated files from the schema compiler, you will see it generated accessors for all non-`deprecated` fields. For example:
~~~{.cpp} auto hp = monster->hp(); auto mana = monster->mana(); auto name = monster->name()->c_str(); ~~~
~~~{.java} short hp = monster.hp(); short mana = monster.mana(); String name = monster.name(); ~~~
~~~{.kt} val hp = monster.hp val mana = monster.mana val name = monster.name ~~~
~~~{.cs} // For C#, unlike most other languages support by FlatBuffers, most values (except for // vectors and unions) are available as properties instead of accessor methods. var hp = monster.Hp var mana = monster.Mana var name = monster.Name ~~~
~~~{.go} hp := monster.Hp() mana := monster.Mana() name := string(monster.Name()) // Note: `monster.Name()` returns a byte[]. ~~~
~~~{.py} hp = monster.Hp() mana = monster.Mana() name = monster.Name() ~~~
~~~{.js} var hp = monster.hp(); var mana = monster.mana(); var name = monster.name(); ~~~
~~~{.ts} let hp = monster.hp(); let mana = monster.mana(); let name = monster.name(); ~~~
~~~{.php} $hp = $monster->getHp(); $mana = $monster->getMana(); $name = monster->getName(); ~~~
~~~{.c} uint16_t hp = ns(Monster_hp(monster)); uint16_t mana = ns(Monster_mana(monster)); flatbuffers_string_t name = ns(Monster_name(monster)); ~~~
~~~{.dart} // For Dart, unlike other languages support by FlatBuffers, most values // are available as properties instead of accessor methods. var hp = monster.hp; var mana = monster.mana; var name = monster.name; ~~~
~~~{.lua} local hp = mon:Hp() local mana = mon:Mana() local name = mon:Name() ~~~
~~~{.lobster} let hp = monster.hp let mana = monster.mana let name = monster.name ~~~
~~~{.rs} // Get and test some scalar types from the FlatBuffer. let hp = monster.hp(); let mana = monster.mana(); let name = monster.name(); ~~~
~~~{.swift} let hp = monster.hp let mana = monster.mana let name = monster.name // returns an optional string ~~~
These should hold `300`, `150`, and `"Orc"` respectively. *Note: The default value `150` wasn't stored in `mana`, but we are still able to retrieve it.* To access sub-objects, in the case of our `pos`, which is a `Vec3`:
~~~{.cpp} auto pos = monster->pos(); auto x = pos->x(); auto y = pos->y(); auto z = pos->z(); ~~~
~~~{.java} Vec3 pos = monster.pos(); float x = pos.x(); float y = pos.y(); float z = pos.z(); ~~~
~~~{.kt} val pos = monster.pos!! val x = pos.x val y = pos.y val z = pos.z ~~~
~~~{.cs} var pos = monster.Pos.Value; var x = pos.X; var y = pos.Y; var z = pos.Z; ~~~
~~~{.go} pos := monster.Pos(nil) x := pos.X() y := pos.Y() z := pos.Z() // Note: Whenever you access a new object, like in `Pos()`, a new temporary // accessor object gets created. If your code is very performance sensitive, // you can pass in a pointer to an existing `Vec3` instead of `nil`. This // allows you to reuse it across many calls to reduce the amount of object // allocation/garbage collection. ~~~
~~~{.py} pos = monster.Pos() x = pos.X() y = pos.Y() z = pos.Z() ~~~
~~~{.js} var pos = monster.pos(); var x = pos.x(); var y = pos.y(); var z = pos.z(); ~~~
~~~{.ts} let pos = monster.pos(); let x = pos.x(); let y = pos.y(); let z = pos.z(); ~~~
~~~{.php} $pos = $monster->getPos(); $x = $pos->getX(); $y = $pos->getY(); $z = $pos->getZ(); ~~~
~~~{.c} ns(Vec3_struct_t) pos = ns(Monster_pos(monster)); float x = ns(Vec3_x(pos)); float y = ns(Vec3_y(pos)); float z = ns(Vec3_z(pos)); ~~~
~~~{.dart} myGame.Vec3 pos = monster.pos; double x = pos.x; double y = pos.y; double z = pos.z; ~~~
~~~{.lua} local pos = mon:Pos() local x = pos:X() local y = pos:Y() local z = pos:Z() ~~~
~~~{.lobster} let pos = monster.pos let x = pos.x let y = pos.y let z = pos.z ~~~
~~~{.rs} let pos = monster.pos().unwrap(); let x = pos.x(); let y = pos.y(); let z = pos.z(); ~~~
~~~{.swift} let pos = monster.pos let x = pos.x let y = pos.y let z = pos.z ~~~
`x`, `y`, and `z` will contain `1.0`, `2.0`, and `3.0`, respectively. *Note: Had we not set `pos` during serialization, it would be a `null`-value.* Similarly, we can access elements of the inventory `vector` by indexing it. You can also iterate over the length of the array/vector representing the FlatBuffers `vector`.
~~~{.cpp} auto inv = monster->inventory(); // A pointer to a `flatbuffers::Vector<>`. auto inv_len = inv->size(); auto third_item = inv->Get(2); ~~~
~~~{.java} int invLength = monster.inventoryLength(); byte thirdItem = monster.inventory(2); ~~~
~~~{.kotlin} val invLength = monster.inventoryLength val thirdItem = monster.inventory(2)!! ~~~
~~~{.cs} int invLength = monster.InventoryLength; var thirdItem = monster.Inventory(2); ~~~
~~~{.go} invLength := monster.InventoryLength() thirdItem := monster.Inventory(2) ~~~
~~~{.py} inv_len = monster.InventoryLength() third_item = monster.Inventory(2) ~~~
~~~{.js} var invLength = monster.inventoryLength(); var thirdItem = monster.inventory(2); ~~~
~~~{.ts} let invLength = monster.inventoryLength(); let thirdItem = monster.inventory(2); ~~~
~~~{.php} $inv_len = $monster->getInventoryLength(); $third_item = $monster->getInventory(2); ~~~
~~~{.c} // If `inv` hasn't been set, it will be null. It is valid get // the length of null which will be 0, useful for iteration. flatbuffers_uint8_vec_t inv = ns(Monster_inventory(monster)); size_t inv_len = flatbuffers_uint8_vec_len(inv); ~~~
~~~{.dart} int invLength = monster.inventory.length; var thirdItem = monster.inventory[2]; ~~~
~~~{.lua} local invLength = mon:InventoryLength() local thirdItem = mon:Inventory(3) -- Lua is 1-based ~~~
~~~{.lobster} let inv_len = monster.inventory_length let third_item = monster.inventory(2) ~~~
~~~{.rs} // Get and test an element from the `inventory` FlatBuffer's `vector`. let inv = monster.inventory().unwrap(); // Note that this vector is returned as a slice, because direct access for // this type, a `u8` vector, is safe on all platforms: let third_item = inv[2]; ~~~
~~~{.swift} // Get a the count of objects in the vector let count = monster.inventoryCount // get item at index 4 let object = monster.inventory(at: 4) // or you can fetch the entire array let inv = monster.inventory // inv[4] should equal object ~~~
For `vector`s of `table`s, you can access the elements like any other vector, except you need to handle the result as a FlatBuffer `table`:
~~~{.cpp} auto weapons = monster->weapons(); // A pointer to a `flatbuffers::Vector<>`. auto weapon_len = weapons->size(); auto second_weapon_name = weapons->Get(1)->name()->str(); auto second_weapon_damage = weapons->Get(1)->damage() ~~~
~~~{.java} int weaponsLength = monster.weaponsLength(); String secondWeaponName = monster.weapons(1).name(); short secondWeaponDamage = monster.weapons(1).damage(); ~~~
~~~{.kt} val weaponsLength = monster.weaponsLength val secondWeaponName = monster.weapons(1)!!.name val secondWeaponDamage = monster.weapons(1)!!.damage ~~~
~~~{.cs} int weaponsLength = monster.WeaponsLength; var secondWeaponName = monster.Weapons(1).Name; var secondWeaponDamage = monster.Weapons(1).Damage; ~~~
~~~{.go} weaponLength := monster.WeaponsLength() weapon := new(sample.Weapon) // We need a `sample.Weapon` to pass into `monster.Weapons()` // to capture the output of the function. if monster.Weapons(weapon, 1) { secondWeaponName := weapon.Name() secondWeaponDamage := weapon.Damage() } ~~~
~~~{.py} weapons_length = monster.WeaponsLength() second_weapon_name = monster.Weapons(1).Name() second_weapon_damage = monster.Weapons(1).Damage() ~~~
~~~{.js} var weaponsLength = monster.weaponsLength(); var secondWeaponName = monster.weapons(1).name(); var secondWeaponDamage = monster.weapons(1).damage(); ~~~
~~~{.ts} let weaponsLength = monster.weaponsLength(); let secondWeaponName = monster.weapons(1).name(); let secondWeaponDamage = monster.weapons(1).damage(); ~~~
~~~{.php} $weapons_len = $monster->getWeaponsLength(); $second_weapon_name = $monster->getWeapons(1)->getName(); $second_weapon_damage = $monster->getWeapons(1)->getDamage(); ~~~
~~~{.c} ns(Weapon_vec_t) weapons = ns(Monster_weapons(monster)); size_t weapons_len = ns(Weapon_vec_len(weapons)); // We can use `const char *` instead of `flatbuffers_string_t`. const char *second_weapon_name = ns(Weapon_name(ns(Weapon_vec_at(weapons, 1)))); uint16_t second_weapon_damage = ns(Weapon_damage(ns(Weapon_vec_at(weapons, 1)))); ~~~
~~~{.dart} int weaponsLength = monster.weapons.length; var secondWeaponName = monster.weapons[1].name; var secondWeaponDamage = monster.Weapons[1].damage; ~~~
~~~{.lua} local weaponsLength = mon:WeaponsLength() local secondWeaponName = mon:Weapon(2):Name() local secondWeaponDamage = mon:Weapon(2):Damage() ~~~
~~~{.lobster} let weapons_length = monster.weapons_length let second_weapon_name = monster.weapons(1).name let second_weapon_damage = monster.weapons(1).damage ~~~
~~~{.rs} // Get and test the `weapons` FlatBuffers's `vector`. let weps = monster.weapons().unwrap(); let weps_len = weps.len(); let wep2 = weps.get(1); let second_weapon_name = wep2.name(); let second_weapon_damage = wep2.damage(); ~~~
~~~{.swift} // Get the count of weapon objects let wepsCount = monster.weaponsCount let weapon2 = monster.weapons(at: 1) let weaponName = weapon2.name let weaponDmg = weapon2.damage ~~~
Last, we can access our `Equipped` FlatBuffer `union`. Just like when we created the `union`, we need to get both parts of the `union`: the type and the data. We can access the type to dynamically cast the data as needed (since the `union` only stores a FlatBuffer `table`).
~~~{.cpp} auto union_type = monster->equipped_type(); if (union_type == Equipment_Weapon) { auto weapon = static_cast(monster->equipped()); // Requires `static_cast` // to type `const Weapon*`. auto weapon_name = weapon->name()->str(); // "Axe" auto weapon_damage = weapon->damage(); // 5 } ~~~
~~~{.java} int unionType = monster.EquippedType(); if (unionType == Equipment.Weapon) { Weapon weapon = (Weapon)monster.equipped(new Weapon()); // Requires explicit cast // to `Weapon`. String weaponName = weapon.name(); // "Axe" short weaponDamage = weapon.damage(); // 5 } ~~~
~~~{.kt} val unionType = monster.EquippedType if (unionType == Equipment.Weapon) { val weapon = monster.equipped(Weapon()) as Weapon // Requires explicit cast // to `Weapon`. val weaponName = weapon.name // "Axe" val weaponDamage = weapon.damage // 5 } ~~~
~~~{.cs} var unionType = monster.EquippedType; if (unionType == Equipment.Weapon) { var weapon = monster.Equipped().Value; var weaponName = weapon.Name; // "Axe" var weaponDamage = weapon.Damage; // 5 } ~~~
~~~{.go} // We need a `flatbuffers.Table` to capture the output of the // `monster.Equipped()` function. unionTable := new(flatbuffers.Table) if monster.Equipped(unionTable) { unionType := monster.EquippedType() if unionType == sample.EquipmentWeapon { // Create a `sample.Weapon` object that can be initialized with the contents // of the `flatbuffers.Table` (`unionTable`), which was populated by // `monster.Equipped()`. unionWeapon = new(sample.Weapon) unionWeapon.Init(unionTable.Bytes, unionTable.Pos) weaponName = unionWeapon.Name() weaponDamage = unionWeapon.Damage() } } ~~~
~~~{.py} union_type = monster.EquippedType() if union_type == MyGame.Sample.Equipment.Equipment().Weapon: # `monster.Equipped()` returns a `flatbuffers.Table`, which can be used to # initialize a `MyGame.Sample.Weapon.Weapon()`. union_weapon = MyGame.Sample.Weapon.Weapon() union_weapon.Init(monster.Equipped().Bytes, monster.Equipped().Pos) weapon_name = union_weapon.Name() // 'Axe' weapon_damage = union_weapon.Damage() // 5 ~~~
~~~{.js} var unionType = monster.equippedType(); if (unionType == MyGame.Sample.Equipment.Weapon) { var weaponName = monster.equipped(new MyGame.Sample.Weapon()).name(); // 'Axe' var weaponDamage = monster.equipped(new MyGame.Sample.Weapon()).damage(); // 5 } ~~~
~~~{.ts} let unionType = monster.equippedType(); if (unionType == MyGame.Sample.Equipment.Weapon) { let weaponName = monster.equipped(new MyGame.Sample.Weapon()).name(); // 'Axe' let weaponDamage = monster.equipped(new MyGame.Sample.Weapon()).damage(); // 5 } ~~~
~~~{.php} $union_type = $monster->getEquippedType(); if ($union_type == \MyGame\Sample\Equipment::Weapon) { $weapon_name = $monster->getEquipped(new \MyGame\Sample\Weapon())->getName(); // "Axe" $weapon_damage = $monster->getEquipped(new \MyGame\Sample\Weapon())->getDamage(); // 5 } ~~~
~~~{.c} // Access union type field. if (ns(Monster_equipped_type(monster)) == ns(Equipment_Weapon)) { // Cast to appropriate type: // C allows for silent void pointer assignment, so we need no explicit cast. ns(Weapon_table_t) weapon = ns(Monster_equipped(monster)); const char *weapon_name = ns(Weapon_name(weapon)); // "Axe" uint16_t weapon_damage = ns(Weapon_damage(weapon)); // 5 } ~~~
~~~{.dart} var unionType = monster.equippedType.value; if (unionType == myGame.EquipmentTypeId.Weapon.value) { myGame.Weapon weapon = mon.equipped as myGame.Weapon; var weaponName = weapon.name; // "Axe" var weaponDamage = weapon.damage; // 5 } ~~~
~~~{.lua} local unionType = mon:EquippedType() if unionType == equipment.Weapon then local unionWeapon = weapon.New() unionWeapon:Init(mon:Equipped().bytes, mon:Equipped().pos) local weaponName = unionWeapon:Name() -- 'Axe' local weaponDamage = unionWeapon:Damage() -- 5 end ~~~
~~~{.lobster} union_type = monster.equipped_type if union_type == MyGame_Sample_Equipment_Weapon: // `monster.equipped_as_Weapon` returns a FlatBuffer handle much like normal table fields, // but this is only valid to call if we already know it is the correct type. let union_weapon = monster.equipped_as_Weapon let weapon_name = union_weapon.name // "Axe" let weapon_damage = union_weapon.damage // 5 ~~~
~~~{.rs} // Get and test the `Equipment` union (`equipped` field). // `equipped_as_weapon` returns a FlatBuffer handle much like normal table // fields, but this will return `None` if the union is not actually of that // type. if monster.equipped_type() == Equipment::Weapon { let equipped = monster.equipped_as_weapon().unwrap(); let weapon_name = equipped.name(); let weapon_damage = equipped.damage(); ~~~
~~~{.swift} // Get and check if the monster has an equipped item if monster.equippedType == .weapon { let _weapon = monster.equipped(type: Weapon.self) let name = _weapon.name // should return "Axe" let dmg = _weapon.damage // should return 5 } ~~~
## Mutating FlatBuffers As you saw above, typically once you have created a FlatBuffer, it is read-only from that moment on. There are, however, cases where you have just received a FlatBuffer, and you'd like to modify something about it before sending it on to another recipient. With the above functionality, you'd have to generate an entirely new FlatBuffer, while tracking what you modified in your own data structures. This is inconvenient. For this reason FlatBuffers can also be mutated in-place. While this is great for making small fixes to an existing buffer, you generally want to create buffers from scratch whenever possible, since it is much more efficient and the API is much more general purpose. To get non-const accessors, invoke `flatc` with `--gen-mutable`. Similar to how we read fields using the accessors above, we can now use the mutators like so:
~~~{.cpp} auto monster = GetMutableMonster(buffer_pointer); // non-const monster->mutate_hp(10); // Set the table `hp` field. monster->mutable_pos()->mutate_z(4); // Set struct field. monster->mutable_inventory()->Mutate(0, 1); // Set vector element. ~~~
~~~{.java} Monster monster = Monster.getRootAsMonster(buf); monster.mutateHp(10); // Set table field. monster.pos().mutateZ(4); // Set struct field. monster.mutateInventory(0, 1); // Set vector element. ~~~
~~~{.kt} val monster = Monster.getRootAsMonster(buf) monster.mutateHp(10) // Set table field. monster.pos!!.mutateZ(4) // Set struct field. monster.mutateInventory(0, 1) // Set vector element. ~~~
~~~{.cs} var monster = Monster.GetRootAsMonster(buf); monster.MutateHp(10); // Set table field. monster.Pos.MutateZ(4); // Set struct field. monster.MutateInventory(0, 1); // Set vector element. ~~~
~~~{.go} ~~~
~~~{.py} ~~~
~~~{.js} ~~~
~~~{.ts} ~~~
~~~{.php} ~~~
~~~{.c} ~~~
~~~{.dart} ~~~
~~~{.lua} ~~~
~~~{.lobster} ~~~
~~~{.rs} ~~~
~~~{.swift} let monster = Monster.getRootAsMonster(bb: ByteBuffer(bytes: buf)) monster.mutate(hp: 10) // mutates a value in a table /// to mutate structs in swift you have to use the mutable accessors monster.mutablePos.mutate(z: 4) // mutates a value in a struct monster.mutate(inventory: 6, at index: 0) // mutates a value in an Scalar array ~~~
We use the somewhat verbose term `mutate` instead of `set` to indicate that this is a special use case, not to be confused with the default way of constructing FlatBuffer data. After the above mutations, you can send on the FlatBuffer to a new recipient without any further work! Note that any `mutate` functions on a table will return a boolean, which is `false` if the field we're trying to set is not present in the buffer. Fields are not present if they weren't set, or even if they happen to be equal to the default value. For example, in the creation code above, the `mana` field is equal to `150`, which is the default value, so it was never stored in the buffer. Trying to call the corresponding `mutate` method for `mana` on such data will return `false`, and the value won't actually be modified! One way to solve this is to call `ForceDefaults` on a FlatBufferBuilder to force all fields you set to actually be written. This, of course, increases the size of the buffer somewhat, but this may be acceptable for a mutable buffer. If this is not sufficient, other ways of mutating FlatBuffers may be supported in your language through an object based API (`--gen-object-api`) or reflection. See the individual language documents for support. ## Using `flatc` as a JSON Conversion Tool If you are working with C, C++, or Lobster, you can parse JSON at runtime. If your language does not support JSON at the moment, `flatc` may provide an alternative. Using `flatc` is often the preferred method, as it doesn't require you to add any new code to your program. It is also efficient, since you can ship with the binary data. The drawback is that it requires an extra step for your users/developers to perform (although it may be able to be automated as part of your compilation). #### JSON to binary representation Let's say you have a JSON file that describes your monster. In this example, we will use the file `flatbuffers/samples/monsterdata.json`. Here are the contents of the file: ~~~{.json} { "pos": { "x": 1.0, "y": 2.0, "z": 3.0 }, "hp": 300, "name": "Orc", "weapons": [ { "name": "axe", "damage": 100 }, { "name": "bow", "damage": 90 } ], "equipped_type": "Weapon", "equipped": { "name": "bow", "damage": 90 } } ~~~ You can run this file through the `flatc` compiler with the `-b` flag and our `monster.fbs` schema to produce a FlatBuffer binary file. ~~~{.sh} ./../flatc --binary monster.fbs monsterdata.json ~~~ The output of this will be a file `monsterdata.bin`, which will contain the FlatBuffer binary representation of the contents from our `.json` file.
*Note: If you're working in C++, you can also parse JSON at runtime. See the [Use in C++](@ref flatbuffers_guide_use_cpp) section of the Programmer's Guide for more information.*
*Note: If you're working in C, the `flatcc --json` (not `flatc`) compiler will generate schema specific high performance json parsers and printers that you can compile and use at runtime. The `flatc` compiler (not `flatcc`) on the other hand, is still useful for general offline json to flatbuffer conversion from a given schema. There are no current plans for `flatcc` to support this.*
*Note: If you're working in Lobster, you can also parse JSON at runtime. See the [Use in Lobster](@ref flatbuffers_guide_use_lobster) section of the Programmer's Guide for more information.*
#### FlatBuffer binary to JSON Converting from a FlatBuffer binary representation to JSON is supported as well: ~~~{.sh} ./../flatc --json --raw-binary monster.fbs -- monsterdata.bin ~~~ This will convert `monsterdata.bin` back to its original JSON representation. You need to pass the corresponding FlatBuffers schema so that flatc knows how to interpret the binary buffer. Since `monster.fbs` does not specify an explicit `file_identifier` for binary buffers, `flatc` needs to be forced into reading the `.bin` file using the `--raw-binary` option. The FlatBuffer binary representation does not explicitly encode default values, therefore they are not present in the resulting JSON unless you specify `--defaults-json`. If you intend to process the JSON with other tools, you may consider switching on `--strict-json` so that identifiers are quoted properly. *Note: The resulting JSON file is not necessarily identical with the original JSON. If the binary representation contains floating point numbers, floats and doubles are rounded to 6 and 12 digits, respectively, in order to represent them as decimals in the JSON document.* ## Advanced Features for Each Language ### Vector of Unions Some languages support storing unions directly in a vector. ~~~ // File found in tests/union_vector/union_vector.fbs namespace Example.VectorOfUnions; // Demonstrates the ability to have vectors of unions, and also to // store structs and strings in unions. table Attacker { sword_attack_damage: int; } struct Rapunzel { hair_length: int; } struct BookReader { books_read: int; } union Character { MuLan: Attacker, // Can have name be different from type. Rapunzel, // Or just both the same, as before. Belle: BookReader, BookFan: BookReader, Other: string, Unused: string } table Movie { main_character: Character; characters: [Character]; } ~~~ #### Creating Analagously to how a union adds two fields to a table a vector of unions creates two different vectors: one for the union data and one for the data types.
C++ supports vectors of unions, but it isn't currently documented.
Typescript supports vectors of unions, but it isn't currently documented.
PHP supports vectors of unions, but it isn't currently documented.
Java supports vectors of unions, but it isn't currently documented.
~~~{.cs} using Google.FlatBuffers; using Example.VectorOfUnions; var fbb = new FlatBufferBuilder(100); var characterTypes = new[] { Character.MuLan, Character.Belle, Character.Other, }; var characterTypesOffset = Movie.CreateCharactersTypeVector(fbb, characterTypes); var characters = new[] { Attacker.CreateAttacker(fbb, 10).Value, BookReader.CreateBookReader(fbb, 20).Value, fbb.CreateSharedString("Chip").Value, }; var charactersOffset = Movie.CreateCharactersVector(fbb, characters); var movieOffset = Movie.CreateMovie( fbb, Character.Rapunzel, rapunzel, characterTypesOffset, charactersOffset); Movie.FinishMovieBuffer(fbb, movieOffset); ~~~
Kotlin supports vectors of unions, but it isn't currently documented.
Swift supports vectors of unions, but it isn't currently documented.
#### Reading
~~~{.cs} var movie = Movie.GetRootAsMovie(fbb.DataBuffer); for (var i = 0; i <= movie.CharactersLength; i++) { if (movie.CharactersType(i) == Character.MuLan) { var mulanSwordDamage = movie.Characters(i).Value.SwordAttackDamage; } else if (movie.CharactersType(i) == Character.Belle) { var belleBooksRead = movie.Characters(i).Value.BooksRead; } else if (movie.CharactersType(i) == Character.Other) { var otherStr = movie.CharactersAsString(i); } } ~~~
### Further Reading Each language has a dedicated `Use in XXX` page in the Programmer's Guide to cover the nuances of FlatBuffers in that language. For your chosen language, see:
[Use in C++](@ref flatbuffers_guide_use_cpp)
[Use in Java](@ref flatbuffers_guide_use_java)
[Use in Kotlin](@ref flatbuffers_guide_use_kotlin)
[Use in C#](@ref flatbuffers_guide_use_c-sharp)
[Use in Go](@ref flatbuffers_guide_use_go)
[Use in Python](@ref flatbuffers_guide_use_python)
[Use in JavaScript](@ref flatbuffers_guide_use_javascript)
[Use in TypeScript](@ref flatbuffers_guide_use_typescript)
[Use in PHP](@ref flatbuffers_guide_use_php)
[Use in C](@ref flatbuffers_guide_use_c)
[Use in Dart](@ref flatbuffers_guide_use_dart)
[Use in Lua](@ref flatbuffers_guide_use_lua)
[Use in Lobster](@ref flatbuffers_guide_use_lobster)
[Use in Rust](@ref flatbuffers_guide_use_rust)
[Use in Swift](@ref flatbuffers_guide_use_swift)

flatbuffers-24.12.23/docs/source/TypeScriptUsage.md000066400000000000000000000067211473234705300221330ustar00rootroot00000000000000Use in TypeScript {#flatbuffers_guide_use_typescript} ================= ## Before you get started Before diving into the FlatBuffers usage in TypeScript, it should be noted that the [Tutorial](@ref flatbuffers_guide_tutorial) page has a complete guide to general FlatBuffers usage in all of the supported languages (including TypeScript). This page is specifically designed to cover the nuances of FlatBuffers usage in TypeScript. You should also have read the [Building](@ref flatbuffers_guide_building) documentation to build `flatc` and should be familiar with [Using the schema compiler](@ref flatbuffers_guide_using_schema_compiler) and [Writing a schema](@ref flatbuffers_guide_writing_schema). ## FlatBuffers TypeScript library code location The code for the FlatBuffers TypeScript library can be found at https://www.npmjs.com/package/flatbuffers. ## Testing the FlatBuffers TypeScript library To run the tests, use the [TypeScriptTest.py](https://github.com/google/ flatbuffers/blob/master/tests/TypeScriptTest.py) Python3 script. *Note: The TypeScript test file requires [Node.js](https://nodejs.org/en/).* ## Using the FlatBuffers TypeScript library *Note: See [Tutorial](@ref flatbuffers_guide_tutorial) for a more in-depth example of how to use FlatBuffers in TypeScript.* FlatBuffers supports both reading and writing FlatBuffers in TypeScript. To use FlatBuffers in your own code, first generate TypeScript classes from your schema with the `--ts` option to `flatc`. Then you can include both FlatBuffers and the generated code to read or write a FlatBuffer. For example, here is how you would read a FlatBuffer binary file in TypeScript: First, include the library and generated code. Then read the file into an `Uint8Array`. Make a `flatbuffers.ByteBuffer` out of the `Uint8Array`, and pass the ByteBuffer to the `getRootAsMonster` function. ~~~{.ts} import * as flatbuffers from 'flatbuffers'; import { MyGame } from './monster_generated'; let data = new Uint8Array(fs.readFileSync('monster.dat')); let buf = new flatbuffers.ByteBuffer(data); let monster = MyGame.Example.Monster.getRootAsMonster(buf); ~~~ Now you can access values like this: ~~~{.ts} let hp = monster.hp(); let pos = monster.pos(); ~~~ ## Object based API FlatBuffers is all about memory efficiency, which is why its base API is written around using as little as possible of it. This does make the API clumsier (requiring pre-order construction of all data, and making mutation harder). For times when efficiency is less important a more convenient object based API can be used (through `--gen-object-api`) that is able to unpack & pack a FlatBuffer into objects and standard TS types. To use: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.ts} // Autogenerated class from table Monster. let monsterobj = new MonsterT(); // Deserialize from buffer into object. Monster.getRootAsMonster(flatbuffer).unpackTo(monsterobj); // or let monsterobj = Monster.getRootAsMonster(flatbuffer).unpack(); // Update object directly like a regular TS class instance. console.log(monsterobj.name); monsterobj.name = "Bob"; // Serialize into new flatbuffer. let fbb = new flatbuffers.Builder(1); Monster.finishMonsterBuffer(fbb, monsterobj.pack(fbb)); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ## Text parsing FlatBuffers in TypeScript There currently is no support for parsing text (Schema's and JSON) directly from TypeScript. flatbuffers-24.12.23/docs/source/WhitePaper.md000066400000000000000000000131601473234705300211030ustar00rootroot00000000000000FlatBuffers white paper {#flatbuffers_white_paper} ======================= This document tries to shed some light on to the "why" of FlatBuffers, a new serialization library. ## Motivation Back in the good old days, performance was all about instructions and cycles. Nowadays, processing units have run so far ahead of the memory subsystem, that making an efficient application should start and finish with thinking about memory. How much you use of it. How you lay it out and access it. How you allocate it. When you copy it. Serialization is a pervasive activity in a lot programs, and a common source of memory inefficiency, with lots of temporary data structures needed to parse and represent data, and inefficient allocation patterns and locality. If it would be possible to do serialization with no temporary objects, no additional allocation, no copying, and good locality, this could be of great value. The reason serialization systems usually don't manage this is because it goes counter to forwards/backwards compatibility, and platform specifics like endianness and alignment. FlatBuffers is what you get if you try anyway. In particular, FlatBuffers focus is on mobile hardware (where memory size and memory bandwidth is even more constrained than on desktop hardware), and applications that have the highest performance needs: games. ## FlatBuffers *This is a summary of FlatBuffers functionality, with some rationale. A more detailed description can be found in the FlatBuffers documentation.* ### Summary A FlatBuffer is a binary buffer containing nested objects (structs, tables, vectors,..) organized using offsets so that the data can be traversed in-place just like any pointer-based data structure. Unlike most in-memory data structures however, it uses strict rules of alignment and endianness (always little) to ensure these buffers are cross platform. Additionally, for objects that are tables, FlatBuffers provides forwards/backwards compatibility and general optionality of fields, to support most forms of format evolution. You define your object types in a schema, which can then be compiled to C++ or Java for low to zero overhead reading & writing. Optionally, JSON data can be dynamically parsed into buffers. ### Tables Tables are the cornerstone of FlatBuffers, since format evolution is essential for most applications of serialization. Typically, dealing with format changes is something that can be done transparently during the parsing process of most serialization solutions out there. But a FlatBuffer isn't parsed before it is accessed. Tables get around this by using an extra indirection to access fields, through a *vtable*. Each table comes with a vtable (which may be shared between multiple tables with the same layout), and contains information where fields for this particular kind of instance of vtable are stored. The vtable may also indicate that the field is not present (because this FlatBuffer was written with an older version of the software, or simply because the information was not necessary for this instance, or deemed deprecated), in which case a default value is returned. Tables have a low overhead in memory (since vtables are small and shared) and in access cost (an extra indirection), but provide great flexibility. Tables may even cost less memory than the equivalent struct, since fields do not need to be stored when they are equal to their default. FlatBuffers additionally offers "naked" structs, which do not offer forwards/backwards compatibility, but can be even smaller (useful for very small objects that are unlikely to change, like e.g. a coordinate pair or a RGBA color). ### Schemas While schemas reduce some generality (you can't just read any data without having its schema), they have a lot of upsides: - Most information about the format can be factored into the generated code, reducing memory needed to store data, and time to access it. - The strong typing of the data definitions means less error checking/handling at runtime (less can go wrong). - A schema enables us to access a buffer without parsing. FlatBuffer schemas are fairly similar to those of the incumbent, Protocol Buffers, and generally should be readable to those familiar with the C family of languages. We chose to improve upon the features offered by .proto files in the following ways: - Deprecation of fields instead of manual field id assignment. Extending an object in a .proto means hunting for a free slot among the numbers (preferring lower numbers since they have a more compact representation). Besides being inconvenient, it also makes removing fields problematic: you either have to keep them, not making it obvious that this field shouldn't be read/written anymore, and still generating accessors. Or you remove it, but now you risk that there's still old data around that uses that field by the time someone reuses that field id, with nasty consequences. - Differentiating between tables and structs (see above). Effectively all table fields are `optional`, and all struct fields are `required`. - Having a native vector type instead of `repeated`. This gives you a length without having to collect all items, and in the case of scalars provides for a more compact representation, and one that guarantees adjacency. - Having a native `union` type instead of using a series of `optional` fields, all of which must be checked individually. - Being able to define defaults for all scalars, instead of having to deal with their optionality at each access. - A parser that can deal with both schemas and data definitions (JSON compatible) uniformly.
flatbuffers-24.12.23/docs/source/doxyfile000066400000000000000000003103661473234705300202670ustar00rootroot00000000000000# Doxyfile 1.8.5 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project. # # All text after a double hash (##) is considered a comment and is placed in # front of the TAG it is preceding. # # All text after a single hash (#) is considered a comment and will be ignored. # The format is: # TAG = value [value, ...] # For lists, items can also be appended using: # TAG += value [value, ...] # Values that contain spaces should be placed between quotes (\" \"). #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- # This tag specifies the encoding used for all characters in the config file # that follow. The default is UTF-8 which is also the encoding used for all text # before the first occurrence of this tag. Doxygen uses libiconv (or the iconv # built into libc) for the transcoding. See http://www.gnu.org/software/libiconv # for the list of possible encodings. # The default value is: UTF-8. DOXYFILE_ENCODING = UTF-8 # The PROJECT_NAME tag is a single word (or a sequence of words surrounded by # double-quotes, unless you are using Doxywizard) that should identify the # project for which the documentation is generated. This name is used in the # title of most generated pages and in a few other places. # The default value is: My Project. PROJECT_NAME = "FlatBuffers" # The PROJECT_NUMBER tag can be used to enter a project or revision number. This # could be handy for archiving the generated documentation or if some version # control system is used. PROJECT_NUMBER = # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a # quick idea about the purpose of the project. Keep the description short. PROJECT_BRIEF = # With the PROJECT_LOGO tag one can specify an logo or icon that is included in # the documentation. The maximum height of the logo should not exceed 55 pixels # and the maximum width should not exceed 200 pixels. Doxygen will copy the logo # to the output directory. PROJECT_LOGO = # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path # into which the generated documentation will be written. If a relative path is # entered, it will be relative to the location where doxygen was started. If # left blank the current directory will be used. OUTPUT_DIRECTORY = ".." # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub- # directories (in 2 levels) under the output directory of each output format and # will distribute the generated files over these directories. Enabling this # option can be useful when feeding doxygen a huge amount of source files, where # putting all generated files in the same directory would otherwise causes # performance problems for the file system. # The default value is: NO. CREATE_SUBDIRS = NO # The OUTPUT_LANGUAGE tag is used to specify the language in which all # documentation generated by doxygen is written. Doxygen will use this # information to generate all constant output in the proper language. # Possible values are: Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese- # Traditional, Croatian, Czech, Danish, Dutch, English, Esperanto, Farsi, # Finnish, French, German, Greek, Hungarian, Italian, Japanese, Japanese-en, # Korean, Korean-en, Latvian, Norwegian, Macedonian, Persian, Polish, # Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish, Swedish, # Turkish, Ukrainian and Vietnamese. # The default value is: English. OUTPUT_LANGUAGE = English # If the BRIEF_MEMBER_DESC tag is set to YES doxygen will include brief member # descriptions after the members that are listed in the file and class # documentation (similar to Javadoc). Set to NO to disable this. # The default value is: YES. BRIEF_MEMBER_DESC = YES # If the REPEAT_BRIEF tag is set to YES doxygen will prepend the brief # description of a member or function before the detailed description # # Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the # brief descriptions will be completely suppressed. # The default value is: YES. REPEAT_BRIEF = YES # This tag implements a quasi-intelligent brief description abbreviator that is # used to form the text in various listings. Each string in this list, if found # as the leading text of the brief description, will be stripped from the text # and the result, after processing the whole list, is used as the annotated # text. Otherwise, the brief description is used as-is. If left blank, the # following values are used ($name is automatically replaced with the name of # the entity):The $name class, The $name widget, The $name file, is, provides, # specifies, contains, represents, a, an and the. ABBREVIATE_BRIEF = "The $name class" \ "The $name widget" \ "The $name file" \ is \ provides \ specifies \ contains \ represents \ a \ an \ the # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then # doxygen will generate a detailed section even if there is only a brief # description. # The default value is: NO. ALWAYS_DETAILED_SEC = NO # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all # inherited members of a class in the documentation of that class as if those # members were ordinary class members. Constructors, destructors and assignment # operators of the base classes will not be shown. # The default value is: NO. INLINE_INHERITED_MEMB = NO # If the FULL_PATH_NAMES tag is set to YES doxygen will prepend the full path # before files name in the file list and in the header files. If set to NO the # shortest path that makes the file name unique will be used # The default value is: YES. FULL_PATH_NAMES = NO # The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. # Stripping is only done if one of the specified strings matches the left-hand # part of the path. The tag can be used to show relative paths in the file list. # If left blank the directory from which doxygen is run is used as the path to # strip. # # Note that you can specify absolute paths here, but also relative paths, which # will be relative from the directory where doxygen is started. # This tag requires that the tag FULL_PATH_NAMES is set to YES. STRIP_FROM_PATH = # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the # path mentioned in the documentation of a class, which tells the reader which # header file to include in order to use a class. If left blank only the name of # the header file containing the class definition is used. Otherwise one should # specify the list of include paths that are normally passed to the compiler # using the -I flag. STRIP_FROM_INC_PATH = # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but # less readable) file names. This can be useful is your file systems doesn't # support long names like on DOS, Mac, or CD-ROM. # The default value is: NO. SHORT_NAMES = NO # If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the # first line (until the first dot) of a Javadoc-style comment as the brief # description. If set to NO, the Javadoc-style will behave just like regular Qt- # style comments (thus requiring an explicit @brief command for a brief # description.) # The default value is: NO. JAVADOC_AUTOBRIEF = YES # If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first # line (until the first dot) of a Qt-style comment as the brief description. If # set to NO, the Qt-style will behave just like regular Qt-style comments (thus # requiring an explicit \brief command for a brief description.) # The default value is: NO. QT_AUTOBRIEF = NO # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a # multi-line C++ special comment block (i.e. a block of //! or /// comments) as # a brief description. This used to be the default behavior. The new default is # to treat a multi-line C++ comment block as a detailed description. Set this # tag to YES if you prefer the old behavior instead. # # Note that setting this tag to YES also means that rational rose comments are # not recognized any more. # The default value is: NO. MULTILINE_CPP_IS_BRIEF = NO # If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the # documentation from any documented member that it re-implements. # The default value is: YES. INHERIT_DOCS = YES # If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce a # new page for each member. If set to NO, the documentation of a member will be # part of the file/class/namespace that contains it. # The default value is: NO. SEPARATE_MEMBER_PAGES = NO # The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen # uses this value to replace tabs by spaces in code fragments. # Minimum value: 1, maximum value: 16, default value: 4. TAB_SIZE = 2 # This tag can be used to specify a number of aliases that act as commands in # the documentation. An alias has the form: # name=value # For example adding # "sideeffect=@par Side Effects:\n" # will allow you to put the command \sideeffect (or @sideeffect) in the # documentation, which will result in a user-defined paragraph with heading # "Side Effects:". You can put \n's in the value part of an alias to insert # newlines. ALIASES = # This tag can be used to specify a number of word-keyword mappings (TCL only). # A mapping has the form "name=value". For example adding "class=itcl::class" # will allow you to use the command class in the itcl::class meaning. TCL_SUBST = # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources # only. Doxygen will then generate output that is more tailored for C. For # instance, some of the names that are used will be different. The list of all # members will be omitted, etc. # The default value is: NO. OPTIMIZE_OUTPUT_FOR_C = NO # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or # Python sources only. Doxygen will then generate output that is more tailored # for that language. For instance, namespaces will be presented as packages, # qualified scopes will look different, etc. # The default value is: NO. OPTIMIZE_OUTPUT_JAVA = NO # Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran # sources. Doxygen will then generate output that is tailored for Fortran. # The default value is: NO. OPTIMIZE_FOR_FORTRAN = NO # Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL # sources. Doxygen will then generate output that is tailored for VHDL. # The default value is: NO. OPTIMIZE_OUTPUT_VHDL = NO # Doxygen selects the parser to use depending on the extension of the files it # parses. With this tag you can assign which parser to use for a given # extension. Doxygen has a built-in mapping, but you can override or extend it # using this tag. The format is ext=language, where ext is a file extension, and # language is one of the parsers supported by doxygen: IDL, Java, Javascript, # C#, C, C++, D, PHP, Objective-C, Python, Fortran, VHDL. For instance to make # doxygen treat .inc files as Fortran files (default is PHP), and .f files as C # (default is Fortran), use: inc=Fortran f=C. # # Note For files without extension you can use no_extension as a placeholder. # # Note that for custom extensions you also need to set FILE_PATTERNS otherwise # the files are not read by doxygen. EXTENSION_MAPPING = # If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments # according to the Markdown format, which allows for more readable # documentation. See http://daringfireball.net/projects/markdown/ for details. # The output of markdown processing is further processed by doxygen, so you can # mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in # case of backward compatibilities issues. # The default value is: YES. MARKDOWN_SUPPORT = YES # When enabled doxygen tries to link words that correspond to documented # classes, or namespaces to their corresponding documentation. Such a link can # be prevented in individual cases by by putting a % sign in front of the word # or globally by setting AUTOLINK_SUPPORT to NO. # The default value is: YES. AUTOLINK_SUPPORT = NO # Due to the multiple languages included in the API # reference for FlatBuffers, the Auto-links were # wrong more often than not. # If you use STL classes (i.e. std::string, std::vector, etc.) but do not want # to include (a tag file for) the STL sources as input, then you should set this # tag to YES in order to let doxygen match functions declarations and # definitions whose arguments contain STL classes (e.g. func(std::string); # versus func(std::string) {}). This also make the inheritance and collaboration # diagrams that involve STL classes more complete and accurate. # The default value is: NO. BUILTIN_STL_SUPPORT = NO # If you use Microsoft's C++/CLI language, you should set this option to YES to # enable parsing support. # The default value is: NO. CPP_CLI_SUPPORT = NO # Set the SIP_SUPPORT tag to YES if your project consists of sip (see: # http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen # will parse them like normal C++ but will assume all classes use public instead # of private inheritance when no explicit protection keyword is present. # The default value is: NO. SIP_SUPPORT = NO # For Microsoft's IDL there are propget and propput attributes to indicate # getter and setter methods for a property. Setting this option to YES will make # doxygen to replace the get and set methods by a property in the documentation. # This will only work if the methods are indeed getting or setting a simple # type. If this is not the case, or you want to show the methods anyway, you # should set this option to NO. # The default value is: YES. IDL_PROPERTY_SUPPORT = NO # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC # tag is set to YES, then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. # The default value is: NO. DISTRIBUTE_GROUP_DOC = NO # Set the SUBGROUPING tag to YES to allow class member groups of the same type # (for instance a group of public functions) to be put as a subgroup of that # type (e.g. under the Public Functions section). Set it to NO to prevent # subgrouping. Alternatively, this can be done per class using the # \nosubgrouping command. # The default value is: YES. SUBGROUPING = YES # When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions # are shown inside the group in which they are included (e.g. using \ingroup) # instead of on a separate page (for HTML and Man pages) or section (for LaTeX # and RTF). # # Note that this feature does not work in combination with # SEPARATE_MEMBER_PAGES. # The default value is: NO. INLINE_GROUPED_CLASSES = NO # When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions # with only public data fields or simple typedef fields will be shown inline in # the documentation of the scope in which they are defined (i.e. file, # namespace, or group documentation), provided this scope is documented. If set # to NO, structs, classes, and unions are shown on a separate page (for HTML and # Man pages) or section (for LaTeX and RTF). # The default value is: NO. INLINE_SIMPLE_STRUCTS = NO # When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or # enum is documented as struct, union, or enum with the name of the typedef. So # typedef struct TypeS {} TypeT, will appear in the documentation as a struct # with name TypeT. When disabled the typedef will appear as a member of a file, # namespace, or class. And the struct will be named TypeS. This can typically be # useful for C code in case the coding convention dictates that all compound # types are typedef'ed and only the typedef is referenced, never the tag name. # The default value is: NO. TYPEDEF_HIDES_STRUCT = NO # The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This # cache is used to resolve symbols given their name and scope. Since this can be # an expensive process and often the same symbol appears multiple times in the # code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small # doxygen will become slower. If the cache is too large, memory is wasted. The # cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range # is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 # symbols. At the end of a run doxygen will report the cache usage and suggest # the optimal cache size from a speed point of view. # Minimum value: 0, maximum value: 9, default value: 0. LOOKUP_CACHE_SIZE = 0 #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- # If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in # documentation are documented, even if no documentation was available. Private # class members and static file members will be hidden unless the # EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. # Note: This will also disable the warnings about undocumented members that are # normally produced when WARNINGS is set to YES. # The default value is: NO. EXTRACT_ALL = NO # If the EXTRACT_PRIVATE tag is set to YES all private members of a class will # be included in the documentation. # The default value is: NO. EXTRACT_PRIVATE = NO # If the EXTRACT_PACKAGE tag is set to YES all members with package or internal # scope will be included in the documentation. # The default value is: NO. EXTRACT_PACKAGE = NO # If the EXTRACT_STATIC tag is set to YES all static members of a file will be # included in the documentation. # The default value is: NO. EXTRACT_STATIC = YES # If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) defined # locally in source files will be included in the documentation. If set to NO # only classes defined in header files are included. Does not have any effect # for Java sources. # The default value is: YES. EXTRACT_LOCAL_CLASSES = NO # This flag is only useful for Objective-C code. When set to YES local methods, # which are defined in the implementation section but not in the interface are # included in the documentation. If set to NO only methods in the interface are # included. # The default value is: NO. EXTRACT_LOCAL_METHODS = NO # If this flag is set to YES, the members of anonymous namespaces will be # extracted and appear in the documentation as a namespace called # 'anonymous_namespace{file}', where file will be replaced with the base name of # the file that contains the anonymous namespace. By default anonymous namespace # are hidden. # The default value is: NO. EXTRACT_ANON_NSPACES = NO # If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all # undocumented members inside documented classes or files. If set to NO these # members will be included in the various overviews, but no documentation # section is generated. This option has no effect if EXTRACT_ALL is enabled. # The default value is: NO. HIDE_UNDOC_MEMBERS = NO # If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. If set # to NO these classes will be included in the various overviews. This option has # no effect if EXTRACT_ALL is enabled. # The default value is: NO. HIDE_UNDOC_CLASSES = NO # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend # (class|struct|union) declarations. If set to NO these declarations will be # included in the documentation. # The default value is: NO. HIDE_FRIEND_COMPOUNDS = NO # If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any # documentation blocks found inside the body of a function. If set to NO these # blocks will be appended to the function's detailed documentation block. # The default value is: NO. HIDE_IN_BODY_DOCS = NO # The INTERNAL_DOCS tag determines if documentation that is typed after a # \internal command is included. If the tag is set to NO then the documentation # will be excluded. Set it to YES to include the internal documentation. # The default value is: NO. INTERNAL_DOCS = NO # If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file # names in lower-case letters. If set to YES upper-case letters are also # allowed. This is useful if you have classes or files whose names only differ # in case and if your file system supports case sensitive file names. Windows # and Mac users are advised to set this option to NO. # The default value is: system dependent. CASE_SENSE_NAMES = NO # If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with # their full class and namespace scopes in the documentation. If set to YES the # scope will be hidden. # The default value is: NO. HIDE_SCOPE_NAMES = NO # If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of # the files that are included by a file in the documentation of that file. # The default value is: YES. SHOW_INCLUDE_FILES = YES # If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include # files with double quotes in the documentation rather than with sharp brackets. # The default value is: NO. FORCE_LOCAL_INCLUDES = NO # If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the # documentation for inline members. # The default value is: YES. INLINE_INFO = YES # If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the # (detailed) documentation of file and class members alphabetically by member # name. If set to NO the members will appear in declaration order. # The default value is: YES. SORT_MEMBER_DOCS = YES # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief # descriptions of file, namespace and class members alphabetically by member # name. If set to NO the members will appear in declaration order. # The default value is: NO. SORT_BRIEF_DOCS = YES # If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the # (brief and detailed) documentation of class members so that constructors and # destructors are listed first. If set to NO the constructors will appear in the # respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. # Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief # member documentation. # Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting # detailed member documentation. # The default value is: NO. SORT_MEMBERS_CTORS_1ST = NO # If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy # of group names into alphabetical order. If set to NO the group names will # appear in their defined order. # The default value is: NO. SORT_GROUP_NAMES = NO # If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by # fully-qualified names, including namespaces. If set to NO, the class list will # be sorted only by class name, not including the namespace part. # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. # Note: This option applies only to the class list, not to the alphabetical # list. # The default value is: NO. SORT_BY_SCOPE_NAME = NO # If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper # type resolution of all parameters of a function it will reject a match between # the prototype and the implementation of a member function even if there is # only one candidate or it is obvious which candidate to choose by doing a # simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still # accept a match between prototype and implementation in such cases. # The default value is: NO. STRICT_PROTO_MATCHING = NO # The GENERATE_TODOLIST tag can be used to enable ( YES) or disable ( NO) the # todo list. This list is created by putting \todo commands in the # documentation. # The default value is: YES. GENERATE_TODOLIST = NO # The GENERATE_TESTLIST tag can be used to enable ( YES) or disable ( NO) the # test list. This list is created by putting \test commands in the # documentation. # The default value is: YES. GENERATE_TESTLIST = NO # The GENERATE_BUGLIST tag can be used to enable ( YES) or disable ( NO) the bug # list. This list is created by putting \bug commands in the documentation. # The default value is: YES. GENERATE_BUGLIST = NO # The GENERATE_DEPRECATEDLIST tag can be used to enable ( YES) or disable ( NO) # the deprecated list. This list is created by putting \deprecated commands in # the documentation. # The default value is: YES. GENERATE_DEPRECATEDLIST= YES # The ENABLED_SECTIONS tag can be used to enable conditional documentation # sections, marked by \if ... \endif and \cond # ... \endcond blocks. ENABLED_SECTIONS = # The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the # initial value of a variable or macro / define can have for it to appear in the # documentation. If the initializer consists of more lines than specified here # it will be hidden. Use a value of 0 to hide initializers completely. The # appearance of the value of individual variables and macros / defines can be # controlled using \showinitializer or \hideinitializer command in the # documentation regardless of this setting. # Minimum value: 0, maximum value: 10000, default value: 30. MAX_INITIALIZER_LINES = 30 # Set the SHOW_USED_FILES tag to NO to disable the list of files generated at # the bottom of the documentation of classes and structs. If set to YES the list # will mention the files that were used to generate the documentation. # The default value is: YES. SHOW_USED_FILES = YES # Set the SHOW_FILES tag to NO to disable the generation of the Files page. This # will remove the Files entry from the Quick Index and from the Folder Tree View # (if specified). # The default value is: YES. SHOW_FILES = YES # Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces # page. This will remove the Namespaces entry from the Quick Index and from the # Folder Tree View (if specified). # The default value is: YES. SHOW_NAMESPACES = YES # The FILE_VERSION_FILTER tag can be used to specify a program or script that # doxygen should invoke to get the current version for each file (typically from # the version control system). Doxygen will invoke the program by executing (via # popen()) the command command input-file, where command is the value of the # FILE_VERSION_FILTER tag, and input-file is the name of an input file provided # by doxygen. Whatever the program writes to standard output is used as the file # version. For an example see the documentation. FILE_VERSION_FILTER = # The LAYOUT_FILE tag can be used to specify a layout file which will be parsed # by doxygen. The layout file controls the global structure of the generated # output files in an output format independent way. To create the layout file # that represents doxygen's defaults, run doxygen with the -l option. You can # optionally specify a file name after the option, if omitted DoxygenLayout.xml # will be used as the name of the layout file. # # Note that if you run doxygen from a directory containing a file called # DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE # tag is left empty. LAYOUT_FILE = doxygen_layout.xml # The CITE_BIB_FILES tag can be used to specify one or more bib files containing # the reference definitions. This must be a list of .bib files. The .bib # extension is automatically appended if omitted. This requires the bibtex tool # to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. # For LaTeX the style of the bibliography can be controlled using # LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the # search path. Do not use file names with spaces, bibtex cannot handle them. See # also \cite for info how to create references. CITE_BIB_FILES = #--------------------------------------------------------------------------- # Configuration options related to warning and progress messages #--------------------------------------------------------------------------- # The QUIET tag can be used to turn on/off the messages that are generated to # standard output by doxygen. If QUIET is set to YES this implies that the # messages are off. # The default value is: NO. QUIET = NO # The WARNINGS tag can be used to turn on/off the warning messages that are # generated to standard error ( stderr) by doxygen. If WARNINGS is set to YES # this implies that the warnings are on. # # Tip: Turn warnings on while writing the documentation. # The default value is: YES. WARNINGS = YES # If the WARN_IF_UNDOCUMENTED tag is set to YES, then doxygen will generate # warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag # will automatically be disabled. # The default value is: YES. WARN_IF_UNDOCUMENTED = YES # If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for # potential errors in the documentation, such as not documenting some parameters # in a documented function, or documenting parameters that don't exist or using # markup commands wrongly. # The default value is: YES. WARN_IF_DOC_ERROR = NO # This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that # are documented, but have no documentation for their parameters or return # value. If set to NO doxygen will only warn about wrong or incomplete parameter # documentation, but not about the absence of documentation. # The default value is: NO. WARN_NO_PARAMDOC = NO # The WARN_FORMAT tag determines the format of the warning messages that doxygen # can produce. The string should contain the $file, $line, and $text tags, which # will be replaced by the file and line number from which the warning originated # and the warning text. Optionally the format may contain $version, which will # be replaced by the version of the file (if it could be obtained via # FILE_VERSION_FILTER) # The default value is: $file:$line: $text. WARN_FORMAT = "$file:$line: $text" # The WARN_LOGFILE tag can be used to specify a file to which warning and error # messages should be written. If left blank the output is written to standard # error (stderr). WARN_LOGFILE = #--------------------------------------------------------------------------- # Configuration options related to the input files #--------------------------------------------------------------------------- # The INPUT tag is used to specify the files and/or directories that contain # documented source files. You may enter file names like myfile.cpp or # directories like /usr/src/myproject. Separate the files or directories with # spaces. # Note: If this tag is empty the current directory is searched. INPUT = "FlatBuffers.md" \ "Building.md" \ "Compiler.md" \ "Schemas.md" \ "CppUsage.md" \ "CUsage.md" \ "DartUsage.md" \ "GoUsage.md" \ "JavaUsage.md" \ "CsharpUsage.md" \ "SwiftUsage.md" \ "JavaScriptUsage.md" \ "TypeScriptUsage.md" \ "PHPUsage.md" \ "PythonUsage.md" \ "LuaUsage.md" \ "LobsterUsage.md" \ "RustUsage.md" \ "Support.md" \ "Benchmarks.md" \ "WhitePaper.md" \ "FlexBuffers.md" \ "Internals.md" \ "IntermediateRepresentation.md" \ "Grammar.md" \ "../../CONTRIBUTING.md" \ "Tutorial.md" \ "GoApi.md" \ "gRPC/CppUsage.md" \ "groups" \ "../../java/com/google/flatbuffers" \ "../../python/flatbuffers/builder.py" \ "../../js/flatbuffers.js" \ "../../php/FlatbufferBuilder.php" \ "../../net/FlatBuffers/FlatBufferBuilder.cs" "../../net/FlatBuffers/FlatBufferVerify.cs" \ "../../include/flatbuffers/flatbuffers.h" \ "../../go/builder.go" \ "../../rust/flatbuffers/src/builder.rs" # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses # libiconv (or the iconv built into libc) for the transcoding. See the libiconv # documentation (see: http://www.gnu.org/software/libiconv) for the list of # possible encodings. # The default value is: UTF-8. INPUT_ENCODING = UTF-8 # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and # *.h) to filter out the source-files in the directories. If left blank the # following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii, # *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp, # *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown, # *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf, # *.qsf, *.as and *.js. FILE_PATTERNS = *.c \ *.cc \ *.cxx \ *.cpp \ *.c++ \ *.java \ *.ii \ *.ixx \ *.ipp \ *.i++ \ *.inl \ *.idl \ *.ddl \ *.odl \ *.h \ *.hh \ *.hxx \ *.hpp \ *.h++ \ *.cs \ *.d \ *.php \ *.php4 \ *.php5 \ *.phtml \ *.inc \ *.m \ *.markdown \ *.md \ *.mm \ *.dox \ *.py \ *.f90 \ *.f \ *.for \ *.tcl \ *.vhd \ *.vhdl \ *.ucf \ *.qsf \ *.as \ *.js \ *.go # The RECURSIVE tag can be used to specify whether or not subdirectories should # be searched for input files as well. # The default value is: NO. RECURSIVE = YES # The EXCLUDE tag can be used to specify files and/or directories that should be # excluded from the INPUT source files. This way you can easily exclude a # subdirectory from a directory tree whose root is specified with the INPUT tag. # # Note that relative paths are relative to the directory from which doxygen is # run. EXCLUDE = # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or # directories that are symbolic links (a Unix file system feature) are excluded # from the input. # The default value is: NO. EXCLUDE_SYMLINKS = NO # If the value of the INPUT tag contains directories, you can use the # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude # certain files from those directories. # # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories for example use the pattern */test/* EXCLUDE_PATTERNS = *_test.py | __init__.py # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # (namespaces, classes, functions, etc.) that should be excluded from the # output. The symbol name can be a fully qualified name, a word, or if the # wildcard * is used, a substring. Examples: ANamespace, AClass, # AClass::ANamespace, ANamespace::*Test # # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories use the pattern */test/* EXCLUDE_SYMBOLS = # The EXAMPLE_PATH tag can be used to specify one or more files or directories # that contain example code fragments that are included (see the \include # command). EXAMPLE_PATH = "GoApi_generated.txt" "../../grpc/samples" # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and # *.h) to filter out the source-files in the directories. If left blank all # files are included. EXAMPLE_PATTERNS = *.cpp *.h *.txt *.fbs # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be # searched for input files to be used with the \include or \dontinclude commands # irrespective of the value of the RECURSIVE tag. # The default value is: NO. EXAMPLE_RECURSIVE = YES # The IMAGE_PATH tag can be used to specify one or more files or directories # that contain images that are to be included in the documentation (see the # \image command). IMAGE_PATH = # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program # by executing (via popen()) the command: # # # # where is the value of the INPUT_FILTER tag, and is the # name of an input file. Doxygen will then use the output that the filter # program writes to standard output. If FILTER_PATTERNS is specified, this tag # will be ignored. # # Note that the filter must not add or remove lines; it is applied before the # code is scanned, but not when the output code is generated. If lines are added # or removed, the anchors will not be placed correctly. INPUT_FILTER = # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern # basis. Doxygen will compare the file name with each pattern and apply the # filter if there is a match. The filters are a list of the form: pattern=filter # (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how # filters are used. If the FILTER_PATTERNS tag is empty or if none of the # patterns match the file name, INPUT_FILTER is applied. FILTER_PATTERNS = *.py=py_filter # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER ) will also be used to filter the input files that are used for # producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). # The default value is: NO. FILTER_SOURCE_FILES = NO # The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file # pattern. A pattern will override the setting for FILTER_PATTERN (if any) and # it is also possible to disable source filtering for a specific pattern using # *.ext= (so without naming a filter). # This tag requires that the tag FILTER_SOURCE_FILES is set to YES. FILTER_SOURCE_PATTERNS = # If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that # is part of the input, its contents will be placed on the main page # (index.html). This can be useful if you have a project on for instance GitHub # and want to reuse the introduction page also for the doxygen output. USE_MDFILE_AS_MAINPAGE = FlatBuffers.md #--------------------------------------------------------------------------- # Configuration options related to source browsing #--------------------------------------------------------------------------- # If the SOURCE_BROWSER tag is set to YES then a list of source files will be # generated. Documented entities will be cross-referenced with these sources. # # Note: To get rid of all source code in the generated output, make sure that # also VERBATIM_HEADERS is set to NO. # The default value is: NO. SOURCE_BROWSER = NO # Setting the INLINE_SOURCES tag to YES will include the body of functions, # classes and enums directly into the documentation. # The default value is: NO. INLINE_SOURCES = NO # Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any # special comment blocks from generated source code fragments. Normal C, C++ and # Fortran comments will always remain visible. # The default value is: YES. STRIP_CODE_COMMENTS = NO # If the REFERENCED_BY_RELATION tag is set to YES then for each documented # function all documented functions referencing it will be listed. # The default value is: NO. REFERENCED_BY_RELATION = NO # If the REFERENCES_RELATION tag is set to YES then for each documented function # all documented entities called/used by that function will be listed. # The default value is: NO. REFERENCES_RELATION = NO # If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set # to YES, then the hyperlinks from functions in REFERENCES_RELATION and # REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will # link to the documentation. # The default value is: YES. REFERENCES_LINK_SOURCE = YES # If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the # source code will show a tooltip with additional information such as prototype, # brief description and links to the definition and documentation. Since this # will make the HTML file larger and loading of large files a bit slower, you # can opt to disable this feature. # The default value is: YES. # This tag requires that the tag SOURCE_BROWSER is set to YES. SOURCE_TOOLTIPS = YES # If the USE_HTAGS tag is set to YES then the references to source code will # point to the HTML generated by the htags(1) tool instead of doxygen built-in # source browser. The htags tool is part of GNU's global source tagging system # (see http://www.gnu.org/software/global/global.html). You will need version # 4.8.6 or higher. # # To use it do the following: # - Install the latest version of global # - Enable SOURCE_BROWSER and USE_HTAGS in the config file # - Make sure the INPUT points to the root of the source tree # - Run doxygen as normal # # Doxygen will invoke htags (and that will in turn invoke gtags), so these # tools must be available from the command line (i.e. in the search path). # # The result: instead of the source browser generated by doxygen, the links to # source code will now point to the output of htags. # The default value is: NO. # This tag requires that the tag SOURCE_BROWSER is set to YES. USE_HTAGS = NO # If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a # verbatim copy of the header file for each class for which an include is # specified. Set to NO to disable this. # See also: Section \class. # The default value is: YES. VERBATIM_HEADERS = YES #--------------------------------------------------------------------------- # Configuration options related to the alphabetical class index #--------------------------------------------------------------------------- # If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all # compounds will be generated. Enable this if the project contains a lot of # classes, structs, unions or interfaces. # The default value is: YES. ALPHABETICAL_INDEX = YES # The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in # which the alphabetical index list will be split. # Minimum value: 1, maximum value: 20, default value: 5. # This tag requires that the tag ALPHABETICAL_INDEX is set to YES. COLS_IN_ALPHA_INDEX = 5 # In case all classes in a project start with a common prefix, all classes will # be put under the same header in the alphabetical index. The IGNORE_PREFIX tag # can be used to specify a prefix (or a list of prefixes) that should be ignored # while generating the index headers. # This tag requires that the tag ALPHABETICAL_INDEX is set to YES. IGNORE_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the HTML output #--------------------------------------------------------------------------- # If the GENERATE_HTML tag is set to YES doxygen will generate HTML output # The default value is: YES. GENERATE_HTML = YES # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a # relative path is entered the value of OUTPUT_DIRECTORY will be put in front of # it. # The default directory is: html. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_OUTPUT = html # The HTML_FILE_EXTENSION tag can be used to specify the file extension for each # generated HTML page (for example: .htm, .php, .asp). # The default value is: .html. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_FILE_EXTENSION = .html # The HTML_HEADER tag can be used to specify a user-defined HTML header file for # each generated HTML page. If the tag is left blank doxygen will generate a # standard header. # # To get valid HTML the header file that includes any scripts and style sheets # that doxygen needs, which is dependent on the configuration options used (e.g. # the setting GENERATE_TREEVIEW). It is highly recommended to start with a # default header using # doxygen -w html new_header.html new_footer.html new_stylesheet.css # YourConfigFile # and then modify the file new_header.html. See also section "Doxygen usage" # for information on how to generate the default header that doxygen normally # uses. # Note: The header is subject to change so you typically have to regenerate the # default header when upgrading to a newer version of doxygen. For a description # of the possible markers and block names see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_HEADER = ../header.html # The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each # generated HTML page. If the tag is left blank doxygen will generate a standard # footer. See HTML_HEADER for more information on how to generate a default # footer and what special commands can be used inside the footer. See also # section "Doxygen usage" for information on how to generate the default footer # that doxygen normally uses. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_FOOTER = ../footer.html # The HTML_STYLESHEET tag can be used to specify a user-defined cascading style # sheet that is used by each HTML page. It can be used to fine-tune the look of # the HTML output. If left blank doxygen will generate a default style sheet. # See also section "Doxygen usage" for information on how to generate the style # sheet that doxygen normally uses. # Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as # it is more robust and this tag (HTML_STYLESHEET) will in the future become # obsolete. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_STYLESHEET = # The HTML_EXTRA_STYLESHEET tag can be used to specify an additional user- # defined cascading style sheet that is included after the standard style sheets # created by doxygen. Using this option one can overrule certain style aspects. # This is preferred over using HTML_STYLESHEET since it does not replace the # standard style sheet and is therefor more robust against future updates. # Doxygen will copy the style sheet file to the output directory. For an example # see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_EXTRA_STYLESHEET = style.css # The HTML_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the HTML output directory. Note # that these files will be copied to the base HTML output directory. Use the # $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these # files. In the HTML_STYLESHEET file, use the file name only. Also note that the # files will be copied as-is; there are no commands or markers available. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_EXTRA_FILES = "../images/fpl_logo_small.png" \ "../images/ftv2mnode.png" \ "../images/ftv2pnode.png" # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen # will adjust the colors in the stylesheet and background images according to # this color. Hue is specified as an angle on a colorwheel, see # http://en.wikipedia.org/wiki/Hue for more information. For instance the value # 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 # purple, and 360 is red again. # Minimum value: 0, maximum value: 359, default value: 220. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_COLORSTYLE_HUE = 220 # The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors # in the HTML output. For a value of 0 the output will use grayscales only. A # value of 255 will produce the most vivid colors. # Minimum value: 0, maximum value: 255, default value: 100. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_COLORSTYLE_SAT = 100 # The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the # luminance component of the colors in the HTML output. Values below 100 # gradually make the output lighter, whereas values above 100 make the output # darker. The value divided by 100 is the actual gamma applied, so 80 represents # a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not # change the gamma. # Minimum value: 40, maximum value: 240, default value: 80. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_COLORSTYLE_GAMMA = 80 # If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML # page will contain the date and time when the page was generated. Setting this # to NO can help when comparing the output of multiple runs. # The default value is: YES. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_TIMESTAMP = YES # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML # documentation will contain sections that can be hidden and shown after the # page has loaded. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_DYNAMIC_SECTIONS = NO # With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries # shown in the various tree structured indices initially; the user can expand # and collapse entries dynamically later on. Doxygen will expand the tree to # such a level that at most the specified number of entries are visible (unless # a fully collapsed tree already exceeds this amount). So setting the number of # entries 1 will produce a full collapsed tree by default. 0 is a special value # representing an infinite number of entries and will result in a full expanded # tree by default. # Minimum value: 0, maximum value: 9999, default value: 100. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_INDEX_NUM_ENTRIES = 100 # If the GENERATE_DOCSET tag is set to YES, additional index files will be # generated that can be used as input for Apple's Xcode 3 integrated development # environment (see: http://developer.apple.com/tools/xcode/), introduced with # OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a # Makefile in the HTML output directory. Running make will produce the docset in # that directory and running make install will install the docset in # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at # startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html # for more information. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_DOCSET = NO # This tag determines the name of the docset feed. A documentation feed provides # an umbrella under which multiple documentation sets from a single provider # (such as a company or product suite) can be grouped. # The default value is: Doxygen generated docs. # This tag requires that the tag GENERATE_DOCSET is set to YES. DOCSET_FEEDNAME = "Doxygen generated docs" # This tag specifies a string that should uniquely identify the documentation # set bundle. This should be a reverse domain-name style string, e.g. # com.mycompany.MyDocSet. Doxygen will append .docset to the name. # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_DOCSET is set to YES. DOCSET_BUNDLE_ID = org.doxygen.Project # The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify # the documentation publisher. This should be a reverse domain-name style # string, e.g. com.mycompany.MyDocSet.documentation. # The default value is: org.doxygen.Publisher. # This tag requires that the tag GENERATE_DOCSET is set to YES. DOCSET_PUBLISHER_ID = org.doxygen.Publisher # The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. # The default value is: Publisher. # This tag requires that the tag GENERATE_DOCSET is set to YES. DOCSET_PUBLISHER_NAME = Publisher # If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three # additional HTML index files: index.hhp, index.hhc, and index.hhk. The # index.hhp is a project file that can be read by Microsoft's HTML Help Workshop # (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on # Windows. # # The HTML Help Workshop contains a compiler that can convert all HTML output # generated by doxygen into a single compiled HTML file (.chm). Compiled HTML # files are now used as the Windows 98 help format, and will replace the old # Windows help format (.hlp) on all Windows platforms in the future. Compressed # HTML files also contain an index, a table of contents, and you can search for # words in the documentation. The HTML workshop also contains a viewer for # compressed HTML files. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_HTMLHELP = NO # The CHM_FILE tag can be used to specify the file name of the resulting .chm # file. You can add a path in front of the file if the result should not be # written to the html output directory. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. CHM_FILE = # The HHC_LOCATION tag can be used to specify the location (absolute path # including file name) of the HTML help compiler ( hhc.exe). If non-empty # doxygen will try to run the HTML help compiler on the generated index.hhp. # The file has to be specified with full path. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. HHC_LOCATION = # The GENERATE_CHI flag controls if a separate .chi index file is generated ( # YES) or that it should be included in the master .chm file ( NO). # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. GENERATE_CHI = NO # The CHM_INDEX_ENCODING is used to encode HtmlHelp index ( hhk), content ( hhc) # and project file content. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. CHM_INDEX_ENCODING = # The BINARY_TOC flag controls whether a binary table of contents is generated ( # YES) or a normal table of contents ( NO) in the .chm file. # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. BINARY_TOC = NO # The TOC_EXPAND flag can be set to YES to add extra items for group members to # the table of contents of the HTML help documentation and to the tree view. # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. TOC_EXPAND = NO # If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and # QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that # can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help # (.qch) of the generated HTML documentation. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_QHP = NO # If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify # the file name of the resulting .qch file. The path specified is relative to # the HTML output folder. # This tag requires that the tag GENERATE_QHP is set to YES. QCH_FILE = # The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help # Project output. For more information please see Qt Help Project / Namespace # (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace). # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_QHP is set to YES. QHP_NAMESPACE = org.doxygen.Project # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt # Help Project output. For more information please see Qt Help Project / Virtual # Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual- # folders). # The default value is: doc. # This tag requires that the tag GENERATE_QHP is set to YES. QHP_VIRTUAL_FOLDER = doc # If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom # filter to add. For more information please see Qt Help Project / Custom # Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- # filters). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_CUST_FILTER_NAME = # The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the # custom filter to add. For more information please see Qt Help Project / Custom # Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- # filters). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_CUST_FILTER_ATTRS = # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this # project's filter section matches. Qt Help Project / Filter Attributes (see: # http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_SECT_FILTER_ATTRS = # The QHG_LOCATION tag can be used to specify the location of Qt's # qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the # generated .qhp file. # This tag requires that the tag GENERATE_QHP is set to YES. QHG_LOCATION = # If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be # generated, together with the HTML files, they form an Eclipse help plugin. To # install this plugin and make it available under the help contents menu in # Eclipse, the contents of the directory containing the HTML and XML files needs # to be copied into the plugins directory of eclipse. The name of the directory # within the plugins directory should be the same as the ECLIPSE_DOC_ID value. # After copying Eclipse needs to be restarted before the help appears. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_ECLIPSEHELP = NO # A unique identifier for the Eclipse help plugin. When installing the plugin # the directory name containing the HTML and XML files should also have this # name. Each documentation set should have its own identifier. # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. ECLIPSE_DOC_ID = org.doxygen.Project # If you want full control over the layout of the generated HTML pages it might # be necessary to disable the index and replace it with your own. The # DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top # of each HTML page. A value of NO enables the index and the value YES disables # it. Since the tabs in the index contain the same information as the navigation # tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. DISABLE_INDEX = NO # The GENERATE_TREEVIEW tag is used to specify whether a tree-like index # structure should be generated to display hierarchical information. If the tag # value is set to YES, a side panel will be generated containing a tree-like # index structure (just like the one that is generated for HTML Help). For this # to work a browser that supports JavaScript, DHTML, CSS and frames is required # (i.e. any modern browser). Windows users are probably better off using the # HTML help feature. Via custom stylesheets (see HTML_EXTRA_STYLESHEET) one can # further fine-tune the look of the index. As an example, the default style # sheet generated by doxygen has an example that shows how to put an image at # the root of the tree instead of the PROJECT_NAME. Since the tree basically has # the same information as the tab index, you could consider setting # DISABLE_INDEX to YES when enabling this option. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_TREEVIEW = YES # The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that # doxygen will group on one line in the generated HTML documentation. # # Note that a value of 0 will completely suppress the enum values from appearing # in the overview section. # Minimum value: 0, maximum value: 20, default value: 4. # This tag requires that the tag GENERATE_HTML is set to YES. ENUM_VALUES_PER_LINE = 4 # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used # to set the initial width (in pixels) of the frame in which the tree is shown. # Minimum value: 0, maximum value: 1500, default value: 250. # This tag requires that the tag GENERATE_HTML is set to YES. TREEVIEW_WIDTH = 250 # When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open links to # external symbols imported via tag files in a separate window. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. EXT_LINKS_IN_WINDOW = NO # Use this tag to change the font size of LaTeX formulas included as images in # the HTML documentation. When you change the font size after a successful # doxygen run you need to manually remove any form_*.png images from the HTML # output directory to force them to be regenerated. # Minimum value: 8, maximum value: 50, default value: 10. # This tag requires that the tag GENERATE_HTML is set to YES. FORMULA_FONTSIZE = 10 # Use the FORMULA_TRANPARENT tag to determine whether or not the images # generated for formulas are transparent PNGs. Transparent PNGs are not # supported properly for IE 6.0, but are supported on all modern browsers. # # Note that when changing this option you need to delete any form_*.png files in # the HTML output directory before the changes have effect. # The default value is: YES. # This tag requires that the tag GENERATE_HTML is set to YES. FORMULA_TRANSPARENT = YES # Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see # http://www.mathjax.org) which uses client side Javascript for the rendering # instead of using prerendered bitmaps. Use this if you do not have LaTeX # installed or if you want to formulas look prettier in the HTML output. When # enabled you may also need to install MathJax separately and configure the path # to it using the MATHJAX_RELPATH option. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. USE_MATHJAX = NO # When MathJax is enabled you can set the default output format to be used for # the MathJax output. See the MathJax site (see: # http://docs.mathjax.org/en/latest/output.html) for more details. # Possible values are: HTML-CSS (which is slower, but has the best # compatibility), NativeMML (i.e. MathML) and SVG. # The default value is: HTML-CSS. # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_FORMAT = HTML-CSS # When MathJax is enabled you need to specify the location relative to the HTML # output directory using the MATHJAX_RELPATH option. The destination directory # should contain the MathJax.js script. For instance, if the mathjax directory # is located at the same level as the HTML output directory, then # MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax # Content Delivery Network so you can quickly see the result without installing # MathJax. However, it is strongly recommended to install a local copy of # MathJax from http://www.mathjax.org before deployment. # The default value is: http://cdn.mathjax.org/mathjax/latest. # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest # The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax # extension names that should be enabled during MathJax rendering. For example # MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_EXTENSIONS = # The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces # of code that will be used on startup of the MathJax code. See the MathJax site # (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an # example see the documentation. # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_CODEFILE = # When the SEARCHENGINE tag is enabled doxygen will generate a search box for # the HTML output. The underlying search engine uses javascript and DHTML and # should work on any modern browser. Note that when using HTML help # (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) # there is already a search function so this one should typically be disabled. # For large projects the javascript based search engine can be slow, then # enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to # search using the keyboard; to jump to the search box use + S # (what the is depends on the OS and browser, but it is typically # , /