Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Static Protected Attributes | List of all members
openfluid::base::Environment Class Reference

#include <base/Environment.hpp>

Inheritance diagram for openfluid::base::Environment:
Inheritance graph
[legend]

Static Public Member Functions

static void init ()
 
static std::string getHostName ()
 
static std::string getSystemArch ()
 
static int getIdealThreadCount ()
 
static std::string getUserName ()
 
static std::string getVersion ()
 
static std::string getVersionFull ()
 
static std::string getVersionMajorMinor ()
 
static std::string getTempDir ()
 
static std::string getInstallPrefix ()
 
static std::string getUserHomeDir ()
 
static std::string getUserDataDir ()
 
static std::string getUserDataFullPath (const std::string &Path)
 
static std::string getUserExamplesDir ()
 
static std::string getProvidedExamplesDir ()
 
static void prepareUserDataDirectory ()
 
static std::string getConfigFile ()
 
static std::string getTranslationsDir ()
 
static std::string getCommonResourcesDir ()
 
static std::string getCommonResourcesFullPath (const std::string &Path)
 
static std::string getAppResourcesDir (const std::string &AppName)
 
static std::string getAppResourcesFullPath (const std::string &AppName, const std::string &Path)
 
static std::vector< std::string > getSimulatorsDirs ()
 
static std::vector< std::string > getDefaultSimulatorsDirs ()
 
static std::vector< std::string > getExtraSimulatorsDirs ()
 
static void addExtraSimulatorsDirs (const std::string &Paths)
 
static void resetExtraSimulatorsDirs ()
 
static std::string getSimulatorFullPath (const std::string &Filename)
 
static std::vector< std::string > getObserversDirs ()
 
static std::vector< std::string > getDefaultObserversDirs ()
 
static std::vector< std::string > getExtraObserversDirs ()
 
static void addExtraObserversDirs (const std::string &Paths)
 
static void resetExtraObserversDirs ()
 
static std::string getObserverFullPath (const std::string &Filename)
 
static std::vector< std::string > getBuilderextsDirs ()
 
static std::vector< std::string > getDefaultBuilderextsDirs ()
 
static std::vector< std::string > getExtraBuilderextsDirs ()
 
static void addExtraBuilderextsDirs (const std::string &Paths)
 
static void resetExtraBuilderextsDirs ()
 
static std::string getBuilderextFullPath (const std::string &Filename)
 
static std::string getMarketBagBinSubDir ()
 
static std::string getMarketBagBuilderextsDir ()
 
static std::string getMarketBagDataDir ()
 
static std::string getMarketBagDir ()
 
static std::string getMarketBagObserversDir ()
 
static std::string getMarketBagSimulatorsDir ()
 
static std::string getMarketBagSrcSubDir ()
 
static std::string getMarketBagVersionDir ()
 

Protected Member Functions

 Environment ()
 

Static Protected Member Functions

static std::string getWareFullPath (const std::vector< std::string > &Dirs, const std::string &Filename)
 

Static Protected Attributes

static std::string m_SystemArch
 
static std::string m_HostName
 
static std::string m_UserName
 
static std::string m_Version
 
static std::string m_VersionFull
 
static std::string m_VersionMajorMinor
 
static std::string m_InstallPrefix
 
static std::string m_TempDir
 
static std::string m_UserHomeDir
 
static std::string m_UserDataDir
 
static std::string m_ConfigFile
 
static std::vector< std::string > m_DefaultSimulatorsDirs
 
static std::vector< std::string > m_ExtraSimulatorsDirs
 
static std::vector< std::string > m_DefaultObserversDirs
 
static std::vector< std::string > m_ExtraObserversDirs
 
static std::vector< std::string > m_DefaultBuilderextsDirs
 
static std::vector< std::string > m_ExtraBuilderextsDirs
 
static std::string m_ProvidedExamplesDir
 
static std::string m_UserExamplesDir
 
static std::string m_MarketBagDir
 
static std::string m_MarketBagVersionDir
 
static std::string m_MarketBagSimulatorsDir
 
static std::string m_MarketBagObserversDir
 
static std::string m_MarketBagBuilderextsDir
 
static std::string m_MarketBagDataDir
 
static std::string m_MarketBagBinSubDir
 
static std::string m_MarketBagSrcSubDir
 
static std::string m_TranslationsDir
 
static std::string m_CommonResourcesDir
 
static std::string m_AppsResourcesDir
 
static int m_IdealThreadCount
 

Constructor & Destructor Documentation

openfluid::base::Environment::Environment ( )
inlineprotected

Member Function Documentation

static void openfluid::base::Environment::addExtraBuilderextsDirs ( const std::string &  Paths)
static

Adds paths to the list of directories where OpenFLUID searches for builder-extensions. The paths are given as a single string of paths separated by ":" (on Unices systems) or ";" (on Windows systems)

Parameters
[in]Pathsthe list of full paths as a single string
static void openfluid::base::Environment::addExtraObserversDirs ( const std::string &  Paths)
static

Adds paths to the list of directories where OpenFLUID searches for observers. The paths are given as a single string of paths separated by ":" (on Unices systems) or ";" (on Windows systems)

Parameters
[in]Pathsthe list of full paths as a single string
static void openfluid::base::Environment::addExtraSimulatorsDirs ( const std::string &  Paths)
static

Adds paths to the list of directories where OpenFLUID searches for simulators. The paths are given as a single string of paths separated by ":" (on Unices systems) or ";" (on Windows systems)

Parameters
[in]Pathsthe list of full paths as a single string
static std::string openfluid::base::Environment::getAppResourcesDir ( const std::string &  AppName)
inlinestatic

Returns the resources directory for a given OpenFLUID software application

Parameters
[in]AppNamethe name of the OpenFLUID application
Returns
the full path to the directory
static std::string openfluid::base::Environment::getAppResourcesFullPath ( const std::string &  AppName,
const std::string &  Path 
)
inlinestatic

Returns the full path of a file or directory relative to the resources directory of a given OpenFLUID software application

Parameters
[in]AppNamethe name of the OpenFLUID application
[in]Paththe path relative to the OpenFLUID application resources directory
Returns
the full path to the file or directory
static std::string openfluid::base::Environment::getBuilderextFullPath ( const std::string &  Filename)
static

Returns the full path of a searched builder-extension file

Returns
the full path of the searched file, empty if not found
static std::vector<std::string> openfluid::base::Environment::getBuilderextsDirs ( )
static

Returns the list of directories full paths where OpenFLUID searches for builder-extensions. Extra directories added at run time are at the beginning of the list, followed by standard search paths.

Returns
the list of directories full paths
static std::string openfluid::base::Environment::getCommonResourcesDir ( )
inlinestatic

Returns the OpenFLUID common resources directory

Returns
the full path to the directory
static std::string openfluid::base::Environment::getCommonResourcesFullPath ( const std::string &  Path)
inlinestatic

Returns the full path of a file or directory relative to the OpenFLUID common resources directory

Parameters
[in]Paththe path relative to the OpenFLUID common resources directory
Returns
the full path to the file or directory
static std::string openfluid::base::Environment::getConfigFile ( )
inlinestatic

Returns the configuration file path for the current user

Returns
the full path to the file
static std::vector<std::string> openfluid::base::Environment::getDefaultBuilderextsDirs ( )
inlinestatic

Returns the list of default directories full paths where OpenFLUID searches for builder-extensions.

Returns
the list of directories full paths
static std::vector<std::string> openfluid::base::Environment::getDefaultObserversDirs ( )
inlinestatic

Returns the list of default directories full paths where OpenFLUID searches for observers.

Returns
the list of directories full paths
static std::vector<std::string> openfluid::base::Environment::getDefaultSimulatorsDirs ( )
inlinestatic

Returns the list of default directories full paths where OpenFLUID searches for simulators.

Returns
the list of directories full paths
static std::vector<std::string> openfluid::base::Environment::getExtraBuilderextsDirs ( )
inlinestatic

Returns the list of extra added directories full paths where OpenFLUID searches for builder-extensions.

Returns
the list of directories full paths
static std::vector<std::string> openfluid::base::Environment::getExtraObserversDirs ( )
inlinestatic

Returns the list of extra added directories full paths where OpenFLUID searches for observers.

Returns
the list of directories full paths
static std::vector<std::string> openfluid::base::Environment::getExtraSimulatorsDirs ( )
inlinestatic

Returns the list of extra added directories full paths where OpenFLUID searches for simulators.

Returns
the list of directories full paths
static std::string openfluid::base::Environment::getHostName ( )
inlinestatic

Returns the current host name

Returns
the host name
static int openfluid::base::Environment::getIdealThreadCount ( )
inlinestatic

Returns the ideal thread count for the current running system

Returns
the number of threads
static std::string openfluid::base::Environment::getInstallPrefix ( )
inlinestatic

Returns the OpenFLUID install prefix directory. It is defined at build time but can be forced using the OPENFLUID_INSTALL_PREFIX environment variable.

Returns
the full path to the directory
static std::string openfluid::base::Environment::getMarketBagBinSubDir ( )
inlinestatic
static std::string openfluid::base::Environment::getMarketBagBuilderextsDir ( )
inlinestatic
static std::string openfluid::base::Environment::getMarketBagDataDir ( )
inlinestatic
static std::string openfluid::base::Environment::getMarketBagDir ( )
inlinestatic
static std::string openfluid::base::Environment::getMarketBagObserversDir ( )
inlinestatic
static std::string openfluid::base::Environment::getMarketBagSimulatorsDir ( )
inlinestatic
static std::string openfluid::base::Environment::getMarketBagSrcSubDir ( )
inlinestatic
static std::string openfluid::base::Environment::getMarketBagVersionDir ( )
inlinestatic
static std::string openfluid::base::Environment::getObserverFullPath ( const std::string &  Filename)
static

Returns the full path of a searched observer file

Returns
the full path of the searched file, empty if not found
static std::vector<std::string> openfluid::base::Environment::getObserversDirs ( )
static

Returns the list of directories full paths where OpenFLUID searches for observers. Extra directories added at run time are at the beginning of the list, followed by standard search paths.

Returns
the list of directories full paths
static std::string openfluid::base::Environment::getProvidedExamplesDir ( )
inlinestatic

Returns the full path of the directory where examples provided by OpenFLUID or models installations are stored

Returns
the full path to the directory
static std::string openfluid::base::Environment::getSimulatorFullPath ( const std::string &  Filename)
static

Returns the full path of a searched simulator file

Returns
the full path of the searched file, empty if not found
static std::vector<std::string> openfluid::base::Environment::getSimulatorsDirs ( )
static

Returns the list of directories full paths where OpenFLUID searches for simulators. Extra directories added at run time are at the beginning of the list, followed by standard search paths.

Returns
the list of directories full paths
static std::string openfluid::base::Environment::getSystemArch ( )
inlinestatic

Returns the current system architecture. Possible values are defined in the global.hpp file with the OPENFLUID_OS_STRLABEL definition

Returns
the system architecture
static std::string openfluid::base::Environment::getTempDir ( )
inlinestatic

Returns the current OpenFLUID temporary directory. It is automatically defined but can be forced using the OPENFLUID_TEMP_PATH environment variable.

Returns
the full path to the directory
static std::string openfluid::base::Environment::getTranslationsDir ( )
inlinestatic

Returns the OpenFLUID translations directory

Returns
the full path to the directory
static std::string openfluid::base::Environment::getUserDataDir ( )
inlinestatic

Returns the OpenFLUID data directory for the current user

Returns
the full path to the directory
static std::string openfluid::base::Environment::getUserDataFullPath ( const std::string &  Path)
inlinestatic

Returns the full path of a file or directory relative to the OpenFLUID data directory for the current user

Parameters
[in]Paththe path relative to the OpenFLUID user data directory
Returns
the full path to the file or directory
static std::string openfluid::base::Environment::getUserExamplesDir ( )
inlinestatic

Returns the full path of the examples directory for the current user

Returns
the full path to the directory
static std::string openfluid::base::Environment::getUserHomeDir ( )
inlinestatic

Returns the current user home directory

Returns
the full path to the directory
static std::string openfluid::base::Environment::getUserName ( )
inlinestatic

Returns the current user name

Returns
the user name
static std::string openfluid::base::Environment::getVersion ( )
inlinestatic

Returns the current OpenFLUID version using the MAJOR.MINOR.PATCH format

Returns
the version number
static std::string openfluid::base::Environment::getVersionFull ( )
inlinestatic

Returns the current OpenFLUID version using the MAJOR.MINOR.PATCH~STATUS format

Returns
the fully qualified version number
static std::string openfluid::base::Environment::getVersionMajorMinor ( )
inlinestatic

Returns the current OpenFLUID version using the MAJOR.MINOR format

Returns
the simplified version number
static std::string openfluid::base::Environment::getWareFullPath ( const std::vector< std::string > &  Dirs,
const std::string &  Filename 
)
staticprotected
static void openfluid::base::Environment::init ( )
static

Initializes OpenFLUID environment

static void openfluid::base::Environment::prepareUserDataDirectory ( )
static

Automatically prepares the user data directory

static void openfluid::base::Environment::resetExtraBuilderextsDirs ( )
static

Resets the list of extra directories where OpenFLUID searches for builder-extensions to empty

static void openfluid::base::Environment::resetExtraObserversDirs ( )
static

Resets the list of extra directories where OpenFLUID searches for observers to empty

static void openfluid::base::Environment::resetExtraSimulatorsDirs ( )
static

Resets the list of extra directories where OpenFLUID searches for simulators to empty

Member Data Documentation

std::string openfluid::base::Environment::m_AppsResourcesDir
staticprotected
std::string openfluid::base::Environment::m_CommonResourcesDir
staticprotected
std::string openfluid::base::Environment::m_ConfigFile
staticprotected
std::vector<std::string> openfluid::base::Environment::m_DefaultBuilderextsDirs
staticprotected
std::vector<std::string> openfluid::base::Environment::m_DefaultObserversDirs
staticprotected
std::vector<std::string> openfluid::base::Environment::m_DefaultSimulatorsDirs
staticprotected
std::vector<std::string> openfluid::base::Environment::m_ExtraBuilderextsDirs
staticprotected
std::vector<std::string> openfluid::base::Environment::m_ExtraObserversDirs
staticprotected
std::vector<std::string> openfluid::base::Environment::m_ExtraSimulatorsDirs
staticprotected
std::string openfluid::base::Environment::m_HostName
staticprotected
int openfluid::base::Environment::m_IdealThreadCount
staticprotected
std::string openfluid::base::Environment::m_InstallPrefix
staticprotected
std::string openfluid::base::Environment::m_MarketBagBinSubDir
staticprotected
std::string openfluid::base::Environment::m_MarketBagBuilderextsDir
staticprotected
std::string openfluid::base::Environment::m_MarketBagDataDir
staticprotected
std::string openfluid::base::Environment::m_MarketBagDir
staticprotected
std::string openfluid::base::Environment::m_MarketBagObserversDir
staticprotected
std::string openfluid::base::Environment::m_MarketBagSimulatorsDir
staticprotected
std::string openfluid::base::Environment::m_MarketBagSrcSubDir
staticprotected
std::string openfluid::base::Environment::m_MarketBagVersionDir
staticprotected
std::string openfluid::base::Environment::m_ProvidedExamplesDir
staticprotected
std::string openfluid::base::Environment::m_SystemArch
staticprotected
std::string openfluid::base::Environment::m_TempDir
staticprotected
std::string openfluid::base::Environment::m_TranslationsDir
staticprotected
std::string openfluid::base::Environment::m_UserDataDir
staticprotected
std::string openfluid::base::Environment::m_UserExamplesDir
staticprotected
std::string openfluid::base::Environment::m_UserHomeDir
staticprotected
std::string openfluid::base::Environment::m_UserName
staticprotected
std::string openfluid::base::Environment::m_Version
staticprotected
std::string openfluid::base::Environment::m_VersionFull
staticprotected
std::string openfluid::base::Environment::m_VersionMajorMinor
staticprotected

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