COVISE Core
Classes | Static Public Member Functions | Private Member Functions | List of all members
covise::coCoviseConfig Class Reference

#include <CoviseConfig.h>

Classes

class  RefPtr
 
class  ScopeEntries
 

Static Public Member Functions

static std::string getEntry (const std::string &entry, bool *exists=0)
 Get a config entry. The entry takes the form "{sectionname.}*entry, whereby sectionname is section[:name]. This method returns the "value"-field of the config entry only. More...
 
static std::string getEntry (const std::string &variable, const std::string &entry, bool *exists=0)
 Get a config entry. The entry takes the form "{sectionname.}*entry, whereby sectionname is section[:name]. This method returns the field given by "variable" of the config entry. More...
 
static std::string getEntry (const std::string &variable, const std::string &entry, const std::string &defaultValue, bool *exists=0)
 Get a config entry. The entry takes the form "{sectionname.}*entry, whereby sectionname is section[:name]. This method returns the field given by "variable" of the config entry. More...
 
static int getInt (const std::string &entry, int defaultValue, bool *exists=0)
 Get an integer value. More...
 
static int getInt (const std::string &variable, const std::string &entry, int defaultValue, bool *exists=0)
 Get an integer value. More...
 
static long getLong (const std::string &entry, long defaultValue, bool *exists=0)
 Get a long integer value. More...
 
static long getLong (const std::string &variable, const std::string &entry, long defaultValue, bool *exists=0)
 Get a long integer value. More...
 
static bool isOn (const std::string &entry, bool defaultValue, bool *exists=0)
 Checks if an option is on or off. As on counts "on", "true", and "1". More...
 
static bool isOn (const std::string &variable, const std::string &entry, bool defaultValue, bool *exists=0)
 Checks if an option is on or off. As on counts "on", "true", and "1". More...
 
static float getFloat (const std::string &entry, float defaultValue, bool *exists=0)
 Get a float value. More...
 
static float getFloat (const std::string &variable, const std::string &entry, float defaultValue, bool *exists=0)
 Get a float value. More...
 
static std::vector< std::stringgetScopeNames (const std::string &scope, const std::string &name="")
 
static ScopeEntries getScopeEntries (const std::string &scope)
 
static ScopeEntries getScopeEntries (const std::string &scope, const std::string &name)
 

Private Member Functions

 coCoviseConfig ()
 
virtual ~coCoviseConfig ()
 

Constructor & Destructor Documentation

◆ coCoviseConfig()

coCoviseConfig::coCoviseConfig ( )
private

◆ ~coCoviseConfig()

coCoviseConfig::~coCoviseConfig ( )
privatevirtual

Member Function Documentation

◆ getEntry() [1/3]

std::string coCoviseConfig::getEntry ( const std::string entry,
bool *  exists = 0 
)
static

Get a config entry. The entry takes the form "{sectionname.}*entry, whereby sectionname is section[:name]. This method returns the "value"-field of the config entry only.

Parameters
entryThe section to get the value from.
existsprovide a pointer to a bool here to get feedback, if the value exists.
Returns
the value of the section, or an empty string if nothing found.

◆ getEntry() [2/3]

std::string coCoviseConfig::getEntry ( const std::string variable,
const std::string entry,
bool *  exists = 0 
)
static

Get a config entry. The entry takes the form "{sectionname.}*entry, whereby sectionname is section[:name]. This method returns the field given by "variable" of the config entry.

Parameters
variableThe variable requested.
entryThe section to get the value from.
existsprovide a pointer to a bool here to get feedback, if the value exists.
Returns
the value of the variable in the denoted section, or an empty string if nothing found.

◆ getEntry() [3/3]

std::string coCoviseConfig::getEntry ( const std::string variable,
const std::string entry,
const std::string defaultValue,
bool *  exists = 0 
)
static

Get a config entry. The entry takes the form "{sectionname.}*entry, whereby sectionname is section[:name]. This method returns the field given by "variable" of the config entry.

Parameters
variableThe variable requested.
entryThe section to get the value from.
defaultValueThe default return value if nothing is found.
existsprovide a pointer to a bool here to get feedback, if the value exists.
Returns
the value of the variable in the denoted section, or the default value if nothing found.

◆ getFloat() [1/2]

float coCoviseConfig::getFloat ( const std::string entry,
float  defaultValue,
bool *  exists = 0 
)
static

Get a float value.

Parameters
entryThe section to get the value from.
defaultValueThe default return value if nothing is found.
existsprovide a pointer to a bool here to get feedback, if the value exists.
Returns
the value of the denoted section, or the default value if nothing found.

◆ getFloat() [2/2]

float coCoviseConfig::getFloat ( const std::string variable,
const std::string entry,
float  defaultValue,
bool *  exists = 0 
)
static

Get a float value.

Parameters
variableThe variable requested.
entryThe section to get the value from.
defaultValueThe default return value if nothing is found.
existsprovide a pointer to a bool here to get feedback, if the value exists.
Returns
the value of the variable in the denoted section, or the default value if nothing found.

◆ getInt() [1/2]

int coCoviseConfig::getInt ( const std::string entry,
int  defaultValue,
bool *  exists = 0 
)
static

Get an integer value.

Parameters
entryThe section to get the value from.
defaultValueThe default return value if nothing is found.
existsprovide a pointer to a bool here to get feedback, if the value exists.
Returns
the value of the section, or the default value if nothing found.

◆ getInt() [2/2]

int coCoviseConfig::getInt ( const std::string variable,
const std::string entry,
int  defaultValue,
bool *  exists = 0 
)
static

Get an integer value.

Parameters
variableThe variable requested.
entryThe section to get the value from.
defaultValueThe default return value if nothing is found.
existsprovide a pointer to a bool here to get feedback, if the value exists.
Returns
the value of the variable in the denoted section, or the default value if nothing found.

◆ getLong() [1/2]

long coCoviseConfig::getLong ( const std::string entry,
long  defaultValue,
bool *  exists = 0 
)
static

Get a long integer value.

Parameters
entryThe section to get the value from.
defaultValueThe default return value if nothing is found.
existsprovide a pointer to a bool here to get feedback, if the value exists.
Returns
the value of the section, or the default value if nothing found.

◆ getLong() [2/2]

long coCoviseConfig::getLong ( const std::string variable,
const std::string entry,
long  defaultValue,
bool *  exists = 0 
)
static

Get a long integer value.

Parameters
variableThe variable requested.
entryThe section to get the value from.
defaultValueThe default return value if nothing is found.
existsprovide a pointer to a bool here to get feedback, if the value exists.
Returns
the value of the variable in the denoted section, or the default value if nothing found.

◆ getScopeEntries() [1/2]

coCoviseConfig::ScopeEntries coCoviseConfig::getScopeEntries ( const std::string scope)
static

◆ getScopeEntries() [2/2]

coCoviseConfig::ScopeEntries coCoviseConfig::getScopeEntries ( const std::string scope,
const std::string name 
)
static

◆ getScopeNames()

std::vector< std::string > coCoviseConfig::getScopeNames ( const std::string scope,
const std::string name = "" 
)
static

◆ isOn() [1/2]

bool coCoviseConfig::isOn ( const std::string entry,
bool  defaultValue,
bool *  exists = 0 
)
static

Checks if an option is on or off. As on counts "on", "true", and "1".

Parameters
entryThe section to get the value from.
defaultValueThe default return value if nothing is found.
existsprovide a pointer to a bool here to get feedback, if the value exists.
Returns
true, if "value" in the denoted section is on, or the default value if nothing found.

◆ isOn() [2/2]

bool coCoviseConfig::isOn ( const std::string variable,
const std::string entry,
bool  defaultValue,
bool *  exists = 0 
)
static

Checks if an option is on or off. As on counts "on", "true", and "1".

Parameters
variableThe variable requested.
entryThe section to get the value from.
defaultValueThe default return value if nothing is found.
existsprovide a pointer to a bool here to get feedback, if the value exists.
Returns
true, if the variable in the denoted section is on, or the default value if nothing found.

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