Maintain key/value pairs of strings, with each property matched to one value.
More...
#include <be_io_properties.h>
Inherited by BiometricEvaluation::IO::PropertiesFile.
|
| Properties (IO::Mode mode=IO::Mode::ReadWrite, const std::map< std::string, std::string > &defaults={}) |
| Construct a new Properties object. More...
|
|
| Properties (const uint8_t *buffer, const size_t size, IO::Mode mode=IO::Mode::ReadWrite, const std::map< std::string, std::string > &defaults={}) |
| Construct a new Properties object from the contents of a buffer. More...
|
|
virtual void | setProperty (const std::string &property, const std::string &value) |
| Set a property with a value. More...
|
|
virtual void | setPropertyFromInteger (const std::string &property, int64_t value) |
| Set a property with an integer value. More...
|
|
virtual void | setPropertyFromDouble (const std::string &property, double value) |
| Set a property with a double value. More...
|
|
virtual void | setPropertyFromBoolean (const std::string &property, bool value) |
| Set a property with a boolean value. More...
|
|
virtual void | removeProperty (const std::string &property) |
| Remove a property. More...
|
|
virtual std::string | getProperty (const std::string &property) const |
| Retrieve a property value as a string object. More...
|
|
virtual int64_t | getPropertyAsInteger (const std::string &property) const |
| Retrieve a property value as an integer value. More...
|
|
virtual double | getPropertyAsDouble (const std::string &property) const |
| Retrieve a property value as a double value. More...
|
|
virtual bool | getPropertyAsBoolean (const std::string &property) const |
|
std::vector< std::string > | getPropertyKeys () const |
| Retrieve a set of all property keys. More...
|
|
virtual | ~Properties () |
| Destructor. More...
|
|
Maintain key/value pairs of strings, with each property matched to one value.
Definition at line 30 of file be_io_properties.h.
◆ Properties() [1/2]
BiometricEvaluation::IO::Properties::Properties |
( |
IO::Mode |
mode = IO::Mode::ReadWrite , |
|
|
const std::map< std::string, std::string > & |
defaults = {} |
|
) |
| |
Construct a new Properties object.
- Parameters
-
[in] | mode | The read/write mode of the object. |
[in] | defaults | Default property/value pairs to insert. |
◆ Properties() [2/2]
BiometricEvaluation::IO::Properties::Properties |
( |
const uint8_t * |
buffer, |
|
|
const size_t |
size, |
|
|
IO::Mode |
mode = IO::Mode::ReadWrite , |
|
|
const std::map< std::string, std::string > & |
defaults = {} |
|
) |
| |
Construct a new Properties object from the contents of a buffer.
The format of the buffer can be seen in PropertiesFile.
- Parameters
-
[in] | buffer | A buffer that contains the contents of a Property file. |
[in] | size | The size of buffer. |
[in] | mode | The read/write mode of the object. |
[in] | defaults | Default property/value pairs to insert. |
- Exceptions
-
◆ ~Properties()
virtual BiometricEvaluation::IO::Properties::~Properties |
( |
| ) |
|
|
virtual |
◆ setProperty()
virtual void BiometricEvaluation::IO::Properties::setProperty |
( |
const std::string & |
property, |
|
|
const std::string & |
value |
|
) |
| |
|
virtual |
Set a property with a value.
Both the property and value will have leading and trailing whitespace removed. If the property already exists in the set, its value will be replaced with the new value; otherwise, the property will be created.
- Parameters
-
[in] | property | The name of the property to set. |
[in] | value | The value associated with the property. |
- Exceptions
-
◆ setPropertyFromInteger()
virtual void BiometricEvaluation::IO::Properties::setPropertyFromInteger |
( |
const std::string & |
property, |
|
|
int64_t |
value |
|
) |
| |
|
virtual |
Set a property with an integer value.
The property will have leading and trailing whitespace removed. If the property already exists in the set, its value will be replaced with the new value; otherwise the property will be created.
- Parameters
-
[in] | property | The name of the property to set. |
[in] | value | The value associated with the property. |
- Exceptions
-
◆ setPropertyFromDouble()
virtual void BiometricEvaluation::IO::Properties::setPropertyFromDouble |
( |
const std::string & |
property, |
|
|
double |
value |
|
) |
| |
|
virtual |
Set a property with a double value.
The property will have leading and trailing whitespace removed. If the property already exists in the set, its value will be replaced with the new value; otherwise the property will be created.
- Parameters
-
[in] | property | The name of the property to set. |
[in] | value | The value associated with the property. |
- Exceptions
-
◆ setPropertyFromBoolean()
virtual void BiometricEvaluation::IO::Properties::setPropertyFromBoolean |
( |
const std::string & |
property, |
|
|
bool |
value |
|
) |
| |
|
virtual |
Set a property with a boolean value.
The actual value to be written is implementation- defined and may not actually be preserved, but the boolean value is guaranteed to remain valid when read with getPropertyAsBoolean().
- Parameters
-
[in] | property | The name of the property to set. |
[in] | value | The value associated with the property. |
- Exceptions
-
◆ removeProperty()
virtual void BiometricEvaluation::IO::Properties::removeProperty |
( |
const std::string & |
property | ) |
|
|
virtual |
Remove a property.
- Parameters
-
[in] | property | The name of the property to set. |
- Exceptions
-
◆ getProperty()
virtual std::string BiometricEvaluation::IO::Properties::getProperty |
( |
const std::string & |
property | ) |
const |
|
virtual |
Retrieve a property value as a string object.
- Parameters
-
[in] | property | The name of the property to get. |
- Exceptions
-
◆ getPropertyAsInteger()
virtual int64_t BiometricEvaluation::IO::Properties::getPropertyAsInteger |
( |
const std::string & |
property | ) |
const |
|
virtual |
Retrieve a property value as an integer value.
Integer value strings for properties can represent either decimal or hexadecimal values, which must be preceded with either "0x" or "0X".
- Parameters
-
[in] | property | The name of the property to get. |
- Exceptions
-
◆ getPropertyAsDouble()
virtual double BiometricEvaluation::IO::Properties::getPropertyAsDouble |
( |
const std::string & |
property | ) |
const |
|
virtual |
Retrieve a property value as a double value.
- Parameters
-
[in] | property | The name of the property to get. |
- Exceptions
-
◆ getPropertyAsBoolean()
virtual bool BiometricEvaluation::IO::Properties::getPropertyAsBoolean |
( |
const std::string & |
property | ) |
const |
|
virtual |
◆ getPropertyKeys()
std::vector< std::string > BiometricEvaluation::IO::Properties::getPropertyKeys |
( |
| ) |
const |
Retrieve a set of all property keys.
- Returns
- A vector of property key strings.
◆ getMode()
◆ initWithBuffer() [1/2]
void BiometricEvaluation::IO::Properties::initWithBuffer |
( |
const Memory::uint8Array & |
buffer, |
|
|
const std::map< std::string, std::string > & |
defaults |
|
) |
| |
|
protected |
Initialize the PropertiesMap with the contents of a properly formatted buffer.
This method ensures that the PropertiesMap contains only the properties found within the buffer.
- Parameters
-
buffer | Contents of a properties file. |
defaults | Default property/value pairs. |
- Exceptions
-
◆ initWithBuffer() [2/2]
void BiometricEvaluation::IO::Properties::initWithBuffer |
( |
const uint8_t *const |
buffer, |
|
|
size_t |
size, |
|
|
const std::map< std::string, std::string > & |
defaults |
|
) |
| |
|
protected |
Initialize the PropertiesMap with the contents of a properly formatted buffer.
This method ensures that the PropertiesMap contains only the properties found within the buffer.
- Parameters
-
buffer | Contents of a properties file. |
size | Size of the buffer. |
defaults | Default property/value pairs. |
- Exceptions
-
The documentation for this class was generated from the following file: