Allows to open, modify and save a properties file (which stores key/value pairs) More...
#include <Properties.h>
Public Member Functions | |
void | AppendSaveToStream (std::ostream &s) |
void | Clear () |
Deletes all key value pairs. | |
bool | Exists (const std::string &key) const |
void | LoadFromStream (std::istream &s) |
void | LoadFromStreamNoOverwrite (std::istream &s, std::stringstream ¬Readable) |
void | LoadFromTxtFile (const std::string &file) |
Properties () | |
Standard constructor. | |
Properties (const Properties &other) | |
bool | ReadBool (const std::string &key) const |
double | ReadDouble (const std::string &key) const |
float | ReadFloat (const std::string &key) const |
int | ReadInt (const std::string &key) const |
std::string | ReadString (const std::string &key) const |
void | SaveToTxtFile (const std::string &file) |
void | Set (const std::string &key, const std::string &value) |
void | Set (const std::string &key, const char *value) |
void | Set (const std::string &key, int value) |
void | Set (const std::string &key, float value) |
void | Set (const std::string &key, double value) |
void | Set (const std::string &key, bool value) |
Private Member Functions | |
std::string & | M_Replace (std::string &s, const std::string &sub, const std::string &other) |
Private Attributes | |
std::map< std::string, std::string > | m_m |
Allows to open, modify and save a properties file (which stores key/value pairs)
Definition at line 13 of file Properties.h.
Standard constructor.
Definition at line 13 of file Properties.cpp.
void face_contour_detector::Properties::AppendSaveToStream | ( | std::ostream & | s | ) |
Definition at line 185 of file Properties.cpp.
Deletes all key value pairs.
Definition at line 247 of file Properties.cpp.
bool face_contour_detector::Properties::Exists | ( | const std::string & | key | ) | const |
Returns if a value exists for the given key
key | the key |
Definition at line 199 of file Properties.cpp.
void face_contour_detector::Properties::LoadFromStream | ( | std::istream & | s | ) |
Loads properties from a stream. (Warining: This will overwrite already present properties with the same key)
s | the stream from where there is going to be parsed |
parse
Definition at line 29 of file Properties.cpp.
void face_contour_detector::Properties::LoadFromStreamNoOverwrite | ( | std::istream & | s, |
std::stringstream & | notReadable | ||
) |
Parses the properties present in the stream, but only set's they don't already exist in this object.
s | the contents of this stream will be parsed |
notReadable | lines that could not be parsed will be put intp the notReadable stream |
parse
Definition at line 90 of file Properties.cpp.
void face_contour_detector::Properties::LoadFromTxtFile | ( | const std::string & | file | ) |
Loads properties from a text file (ASCII Encoding). (Warining: This will overwrite already present properties with the same key)
file | path to the file |
Definition at line 17 of file Properties.cpp.
std::string & face_contour_detector::Properties::M_Replace | ( | std::string & | s, |
const std::string & | sub, | ||
const std::string & | other | ||
) | [inline, private] |
Definition at line 109 of file Properties.h.
bool face_contour_detector::Properties::ReadBool | ( | const std::string & | key | ) | const |
Reads a value as a bool
key | the key |
Definition at line 209 of file Properties.cpp.
double face_contour_detector::Properties::ReadDouble | ( | const std::string & | key | ) | const |
Reads a value as a double
key | the key |
Definition at line 205 of file Properties.cpp.
float face_contour_detector::Properties::ReadFloat | ( | const std::string & | key | ) | const |
Reads a value as a float
key | the key |
Definition at line 203 of file Properties.cpp.
int face_contour_detector::Properties::ReadInt | ( | const std::string & | key | ) | const |
Reads a value as a int
key | the key |
Definition at line 207 of file Properties.cpp.
std::string face_contour_detector::Properties::ReadString | ( | const std::string & | key | ) | const |
Reads a value as a string
key | the key |
Definition at line 201 of file Properties.cpp.
void face_contour_detector::Properties::SaveToTxtFile | ( | const std::string & | file | ) |
Saves the content of the properties into a text file (ASCII Encoded). Also not yet loaded properties, that are defined in the file, will be loaded.
file | path to the file |
Definition at line 149 of file Properties.cpp.
void face_contour_detector::Properties::Set | ( | const std::string & | key, |
const std::string & | value | ||
) |
Sets the key to the given value
key | the key |
value | the value |
Definition at line 217 of file Properties.cpp.
void face_contour_detector::Properties::Set | ( | const std::string & | key, |
const char * | value | ||
) |
Sets the key to the given value
key | the key |
value | the value |
Definition at line 221 of file Properties.cpp.
void face_contour_detector::Properties::Set | ( | const std::string & | key, |
int | value | ||
) |
Sets the key to the given value
key | the key |
value | the value |
Definition at line 225 of file Properties.cpp.
void face_contour_detector::Properties::Set | ( | const std::string & | key, |
float | value | ||
) |
Sets the key to the given value
key | the key |
value | the value |
Definition at line 231 of file Properties.cpp.
void face_contour_detector::Properties::Set | ( | const std::string & | key, |
double | value | ||
) |
Sets the key to the given value
key | the key |
value | the value |
Definition at line 237 of file Properties.cpp.
void face_contour_detector::Properties::Set | ( | const std::string & | key, |
bool | value | ||
) |
Sets the key to the given value
key | the key |
value | the value |
Definition at line 243 of file Properties.cpp.
std::map<std::string, std::string> face_contour_detector::Properties::m_m [private] |
Definition at line 102 of file Properties.h.