Nameless Engine
Loading...
Searching...
No Matches
ne::ProjectPaths Class Reference

#include <ProjectPaths.h>

Public Member Functions

 ProjectPaths (const ProjectPaths &)=delete
 
ProjectPathsoperator= (const ProjectPaths &)=delete
 

Static Public Member Functions

static std::filesystem::path getPathToEngineConfigsDirectory ()
 
static std::filesystem::path getPathToLogsDirectory ()
 
static std::filesystem::path getPathToPlayerProgressDirectory ()
 
static std::filesystem::path getPathToPlayerSettingsDirectory ()
 
static std::filesystem::path getPathToCompiledShadersDirectory ()
 
static std::filesystem::path getPathToResDirectory (ResourceDirectory directory)
 
static std::filesystem::path getPathToBaseConfigDirectory ()
 

Static Private Member Functions

static std::filesystem::path getPathToResDirectory ()
 

Static Private Attributes

static constexpr std::string_view sLogsDirectoryName = "logs"
 
static constexpr std::string_view sProgressDirectoryName = "progress"
 
static constexpr std::string_view sSettingsDirectoryName = "settings"
 
static constexpr std::string_view sEngineDirectoryName = "engine"
 
static constexpr std::string_view sShaderCacheDirectoryName = "shader_cache"
 
static constexpr std::string_view sGameResourcesDirectoryName = "game"
 
static constexpr std::string_view sEngineResourcesDirectoryName = "engine"
 
static constexpr std::string_view sEditorResourcesDirectoryName = "editor"
 

Detailed Description

Provides static functions for acquiring paths to project log/save/resource/etc. directories.

Member Function Documentation

◆ getPathToBaseConfigDirectory()

std::filesystem::path ne::ProjectPaths::getPathToBaseConfigDirectory ( )
static

Returns base (root) directory used to store save and log files, also creates this base directory if not exists.

On Windows, returns something like this: "C:\Users\user\AppData\Local\nameless-engine\" On Linux, returns something like this: "~/.config/nameless-engine/"

Returns
Path to base engine directory. Does not contain application name in the returned path.

◆ getPathToCompiledShadersDirectory()

std::filesystem::path ne::ProjectPaths::getPathToCompiledShadersDirectory ( )
static

Returns path to the directory that is used to store compiled shaders.

Returns
Path to the directory.

◆ getPathToEngineConfigsDirectory()

std::filesystem::path ne::ProjectPaths::getPathToEngineConfigsDirectory ( )
static

Returns path to the directory that is used to store engine configuration files (settings files), such as renderer configuration, shader manager configuration and etc.

Returns
Path to the directory that is used to store engine configuration files.

◆ getPathToLogsDirectory()

std::filesystem::path ne::ProjectPaths::getPathToLogsDirectory ( )
static

Returns path to the directory that is used to store log files.

Returns
Path to the directory.

◆ getPathToPlayerProgressDirectory()

std::filesystem::path ne::ProjectPaths::getPathToPlayerProgressDirectory ( )
static

Returns path to the directory that is used to store player's game progress.

Returns
Path to the directory.

◆ getPathToPlayerSettingsDirectory()

std::filesystem::path ne::ProjectPaths::getPathToPlayerSettingsDirectory ( )
static

Returns path to the directory that is used to store player's game settings.

Returns
Path to the directory.

◆ getPathToResDirectory() [1/2]

std::filesystem::path ne::ProjectPaths::getPathToResDirectory ( )
staticprivate

Returns path to the res directory that is located next to the executable.

Remarks
Shows an error and throws an exception if path to the res directory does not exist.
Returns
Path to the res directory.

◆ getPathToResDirectory() [2/2]

std::filesystem::path ne::ProjectPaths::getPathToResDirectory ( ResourceDirectory  directory)
static

Returns path to the directory used to store resources.

Remarks
Shows an error and throws an exception if path to the resources directory does not exist.
Parameters
directorySpecific directory to query.
Returns
Path to the directory.

Member Data Documentation

◆ sEditorResourcesDirectoryName

constexpr std::string_view ne::ProjectPaths::sEditorResourcesDirectoryName = "editor"
staticconstexprprivate

Name of the directory in which we store editor resources.

◆ sEngineDirectoryName

constexpr std::string_view ne::ProjectPaths::sEngineDirectoryName = "engine"
staticconstexprprivate

Name of the directory in which we store engine configuration files.

◆ sEngineResourcesDirectoryName

constexpr std::string_view ne::ProjectPaths::sEngineResourcesDirectoryName = "engine"
staticconstexprprivate

Name of the directory in which we store engine resources.

◆ sGameResourcesDirectoryName

constexpr std::string_view ne::ProjectPaths::sGameResourcesDirectoryName = "game"
staticconstexprprivate

Name of the directory in which we store game resources.

◆ sLogsDirectoryName

constexpr std::string_view ne::ProjectPaths::sLogsDirectoryName = "logs"
staticconstexprprivate

Name of the directory in which we store engine logs.

◆ sProgressDirectoryName

constexpr std::string_view ne::ProjectPaths::sProgressDirectoryName = "progress"
staticconstexprprivate

Directory name that is used to store player's progress.

◆ sSettingsDirectoryName

constexpr std::string_view ne::ProjectPaths::sSettingsDirectoryName = "settings"
staticconstexprprivate

Directory name that is used to store player's settings.

◆ sShaderCacheDirectoryName

constexpr std::string_view ne::ProjectPaths::sShaderCacheDirectoryName = "shader_cache"
staticconstexprprivate

Name of the directory in which we store compiled shaders.


The documentation for this class was generated from the following files: