#include <QtXmlDocument.h>
Inheritance diagram for QtXmlDocument:
Definition at line 30 of file QtXmlDocument.h.
Public Types | |
enum | Status { Success, OpenError, ParseError, WriteError } |
Status codes for opening an XML document. More... | |
Public Member Functions | |
virtual void | appendChild (XmlElement &) |
Appends the root element to the document. | |
virtual XmlElement * | createElement (const std::string &tagName) |
Creates a new DOM element wrapper object and returns a pointer to it. | |
virtual XmlTextNode * | createTextNode (const std::string &tag) |
Creates a new DOM Text node. | |
virtual XmlElement * | documentElement () const |
Returns the root document element. | |
QtXmlDocument (const std::string &name) | |
QtXmlDocument (QDomDocument document) | |
The public constructor taking a Qt XML module QDocument as argument. | |
virtual Status | saveToFile (const std::string &filename) |
Saves the document to the file. | |
virtual Status | setContent (const std::string &filename) |
Sets the content of the XML document from the text in the file filename. | |
~QtXmlDocument () | |
The dstructor. | |
Private Member Functions | |
QtXmlDocument (const QtXmlDocument &) | |
A private copy constructor in order to avoid copying. | |
Private Attributes | |
QDomDocument | m_document |
The DOM element wrapped by this object. |
enum Status [inherited] |
QtXmlDocument | ( | const QtXmlDocument & | ) | [private] |
A private copy constructor in order to avoid copying.
QtXmlDocument | ( | QDomDocument | document | ) |
The public constructor taking a Qt XML module QDocument as argument.
Definition at line 25 of file QtXmlDocument.cxx.
QtXmlDocument | ( | const std::string & | name | ) |
~QtXmlDocument | ( | ) |
void appendChild | ( | XmlElement & | ) | [virtual] |
Appends the root element to the document.
Implements XmlDocument.
Definition at line 67 of file QtXmlDocument.cxx.
References QtXmlDocument::m_document, and QtXmlNode::m_node.
XmlElement * createElement | ( | const std::string & | tagName | ) | [virtual] |
Creates a new DOM element wrapper object and returns a pointer to it.
The receiver takes procession of the object and is responsible for its deletion.
Implements XmlDocument.
Definition at line 50 of file QtXmlDocument.cxx.
References QDomDocument::createElement(), and QtXmlDocument::m_document.
XmlTextNode * createTextNode | ( | const std::string & | tag | ) | [virtual] |
Creates a new DOM Text node.
Implements XmlDocument.
Definition at line 59 of file QtXmlDocument.cxx.
References QDomDocument::createTextNode(), and QtXmlDocument::m_document.
XmlElement * documentElement | ( | ) | const [virtual] |
Returns the root document element.
Implements XmlDocument.
Definition at line 41 of file QtXmlDocument.cxx.
References QDomDocument::documentElement(), and QtXmlDocument::m_document.
XmlDocument::Status saveToFile | ( | const std::string & | filename | ) | [virtual] |
Saves the document to the file.
Implements XmlDocument.
Definition at line 77 of file QtXmlDocument.cxx.
References QtXmlDocument::m_document, XmlDocument::Success, and XmlDocument::WriteError.
XmlDocument::Status setContent | ( | const std::string & | filename | ) | [virtual] |
Sets the content of the XML document from the text in the file filename.
Also sets the application's current working directory to the path to the file. This is done so that files referenced by the XML document can be found relative to the document itself.
Implements XmlDocument.
Definition at line 100 of file QtXmlDocument.cxx.
References QFileInfo::dirPath(), QtXmlDocument::m_document, XmlDocument::OpenError, XmlDocument::ParseError, QDomDocument::setContent(), QDir::setCurrent(), and XmlDocument::Success.
QDomDocument m_document [private] |
The DOM element wrapped by this object.
Definition at line 36 of file QtXmlDocument.h.
Referenced by QtXmlDocument::appendChild(), QtXmlDocument::createElement(), QtXmlDocument::createTextNode(), QtXmlDocument::documentElement(), QtXmlDocument::QtXmlDocument(), QtXmlDocument::saveToFile(), and QtXmlDocument::setContent().