#include <QtXmlDocument.h>
Inheritance diagram for QtXmlDocument:
Definition at line 26 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. | |
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. |
|
Status codes for opening an XML document.
Definition at line 33 of file XmlDocument.h. |
|
A private copy constructor in order to avoid copying.
|
|
The public constructor taking a Qt XML module QDocument as argument.
Definition at line 23 of file QtXmlDocument.cxx. |
|
Definition at line 29 of file QtXmlDocument.cxx. References m_document. |
|
Appends the root element to the document.
Implements XmlDocument. Definition at line 62 of file QtXmlDocument.cxx. References m_document, and QtXmlNode::m_node. |
|
Creates a new DOM element wrapper object and returns a pointer to it. The receiver takes possesion of the object and is responsible for its deletion. Implements XmlDocument. Definition at line 45 of file QtXmlDocument.cxx. References QDomDocument::createElement(), and m_document. |
|
Creates a new DOM Text node.
Implements XmlDocument. Definition at line 54 of file QtXmlDocument.cxx. References QDomDocument::createTextNode(), and m_document. |
|
Returns the root document element.
Implements XmlDocument. Definition at line 35 of file QtXmlDocument.cxx. References QDomDocument::documentElement(), and m_document. |
|
Saves the document to the file.
Implements XmlDocument. Definition at line 72 of file QtXmlDocument.cxx. References QFile::close(), m_document, QFile::open(), XmlDocument::Success, and XmlDocument::WriteError. |
|
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 90 of file QtXmlDocument.cxx. References QFile::close(), QFileInfo::dirPath(), m_document, QFile::open(), XmlDocument::OpenError, XmlDocument::ParseError, QDomDocument::setContent(), QDir::setCurrent(), and XmlDocument::Success. |
|
The DOM element wrapped by this object.
Definition at line 32 of file QtXmlDocument.h. Referenced by appendChild(), createElement(), createTextNode(), documentElement(), QtXmlDocument(), saveToFile(), and setContent(). |