A basic parser for general property value definitions in XML. Parses a single XML element where a property is defined by a list of values. These values can be numeric or strings. It fills a vector with these values and returns a pointer to it. The parser can handle any number of values.
More...
template<typename T>
class PropertyParser< T >
A basic parser for general property value definitions in XML. Parses a single XML element where a property is defined by a list of values. These values can be numeric or strings. It fills a vector with these values and returns a pointer to it. The parser can handle any number of values.
- Template Parameters
-
T | data type can be char*, string , double, ... |
- Returns
- An unordered map where keys are the attribute names (stored as std::string for safety by default) and values are of type T (which can be std::string, const char*, or double—only these types are acceptable).
<density value="1.0" />
...
<controller kP="10" kI="15" Kd="-2.0" ... />
- Template Parameters
-
T | Accepts either std::string or double. |
- Warning
- This parser does not support mixed property type parsing at once. It can handle an XML element with either all string or all double values. Mixed parsing of attributes will be addressed in future versions.
- Note
- A conversion error from str2double will occur when parsing mixed attribute properties with a propertyParser<double> instance. This issue is currently ignored.
- Todo:
- Fix the bug related to mixed attribute property parsing.