📂 golxzn::os::filesystem 📂 1.6.5
golxzn filesystem submodule
Loading...
Searching...
No Matches
Initialization and setting up

Functions

static error golxzn::os::filesystem::initialize (const std::wstring_view application_name, const std::wstring_view assets_path=default_assets_directory_name)
 Initialize the Resource Manager.
 
static void golxzn::os::filesystem::set_application_name (const std::wstring_view application_name) noexcept
 Sets the application name object.
 
static void golxzn::os::filesystem::associate (std::wstring_view protocol, std::wstring &&prefix) noexcept
 Add the association between the protocol and the prefix. (ex. L"res://" and L"user://")
 

Detailed Description

Function Documentation

◆ associate()

static void golxzn::os::filesystem::associate ( std::wstring_view  protocol,
std::wstring &&  prefix 
)
staticnoexcept

Add the association between the protocol and the prefix. (ex. L"res://" and L"user://")

Add custom protocol to your application. For example, you could have a L"ab-test://" association with your own separated assets directory.

Warning
L"res://", L"user://", L"temp://" are reserved and cannot be used.
Parameters
protocolProtocol extension (ex. "res://"). Has to end with "://"
prefixPrefix of the path. Has to end with a slash!

◆ initialize()

static error golxzn::os::filesystem::initialize ( const std::wstring_view  application_name,
const std::wstring_view  assets_path = default_assets_directory_name 
)
static

Initialize the Resource Manager.

Parameters
application_nameYour application name or the name of the user assets directory
assets_pathThe name of the assets directory or the full path to the directory. If there's [LETTER]:/ or / at the beginning of the string, the path will be used as it is. Otherwise the path is relative to the program's directory.
Returns
golxzn::os::filesystem::error - The error message or an empty string if there's no error

◆ set_application_name()

static void golxzn::os::filesystem::set_application_name ( const std::wstring_view  application_name)
staticnoexcept

Sets the application name object.

Sets the name of the application which is used in the directory path for user data. If the name is empty, the default name will be used.

Warning
This method doesn't change the name of the user data directory!
Parameters
application_nameapplication name