QXmlNamePool Class

The QXmlNamePool class is a table of shared strings referenced by instances of QXmlName . 更多...

头: #include <QXmlNamePool>
qmake: QT += xmlpatterns
Since: Qt 4.4

该类在 Qt 4.4 引入。

注意: 此类的所有函数 可重入 .

公共函数

QXmlNamePool (const QXmlNamePool & other )
QXmlNamePool ()
QXmlNamePool & operator= (const QXmlNamePool & other )
~QXmlNamePool ()

详细描述

QXmlNamePool is used to optimize operations on instances of QXmlName . An instance of QXmlName represents an XML name in a way that allows the XML name to be compared and passed around efficiently. The efficiency is achieved by storing the strings comprising the XML names in an instance of QXmlNamePool, where they are mapped to binary identifiers, which are then packed into a key which is stored in the QXmlName .

This means that each instance of QXmlName is tied to the name pool it was created with, and that name pool should be kept in scope and used to create all instances of QXmlName that might be compared. Note also that the name pool is required if you must reconstitute the QXmlName as text, or if you must access any of its component strings, so although instances of QXmlName can be compared without reference to a name pool, the name pool must be kept in scope if the name's strings must be accessed later.

另请参阅 QXmlName and QXmlQuery::namePool ().

成员函数文档编制

QXmlNamePool:: QXmlNamePool (const QXmlNamePool & other )

构造副本为 other name pool.

QXmlNamePool:: QXmlNamePool ()

Constructs an empty name pool.

QXmlNamePool &QXmlNamePool:: operator= (const QXmlNamePool & other )

赋值 other name pool to this one.

QXmlNamePool:: ~QXmlNamePool ()

Destroys the name pool. Instances of QXmlName constructed with this name pool can still be compared after this destructor is called, but their text strings cannot be accessed.