fw4spl
fwTools::os Namespace Reference

Namespace fwTools::os contains tools methods which depend on os like get user application data directory. More...

Functions

FWTOOLS_API std::string getEnv (const std::string &name, bool *ok=NULL)
 Returns a environment variable value. More...
 
FWTOOLS_API std::string getEnv (const std::string &name, const std::string &defaultValue)
 Returns a environment variable value. More...
 
FWTOOLS_API std::string getUserDataDir (std::string company="", std::string appName="", bool createDirectory=false)
 Return the users's application data directory. More...
 

Detailed Description

Namespace fwTools::os contains tools methods which depend on os like get user application data directory.

Date
2009-2010.

Function Documentation

std::string fwTools::os::getEnv ( const std::string &  name,
bool *  ok = NULL 
)

Returns a environment variable value.

Parameters
nameenvironment variable 'name'
[out]okboolean set to true if variable exists
Returns
The environment variable content if it exists, else an empty string

Definition at line 20 of file Os.cpp.

Referenced by getEnv(), ioVTK::SImageSeriesReader::info(), and uiMedDataQt::action::SExportSeries::updating().

+ Here is the caller graph for this function:

std::string fwTools::os::getEnv ( const std::string &  name,
const std::string &  defaultValue 
)

Returns a environment variable value.

Parameters
nameenvironment variable 'name'
defaultValueValue returned if variable 'name' doesn't exist

Definition at line 33 of file Os.cpp.

References getEnv().

+ Here is the call graph for this function:

std::string fwTools::os::getUserDataDir ( std::string  company = "",
std::string  appName = "",
bool  createDirectory = false 
)

Return the users's application data directory.

Parameters
companyThe company name
appNameThe application name
createDirectoryif true, create the returned directory if it don't exist
Date
2007-2009.

Return the application data directory. If company or appName is not empty, append them to the path. Under unix, XDG conventions are repected. For example, the UserDataDir under linux will be "~/.config/company/appName"

Definition at line 42 of file Os.cpp.

References OSLM_ERROR, and OSLM_INFO.