NSUNI/NSLAR Library a250670
Loading...
Searching...
No Matches

Classes

struct  nnl::dig::TFileRecord< TData >
 A raw entry in the dig archive. More...

Typedefs

using nnl::dig::FileRecord = TFileRecord<Buffer>
 A raw entry in the dig archive.
using nnl::dig::FileRecordView = TFileRecord<BufferView>
 A raw entry in the dig archive.
using nnl::dig::Dig = std::vector<FileRecord>
 A primary game data archive.
using nnl::dig::DigView = std::vector<FileRecordView>
 A non-owning view of a dig archive.

Functions

bool nnl::dig::IsOfType (BufferView buffer)
 Tests if the provided file is a dig archive.
Dig nnl::dig::Import (BufferView buffer)
 Parses a binary file and converts it into a Dig object.
DigView nnl::dig::ImportView (BufferView buffer)
 Parses a binary file and converts it into DigView.
Buffer nnl::dig::Export (const Dig &cfcdig)
 Converts a dig archive to a binary file representation.

Detailed Description


Class Documentation

◆ nnl::dig::TFileRecord

struct nnl::dig::TFileRecord
template<typename TData = Buffer>
struct nnl::dig::TFileRecord< TData >

A raw entry in the dig archive.

This structure encapsulates data and metadata of an entry in the dig archive.

Note
The buffer it stores is also a nested archive that may need to be decompressed before importing.
See also
nnl::dig::Dig
nnl::dig::Decompress

Public Attributes

bool is_compressed = false
 If the buffer is compressed.
u32 decompressed_size = 0
u16 num_entries = 0
 The number of entries in the nested archive.
TData buffer
 Binary file buffer that stores a nested archive.

Member Data Documentation

◆ buffer

template<typename TData = Buffer>
TData nnl::dig::TFileRecord< TData >::buffer

Binary file buffer that stores a nested archive.

See also
nnl::dig_entry::DigEntry

◆ decompressed_size

template<typename TData = Buffer>
u32 nnl::dig::TFileRecord< TData >::decompressed_size = 0

Expected size after decompression. Matches the size of the buffer if it's not compressed.

◆ is_compressed

template<typename TData = Buffer>
bool nnl::dig::TFileRecord< TData >::is_compressed = false

If the buffer is compressed.

◆ num_entries

template<typename TData = Buffer>
u16 nnl::dig::TFileRecord< TData >::num_entries = 0

The number of entries in the nested archive.

Typedef Documentation

◆ Dig

using nnl::dig::Dig = std::vector<FileRecord>

A primary game data archive.

The primary container for game assets. The archive format is known by different names: CFC.DIG in NUC2, *.BIN in NSUNI and NSLAR. It consists of nested archives.

See also
nnl::dig::Import
nnl::dig::Export
nnl::dig::FileRecord
nnl::dig::DigView
nnl::dig_entry::DigEntry
nnl::md5list::Generate

◆ DigView

using nnl::dig::DigView = std::vector<FileRecordView>

A non-owning view of a dig archive.

This type is almost identical to Dig and represents the same archive but allows for access to its entries via references to the source Buffer. It's most suitable when no modifications to the data are expected.

See also
nnl::dig::Dig
nnl::dig::ImportView

◆ FileRecord

A raw entry in the dig archive.

See also
nnl::dig::TFileRecord
nnl::dig::Dig

◆ FileRecordView

Function Documentation

◆ Export()

Buffer nnl::dig::Export ( const Dig & cfcdig)
nodiscard

Converts a dig archive to a binary file representation.

This function takes a Dig archive and converts it into a Buffer, which represents the binary format of the container.

Parameters
cfcdigThe object to be converted.
Returns
A Buffer containing the binary representation of the container.

◆ Import()

Dig nnl::dig::Import ( BufferView buffer)

Parses a binary file and converts it into a Dig object.

This function takes a binary representation of a dig archive, parses its contents, and converts them into a Dig object for easier access and modification.

Parameters
bufferThe binary data to be processed.
Returns
A Dig object consisting of file records.
Note
In NSUNI, the archives may be encrypted and must be decrypted prior to importing.
See also
nnl::format::kPGD
nnl::dig::IsOfType
nnl::dig::ImportView
nnl::dig::Export

◆ ImportView()

DigView nnl::dig::ImportView ( BufferView buffer)

Parses a binary file and converts it into DigView.

DigView does not store copies of file buffers but stores references to the original data.

Parameters
bufferThe binary data to be processed.
Returns
A DigView object representing the converted data.
Note
In NSUNI, the archives may be encrypted and must be decrypted prior to importing.
See also
nnl::format::kPGD
nnl::dig::Dig
nnl::dig::IsOfType
nnl::dig::Export

◆ IsOfType()

bool nnl::dig::IsOfType ( BufferView buffer)

Tests if the provided file is a dig archive.

This function takes data representing a file and checks whether it corresponds to the in-game dig archive format.

Parameters
bufferThe data to be tested.
Returns
true if the file is identified as a dig archive
See also
nnl::dig::Import
nnl::dig::ImportView