45 current_element = document =
nullptr;
46 working_string.erase();
51void FGXMLParse::dumpDataLines(
void)
53 if (!working_string.empty()) {
54 for (
auto s:
split(working_string,
'\n'))
57 working_string.erase();
66 current_element = document;
73 current_element->AddChildElement(temp_element);
75 current_element = temp_element;
78 if (!current_element) {
79 cerr <<
"In file " << getPath() <<
": line " << getLine() << endl
80 <<
"No current element read (running out of memory?)" << endl;
84 current_element->SetLineNumber(getLine());
85 current_element->SetFileName(getPath());
87 for (
int i=0;
i<atts.size();
i++) {
88 current_element->AddAttribute(atts.getName(
i), atts.getValue(
i));
97 current_element = current_element->GetParent();
104 working_string += string(s, length);
111 cerr <<
"Warning: " << message <<
" line: " << line <<
" column: " << column
void SetParent(Element *p)
This function sets the value of the parent class attribute to the supplied Element pointer.
void AddData(std::string d)
Stores data belonging to this element.
void data(const char *s, int length) override
void endElement(const char *name) override
void startElement(const char *name, const XMLAttributes &atts) override
void warning(const char *message, int line, int column) override
std::vector< std::string > split(std::string str, char d)