A class holding a set of properties.
More...
#include <properties.h>
|
virtual | ~Properties ()=default |
|
std::string | getProperty (const std::string &name, const std::string &def=std::string()) const |
| Get a map property.
|
|
float | getFloatProperty (const std::string &name, float def=0.0f) const |
| Gets a map property as a float.
|
|
float | getIntProperty (const std::string &name, int def=0) const |
| Gets a map property as an int.
|
|
bool | getBoolProperty (const std::string &name, bool def=false) const |
| Gets a map property as a boolean.
|
|
bool | hasProperty (const std::string &name) const |
| Returns whether a certain property is available.
|
|
void | setProperty (const std::string &name, const std::string &value) |
| Set a map property.
|
|
|
using | PropertyMap = std::map< std::string, std::string > |
|
A class holding a set of properties.
Definition at line 31 of file properties.h.
◆ PropertyMap
◆ ~Properties()
virtual Properties::~Properties |
( |
| ) |
|
|
virtualdefault |
◆ getBoolProperty()
bool Properties::getBoolProperty |
( |
const std::string & |
name, |
|
|
bool |
def = false |
|
) |
| const |
|
inline |
Gets a map property as a boolean.
- Parameters
-
name | The name of the property. |
def | Default value, false by default. |
- Returns
- the value of the given property or the given default when it doesn't exist.
Definition at line 101 of file properties.h.
◆ getFloatProperty()
float Properties::getFloatProperty |
( |
const std::string & |
name, |
|
|
float |
def = 0.0f |
|
) |
| const |
|
inline |
Gets a map property as a float.
- Parameters
-
name | The name of the property. |
def | Default value, 0.0f by default. |
- Returns
- the value of the given property or the given default when it doesn't exist.
Definition at line 59 of file properties.h.
◆ getIntProperty()
float Properties::getIntProperty |
( |
const std::string & |
name, |
|
|
int |
def = 0 |
|
) |
| const |
|
inline |
Gets a map property as an int.
- Parameters
-
name | The name of the property. |
def | Default value, 0 by default. |
- Returns
- the value of the given property or the given default when it doesn't exist.
Definition at line 80 of file properties.h.
◆ getProperty()
std::string Properties::getProperty |
( |
const std::string & |
name, |
|
|
const std::string & |
def = std::string() |
|
) |
| const |
|
inline |
Get a map property.
- Parameters
-
name | The name of the property. |
def | Default value, empty string by default. |
- Returns
- the value of the given property or the given default when it doesn't exist.
Definition at line 44 of file properties.h.
◆ hasProperty()
bool Properties::hasProperty |
( |
const std::string & |
name | ) |
const |
|
inline |
Returns whether a certain property is available.
- Parameters
-
name | The name of the property. |
- Returns
true
when a property is defined, false
otherwise.
Definition at line 122 of file properties.h.
◆ setProperty()
void Properties::setProperty |
( |
const std::string & |
name, |
|
|
const std::string & |
value |
|
) |
| |
|
inline |
Set a map property.
- Parameters
-
name | The name of the property. |
value | The value of the property. |
Definition at line 133 of file properties.h.
◆ mProperties
The documentation for this class was generated from the following file: