#include <PropertySourceXml.h>
Property source backed by the attributes of an xml node.
Definition at line 46 of file PropertySourceXml.h.
◆ PropertySourceXml() [1/2]
Rcs::PropertySourceXml::PropertySourceXml |
( |
xmlNodePtr |
node, |
|
|
xmlDocPtr |
doc = NULL |
|
) |
| |
Constructor
- Parameters
-
[in] | node | node whose attributes will be read |
[in] | doc | document to destroy on close. Use to make the node owned by this class. If null, node will not be destroyed. |
Definition at line 62 of file PropertySourceXml.cpp.
◆ PropertySourceXml() [2/2]
Rcs::PropertySourceXml::PropertySourceXml |
( |
const char * |
configFile | ) |
|
|
explicit |
Constructor, loading XML from filename. Expects a root tag named 'Experiment'.
- Parameters
-
Definition at line 45 of file PropertySourceXml.cpp.
◆ ~PropertySourceXml()
Rcs::PropertySourceXml::~PropertySourceXml |
( |
| ) |
|
|
virtual |
◆ clone()
◆ exists()
bool Rcs::PropertySourceXml::exists |
( |
| ) |
|
|
virtual |
◆ getChild()
PropertySource * Rcs::PropertySourceXml::getChild |
( |
const char * |
prefix | ) |
|
|
virtual |
Obtain a child property source.
The exact meaning of this depends on the implementation. For an Xml document, it could be a child element. For a python dict, it could be a dict-typed entry.
The returned object is owned by the parent.
Implements Rcs::PropertySource.
Definition at line 196 of file PropertySourceXml.cpp.
◆ getChildList()
const std::vector< PropertySource * > & Rcs::PropertySourceXml::getChildList |
( |
const char * |
prefix | ) |
|
|
virtual |
Obtain a list of child property sources. The exact meaning of this depends on the implementation. For an Xml document, it could be child elements with the same tag name. For a python dict, it could be a list of dicts.
The returned objects are owned by the parent.
Implements Rcs::PropertySource.
Definition at line 218 of file PropertySourceXml.cpp.
◆ getProperty() [1/5]
bool Rcs::PropertySourceXml::getProperty |
( |
std::string & |
out, |
|
|
const char * |
property |
|
) |
| |
|
virtual |
Read a string value.
- Parameters
-
[out] | out | storage for read value |
[in] | property | name of property to read |
- Returns
- true if the property was read successfully
- Exceptions
-
std::exception | if the property exists, but couldn't be converted |
Implements Rcs::PropertySource.
Definition at line 93 of file PropertySourceXml.cpp.
◆ getProperty() [2/5]
bool Rcs::PropertySourceXml::getProperty |
( |
std::vector< std::string > & |
out, |
|
|
const char * |
property |
|
) |
| |
|
overridevirtual |
Read a string list value.
- Parameters
-
[out] | out | storage for read value |
[in] | property | name of property to read |
- Returns
- true if the property was read successfully
- Exceptions
-
std::exception | if the property exists, but couldn't be converted |
Implements Rcs::PropertySource.
Definition at line 105 of file PropertySourceXml.cpp.
◆ getProperty() [3/5]
bool Rcs::PropertySourceXml::getProperty |
( |
double & |
out, |
|
|
const char * |
property |
|
) |
| |
|
virtual |
Read a double value.
- Parameters
-
[out] | out | storage for read value |
[in] | property | name of property to read |
- Returns
- true if the property was read successfully, false if it doesn't exist
- Exceptions
-
std::exception | if the property exists, but couldn't be converted |
Implements Rcs::PropertySource.
Definition at line 114 of file PropertySourceXml.cpp.
◆ getProperty() [4/5]
bool Rcs::PropertySourceXml::getProperty |
( |
int & |
out, |
|
|
const char * |
property |
|
) |
| |
|
virtual |
Read an int value.
- Parameters
-
[out] | out | storage for read value |
[in] | property | name of property to read |
- Returns
- true if the property was read successfully, false if it doesn't exist
- Exceptions
-
std::exception | if the property exists, but couldn't be converted |
Implements Rcs::PropertySource.
Definition at line 132 of file PropertySourceXml.cpp.
◆ getProperty() [5/5]
bool Rcs::PropertySourceXml::getProperty |
( |
MatNd *& |
out, |
|
|
const char * |
property |
|
) |
| |
|
virtual |
Read a vector/matrix value. The variable out should be a pointer and will be set to a newly created MatNd* on success.
- Parameters
-
[out] | out | storage for read value |
[in] | property | name of property to read |
- Returns
- true if the property was read successfully, false if it doesn't exist
- Exceptions
-
std::exception | if the property exists, but couldn't be converted |
Implements Rcs::PropertySource.
Definition at line 150 of file PropertySourceXml.cpp.
◆ getPropertyBool()
bool Rcs::PropertySourceXml::getPropertyBool |
( |
const char * |
property, |
|
|
bool |
def = false |
|
) |
| |
|
virtual |
Read a boolean value, returning a default value if not found. This interface differs from the others to ease usability
- Parameters
-
[in] | property | name of property to read |
[in] | def | value to return if property doesn't exist |
- Returns
- true if the property was read successfully
- Exceptions
-
std::exception | if the property exists, but couldn't be converted |
Implements Rcs::PropertySource.
Definition at line 184 of file PropertySourceXml.cpp.
◆ saveXML()
void Rcs::PropertySourceXml::saveXML |
( |
const char * |
fileName, |
|
|
const char * |
rootNodeName |
|
) |
| |
|
virtual |
Save this property source as xml file.
- Parameters
-
[in] | fileName | name of the file to write |
[in] | rootNodeName | name of the xml root node |
Implements Rcs::PropertySource.
Definition at line 251 of file PropertySourceXml.cpp.
◆ children
std::map<std::string, PropertySource*> Rcs::PropertySourceXml::children |
|
private |
◆ doc
xmlDocPtr Rcs::PropertySourceXml::doc |
|
private |
◆ listChildren
std::map<std::string, std::vector<PropertySource*> > Rcs::PropertySourceXml::listChildren |
|
private |
◆ node
xmlNodePtr Rcs::PropertySourceXml::node |
|
private |
The documentation for this class was generated from the following files: