DataDirector API
Public Member Functions | Static Public Member Functions | List of all members
DDD_PathManager Class Reference

#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_PathManagerInstance ()
 
static bool IsPathRelative (const std::string &pathStr)
 
static bool IsPathAbsolute (const std::string &pathStr)
 
static bool IsPathValid (const std::string &pathStr)
 

Detailed Description

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.

Constructor & Destructor Documentation

Destructor

Member Function Documentation

void CallingAppPath ( const std::string &  path)

Sets the calling application path

Parameters
pathAbsolute path to calling application
std::string CallingAppPath ( )
Returns
The absolute path to the calling application
void DDDConfigPath ( const std::string &  pathStr)

Sets the loaded DDD config path (.ddd) file

Parameters
pathAbsolute path to config file
std::string DDDConfigPath ( )
Returns
The absolute path to the loaded DDD config (.ddd file), if available
std::string GetRelativePathFromCallingApp ( const std::string &  absPath)

Gets the relative path from calling app

Parameters
absPathAbsolute pathname
Returns
Path string relative to that of the calling app
std::string GetRelativePathFromDDDConfig ( const std::string &  absPath)

Gets the relative path from DDD configuration file

Parameters
absPathAbsolute pathname
Returns
Path string relative to that of the DDD file
static DDD_PathManager& Instance ( )
static

singleton interface

static bool IsPathAbsolute ( const std::string &  pathStr)
static

Is path a absolute path?

Parameters
pathPath string to check
Returns
true if given path string is an absolute path
static bool IsPathRelative ( const std::string &  pathStr)
static

Is path a relative path?

Parameters
pathPath string to check
Returns
true if given path string is a relative path
static bool IsPathValid ( const std::string &  pathStr)
static

Checks given path string (whether relative or absolute) to determine if given path or file exists

Parameters
pathPath string to check
Returns
true if given path string is a valid path
bool MakeAbsolutePath ( const std::string &  pathStr,
std::string &  absPath 
)

Attempts to convert the relative path to an absolute path

Parameters
pathStrPath string to convert
absPathAbsolute path returned by method

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