flatbuffers: Add LoadBuffer utility#176
Conversation
|
The created documentation from the pull request is available at: docu-html |
OliverHeilwagen
left a comment
There was a problem hiding this comment.
Only remaining point is API return type: Result vs expected.
I just found out its |
In this case i would assume we should go with |
|
@4og and @fbaeuerle would it be possible to squash merge this pr with the message: flatbuffers: Add LoadBuffer score/flatbuffers/load_buffer.hpp — public API header with LoadBuffer functions returning a Result type Build & CI changes score/flatbuffers/BUILD - flatbufferutils library for LoadBuffer Tooling fixes .clang-tidy-minimal — renamed ExtraArgs → ExtraArgsBefore |
bf6210c to
0d42c0e
Compare
There was a problem hiding this comment.
Pull request overview
Adds a new score::flatbuffers::LoadBuffer utility to load binary FlatBuffer files into either std::vector<uint8_t> or std::pmr::vector<uint8_t>, and wires it into examples, tests, Bazel, and CI tooling.
Changes:
- Introduce public
LoadBufferAPI plus internal OS-abstraction-based implementation and translation unit. - Add unit + integration tests for success and error-path behaviors; update the config-usecase demo test to use the new API.
- Add Bazel targets and supporting CI/tooling tweaks (coverage symlink, clang-tidy config rename, pre-commit exclusions, gitignore).
Reviewed changes
Copilot reviewed 11 out of 13 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| score/flatbuffers/load_buffer.hpp | New public API header declaring LoadBuffer overloads and documenting error behavior. |
| score/flatbuffers/details/load_buffer_internal.hpp | New internal templated implementation using OS abstractions (open/fstat/read/close). |
| score/flatbuffers/details/load_buffer.cpp | Implements the public API by delegating to the internal implementation. |
| score/flatbuffers/details/load_buffer_test.cpp | Unit tests with OS mocks + smoke tests for public API. |
| score/flatbuffers/test/load_buffer_test.cpp | Integration tests performing real filesystem I/O and checking returned Error::Codes. |
| score/flatbuffers/examples/config_usecase/demo_app_test.cpp | Switch demo to use LoadBuffer instead of ad-hoc file reading. |
| score/flatbuffers/examples/config_usecase/BUILD | Add dependency on the new flatbufferutils library. |
| score/flatbuffers/details/idl_parser.cpp | Relocates/provides minimal FlatBuffers version symbol implementation. |
| score/flatbuffers/BUILD | Adds flatbufferutils library and new cc_test targets; updates flatbufferscpp source path. |
| .github/workflows/coverage_report.yml | Creates/removes an external symlink so genhtml can resolve external flatbuffers headers. |
| .gitignore | Ignores generated cpp_coverage output directory. |
| .clang-tidy-minimal | Renames clang-tidy config key to ExtraArgsBefore. |
| .pre-commit-config.yaml | Excludes load_buffer_internal.hpp from clang-tidy and updates exclude regex. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
0d42c0e to
8526c57
Compare
fc692a8 to
e4fb461
Compare
score/flatbuffers/load_buffer.hpp — public API header with LoadBuffer functions returning a Result type score/flatbuffers/details/load_buffer_internal.hpp — internal implementation details score/flatbuffers/details/load_buffer.cpp — implementation translation unit score/flatbuffers/details/load_buffer_test.cpp - unit test score/flatbuffers/test/load_buffer_test.cpp - integration test Build & CI changes score/flatbuffers/BUILD - added flatbufferutils library for LoadBuffer .github/workflows/coverage_report.yml — added --source-directory option .gitignore — added cpp_coverage directory Tooling fixes .clang-tidy-minimal — renamed ExtraArgs → ExtraArgsBefore .pre-commit-config.yaml — excluded load_buffer_internal.hpp from clang-tidy (private header with no compile commands; checked indirectly via load_buffer.cpp) score/flatbuffers/examples/config_usecase/demo_app_test.cpp — minor cleanup
e4fb461 to
5ac15ee
Compare
|
Closes #126 |
flatbuffers: Add LoadBuffer
score/flatbuffers/load_buffer.hpp — public API header with LoadBuffer functions returning a Result type
score/flatbuffers/details/load_buffer_internal.hpp — internal implementation details
score/flatbuffers/details/load_buffer.cpp — implementation translation unit
score/flatbuffers/details/load_buffer_test.cpp - unit test
score/flatbuffers/test/load_buffer_test.cpp - integration test
Build & CI changes
score/flatbuffers/BUILD - added flatbufferutils library for LoadBuffer
.github/workflows/coverage_report.yml — added --source-directory option
.gitignore — added cpp_coverage directory
Tooling fixes
.clang-tidy-minimal — renamed ExtraArgs → ExtraArgsBefore
.pre-commit-config.yaml — excluded load_buffer_internal.hpp from clang-tidy (private header with no compile commands; checked indirectly via load_buffer.cpp)
score/flatbuffers/examples/config_usecase/demo_app_test.cpp — minor cleanup