bsa namespace

Namespaces

namespace components
namespace concepts
namespace fo4
namespace tes3
namespace tes4

Classes

class compression_error
Classifies errors generated during compression library operations.
struct doxygen_detail
A doxygen only, detail class.
class exception
The base exception type for all bsa exceptions.

Enums

enum class compression_type { decompressed, compressed }
Indicates whether the operation should finish by compressing the data or not.
enum class copy_type { deep, shallow }
The copy method to use when reading from in-memory buffers.
enum class file_format { tes3, tes4, fo4 }
The file format for a given archive.

Functions

auto guess_file_format(std::filesystem::path a_path) -> std::optional<file_format>
Guesses the archive format for a given file.
auto guess_file_format(std::span<const std::byte> a_src) -> std::optional<file_format>
Guesses the archive format for a given file.
auto make_four_cc(std::string_view a_cc) -> std::uint32_t constexpr noexcept
Converts, at most, the first 4 characters of the given string into a 4 byte integer.

Enum documentation

enum class bsa::compression_type

Indicates whether the operation should finish by compressing the data or not.

Enumerators
decompressed

The data will finish in an uncompressed state.

compressed

The data will finish in a compressed state.

enum class bsa::copy_type

The copy method to use when reading from in-memory buffers.

Enumerators
deep

Makes a deep copy of the given data (i.e. uses an allocating std::vector instead of a lightweight std::span).

shallow

Make a shallow copy of the given data (i.e. uses a lightweight std::span instead of an allocating std::vector).

enum class bsa::file_format

The file format for a given archive.

Function documentation

std::optional<file_format> bsa::guess_file_format(std::filesystem::path a_path)

Guesses the archive format for a given file.

Parameters
a_path The file to guess.
Returns The guessed archive format for the given file, or std::nullopt if the file doesn't match any known format.
Exceptions
binary_io::buffer_exhausted Thrown when reads index out of bounds.
bsa::exception Thrown when parsing errors are encountered.

std::optional<file_format> bsa::guess_file_format(std::span<const std::byte> a_src)

Guesses the archive format for a given file.

Parameters
a_src The buffer to guess.
Returns The guessed archive format for the given file, or std::nullopt if the file doesn't match any known format.
Exceptions
binary_io::buffer_exhausted Thrown when reads index out of bounds.
bsa::exception Thrown when parsing errors are encountered.

std::uint32_t bsa::make_four_cc(std::string_view a_cc) constexpr noexcept

Converts, at most, the first 4 characters of the given string into a 4 byte integer.