
We bake cookies in your browser for a better experience. Using this site means that you consent.Read More
TheQDomNamedNodeMap class contains a collection of nodes that can be accessed by name.More...
| Header: | #include <QDomNamedNodeMap> |
Note: All functions in this class arereentrant.
| QDomNamedNodeMap() | |
| QDomNamedNodeMap(const QDomNamedNodeMap & n) | |
| ~QDomNamedNodeMap() | |
| bool | contains(const QString & name) const |
| int | count() const |
| bool | isEmpty() const |
| QDomNode | item(int index) const |
| uint | 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 |
TheQDomNamedNodeMap class contains a collection of nodes that can be accessed by name.
Note thatQDomNamedNodeMap does not inherit fromQDomNodeList. QDomNamedNodeMaps do not provide any specific node ordering. Although nodes in aQDomNamedNodeMap may be accessed by an ordinal index, this is simply to allow a convenient enumeration of the contents of aQDomNamedNodeMap, and does not imply that the DOM specifies an ordering of the nodes.
TheQDomNamedNodeMap is used in three places:
Items in the map are identified by the name which QDomNode::name() returns. Nodes are retrieved usingnamedItem(),namedItemNS() oritem(). New nodes are inserted withsetNamedItem() orsetNamedItemNS() and removed withremoveNamedItem() orremoveNamedItemNS(). Usecontains() to see if an item with the given name is in the named node map. The number of items is returned bylength().
Terminology: in this class we use "item" and "node" interchangeably.
Constructs an empty named node map.
Constructs a copy ofn.
Destroys the object and frees its resources.
Returns true if the map contains a node calledname; otherwise returns false.
Note: This function does not take the presence of namespaces into account. UsenamedItemNS() to test whether the map contains a node with a specific namespace URI and name.
This function is provided for Qt API consistency. It is equivalent tolength().
Returns true if the map is empty; otherwise returns false. This function is provided for Qt API consistency.
Retrieves the node at positionindex.
This can be used to iterate over the map. Note that the nodes in the map are ordered arbitrarily.
See alsolength().
Returns the number of nodes in the map.
See alsoitem().
Returns the node calledname.
If the named node map does not contain such a node, anull node is returned. A node's name is the name returned byQDomNode::nodeName().
See alsosetNamedItem() andnamedItemNS().
Returns the node associated with the local namelocalName and the namespace URInsURI.
If the map does not contain such a node, anull node is returned.
See alsosetNamedItemNS() andnamedItem().
Removes the node calledname from the map.
The function returns the removed node or anull node if the map did not contain a node calledname.
See alsosetNamedItem(),namedItem(), andremoveNamedItemNS().
Removes the node with the local namelocalName and the namespace URInsURI from the map.
The function returns the removed node or anull node if the map did not contain a node with the local namelocalName and the namespace URInsURI.
See alsosetNamedItemNS(),namedItemNS(), andremoveNamedItem().
Inserts the nodenewNode into the named node map. The name used by the map is the node name ofnewNode as returned byQDomNode::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.
See alsonamedItem(),removeNamedItem(), andsetNamedItemNS().
Inserts the nodenewNode in the map. If a node with the same namespace URI and the same local name already exists in the map, it is replaced bynewNode. If the new node replaces an existing node, the replaced node is returned.
See alsonamedItemNS(),removeNamedItemNS(), andsetNamedItem().
This function is provided for Qt API consistency. It is equivalent tolength().
Returns true ifn and this named node map are not equal; otherwise returns false.
Assignsn to this named node map.
Returns true ifn and this named node map are equal; otherwise returns false.
© 2016 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of theGNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.