bsa::components::byte_container class

A byte storage container without compression support.

Base classes

class basic_byte_container
A basic byte storage container.

Derived classes

class bsa::tes3::file final
Represents a file within the TES3 virtual filesystem.

Capacity

auto empty() const -> bool noexcept
Checks if the underlying byte container is empty.
auto size() const -> std::size_t noexcept
Returns the size of the underlying byte container.

Element access

auto as_bytes() const -> std::span<const std::byte> noexcept
Retrieves an immutable view into the underlying bytes.
auto data() const -> const std::byte* noexcept
Retrieves an immutable pointer to the underlying bytes.

Modifiers

void set_data(std::span<const std::byte> a_data) noexcept
Assigns the underlying container to be a non-owning view into the given data.
void set_data(std::vector<std::byte> a_data) noexcept
Assigns the underlying container to be an owning view into the given data.

Function documentation

void bsa::components::byte_container::set_data(std::span<const std::byte> a_data) noexcept

Assigns the underlying container to be a non-owning view into the given data.

Parameters
a_data The data to store a view to.

void bsa::components::byte_container::set_data(std::vector<std::byte> a_data) noexcept

Assigns the underlying container to be an owning view into the given data.

Parameters
a_data The data to take ownership of.