Wrapper for DOMDocument that implements the Archive interface. More...
#include <Valuable/XMLArchive.hpp>
Public Member Functions | |
| virtual ArchiveElement | createElement (const QString &name) |
| Create a new element with correct implementation. More... | |
| bool | readFromFile (const QString &filename) |
| Read archive contents from a file. More... | |
| bool | readFromMem (const QByteArray &buffer) |
| Read archive contents from a buffer. More... | |
| ArchiveElement | root () const |
| Query the root element. More... | |
| void | setRoot (const ArchiveElement &element) |
| Sets the root element. More... | |
| bool | writeToFile (const QString &filename) const |
| Serialize archive as XML to a file. More... | |
| bool | writeToMem (QByteArray &buffer) const |
| Serialize archive as XML to a buffer. More... | |
| DOMDocument * | xml () |
| Returns a pointer to wrapped DOMDocument. More... | |
| XMLArchive (unsigned int options=DEFAULTS) | |
| Creates a new DOMDocument. More... | |
| virtual | ~XMLArchive () |
| Deletes the DOMDocument. | |
Public Member Functions inherited from Valuable::Archive | |
| Archive (unsigned int options=DEFAULTS) | |
| Creates a new Archive and initializes the SerializationOptions with given options. More... | |
| virtual | ~Archive () |
| Default destructor does nothing. | |
Public Member Functions inherited from Valuable::SerializationOptions | |
| bool | checkFlags (Options flag) |
| Check if given flag is enabled. More... | |
| SerializationOptions (unsigned int options=DEFAULTS) | |
| Construct an options object with given flags. | |
| void | setOptions (Options flags) |
| Set the options for serialization. | |
Static Public Member Functions | |
| static QString | cleanElementName (QString name) |
| Clean string so that it is a valid XML element name. | |
Additional Inherited Members | |
Public Types inherited from Valuable::SerializationOptions | |
| enum | Options { LAYER_DEFAULT = 1 << 0, LAYER_STYLE = 1 << 1, LAYER_USER = 1 << 2, LAYER_STYLE_IMPORTANT = 1 << 3, DEFAULTS = LAYER_USER, ONLY_CHANGED = LAYER_STYLE | LAYER_USER | LAYER_STYLE_IMPORTANT, EVERYTHING = LAYER_DEFAULT | LAYER_STYLE | LAYER_USER | LAYER_STYLE_IMPORTANT } |
| Serialization bitflags. More... | |
Protected Attributes inherited from Valuable::SerializationOptions | |
| unsigned int | m_options |
| Actual bitmask of flags. | |
Wrapper for DOMDocument that implements the Archive interface.
All ArchiveElements use XMLArchiveElement implementation and are constructed in createElement.
| Valuable::XMLArchive::XMLArchive | ( | unsigned int | options = DEFAULTS | ) |
Creates a new DOMDocument.
| options | Bitmask of SerializationOptions::Options |
|
virtual |
Create a new element with correct implementation.
| name | Name of the element. |
Implements Valuable::Archive.
|
virtual |
Read archive contents from a file.
| filename | file to open |
Implements Valuable::Archive.
|
virtual |
Read archive contents from a buffer.
| buffer | data buffer to read the data from |
Implements Valuable::Archive.
|
virtual |
|
virtual |
Sets the root element.
| element | New element that should be set as a new root element |
Implements Valuable::Archive.
|
virtual |
Serialize archive as XML to a file.
| filename | file to open |
Implements Valuable::Archive.
|
virtual |
Serialize archive as XML to a buffer.
| buffer | that will be overwritten with the new data |
Implements Valuable::Archive.
|
virtual |
Returns a pointer to wrapped DOMDocument.
Reimplemented from Valuable::Archive.