#include <xmlstorage.h>#include <iostream>
Go to the source code of this file.
Functions | |
| void | test_write () |
| void | test_read () |
| int | main () |
| int main | ( | ) |
Definition at line 85 of file example4.cpp.
References test_read(), and test_write().
{
test_write();
test_read();
return 0;
}

| void test_read | ( | ) |
Definition at line 62 of file example4.cpp.
References XMLStorage::XMLPos::back(), XMLStorage::const_XMLChildrenFilter::begin(), XMLStorage::const_XMLChildrenFilter::end(), XMLStorage::XMLNode::get_content(), XMLStorage::XMLPos::go(), and XMLStorage::XMLDoc::read_file().
{
XMLDoc doc;
// Einlesen des XML-Files
doc.read_file("enum-children.xml");
XMLPos pos(&doc);
if (pos.go("Test")) {
const_XMLChildrenFilter children(pos, "Child");
for(const_XMLChildrenFilter::const_iterator it=children.begin(); it!=children.end(); ++it) {
const XMLNode* node = *it;
cout << node->get_content() << endl;
}
pos.back();
}
}

| void test_write | ( | ) |
Definition at line 46 of file example4.cpp.
References XMLStorage::XMLWriter::back(), XMLStorage::XMLWriter::create(), and XMLStorage::XMLWriter::set_content().
{
XMLWriter out("enum-children.xml");
out.create("Test");
out.create("Child");
out.set_content("Wert1");
out.back();
out.create("Child");
out.set_content("Wert2");
out.back();
out.back();
}

1.7.2