Go to the documentation of this file.
51 if (element.GetText() ==
nullptr)
65 if (element.FirstChildElement() ==
nullptr)
77 for (
const tinyxml2::XMLAttribute* attribute = element.FirstAttribute(); attribute !=
nullptr; attribute = attribute->Next())
85 for(
const tinyxml2::XMLElement* e = element.FirstChildElement(); e !=
nullptr; e = e->NextSiblingElement())
93 error <<
"Error parsing " << candidate_name;
111 const tinyxml2::XMLElement* root = doc.FirstChildElement();
113 if (root->NextSibling() !=
nullptr)
125 tinyxml2::XMLDocument doc;
127 stream >> stream_string;
128 doc.Parse(stream_string.c_str());
133 error << doc.ErrorStr() <<
" at line " << doc.ErrorLineNum();
144 tinyxml2::XMLDocument doc;
145 doc.Parse(
string.c_str());
150 error << doc.ErrorStr() <<
" at line " << doc.ErrorLineNum();
167 error <<
"[loadFromXMLFile] file '" << filename <<
"' doesn't exist." <<
std::endl;
173 tinyxml2::XMLDocument doc;
174 doc.LoadFile(filename.
c_str());
178 error <<
"Error loading " << filename <<
": ";
179 error << doc.ErrorStr() <<
" at row " << doc.ErrorLineNum();
bool loadFromXMLText(const tinyxml2::XMLElement &element, ReaderWriter &config)
loadFromXMLText writes a value from xml element into config object. Stored as double,...
void setSource(const std::string &source)
setSource set the source file of the data in this object
bool endArrayItem()
endArrayItem go back to the array level
bool loadFromXMLFile(const std::string &filename, ReaderWriter &config)
loadFromXMLFile loads a xml file into a ReaderWriter class
bool strToBool(std::string s, bool &rhs)
strToBool Converts a string to a boolean of matches one of the following: y, n, yes,...
bool writeArray(const std::string &name)
writeArray starts writing an array. Or start extending it, if it already exists.
bool loadFromXMLDocument(const tinyxml2::XMLDocument &doc, ReaderWriter &config)
bool addArrayItem()
addArrayItem create a new item in the array
bool setValue(const std::string &key, const std::string &value, ReaderWriter &config)
setValue sets the value as a double, int or string
bool loadFromXMLElement(const tinyxml2::XMLElement &element, ReaderWriter &config)
bool endArray()
endArray go to parrent of current array, wrapping end() for readibility
void addError(const std::string &msg)
void setValue(const std::string &name, const T &value)
setValue set child value with key 'name' and value 'value'
bool loadFromXMLString(const std::string &string, ReaderWriter &config)
loadFromXMLString loads a xml string into a ReaderWriter class
bool loadFromXMLStream(std::istream &stream, ReaderWriter &config)
loadFromXMLStream loads a xml stream into a ReaderWriter class
tue::config::ReaderWriter config