Functions

example5.cpp File Reference

#include <xmlstorage.h>
#include <iostream>
Include dependency graph for example5.cpp:

Go to the source code of this file.

Functions

void test_write ()
void test_delete ()
int main ()

Function Documentation

int main (  )

Definition at line 99 of file example5.cpp.

References test_delete(), and test_write().

{
    test_write();
    test_delete();

    return 0;
}

Here is the call graph for this function:

void test_delete (  )

Definition at line 74 of file example5.cpp.

References XMLStorage::XMLPos::back(), XMLStorage::XMLPos::delete_this(), XMLStorage::XMLPos::erase(), XMLStorage::XMLPos::go_down(), XMLStorage::XMLDoc::read_file(), and XMLStorage::XMLDoc::write_file().

Referenced by main().

{
    XMLDoc doc;

     // Einlesen des XML-Files
    doc.read_file("example5.xml");

    XMLPos pos(&doc);

    pos.go_down("PERSON");
//      pos.remove_children("VORNAME");

        pos.go_down("VORNAME");
        pos.delete_this();
    pos.back(); // </PERSON>

    pos.go_down("ADRESSE");
        pos.erase("private");
    pos.back();

     // Schreiben der XML-Datei
    doc.write_file("example5.xml");
}

Here is the call graph for this function:

Here is the caller graph for this function:

void test_write (  )

Definition at line 46 of file example5.cpp.

References XMLStorage::XMLPos::back(), XMLStorage::XMLPos::create(), and XMLStorage::XMLDoc::write_file().

{
    XMLDoc doc;
    XMLPos pos(&doc);

     // Zusammenstellen der XML-Struktur im Dokument 'doc'
    pos.create("PERSON");

      pos.create("NAME");
        pos->set_content("Mustername");
      pos.back(); // </NAME>

      pos.create("VORNAME");
        pos->set_content("Mustervorname");
      pos.back(); // </VORNAME>

      pos.create("ADRESSE");
        pos["private"] = "true";
        pos->set_content("Musteradresse");
      pos.back(); // </ADRESSE>

    pos.back(); // </PERSON>

     // Schreiben der XML-Datei
    doc.write_file("example5.xml");
}

Here is the call graph for this function: