52template <
typename TData = Buffer>
90using Dig = std::vector<FileRecord>;
117bool IsOfType(
const std::filesystem::path& path);
140Dig Import(
const std::filesystem::path& path);
174void Export(
const Dig& cfcdig,
const std::filesystem::path& path);
180void Export(
const DigView& cfcdig,
const std::filesystem::path& path);
227 u32 compressed_size = 0;
229 u16 is_compressed = 0;
230 u32 decompressed_size = 0;
233static_assert(
sizeof(RFileRecord) == 0x10);
235template <
typename TData = Buffer>
237 std::vector<RFileRecord> file_records;
240 std::map<u32, TData> file_buffers;
243RDig<Buffer> Parse(
Reader& f);
247Dig Convert(RDig<Buffer>&& cfcdig);
249DigView Convert(RDig<BufferView>&& cfcdig);
Contains macros and definitions for fixed-width types.
Buffer Compress(BufferView buffer)
Compress binary data.
Buffer Decompress(BufferView buffer, u32 decompressed_size)
Decompress binary data.
bool is_compressed
Definition dig.hpp:54
u32 decompressed_size
Definition dig.hpp:55
Buffer buffer
Definition dig.hpp:58
u16 num_entries
Definition dig.hpp:57
A raw entry in the dig archive.
Definition dig.hpp:53
TFileRecord< BufferView > FileRecordView
A raw entry in the dig archive.
Definition dig.hpp:75
TFileRecord< Buffer > FileRecord
A raw entry in the dig archive.
Definition dig.hpp:67
std::vector< FileRecord > Dig
A primary game data archive.
Definition dig.hpp:90
std::vector< FileRecordView > DigView
A non-owning view of a dig archive.
Definition dig.hpp:101
bool IsOfType(BufferView buffer)
Tests if the provided file is a dig archive.
DigView ImportView(BufferView buffer)
Parses a binary file and converts it into DigView.
Buffer Export(const Dig &cfcdig)
Converts a dig archive to a binary file representation.
Dig Import(BufferView buffer)
Parses a binary file and converts it into a Dig object.
constexpr u32 kBlockSize
The size of an LBA sector in bytes.
Definition dig.hpp:223
std::uint16_t u16
16-bit unsigned integer
Definition fixed_type.hpp:62
std::uint32_t u32
32-bit unsigned integer
Definition fixed_type.hpp:60
#define NNL_PACK(...)
A structure packing directive.
Definition fixed_type.hpp:41
Provides classes for reading and writing binary data to and from various sources.
Provides structures and functions to manage primary game archives.
Definition dig.hpp:34
Definition exception.hpp:56