All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Valuable::DOMDocument Class Reference

Represents a DOM document. More...

#include <Valuable/DOMDocument.hpp>

Public Member Functions

void appendChild (DOMElement element)
 Appends an element to the document.
 
DOMElement createElement (const QString &name)
 Creates a new DOM element with the given name. More...
 
DOMElement getDocumentElement ()
 Returns the main document element.
 
bool readFromFile (const QString &filename, bool validate=false)
 Parse a document from a file. More...
 
bool readFromMem (const QByteArray &buffer)
 
bool writeToFile (const QString &filename)
 Writes the document to a file.
 
bool writeToMem (QByteArray &buf)
 Writes the document to memory.
 

Static Public Member Functions

static DOMDocumentcreateDocument ()
 Creates a new DOM document.
 

Detailed Description

Represents a DOM document.

Member Function Documentation

DOMElement Valuable::DOMDocument::createElement ( const QString &  name)

Creates a new DOM element with the given name.

Parameters
nameTag name of the DOM element
Returns
The created element
bool Valuable::DOMDocument::readFromFile ( const QString &  filename,
bool  validate = false 
)

Parse a document from a file.

Parameters
filenamename of the file to read from
validateif set to true, the XML must validate (it must have a schema)
Returns
true if there were no errors