TrueReality  v0.1.1912
PathUtils.cpp File Reference
#include <trUtil/PathUtils.h>
#include <trUtil/EnvVariables.h>
#include <trUtil/FileUtils.h>
#include <trUtil/PlatformMacros.h>
#include <trUtil/StringUtils.h>
#include <trUtil/Logging/Log.h>
#include <osgDB/FileUtils>
#include <osgDB/FileNameUtils>
#include <pwd.h>
#include <unistd.h>
Include dependency graph for PathUtils.cpp:

Go to the source code of this file.

Namespaces

 trUtil::PathUtils
 

Functions

TR_UTIL_EXPORT std::string trUtil::PathUtils::GetUserHomeDirectory ()
 Get the USER Home directory. More...
 
TR_UTIL_EXPORT std::string trUtil::PathUtils::GetDataPath ()
 Get the TR Data file path. More...
 
TR_UTIL_EXPORT void trUtil::PathUtils::SetDataPath (std::string &path)
 Overwrites the Data path. More...
 
TR_UTIL_EXPORT void trUtil::PathUtils::CreateDataPathTree ()
 Creates all the folders in the Data (TR_DATA) folder, that includes Maps, GUI, Shaders, StaticMeshes, etc etc. More...
 
TR_UTIL_EXPORT void trUtil::PathUtils::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 trUtil::PathUtils::CreateDataPathTrees ()
 Convenience function that calls CreateDataPathTree() and CreateUserDataPathTree();. More...
 
TR_UTIL_EXPORT 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. More...
 
TR_UTIL_EXPORT 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. More...
 
TR_UTIL_EXPORT 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. More...
 
TR_UTIL_EXPORT void trUtil::PathUtils::SetDataFilePathList (const std::string &pathList)
 Set the list of data file paths. More...
 
TR_UTIL_EXPORT std::string trUtil::PathUtils::GetDataFilePathList ()
 Get the list of data file paths. More...
 
TR_UTIL_EXPORT std::string trUtil::PathUtils::FindFile (const std::string &fileName)
 Searches for a file in the list of paths found by calling GetDataFilePathList() More...
 
TR_UTIL_EXPORT 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. More...
 
TR_UTIL_EXPORT std::string trUtil::PathUtils::GetEnvironment (const std::string &env)
 Convenience method to get the supplied environment variable. More...
 
TR_UTIL_EXPORT void trUtil::PathUtils::SetEnvironment (const std::string &name, const std::string &value)
 Sets an environment variable. More...
 
TR_UTIL_EXPORT bool trUtil::PathUtils::IsEnvironment (const std::string &env)
 Is the supplied environment variable defined? More...
 
TR_UTIL_EXPORT std::string trUtil::PathUtils::GetStaticMeshesPath ()
 Gets static meshes path. More...
 
TR_UTIL_EXPORT std::string trUtil::PathUtils::GetSkeletalMeshesPath ()
 Gets skeletal meshes path. More...
 
TR_UTIL_EXPORT std::string trUtil::PathUtils::GetSoundsPath ()
 Gets sounds path. More...
 
TR_UTIL_EXPORT std::string trUtil::PathUtils::GetParticlesPath ()
 Gets particles path. More...
 
TR_UTIL_EXPORT std::string trUtil::PathUtils::GetTexturesPath ()
 Gets textures path. More...
 
TR_UTIL_EXPORT std::string trUtil::PathUtils::GetTerrainsPath ()
 Gets terrain path. More...
 
TR_UTIL_EXPORT std::string trUtil::PathUtils::GetShadersPath ()
 Gets shaders path. More...
 
TR_UTIL_EXPORT std::string trUtil::PathUtils::GetGUIPath ()
 Gets graphical user interface path. More...
 
TR_UTIL_EXPORT std::string trUtil::PathUtils::GetConfigPath ()
 Gets configuration path. More...
 
TR_UTIL_EXPORT std::string trUtil::PathUtils::GetUserStaticMeshesPath ()
 Gets user static meshes path. More...
 
TR_UTIL_EXPORT std::string trUtil::PathUtils::GetUserSkeletalMeshesPath ()
 Gets user skeletal meshes path. More...
 
TR_UTIL_EXPORT std::string trUtil::PathUtils::GetUserSoundsPath ()
 Gets user sounds path. More...
 
TR_UTIL_EXPORT std::string trUtil::PathUtils::GetUserParticlesPath ()
 Gets user particles path. More...
 
TR_UTIL_EXPORT std::string trUtil::PathUtils::GetUserTexturesPath ()
 Gets user textures path. More...
 
TR_UTIL_EXPORT std::string trUtil::PathUtils::GetUserTerrainsPath ()
 Gets user terrain path. More...
 
TR_UTIL_EXPORT std::string trUtil::PathUtils::GetUserShadersPath ()
 Gets user shaders path. More...
 
TR_UTIL_EXPORT std::string trUtil::PathUtils::GetUserGUIPath ()
 Gets user graphical user interface path. More...
 
TR_UTIL_EXPORT std::string trUtil::PathUtils::GetUserConfigPath ()
 Gets user configuration path. More...
 

Variables

static OpenThreads::Mutex trUtil::PathUtils::gDatapathMutex
 
static std::string trUtil::PathUtils::mDataPath = trUtil::StringUtils::STR_BLANK