DataDirector API
|
#include <DDD_PathManager.h>
Public Member Functions | |
~DDD_PathManager () | |
bool | MakeAbsolutePath (const std::string &pathStr, std::string &absPath) |
void | DDDConfigPath (const std::string &pathStr) |
std::string | DDDConfigPath () |
std::string | GetRelativePathFromDDDConfig (const std::string &absPath) |
void | CallingAppPath (const std::string &path) |
std::string | CallingAppPath () |
std::string | GetRelativePathFromCallingApp (const std::string &absPath) |
Static Public Member Functions | |
static DDD_PathManager & | Instance () |
static bool | IsPathRelative (const std::string &pathStr) |
static bool | IsPathAbsolute (const std::string &pathStr) |
static bool | IsPathValid (const std::string &pathStr) |
The DDD_PathManager class allows the application to handle multiple base paths for relative path access. For example, the location of the assets and converters are relative to that of the application, but the RSOs loaded by a .ddd file would be relative to the file. This class is easily accessible anywhere where DataDirector apps are created, so the right working directory can be accessed appropriately whenever relative paths may be encountered.
~DDD_PathManager | ( | ) |
Destructor
void CallingAppPath | ( | const std::string & | path | ) |
Sets the calling application path
path | Absolute path to calling application |
std::string CallingAppPath | ( | ) |
void DDDConfigPath | ( | const std::string & | pathStr | ) |
Sets the loaded DDD config path (.ddd) file
path | Absolute path to config file |
std::string DDDConfigPath | ( | ) |
std::string GetRelativePathFromCallingApp | ( | const std::string & | absPath | ) |
Gets the relative path from calling app
absPath | Absolute pathname |
std::string GetRelativePathFromDDDConfig | ( | const std::string & | absPath | ) |
Gets the relative path from DDD configuration file
absPath | Absolute pathname |
|
static |
singleton interface
|
static |
Is path a absolute path?
path | Path string to check |
|
static |
Is path a relative path?
path | Path string to check |
|
static |
Checks given path string (whether relative or absolute) to determine if given path or file exists
path | Path string to check |
bool MakeAbsolutePath | ( | const std::string & | pathStr, |
std::string & | absPath | ||
) |
Attempts to convert the relative path to an absolute path
pathStr | Path string to convert |
absPath | Absolute path returned by method |