Manages the asset paths for the application. More...
#include <Assets.hpp>
Public Member Functions | |
void | initialize (const string &executable_file_path) |
Initializes the base path for assets based on the executable file path. | |
path | get_asset_path (const string &asset_name) |
Gets the full path of an asset by its name. | |
Static Public Member Functions | |
static Assets & | instance () |
Returns the singleton instance of the Assets class. | |
Private Member Functions | |
Assets ()=default | |
Construct a new Assets object. | |
Assets (const Assets &)=delete | |
Destroy the Assets object. | |
Assets (const Assets &&)=delete | |
Move constructor is deleted to prevent moving the Assets instance. | |
Assets & | operator= (const Assets &)=delete |
Assignment operator is deleted to prevent copying the Assets instance. | |
Assets & | operator= (const Assets &&)=delete |
Move assignment operator is deleted to prevent moving the Assets instance. | |
Private Attributes | |
path | base_path = "./" |
Manages the asset paths for the application.
The Assets class provides a singleton instance to manage asset paths, allowing for easy retrieval of asset files. It initializes the base path based on the executable file path, and provides a method to get the full path of an asset by its name.
|
privatedefault |
|
privatedelete |
|
privatedelete |
Move constructor is deleted to prevent moving the Assets instance.
|
inline |
Gets the full path of an asset by its name.
This method constructs the full path to an asset file by appending the asset name to the base path.
asset_name | The name of the asset file. |
|
inline |
Initializes the base path for assets based on the executable file path.
This method sets the base path to the "assets" directory relative to the executable's location. In debug mode, it uses a relative path to the assets directory. In release mode, it sets the base path to a specific directory.
executable_file_path | The path of the executable file. |
|
inlinestatic |
Move assignment operator is deleted to prevent moving the Assets instance.
Assignment operator is deleted to prevent copying the Assets instance.
|
private |