lib
KoXmlWriter Class Reference
#include <KoXmlWriter.h>
Detailed Description
A class for writing out XML (to any QIODevice), with a special attention on performance.The XML is being written out along the way, which avoids requiring the entire document in memory (like QDom does), and avoids using QTextStream at all (which in Qt3 has major performance issues when converting to utf8).
Definition at line 36 of file KoXmlWriter.h.
Public Member Functions | |
KoXmlWriter (QIODevice *dev, int indentLevel=0) | |
~KoXmlWriter () | |
QIODevice * | device () const |
void | startDocument (const char *rootElemName, const char *publicId=0, const char *systemId=0) |
void | endDocument () |
void | startElement (const char *tagName, bool indentInside=true) |
void | addAttribute (const char *attrName, const QString &value) |
void | addAttribute (const char *attrName, int value) |
void | addAttribute (const char *attrName, uint value) |
void | addAttribute (const char *attrName, double value) |
void | addAttributePt (const char *attrName, double value) |
void | addAttribute (const char *attrName, const QCString &value) |
void | addAttribute (const char *attrName, const char *value) |
void | endElement () |
void | addTextNode (const QString &str) |
void | addTextNode (const QCString &cstr) |
void | addTextNode (const char *cstr) |
void | addProcessingInstruction (const char *cstr) |
void | addCompleteElement (const char *cstr) |
void | addCompleteElement (QIODevice *dev) |
void | addManifestEntry (const QString &fullPath, const QString &mediaType) |
void | addConfigItem (const QString &configName, const QString &value) |
void | addConfigItem (const QString &configName, bool value) |
void | addConfigItem (const QString &configName, int value) |
void | addConfigItem (const QString &configName, double value) |
void | addConfigItem (const QString &configName, long value) |
void | addConfigItem (const QString &configName, short value) |
void | addTextSpan (const QString &text) |
void | addTextSpan (const QString &text, const QMap< int, int > &tabCache) |
int | indentLevel () const |
Constructor & Destructor Documentation
|
Create a KoXmlWriter instance to write out an XML document into the given QIODevice.
Definition at line 29 of file KoXmlWriter.cpp. |
|
Destructor.
Definition at line 44 of file KoXmlWriter.cpp. |
Member Function Documentation
|
Add an attribute to the current element.
Definition at line 180 of file KoXmlWriter.cpp. |
|
Overloaded version of the one taking a const char* argument, for convenience.
Definition at line 110 of file KoXmlWriter.h. |
|
Add an attribute whose value is a floating point number The number is written out with the highest possible precision (unlike QString::number and setNum, which default to 6 digits).
Definition at line 192 of file KoXmlWriter.cpp. |
|
Add an attribute whose value is an unsigned integer.
Definition at line 90 of file KoXmlWriter.h. |
|
Add an attribute whose value is an integer.
Definition at line 82 of file KoXmlWriter.h. |
|
Overloaded version of addAttribute( const char*, const char* ), which is a bit slower because it needs to convert
Definition at line 76 of file KoXmlWriter.h. |
|
Add an attribute which represents a distance, measured in pt The number is written out with the highest possible precision (unlike QString::number and setNum, which default to 6 digits), and the unit name ("pt") is appended to it.
Definition at line 199 of file KoXmlWriter.cpp. |
|
This is quite a special-purpose method, not for everyday use. It adds a complete element (with its attributes and child elements) as a child of the current element. The iodevice is supposed to be escaped for XML already, so it will usually come from another KoXmlWriter. This is usually used with KTempFile. Definition at line 123 of file KoXmlWriter.cpp. |
|
This is quite a special-purpose method, not for everyday use. It adds a complete element (with its attributes and child elements) as a child of the current element. The string is supposed to be escaped for XML already, so it will usually come from another KoXmlWriter. Definition at line 116 of file KoXmlWriter.cpp. |
|
Definition at line 336 of file KoXmlWriter.cpp. |
|
Definition at line 327 of file KoXmlWriter.cpp. |
|
Definition at line 318 of file KoXmlWriter.cpp. |
|
Definition at line 309 of file KoXmlWriter.cpp. |
|
Definition at line 300 of file KoXmlWriter.cpp. |
|
Special helper for writing config item into settings.xml.
Definition at line 291 of file KoXmlWriter.cpp. |
|
Special helper for writing "manifest" files This is equivalent to startElement/2*addAttribute/endElement This API will probably have to change (or not be used anymore) when we add support for encrypting/signing.
Definition at line 283 of file KoXmlWriter.cpp. |
|
Adds a processing instruction. This writes a processing instruction, like <?foo bar blah?>, where foo is the target, and the rest is the data. Processing instructions are used in XML to keep processor-specific information in the text of the document. Definition at line 172 of file KoXmlWriter.cpp. |
|
Adds a text node as a child of the current element.
This is appends the litteral content of Definition at line 163 of file KoXmlWriter.cpp. |
|
Overloaded version of the one taking a const char* argument.
Definition at line 130 of file KoXmlWriter.h. |
|
Overloaded version of addTextNode( const char* ), which is a bit slower because it needs to convert
Definition at line 126 of file KoXmlWriter.h. |
|
Overloaded version of addTextSpan which takes an additional tabCache map.
Definition at line 351 of file KoXmlWriter.cpp. |
|
Adds a text span as nodes of the current element. Unlike KoXmlWriter::addTextNode it handles tabulations, linebreaks, and multiple spaces by using the appropriate OASIS tags.
Definition at line 345 of file KoXmlWriter.cpp. |
|
Call this to terminate an XML document.
Definition at line 68 of file KoXmlWriter.cpp. |
|
Terminate the current element. After this you should start a new one (sibling), add a sibling text node, or close another one (end of siblings). Definition at line 140 of file KoXmlWriter.cpp. |
|
Definition at line 221 of file KoXmlWriter.h. |
|
Start the XML document. This writes out the <?xml?> tag with utf8 encoding, and the DOCTYPE.
Definition at line 50 of file KoXmlWriter.cpp. |
|
Start a new element, as a child of the current element.
Definition at line 103 of file KoXmlWriter.cpp. |
The documentation for this class was generated from the following files: