MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / BinaryBlob

Class BinaryBlob

include/engine/framework/io/binary.h:11–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9namespace engine::io {
10
11class BinaryBlob {
12public:
13 BinaryBlob() = default;
14 ~BinaryBlob();
15
16 BinaryBlob(const BinaryBlob &) = delete;
17 BinaryBlob & operator=(const BinaryBlob &) = delete;
18 BinaryBlob(BinaryBlob && other) noexcept;
19 BinaryBlob & operator=(BinaryBlob && other) noexcept;
20
21 [[nodiscard]] const std::byte * data() const noexcept;
22 [[nodiscard]] size_t size() const noexcept;
23 [[nodiscard]] bool empty() const noexcept;
24 void discard_range(size_t offset, size_t size) const noexcept;
25
26private:
27 friend BinaryBlob read_binary_blob(const std::filesystem::path & path);
28
29 explicit BinaryBlob(std::vector<std::byte> owned) noexcept;
30 BinaryBlob(const std::byte * mapped, size_t size) noexcept;
31 void reset() noexcept;
32
33 std::vector<std::byte> owned_;
34 const std::byte * mapped_ = nullptr;
35 size_t size_ = 0;
36};
37
38BinaryBlob read_binary_blob(const std::filesystem::path & path);
39std::vector<std::byte> read_binary_file(const std::filesystem::path & path);

Callers 2

release_storageMethod · 0.85
read_binary_blobFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected