Qt 4.8
|
#include <qxmlserializer_p.h>
Public Functions | |
QXmlSerializerPrivate (const QXmlQuery &q, QIODevice *outputDevice) | |
void | write (const char c) |
Public Functions inherited from QAbstractXmlReceiverPrivate | |
virtual | ~QAbstractXmlReceiverPrivate () |
Public Variables | |
const QTextCodec * | codec |
QTextCodec::ConverterState | converterState |
QIODevice * | device |
QStack< QPair< QXmlName, bool > > | hasClosedElement |
bool | isPreviousAtomic |
QHash< QXmlName::Code, QByteArray > | nameCache |
QStack< QVector< QXmlName > > | namespaces |
const QPatternist::NamePool::Ptr | np |
const QXmlQuery | query |
QXmlSerializer::State | state |
Private Types | |
enum | Constants { EstimatedTreeDepth = 10, EstimatedNameCount = 60 } |
Definition at line 69 of file qxmlserializer_p.h.
|
private |
Enumerator | |
---|---|
EstimatedTreeDepth | |
EstimatedNameCount | We use a high count to avoid rehashing. We can afford it since we only allocate one hash for this. |
Definition at line 111 of file qxmlserializer_p.h.
Definition at line 53 of file qxmlserializer.cpp.
|
inline |
Definition at line 123 of file qxmlserializer_p.h.
const QTextCodec* QXmlSerializerPrivate::codec |
Definition at line 90 of file qxmlserializer_p.h.
QTextCodec::ConverterState QXmlSerializerPrivate::converterState |
Definition at line 91 of file qxmlserializer_p.h.
Referenced by QXmlSerializerPrivate().
QIODevice* QXmlSerializerPrivate::device |
Definition at line 89 of file qxmlserializer_p.h.
Referenced by write().
Definition at line 75 of file qxmlserializer_p.h.
Referenced by QXmlSerializerPrivate().
bool QXmlSerializerPrivate::isPreviousAtomic |
Definition at line 76 of file qxmlserializer_p.h.
QHash<QXmlName::Code, QByteArray> QXmlSerializerPrivate::nameCache |
Name cache. Since encoding QStrings are rather expensive operations to do, and we on top of that would have to do it each time a name appears, we here map names to their encoded equivalents.
This means that when writing out large documents, the serialization of names after a while is reduced to a hash lookup and passing an existing byte array.
We use QXmlName::Code as key as opposed to merely QName, because the prefix is of significance.
Definition at line 105 of file qxmlserializer_p.h.
Referenced by QXmlSerializerPrivate().
This member worries me a bit. We never use it but nevertheless it is pushed and pops linear to startElement() and endElement(). An optimization would be to at least merge it with hasClosedElement, but even better to push it on demand. That is, namespaceBinding() pushes it up to the tree depth first when it is needed.
Definition at line 87 of file qxmlserializer_p.h.
Referenced by QXmlSerializerPrivate().
const QPatternist::NamePool::Ptr QXmlSerializerPrivate::np |
Definition at line 78 of file qxmlserializer_p.h.
const QXmlQuery QXmlSerializerPrivate::query |
Definition at line 106 of file qxmlserializer_p.h.
QXmlSerializer::State QXmlSerializerPrivate::state |
Definition at line 77 of file qxmlserializer_p.h.