btu::bsa namespace

Namespaces

namespace dummy

Classes

struct AllowedPath
class Archive
class File
struct PackSettings
struct UnpackSettings

Enums

enum class ArchiveType: std::uint8_t { Textures, Standard }
enum class ArchiveVersion: std::uint32_t { tes3, tes4, fo3, tes5, sse, fo4, starfield }
enum class Compression: std::uint8_t { Yes, No }
enum class FileTypes { Standard, Texture, Incompressible, Blacklist, Plugin, BSA }
enum class PluginLoadingMode { Limited, Unlimited }
enum class UnpackResult { Success = 0, UnreadableArchive, FailedToDeleteArchive }

Typedefs

using AllowFilePred = std::function<bool(const Path&dir, fs::directory_entry const&file_info)>
using UnderlyingFile = { {ArchiveVersion::tes3, "tes3"}, {ArchiveVersion::tes4, "tes4"}, {ArchiveVersion::fo3, "fo3"}, {ArchiveVersion::tes5, "tes5"}, {ArchiveVersion::sse, "sse"}, {ArchiveVersion::fo4, "fo4"}, {ArchiveVersion::starfield, "starfield"}, }) using TES4ArchiveType=libbsa::tes4::archive_type std::variant<libbsa::tes3::file, libbsa::tes4::file, libbsa::fo4::file>

Functions

NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(AllowedPath, extension, directories) struct Settings
NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(Settings, game, max_size, version, has_texture_version, suffix, texture_suffix, extension, plugin_extensions, dummy_plugin, standard_files, texture_files, incompressible_files) inline auto Settings
NLOHMANN_JSON_SERIALIZE_ENUM(ArchiveType, {{ArchiveType::Textures, "textures"}, {ArchiveType::Standard, "standard"}}) NLOHMANN_JSON_SERIALIZE_ENUM(ArchiveVersion
NLOHMANN_JSON_SERIALIZE_ENUM(FileTypes, {{FileTypes::Standard, "standard"}, {FileTypes::Texture, "texture"}, {FileTypes::Incompressible, "incompressible"}, {FileTypes::Blacklist, "blacklist"}, {FileTypes::Plugin, "plugin"}, {FileTypes::BSA, "bsa"}}) static const expr auto k_bsa_ext
NLOHMANN_JSON_SERIALIZE_ENUM(PluginLoadingMode, {{PluginLoadingMode::Limited, "limited"}, {PluginLoadingMode::Unlimited, "unlimited"}})
void clean_dummy_plugins(std::span<const Path> plugins, const Settings& sets)
auto find_archive_name(const Path& directory, const Settings& sets, ArchiveType type) →  std::optional<Path> noexcept
Find a name for the archive. Try plugin name, then directory name, then random name.
auto get_filetype(const Path& filepath, const Path& root, const Settings& sets) →  FileTypes
auto get_tes4_archive_type(const Path& filepath, const Settings& sets) →  std::optional<TES4ArchiveType>
auto list_archive(const Path& dir, const Settings& sets) →  std::vector<Path> noexcept
auto list_plugins(const Path& dir, const Settings& sets) →  std::vector<Path> noexcept
void make_dummy_plugins(std::span<const Path> archives, const Settings& sets)
auto pack(PackSettings settings) →  flux::generator<Archive && > noexcept
void remake_dummy_plugins(const Path& directory, const Settings& sets)
Cleans dummy plugins and make new ones.
auto unpack(UnpackSettings sets) →  UnpackResult
template <class... Keys>
auto virtual_to_local_path(const Keys&... a_keys) →  std::u8string noexcept

Variables

static auto k_archive_extensions constexpr
static auto k_ba2_ext constexpr

Enum documentation

enum class btu::bsa::ArchiveType: std::uint8_t

enum class btu::bsa::ArchiveVersion: std::uint32_t

enum class btu::bsa::Compression: std::uint8_t

enum class btu::bsa::FileTypes

enum class btu::bsa::PluginLoadingMode

enum class btu::bsa::UnpackResult

Typedef documentation

using btu::bsa::AllowFilePred = std::function<bool(const Path&dir, fs::directory_entry const&file_info)>

using btu::bsa::UnderlyingFile = { {ArchiveVersion::tes3, "tes3"}, {ArchiveVersion::tes4, "tes4"}, {ArchiveVersion::fo3, "fo3"}, {ArchiveVersion::tes5, "tes5"}, {ArchiveVersion::sse, "sse"}, {ArchiveVersion::fo4, "fo4"}, {ArchiveVersion::starfield, "starfield"}, }) using TES4ArchiveType=libbsa::tes4::archive_type std::variant<libbsa::tes3::file, libbsa::tes4::file, libbsa::fo4::file>

Function documentation

btu::bsa::NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(AllowedPath, extension, directories) struct Settings

btu::bsa::NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(Settings, game, max_size, version, has_texture_version, suffix, texture_suffix, extension, plugin_extensions, dummy_plugin, standard_files, texture_files, incompressible_files) inline auto Settings

btu::bsa::NLOHMANN_JSON_SERIALIZE_ENUM(ArchiveType, {{ArchiveType::Textures, "textures"}, {ArchiveType::Standard, "standard"}}) NLOHMANN_JSON_SERIALIZE_ENUM(ArchiveVersion

btu::bsa::NLOHMANN_JSON_SERIALIZE_ENUM(FileTypes, {{FileTypes::Standard, "standard"}, {FileTypes::Texture, "texture"}, {FileTypes::Incompressible, "incompressible"}, {FileTypes::Blacklist, "blacklist"}, {FileTypes::Plugin, "plugin"}, {FileTypes::BSA, "bsa"}}) static const expr auto k_bsa_ext

void btu::bsa::clean_dummy_plugins(std::span<const Path> plugins, const Settings& sets)

std::optional<Path> btu::bsa::find_archive_name(const Path& directory, const Settings& sets, ArchiveType type) noexcept

Find a name for the archive. Try plugin name, then directory name, then random name.

Parameters
directory The directory that will contain the archive
sets Game settings
type Archive type
Returns An archive name,or std::nullopt if you are particularly unlucky

FileTypes btu::bsa::get_filetype(const Path& filepath, const Path& root, const Settings& sets)

std::optional<TES4ArchiveType> btu::bsa::get_tes4_archive_type(const Path& filepath, const Settings& sets)

std::vector<Path> btu::bsa::list_archive(const Path& dir, const Settings& sets) noexcept

std::vector<Path> btu::bsa::list_plugins(const Path& dir, const Settings& sets) noexcept

void btu::bsa::make_dummy_plugins(std::span<const Path> archives, const Settings& sets)

flux::generator<Archive && > btu::bsa::pack(PackSettings settings) noexcept

void btu::bsa::remake_dummy_plugins(const Path& directory, const Settings& sets)

Cleans dummy plugins and make new ones.

template <class... Keys>
std::u8string btu::bsa::virtual_to_local_path(const Keys&... a_keys) noexcept

Variable documentation

static auto btu::bsa::k_archive_extensions constexpr

static auto btu::bsa::k_ba2_ext constexpr