NIST Biometric Evaluation Framework
Software components for biometric technology evaluations
|
An IO::Properties object persisted in a file on disk. More...
#include <be_io_propertiesfile.h>
Inherits BiometricEvaluation::IO::Properties.
Public Member Functions | |
PropertiesFile (const std::string &pathname, IO::Mode mode=IO::Mode::ReadOnly, const std::map< std::string, std::string > &defaults={}) | |
Construct a new Properties object from an existing or to be created properties file. More... | |
void | sync () |
Write the properties to the underlying file, synchronizing the in-memory and on-disk versions. More... | |
void | changeName (const std::string &pathname) |
Change the name of the Properties, which means changing the name of the underlying file that stores the properties. More... | |
~PropertiesFile () | |
Destructor. More... | |
PropertiesFile (const PropertiesFile &other)=delete | |
Copy constructor (disabled). More... | |
PropertiesFile & | operator= (const PropertiesFile &other)=delete |
Assignment operator (disabled). More... | |
![]() | |
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... | |
Additional Inherited Members | |
![]() | |
BiometricEvaluation::IO::Mode | getMode () const |
Obtain the mode of the Properties object. More... | |
void | initWithBuffer (const Memory::uint8Array &buffer, const std::map< std::string, std::string > &defaults) |
Initialize the PropertiesMap with the contents of a properly formatted buffer. More... | |
void | initWithBuffer (const uint8_t *const buffer, size_t size, const std::map< std::string, std::string > &defaults) |
Initialize the PropertiesMap with the contents of a properly formatted buffer. More... | |
An IO::Properties object persisted in a file on disk.
An example file might look like this:
* Name = John Smith * Age = 32 * Favorite Hex Number = 0xffff *
For property keys and values, leading and trailing whitespace is removed, therefore the call
results in an entry in the property file as
* My property = A value *
Therefore, the property names "Foo", " Foo", "Foo " are equivalent.
Definition at line 49 of file be_io_propertiesfile.h.
BiometricEvaluation::IO::PropertiesFile::PropertiesFile | ( | const std::string & | pathname, |
IO::Mode | mode = IO::Mode::ReadOnly , |
||
const std::map< std::string, std::string > & | defaults = {} |
||
) |
Construct a new Properties object from an existing or to be created properties file.
The constructor will create the file when it does not exist.
[in] | pathname | The path to the file to store the properties. |
[in] | mode | The read/write mode of the object. |
[in] | defaults | Default property/value pairs to insert. |
Error::StrategyError | A line in the properties file is malformed. |
Error::FileError | An error occurred when using the underlying storage system. |
BiometricEvaluation::IO::PropertiesFile::~PropertiesFile | ( | ) |
Destructor.
|
delete |
Copy constructor (disabled).
Disabled because this object could represent a file on disk.
other | PropertiesFile object to copy. |
void BiometricEvaluation::IO::PropertiesFile::sync | ( | ) |
Write the properties to the underlying file, synchronizing the in-memory and on-disk versions.
Error::FileError | An error occurred when using the underlying storage system. |
Error::StrategyError | The object was constructed with nullptr as the file name, or is read-only. |
void BiometricEvaluation::IO::PropertiesFile::changeName | ( | const std::string & | pathname | ) |
Change the name of the Properties, which means changing the name of the underlying file that stores the properties.
[in] | pathname | The path to the Properties file. |
Error::StrategyError | The object is read-only. |
Error::ObjectExists | A file at pathname already exists. |
|
delete |
Assignment operator (disabled).
Disabled because this object could represent a file on disk.
other | PropertiesFile object to assign; |