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

Typedefs

using nnl::asset::Asset = std::map<u32, Buffer>
 A container for related parts of a complete asset.
using nnl::asset::AssetView = std::map<u32, BufferView>
 A non-owning view of an asset container.

Functions

bool nnl::asset::IsOfType (BufferView buffer)
 Tests if the provided file is an asset container.
Asset nnl::asset::Import (BufferView buffer)
 Parses a binary file and converts it into an Asset object.
AssetView nnl::asset::ImportView (BufferView buffer)
 Parses a binary file and converts it into an AssetView object.
Buffer nnl::asset::Export (const Asset &asset_container)
 Converts an asset container to a binary file representation.

Detailed Description

Typedef Documentation

◆ Asset

using nnl::asset::Asset = std::map<u32, Buffer>

A container for related parts of a complete asset.

This container typically holds closely related components of a complete asset.

For instance, it can store parts of a 3D object, such as meshes, textures, and animations. In other instances, it can hold components of a text archive, including a bitmap font and textual data. Each individual component is typically associated with a specific numeric key, which depends on the category of the container.

See also
nnl::asset::Import
nnl::asset::Category
nnl::asset::Categorize
nnl::asset::AssetView

◆ AssetView

using nnl::asset::AssetView = std::map<u32, BufferView>

A non-owning view of an asset container.

This type is almost identical to Asset and represents the same container 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::asset::Asset
nnl::asset::ImportView

Function Documentation

◆ Export()

Buffer nnl::asset::Export ( const Asset & asset_container)
nodiscard

Converts an asset container to a binary file representation.

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

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

◆ Import()

Asset nnl::asset::Import ( BufferView buffer)

Parses a binary file and converts it into an Asset object.

This function takes a binary representation of an asset container, parses its contents, and converts them into an Asset object for easier access and modification.

Parameters
bufferThe binary data to be processed.
Returns
An Asset object consisting of numeric keys and file buffers.
See also
nnl::asset::IsOfType
nnl::asset::ImportView
nnl::asset::Export

◆ ImportView()

AssetView nnl::asset::ImportView ( BufferView buffer)

Parses a binary file and converts it into an AssetView object.

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

Parameters
bufferThe binary data to be processed.
Returns
An AssetView object representing the converted data.
See also
nnl::action::IsOfType
nnl::asset::Asset
nnl::asset::AssetView

◆ IsOfType()

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

Tests if the provided file is an asset container.

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

Parameters
bufferThe data to be tested.
Returns
true if the file is identified as an asset container
See also
nnl::asset::Import
nnl::asset::ImportView