class final
#include <bsa/tes3.hpp>
file Represents a file within the TES3 virtual filesystem.
Base classes
- class bsa::components::byte_container
- A byte storage container without compression support.
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
Member types
-
using key = components::
key<hashing:: hash, hashing:: hash_file_in_place> - The key used to indentify a file.
Modifiers
- void clear() noexcept
- Clears the contents of the file.
-
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.
Reading
-
void read(read_
source a_source) - Reads the contents of the source.
Writing
-
void write(write_
sink a_sink) const - Writes the contents of the object to the destination.
Function documentation
bool bsa:: tes3:: file:: empty() const noexcept
#include <bsa/detail/common.hpp>
Checks if the underlying byte container is empty.
std:: size_t bsa:: tes3:: file:: size() const noexcept
#include <bsa/detail/common.hpp>
Returns the size of the underlying byte container.
std:: span<const std:: byte> bsa:: tes3:: file:: as_bytes() const noexcept
#include <bsa/detail/common.hpp>
Retrieves an immutable view into the underlying bytes.
const std:: byte* bsa:: tes3:: file:: data() const noexcept
#include <bsa/detail/common.hpp>
Retrieves an immutable pointer to the underlying bytes.
void bsa:: tes3:: file:: set_data(std:: span<const std:: byte> a_data) noexcept
#include <bsa/detail/common.hpp>
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:: tes3:: file:: set_data(std:: vector<std:: byte> a_data) noexcept
#include <bsa/detail/common.hpp>
Assigns the underlying container to be an owning view into the given data.
Parameters | |
---|---|
a_data | The data to take ownership of. |
void bsa:: tes3:: file:: read(read_ source a_source)
Reads the contents of the source.
Parameters | |
---|---|
a_source | Where/how to read the given file. |
Exceptions | |
binary_io::buffer_exhausted | Thrown when reads index out of bounds. |
void bsa:: tes3:: file:: write(write_ sink a_sink) const
Writes the contents of the object to the destination.
Parameters | |
---|---|
a_sink | Where/how to write the given file. |
Exceptions | |
std:: |
Thrown when filesystem errors are encountered. |
binary_io::buffer_exhausted | Thrown when the output buffer is exhausted. |