coastline 0.0.4
Loading...
Searching...
No Matches
assetstorage.h
Go to the documentation of this file.
1#pragma once
2
3#include <cstdint>
4#include <expected>
5#include <filesystem>
6#include <optional>
7#include <string>
8#include <system_error>
9#include <vector>
10
11namespace coastline {
12
14inline constexpr const char *ASSET_ALIASES_FILE = "asset-aliases.txt";
15
22
28
36std::expected<AssetStorageSavings, std::string>
38
48
57
66std::expected<std::vector<AssetFileAlias>, std::string>
68
69} // namespace coastline
Definition assetimport.h:11
constexpr const char * ASSET_ALIASES_FILE
The alias-table filename for logical paths and their physical backing files.
Definition assetstorage.h:14
std::expected< AssetStorageSavings, std::string > DeduplicateAssetFiles(const std::filesystem::path &defaults)
Replace byte-identical generated files with aliases.
void RemoveAssetTree(const std::filesystem::path &path, std::error_code &error)
Delete a tree after restoring directory owner-write permissions, without following symlinks.
std::optional< std::string > FinalizeGeneratedAssetPacks(const std::filesystem::path &defaults)
Remove empty subdirectories and write permissions from generated packs, excluding mod packs.
std::expected< std::vector< AssetFileAlias >, std::string > ReadAssetFileAliases(const std::filesystem::path &pack, const std::filesystem::path &defaults)
Read and validate an alias table, including its physical targets.
A logical file backed by a physical file in the same pack or the default pack.
Definition assetstorage.h:17
std::filesystem::path target
Definition assetstorage.h:19
bool fromDefault
Definition assetstorage.h:20
std::filesystem::path path
Definition assetstorage.h:18
The number and total byte size of files removed from freshly converted generated packs.
Definition assetstorage.h:24
std::uintmax_t bytes
Definition assetstorage.h:26
std::uintmax_t files
Definition assetstorage.h:25