QDomNamedNodeMap class contains a collection of nodes that can be accessed by name. 更多...
头: | #include <QDomNamedNodeMap> |
qmake: | QT += xml |
注意: 此类的所有函数 可重入 .
QDomNamedNodeMap () | |
QDomNamedNodeMap (const QDomNamedNodeMap & n ) | |
~QDomNamedNodeMap () | |
bool | contains (const QString & name ) const |
int | count () const |
bool | isEmpty () const |
QDomNode | item (int index ) const |
int | length () const |
QDomNode | namedItem (const QString & name ) const |
QDomNode | namedItemNS (const QString & nsURI , const QString & localName ) const |
QDomNode | removeNamedItem (const QString & name ) |
QDomNode | removeNamedItemNS (const QString & nsURI , const QString & localName ) |
QDomNode | setNamedItem (const QDomNode & newNode ) |
QDomNode | setNamedItemNS (const QDomNode & newNode ) |
int | size () const |
bool | operator!= (const QDomNamedNodeMap & n ) const |
QDomNamedNodeMap & | operator= (const QDomNamedNodeMap & n ) |
bool | operator== (const QDomNamedNodeMap & n ) const |
QDomNamedNodeMap class contains a collection of nodes that can be accessed by name.
注意, QDomNamedNodeMap does not inherit from QDomNodeList . QDomNamedNodeMaps do not provide any specific node ordering. Although nodes in a QDomNamedNodeMap may be accessed by an ordinal index, this is simply to allow a convenient enumeration of the contents of a QDomNamedNodeMap , and does not imply that the DOM specifies an ordering of the nodes.
QDomNamedNodeMap is used in three places:
Items in the map are identified by the name which QDomNode::name() returns. Nodes are retrieved using namedItem (), namedItemNS () 或 item (). New nodes are inserted with setNamedItem () 或 setNamedItemNS () 和被移除采用 removeNamedItem () 或 removeNamedItemNS ()。使用 contains () to see if an item with the given name is in the named node map. The number of items is returned by length ().
Terminology: in this class we use "item" and "node" interchangeably.
Constructs an empty named node map.
构造副本为 n .
销毁对象并释放其资源。
返回
true
if the map contains a node called
name
;否则返回
false
.
注意: This function does not take the presence of namespaces into account. Use namedItemNS () to test whether the map contains a node with a specific namespace URI and name.
提供此函数是为 Qt API 一致性。它相当于 length ().
返回
true
if the map is empty; otherwise returns
false
. This function is provided for Qt API consistency.
Retrieves the node at position index .
This can be used to iterate over the map. Note that the nodes in the map are ordered arbitrarily.
另请参阅 length ().
Returns the number of nodes in the map.
另请参阅 item ().
Returns the node called name .
If the named node map does not contain such a node, a null 节点 is returned. A node's name is the name returned by QDomNode::nodeName ().
另请参阅 setNamedItem () 和 namedItemNS ().
Returns the node associated with the local name localName 和名称空间 URI nsURI .
If the map does not contain such a node, a null 节点 被返回。
另请参阅 setNamedItemNS () 和 namedItem ().
Removes the node called name from the map.
The function returns the removed node or a null 节点 if the map did not contain a node called name .
另请参阅 setNamedItem (), namedItem (),和 removeNamedItemNS ().
Removes the node with the local name localName 和名称空间 URI nsURI from the map.
The function returns the removed node or a null 节点 if the map did not contain a node with the local name localName 和名称空间 URI nsURI .
另请参阅 setNamedItemNS (), namedItemNS (),和 removeNamedItem ().
插入节点 newNode into the named node map. The name used by the map is the node name of newNode as returned by QDomNode::nodeName ().
If the new node replaces an existing node, i.e. the map contains a node with the same name, the replaced node is returned.
另请参阅 namedItem (), removeNamedItem (),和 setNamedItemNS ().
插入节点 newNode in the map. If a node with the same namespace URI and the same local name already exists in the map, it is replaced by newNode . If the new node replaces an existing node, the replaced node is returned.
另请参阅 namedItemNS (), removeNamedItemNS (),和 setNamedItem ().
提供此函数是为 Qt API 一致性。它相当于 length ().
返回
true
if
n
and this named node map are not equal; otherwise returns
false
.
赋值 n to this named node map.
返回
true
if
n
and this named node map are equal; otherwise returns
false
.