VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
makVrf::DtAppPathResolver Class Reference

Singleton for resolving path variables (DATA_DIR, USER_DIR, etc) More...

Public Member Functions

void setDataPath (const DtFilename &dataPath)
 
void setAppDataPath (const DtFilename &appDataPath)
 
void setUserDataPath (const DtFilename &userDataPath)
 
DtFilename dataPath ()
 
DtFilename appDataPath ()
 
DtFilename userDataPath ()
 
void setAdditionalModelDefinitionPaths (const std::vector< DtFilename > &)
 
const std::vector< DtFilename > & additionalModelDefinitionPaths () const
 
virtual DtString resolvePath (const DtString &path)
 Substitute values into string. More...
 
virtual DtString markupPath (const DtString &path)
 If values of variables are contained in string, substitute variable names. More...
 
virtual void setSharedSettingsDirectory (const DtFilename &)
 This will set where the shared settings are to be found. More...
 
virtual DtFilename sharedSettingsDirectory ()
 The shared settings directory will be a concatination of the shared settings directory root and the application name. More...
 
virtual DtFilename sharedSettingsDirectory (const DtString &appName)
 
virtual void setUseSharedSettingsDirectory (bool)
 Whether or not the call to settingsDirectory() returns the shared or user directory. Default is to return the user directory. More...
 
virtual bool useSharedSettingsDirectory () const
 
virtual DtFilename settingsDirectoryPathFor (const DtString &, bool andSetupFiles=true)
 Returns the settings directory for the given name with the given settings directory path. Will create all the necessary files if the directory does not exist. More...
 
virtual DtFilename settingsDirectory ()
 The settings directory to use. More...
 
virtual void setUserSettingsDirectory (const DtFilename &)
 Override the initital setting of the user settings directory. More...
 
virtual const DtFilename & userSettingsDirectory ()
 
virtual DtFilename resolveSettingsFile (const DtFilename &)
 Given the value of settings directory, return a proper path to the settings file. More...
 
virtual DtFilename backupsPath ()
 Given the current settings directory, append backups to that to store backups for settings. If the directory does not exist it will be created. More...
 
virtual void setApplication (const DtString &)
 Sets up the applicaiton name and version. More...
 
virtual const DtStringapplication () const
 
virtual void setVersionString (const DtString &version)
 
virtual const DtStringversionString () const
 
virtual void setApplicationRootName (const DtString &)
 The root to create the settings under. Default is vrforces. More...
 
virtual const DtStringapplicationRootName () const
 
virtual void setupUserSettingsDirectory (const DtFilename &userSettings, const DtFilename &rootPath, bool copyIfDateIsLater=true)
 Copies files from shared to user directory. This will only copy files that don't exist in the settings user settings directory. More...
 
virtual void setCopyIfDateIsLater (bool)
 If a file already exists in the user setting directory, copy it from the shared if the shared date is later. Default is false. More...
 
bool copyIfDateIsLater () const
 

Static Public Member Functions

static DtAppPathResolverInstance ()
 

Protected Member Functions

 DtAppPathResolver ()
 

Protected Attributes

DtFilename myDataPath
 
DtFilename myAppDataPath
 
DtFilename myUserDataPath
 
DtFilename mySharedSettingsDirectory
 
DtFilename myUserSettingsDirectory
 
DtString myApplicationRootName
 
bool myUseSharedSettingsDirectory
 
DtString myApplicationName
 
bool myNeedsToSetupSettingsDirectory
 
std::vector< DtFilename > myAdditonalModelDefinitionPaths
 
bool myUserSetSettingsDirectory
 
bool myCopyIfDateIsLater
 
DtString myVersionString
 

Detailed Description

Singleton for resolving path variables (DATA_DIR, USER_DIR, etc)

Constructor & Destructor Documentation

makVrf::DtAppPathResolver::DtAppPathResolver ( )
protected

Member Function Documentation

static DtAppPathResolver& makVrf::DtAppPathResolver::Instance ( )
static
void makVrf::DtAppPathResolver::setDataPath ( const DtFilename &  dataPath)
void makVrf::DtAppPathResolver::setAppDataPath ( const DtFilename &  appDataPath)
void makVrf::DtAppPathResolver::setUserDataPath ( const DtFilename &  userDataPath)
DtFilename makVrf::DtAppPathResolver::dataPath ( )
DtFilename makVrf::DtAppPathResolver::appDataPath ( )
DtFilename makVrf::DtAppPathResolver::userDataPath ( )
void makVrf::DtAppPathResolver::setAdditionalModelDefinitionPaths ( const std::vector< DtFilename > &  )
const std::vector<DtFilename>& makVrf::DtAppPathResolver::additionalModelDefinitionPaths ( ) const
virtual DtString makVrf::DtAppPathResolver::resolvePath ( const DtString path)
virtual

Substitute values into string.

virtual DtString makVrf::DtAppPathResolver::markupPath ( const DtString path)
virtual

If values of variables are contained in string, substitute variable names.

virtual void makVrf::DtAppPathResolver::setSharedSettingsDirectory ( const DtFilename &  )
virtual

This will set where the shared settings are to be found.

This will be the same as the directory used for settings if useSharedSettingsDirectory is true, else this will be the directory references when needing to copy settings file to the user directory.

virtual DtFilename makVrf::DtAppPathResolver::sharedSettingsDirectory ( )
virtual

The shared settings directory will be a concatination of the shared settings directory root and the application name.

virtual DtFilename makVrf::DtAppPathResolver::sharedSettingsDirectory ( const DtString appName)
virtual
virtual void makVrf::DtAppPathResolver::setUseSharedSettingsDirectory ( bool  )
virtual

Whether or not the call to settingsDirectory() returns the shared or user directory. Default is to return the user directory.

virtual bool makVrf::DtAppPathResolver::useSharedSettingsDirectory ( ) const
virtual
virtual DtFilename makVrf::DtAppPathResolver::settingsDirectoryPathFor ( const DtString ,
bool  andSetupFiles = true 
)
virtual

Returns the settings directory for the given name with the given settings directory path. Will create all the necessary files if the directory does not exist.

virtual DtFilename makVrf::DtAppPathResolver::settingsDirectory ( )
virtual

The settings directory to use.

Note that the first time this method is called, this will look at the shared settings flag, and, if that is false, will look at the shared settings directory and copy any necessary files to the user settings directory

virtual void makVrf::DtAppPathResolver::setUserSettingsDirectory ( const DtFilename &  )
virtual

Override the initital setting of the user settings directory.

This must be the first call made if you wish to actually effect what settings directory is used.

virtual const DtFilename& makVrf::DtAppPathResolver::userSettingsDirectory ( )
virtual
virtual DtFilename makVrf::DtAppPathResolver::resolveSettingsFile ( const DtFilename &  )
virtual

Given the value of settings directory, return a proper path to the settings file.

virtual DtFilename makVrf::DtAppPathResolver::backupsPath ( )
virtual

Given the current settings directory, append backups to that to store backups for settings. If the directory does not exist it will be created.

virtual void makVrf::DtAppPathResolver::setApplication ( const DtString )
virtual

Sets up the applicaiton name and version.

By default the application name is vrforces and the version is the current value of the MAJOR and MINOR version defines in versions.h

virtual const DtString& makVrf::DtAppPathResolver::application ( ) const
virtual
virtual void makVrf::DtAppPathResolver::setVersionString ( const DtString version)
virtual
virtual const DtString& makVrf::DtAppPathResolver::versionString ( ) const
virtual
virtual void makVrf::DtAppPathResolver::setApplicationRootName ( const DtString )
virtual

The root to create the settings under. Default is vrforces.

virtual const DtString& makVrf::DtAppPathResolver::applicationRootName ( ) const
virtual
virtual void makVrf::DtAppPathResolver::setupUserSettingsDirectory ( const DtFilename &  userSettings,
const DtFilename &  rootPath,
bool  copyIfDateIsLater = true 
)
virtual

Copies files from shared to user directory. This will only copy files that don't exist in the settings user settings directory.

virtual void makVrf::DtAppPathResolver::setCopyIfDateIsLater ( bool  )
virtual

If a file already exists in the user setting directory, copy it from the shared if the shared date is later. Default is false.

bool makVrf::DtAppPathResolver::copyIfDateIsLater ( ) const
inline

Member Data Documentation

DtFilename makVrf::DtAppPathResolver::myDataPath
protected
DtFilename makVrf::DtAppPathResolver::myAppDataPath
protected
DtFilename makVrf::DtAppPathResolver::myUserDataPath
protected
DtFilename makVrf::DtAppPathResolver::mySharedSettingsDirectory
protected
DtFilename makVrf::DtAppPathResolver::myUserSettingsDirectory
protected
DtString makVrf::DtAppPathResolver::myApplicationRootName
protected
bool makVrf::DtAppPathResolver::myUseSharedSettingsDirectory
protected
DtString makVrf::DtAppPathResolver::myApplicationName
protected
bool makVrf::DtAppPathResolver::myNeedsToSetupSettingsDirectory
protected
std::vector<DtFilename> makVrf::DtAppPathResolver::myAdditonalModelDefinitionPaths
protected
bool makVrf::DtAppPathResolver::myUserSetSettingsDirectory
protected
bool makVrf::DtAppPathResolver::myCopyIfDateIsLater
protected
DtString makVrf::DtAppPathResolver::myVersionString
protected

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

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)