Home | C-Bits Package Documentation | Project Page |
#include <PropertyList.h>
Public Methods | |
void | setProperty (const std::string &property_name, const std::string &property_value) |
Set a property. More... | |
const char * | getProperty (const std::string &property_name) |
Retrieve the value (if any) for the specified property. More... | |
const bool | isSet (const char *name) |
Test if a specific property is set in this PropertyList instance. More... | |
const int | getNumProperties () const |
Count number of propety entires in this property set. More... | |
std::vector< std::string > & | getValues (void) |
Retrieve the list of the property values stored in this PropertyList instance. More... | |
std::vector< std::string > & | getKeys (void) |
Retrieve the names of the properties stored in this PropertyList instance. More... | |
void | removeProperties () |
Remove all properties from this instance. More... | |
const bool | readPropertyList (std::istream &prop_stream, const bool override=true, const char nv_delim='=', const char cmt_delim='#') |
Read properties from a stream, and add them to this instance. More... | |
const bool | readFile (const char *const path, const bool override=true, const char nv_delim='=', const char cmt_delim='#') |
Read a property file, adding contents to this propertyList instance. More... | |
const bool | writePropertyList (std::ostream &os, const char delim='=') const |
Write properties to a stream. More... | |
const int | readCommandLine (const int argc, const char *const *argv, const bool override=true, const char delim='=') |
Read command line, adding any properties to this property set. More... | |
Static Public Methods | |
PropertyList & | getPropertyList (const std::string &name) |
Get a new or existing PropertyList. More... | |
void | removePropertyList (const std::string &name) |
Remove a property list from memory. More... | |
void | removeAll () |
Remove all property lists from memory. More... | |
int | getNumPropertyLists () |
Count number of property lists in memory. More... | |
const bool | exists (const std::string &name) |
Test if a property set exists. More... | |
std::string | trim (const std::string &line) |
Trim whitespace from both ends of a line. More... | |
Protected Methods | |
PropertyList () | |
Default constructor. More... | |
Static Protected Methods | |
std::map< std::string, PropertyList * > & | getSets () |
Access the property sets. More... | |
Private Types | |
typedef std::map< std::string, std::string >::const_iterator | PITERATOR |
Properties iterator. More... | |
Private Methods | |
PropertyList (const PropertyList &) | |
Prevent copy construction. More... | |
PropertyList & | operator= (const PropertyList &) |
Prevent assignment. More... | |
Private Attributes | |
std::map< std::string, std::string > | _properties |
The properties for this PropertyList instance. More... | |
std::vector< std::string > | _values |
Cache for the values stored in this PropertyList instance. More... | |
std::vector< std::string > | _keys |
Cache for the property names stored in this PropertyList instance. More... | |
Static Private Attributes | |
std::map< std::string, PropertyList * > | _sets |
Map that holds the property sets. More... |
Can be used to
|
Properties iterator.
|
|
Default constructor.
|
|
Prevent copy construction.
|
|
Test if a property set exists.
|
|
Retrieve the names of the properties stored in this PropertyList instance.
|
|
Count number of propety entires in this property set.
|
|
Count number of property lists in memory.
|
|
Retrieve the value (if any) for the specified property.
|
|
Get a new or existing PropertyList.
|
|
Access the property sets.
|
|
Retrieve the list of the property values stored in this PropertyList instance.
|
|
Test if a specific property is set in this PropertyList instance.
|
|
Prevent assignment.
|
|
Read command line, adding any properties to this property set.
|
|
Read a property file, adding contents to this propertyList instance.
The properties must be 'name <delim> value' pairs, one pair per line, with each line terminated by a ' Whitespace between 'name' and the <delim> character, or between <delim> and 'value' is ignored.
|
|
Read properties from a stream, and add them to this instance.
The properties must be 'name <delim> value' pairs separated by ' Whitespace between 'name' and the <delim> character, or between <delim> and 'value' is ignored.
|
|
Remove all property lists from memory.
|
|
Remove all properties from this instance.
|
|
Remove a property list from memory.
|
|
Set a property. Define the method used to set a property.
|
|
Trim whitespace from both ends of a line.
|
|
Write properties to a stream.
|
|
Cache for the property names stored in this PropertyList instance.
|
|
The properties for this PropertyList instance.
|
|
Map that holds the property sets.
|
|
Cache for the values stored in this PropertyList instance.
|
|
|