Vulkan Schnee 0.0.1 (22840dc8)
High-performance rendering engine
Loading...
Searching...
No Matches
Asset::Path Struct Reference

Identifies a single asset file on disk. More...

#include <AssetPath.h>

Public Member Functions

 Path ()=default
 Creates an empty asset file path.
 Path (const std::filesystem::path &path)
 Creates an asset path from a filesystem path.
 Path (std::filesystem::path &&path) noexcept
 Move-constructs an asset path from a filesystem path.
const std::filesystem::path & fsPath () const
 Gets the stored filesystem path.
const std::filesystem::path & getFilePath () const
 Gets the stored filesystem path.
std::string string () const
 Converts the stored path to a string.
bool empty () const
 Checks whether the stored path is empty.
std::size_t hash () const noexcept
 Calculates a hash for unordered containers.
 operator const std::filesystem::path & () const
 Converts this asset path to its filesystem path.
bool operator== (const Path &other) const
 Compares two asset file paths.
void reset ()
 Clears the stored filesystem path.

Private Attributes

std::filesystem::path filePath = ""

Detailed Description

Identifies a single asset file on disk.

Path wraps std::filesystem::path so engine asset APIs do not expose raw filesystem paths as asset keys. Use MeshPath when addressing a named object inside a container file such as glTF.

Definition at line 13 of file AssetPath.h.

Constructor & Destructor Documentation

◆ Path() [1/3]

Asset::Path::Path ( )
default

Creates an empty asset file path.

Referenced by operator==().

Here is the caller graph for this function:

◆ Path() [2/3]

Asset::Path::Path ( const std::filesystem::path & path)

Creates an asset path from a filesystem path.

Parameters
pathFilesystem path to store.

◆ Path() [3/3]

Asset::Path::Path ( std::filesystem::path && path)
noexcept

Move-constructs an asset path from a filesystem path.

Parameters
pathFilesystem path to move into this asset path.

Member Function Documentation

◆ empty()

bool Asset::Path::empty ( ) const
inlinenodiscard

Checks whether the stored path is empty.

Returns
True when no path is stored.

Definition at line 53 of file AssetPath.h.

References filePath.

◆ fsPath()

const std::filesystem::path & Asset::Path::fsPath ( ) const
inlinenodiscard

Gets the stored filesystem path.

Returns
Stored path.

Definition at line 35 of file AssetPath.h.

References filePath.

◆ getFilePath()

const std::filesystem::path & Asset::Path::getFilePath ( ) const
inlinenodiscard

Gets the stored filesystem path.

Returns
Stored path.

Definition at line 41 of file AssetPath.h.

References filePath.

Referenced by Engine::Core::AssetManager::getAsset().

Here is the caller graph for this function:

◆ hash()

std::size_t Asset::Path::hash ( ) const
nodiscardnoexcept

Calculates a hash for unordered containers.

Returns
Hash of the stored path.

◆ operator const std::filesystem::path &()

Asset::Path::operator const std::filesystem::path & ( ) const
inline

Converts this asset path to its filesystem path.

Returns
Stored filesystem path.

Definition at line 65 of file AssetPath.h.

References filePath.

◆ operator==()

bool Asset::Path::operator== ( const Path & other) const
inline

Compares two asset file paths.

Parameters
otherPath to compare with.
Returns
True when both paths are identical.

Definition at line 72 of file AssetPath.h.

References filePath, and Path().

Here is the call graph for this function:

◆ reset()

void Asset::Path::reset ( )

Clears the stored filesystem path.

◆ string()

std::string Asset::Path::string ( ) const
inlinenodiscard

Converts the stored path to a string.

Returns
Path string.

Definition at line 47 of file AssetPath.h.

References filePath.

Member Data Documentation

◆ filePath

std::filesystem::path Asset::Path::filePath = ""
private

The documentation for this struct was generated from the following file:
  • /workspace/magerbeton/gl3-vulkan/code/Engine/include/Engine/Files/AssetPath.h