|
TrueReality
v0.1.1912
|
Functions | |
| static const std::string | DEFAULT_TR_FOLDER ("/.trueReality") |
| static const std::string | DATA_PATH_DEFAULT ("/Data") |
| static const std::string | STATIC_MESHES_PATH ("/StaticMeshes") |
| static const std::string | SKELETAL_MESHES_PATH ("/SkeletalMeshes") |
| static const std::string | SOUNDS_PATH ("/Sounds") |
| static const std::string | PARTICLES_PATH ("/Particles") |
| static const std::string | TEXTURES_PATH ("/Textures") |
| static const std::string | TERRAINS_PATH ("/Terrains") |
| static const std::string | SHADERS_PATH ("/Shaders") |
| static const std::string | GUI_PATH ("/GUI") |
| static const std::string | CONFIG_PATH ("/Config") |
| TR_UTIL_EXPORT std::string | GetUserHomeDirectory () |
| Get the USER Home directory. More... | |
| TR_UTIL_EXPORT std::string | GetUserDataPath () |
| Get the folder where TR will save and store User data files It is MyDocuments on Windows and the same as GetHomeDirectory() on Linux and Apple If TR_USER_DATA Environmental variable is defined, it will return the path in TR_USER_DATA. More... | |
| TR_UTIL_EXPORT std::string | GetStaticMeshesPath () |
| Gets static meshes path. More... | |
| TR_UTIL_EXPORT std::string | GetSkeletalMeshesPath () |
| Gets skeletal meshes path. More... | |
| TR_UTIL_EXPORT std::string | GetSoundsPath () |
| Gets sounds path. More... | |
| TR_UTIL_EXPORT std::string | GetParticlesPath () |
| Gets particles path. More... | |
| TR_UTIL_EXPORT std::string | GetTexturesPath () |
| Gets textures path. More... | |
| TR_UTIL_EXPORT std::string | GetTerrainsPath () |
| Gets terrain path. More... | |
| TR_UTIL_EXPORT std::string | GetShadersPath () |
| Gets shaders path. More... | |
| TR_UTIL_EXPORT std::string | GetGUIPath () |
| Gets graphical user interface path. More... | |
| TR_UTIL_EXPORT std::string | GetConfigPath () |
| Gets configuration path. More... | |
| TR_UTIL_EXPORT std::string | GetUserStaticMeshesPath () |
| Gets user static meshes path. More... | |
| TR_UTIL_EXPORT std::string | GetUserSkeletalMeshesPath () |
| Gets user skeletal meshes path. More... | |
| TR_UTIL_EXPORT std::string | GetUserSoundsPath () |
| Gets user sounds path. More... | |
| TR_UTIL_EXPORT std::string | GetUserParticlesPath () |
| Gets user particles path. More... | |
| TR_UTIL_EXPORT std::string | GetUserTexturesPath () |
| Gets user textures path. More... | |
| TR_UTIL_EXPORT std::string | GetUserTerrainsPath () |
| Gets user terrain path. More... | |
| TR_UTIL_EXPORT std::string | GetUserShadersPath () |
| Gets user shaders path. More... | |
| TR_UTIL_EXPORT std::string | GetUserGUIPath () |
| Gets user graphical user interface path. More... | |
| TR_UTIL_EXPORT std::string | GetUserConfigPath () |
| Gets user configuration path. More... | |
| TR_UTIL_EXPORT std::string | GetLogPath () |
| Get the folder where TR will save and store the log files It is the same as GetUserDataPath() by default, unless the variable TR_LOG_PATH is set. More... | |
| TR_UTIL_EXPORT void | SetDataFilePathList (const std::string &pathList) |
| Set the list of data file paths. More... | |
| TR_UTIL_EXPORT std::string | GetDataFilePathList () |
| Get the list of data file paths. More... | |
| TR_UTIL_EXPORT std::string | GetDataPath () |
| Get the TR Data file path. More... | |
| TR_UTIL_EXPORT void | SetDataPath (std::string &path) |
| Overwrites the Data path. More... | |
| TR_UTIL_EXPORT void | CreateDataPathTree () |
| Creates all the folders in the Data (TR_DATA) folder, that includes Maps, GUI, Shaders, StaticMeshes, etc etc. More... | |
| TR_UTIL_EXPORT void | CreateUserDataPathTree () |
| Creates all the folders in the Data (TR_USER_DATA) folder, that includes Maps, GUI, Shaders, StaticMeshes, etc etc. More... | |
| TR_UTIL_EXPORT void | CreateDataPathTrees () |
| Convenience function that calls CreateDataPathTree() and CreateUserDataPathTree();. More... | |
| TR_UTIL_EXPORT std::string | GetRootPath () |
| Get the root path to the engine (equivalent to the TR_ROOT environment) If the TR_ROOT environment is not set, the local directory will be returned. More... | |
| TR_UTIL_EXPORT std::string | GetEnvironment (const std::string &env) |
| Convenience method to get the supplied environment variable. More... | |
| TR_UTIL_EXPORT bool | IsEnvironment (const std::string &env) |
| Is the supplied environment variable defined? More... | |
| TR_UTIL_EXPORT void | SetEnvironment (const std::string &name, const std::string &value) |
| Sets an environment variable. More... | |
| TR_UTIL_EXPORT std::string | FindFile (const std::string &fileName) |
| Searches for a file in the list of paths found by calling GetDataFilePathList() More... | |
| TR_UTIL_EXPORT std::string | FindFile (const std::string &fileName, std::vector< std::string > paths, bool caseInsensitive=true) |
| Searches a given path list for a file name. More... | |
| void | RemovePSNCommandLineOption (int &, char **&) |
| Removes the psn command line option. More... | |
Variables | |
| static OpenThreads::Mutex | gDatapathMutex |
| static std::string | mDataPath = trUtil::StringUtils::STR_BLANK |
|
static |
Referenced by CreateDataPathTree(), CreateUserDataPathTree(), GetConfigPath(), and GetUserConfigPath().

| void trUtil::PathUtils::CreateDataPathTree | ( | ) |
Creates all the folders in the Data (TR_DATA) folder, that includes Maps, GUI, Shaders, StaticMeshes, etc etc.
Definition at line 126 of file PathUtils.cpp.
References CONFIG_PATH(), GetDataPath(), trUtil::FileUtils::GetInstance(), GUI_PATH(), trUtil::Exception::LogException(), trUtil::FileUtils::MakeDirectoryEX(), PARTICLES_PATH(), SHADERS_PATH(), SKELETAL_MESHES_PATH(), SOUNDS_PATH(), STATIC_MESHES_PATH(), TERRAINS_PATH(), and TEXTURES_PATH().
Referenced by CreateDataPathTrees().


| void trUtil::PathUtils::CreateDataPathTrees | ( | ) |
Convenience function that calls CreateDataPathTree() and CreateUserDataPathTree();.
Definition at line 168 of file PathUtils.cpp.
References CreateDataPathTree(), CreateUserDataPathTree(), and trUtil::Exception::LogException().

| void trUtil::PathUtils::CreateUserDataPathTree | ( | ) |
Creates all the folders in the Data (TR_USER_DATA) folder, that includes Maps, GUI, Shaders, StaticMeshes, etc etc.
Definition at line 147 of file PathUtils.cpp.
References CONFIG_PATH(), trUtil::FileUtils::GetInstance(), GetUserDataPath(), GUI_PATH(), trUtil::Exception::LogException(), trUtil::FileUtils::MakeDirectoryEX(), PARTICLES_PATH(), SHADERS_PATH(), SKELETAL_MESHES_PATH(), SOUNDS_PATH(), STATIC_MESHES_PATH(), TERRAINS_PATH(), and TEXTURES_PATH().
Referenced by CreateDataPathTrees(), and main().


|
static |
|
static |
| std::string trUtil::PathUtils::FindFile | ( | const std::string & | fileName | ) |
Searches for a file in the list of paths found by calling GetDataFilePathList()
| fileName | Can be a single filename or a path and file name relative to the current engines data path list. |
Definition at line 304 of file PathUtils.cpp.
| std::string trUtil::PathUtils::FindFile | ( | const std::string & | fileName, |
| std::vector< std::string > | paths, | ||
| bool | caseInsensitive = true |
||
| ) |
Searches a given path list for a file name.
| fileName | Can be a single filename or a path and file name relative to the current engines data path list. |
| paths | the list of file paths to search. |
| caseInsensitive | (Optional) If the search should be case insensitive. This only works around case-sensitive file systems, it cannot not make a search fail if the case is wrong on a case insensitive one and one sets it to false. |
Definition at line 323 of file PathUtils.cpp.
References trUtil::FILE_NOT_FOUND, trUtil::FileInfo::fileName, trUtil::FileInfo::fileType, trUtil::FileUtils::GetFileInfo(), trUtil::FileUtils::GetInstance(), and trUtil::FileUtils::PATH_SEPARATOR.

| std::string trUtil::PathUtils::GetConfigPath | ( | ) |
Gets configuration path.
Definition at line 536 of file PathUtils.cpp.
References CONFIG_PATH(), and GetDataPath().

| std::string trUtil::PathUtils::GetDataFilePathList | ( | ) |
Get the list of data file paths.
Definition at line 277 of file PathUtils.cpp.
| std::string trUtil::PathUtils::GetDataPath | ( | ) |
Get the TR Data file path.
This comes directly from the environment variable "TR_DATA", if it wasn't overwritten by the user. If the environment variable is not set, TR_ROOT/Data directory will be returned.
Definition at line 82 of file PathUtils.cpp.
References DATA_PATH_DEFAULT(), GetEnvironment(), GetRootPath(), IsEnvironment(), mDataPath, trUtil::StringUtils::STR_BLANK(), and trUtil::EnvVariables::TR_DATA.
Referenced by CreateDataPathTree(), GetConfigPath(), GetGUIPath(), GetParticlesPath(), GetShadersPath(), GetSkeletalMeshesPath(), GetSoundsPath(), GetStaticMeshesPath(), GetTerrainsPath(), and GetTexturesPath().


| std::string trUtil::PathUtils::GetEnvironment | ( | const std::string & | env | ) |
Convenience method to get the supplied environment variable.
| env | The environment. |
Definition at line 347 of file PathUtils.cpp.
Referenced by GetDataPath(), GetLogPath(), GetRootPath(), and GetUserDataPath().

| std::string trUtil::PathUtils::GetGUIPath | ( | ) |
Gets graphical user interface path.
Definition at line 530 of file PathUtils.cpp.
References GetDataPath(), and GUI_PATH().

| std::string trUtil::PathUtils::GetLogPath | ( | ) |
Get the folder where TR will save and store the log files It is the same as GetUserDataPath() by default, unless the variable TR_LOG_PATH is set.
Definition at line 206 of file PathUtils.cpp.
References GetEnvironment(), GetUserDataPath(), IsEnvironment(), and trUtil::EnvVariables::TR_LOG_PATH.
Referenced by trUtil::Logging::LogWriterFile::OpenFile().


| std::string trUtil::PathUtils::GetParticlesPath | ( | ) |
Gets particles path.
Definition at line 506 of file PathUtils.cpp.
References GetDataPath(), and PARTICLES_PATH().

| std::string trUtil::PathUtils::GetRootPath | ( | ) |
Get the root path to the engine (equivalent to the TR_ROOT environment) If the TR_ROOT environment is not set, the local directory will be returned.
Definition at line 182 of file PathUtils.cpp.
References GetEnvironment(), IsEnvironment(), and trUtil::EnvVariables::TR_ROOT.
Referenced by GetDataPath().


| std::string trUtil::PathUtils::GetShadersPath | ( | ) |
Gets shaders path.
Definition at line 524 of file PathUtils.cpp.
References GetDataPath(), and SHADERS_PATH().

| std::string trUtil::PathUtils::GetSkeletalMeshesPath | ( | ) |
Gets skeletal meshes path.
Definition at line 494 of file PathUtils.cpp.
References GetDataPath(), and SKELETAL_MESHES_PATH().

| std::string trUtil::PathUtils::GetSoundsPath | ( | ) |
Gets sounds path.
Definition at line 500 of file PathUtils.cpp.
References GetDataPath(), and SOUNDS_PATH().

| std::string trUtil::PathUtils::GetStaticMeshesPath | ( | ) |
Gets static meshes path.
Definition at line 488 of file PathUtils.cpp.
References GetDataPath(), and STATIC_MESHES_PATH().
Referenced by trCore::SceneObjects::RingArray::LoadModels().


| std::string trUtil::PathUtils::GetTerrainsPath | ( | ) |
Gets terrain path.
Definition at line 518 of file PathUtils.cpp.
References GetDataPath(), and TERRAINS_PATH().

| std::string trUtil::PathUtils::GetTexturesPath | ( | ) |
Gets textures path.
Definition at line 512 of file PathUtils.cpp.
References GetDataPath(), and TEXTURES_PATH().

| std::string trUtil::PathUtils::GetUserConfigPath | ( | ) |
Gets user configuration path.
Definition at line 590 of file PathUtils.cpp.
References CONFIG_PATH(), and GetUserDataPath().
Referenced by trUtil::JSON::File::File().


| std::string trUtil::PathUtils::GetUserDataPath | ( | ) |
Get the folder where TR will save and store User data files It is MyDocuments on Windows and the same as GetHomeDirectory() on Linux and Apple If TR_USER_DATA Environmental variable is defined, it will return the path in TR_USER_DATA.
Definition at line 219 of file PathUtils.cpp.
References DEFAULT_TR_FOLDER(), GetEnvironment(), GetUserHomeDirectory(), IsEnvironment(), MAX_PATH, and trUtil::EnvVariables::TR_USER_DATA.
Referenced by CreateUserDataPathTree(), GetLogPath(), GetUserConfigPath(), GetUserGUIPath(), GetUserParticlesPath(), GetUserShadersPath(), GetUserSkeletalMeshesPath(), GetUserSoundsPath(), GetUserStaticMeshesPath(), GetUserTerrainsPath(), and GetUserTexturesPath().


| std::string trUtil::PathUtils::GetUserGUIPath | ( | ) |
Gets user graphical user interface path.
Definition at line 584 of file PathUtils.cpp.
References GetUserDataPath(), and GUI_PATH().

| std::string trUtil::PathUtils::GetUserHomeDirectory | ( | ) |
Get the USER Home directory.
Definition at line 58 of file PathUtils.cpp.
References MAX_PATH.
Referenced by GetUserDataPath().

| std::string trUtil::PathUtils::GetUserParticlesPath | ( | ) |
Gets user particles path.
Definition at line 560 of file PathUtils.cpp.
References GetUserDataPath(), and PARTICLES_PATH().

| std::string trUtil::PathUtils::GetUserShadersPath | ( | ) |
Gets user shaders path.
Definition at line 578 of file PathUtils.cpp.
References GetUserDataPath(), and SHADERS_PATH().

| std::string trUtil::PathUtils::GetUserSkeletalMeshesPath | ( | ) |
Gets user skeletal meshes path.
Definition at line 548 of file PathUtils.cpp.
References GetUserDataPath(), and SKELETAL_MESHES_PATH().

| std::string trUtil::PathUtils::GetUserSoundsPath | ( | ) |
Gets user sounds path.
Definition at line 554 of file PathUtils.cpp.
References GetUserDataPath(), and SOUNDS_PATH().

| std::string trUtil::PathUtils::GetUserStaticMeshesPath | ( | ) |
Gets user static meshes path.
Definition at line 542 of file PathUtils.cpp.
References GetUserDataPath(), and STATIC_MESHES_PATH().

| std::string trUtil::PathUtils::GetUserTerrainsPath | ( | ) |
Gets user terrain path.
Definition at line 572 of file PathUtils.cpp.
References GetUserDataPath(), and TERRAINS_PATH().

| std::string trUtil::PathUtils::GetUserTexturesPath | ( | ) |
Gets user textures path.
Definition at line 566 of file PathUtils.cpp.
References GetUserDataPath(), and TEXTURES_PATH().

|
static |
Referenced by CreateDataPathTree(), CreateUserDataPathTree(), GetGUIPath(), and GetUserGUIPath().

| bool trUtil::PathUtils::IsEnvironment | ( | const std::string & | env | ) |
Is the supplied environment variable defined?
| env | The environment. |
Definition at line 475 of file PathUtils.cpp.
Referenced by GetDataPath(), GetLogPath(), GetRootPath(), and GetUserDataPath().

|
static |
Referenced by CreateDataPathTree(), CreateUserDataPathTree(), GetParticlesPath(), and GetUserParticlesPath().

|
inline |
Removes the psn command line option.
| [in,out] | argc | The argc. |
| [in,out] | argv | [in,out] If non-null, the argv. |
Definition at line 441 of file PathUtils.h.
Referenced by SetEnvironment().

| void trUtil::PathUtils::SetDataFilePathList | ( | const std::string & | pathList | ) |
Set the list of data file paths.
| pathList | List of paths. |
Definition at line 242 of file PathUtils.cpp.
References LOG_W.
| void trUtil::PathUtils::SetDataPath | ( | std::string & | path | ) |
Overwrites the Data path.
If this is set, TR will ignore the TR_DATA variable and use the passed in value instead.
| [in,out] | path | Full pathname of the file. |
Definition at line 120 of file PathUtils.cpp.
| void trUtil::PathUtils::SetEnvironment | ( | const std::string & | name, |
| const std::string & | value | ||
| ) |
Sets an environment variable.
| name | the name of the variable to set. |
| value | the value of the environment variable to set. |
Definition at line 371 of file PathUtils.cpp.
References RemovePSNCommandLineOption().

|
static |
Referenced by CreateDataPathTree(), CreateUserDataPathTree(), GetShadersPath(), and GetUserShadersPath().

|
static |
Referenced by CreateDataPathTree(), CreateUserDataPathTree(), GetSkeletalMeshesPath(), and GetUserSkeletalMeshesPath().

|
static |
Referenced by CreateDataPathTree(), CreateUserDataPathTree(), GetSoundsPath(), and GetUserSoundsPath().

|
static |
Referenced by CreateDataPathTree(), CreateUserDataPathTree(), GetStaticMeshesPath(), and GetUserStaticMeshesPath().

|
static |
Referenced by CreateDataPathTree(), CreateUserDataPathTree(), GetTerrainsPath(), and GetUserTerrainsPath().

|
static |
Referenced by CreateDataPathTree(), CreateUserDataPathTree(), GetTexturesPath(), and GetUserTexturesPath().

|
static |
Definition at line 53 of file PathUtils.cpp.
|
static |
Definition at line 55 of file PathUtils.cpp.
Referenced by GetDataPath().