Classes - Annotated - Tree - Functions - Home - Structure

QDomNamedNodeMap Class Reference
[XML module]

The QDomNamedNodeMap class contains a collection of nodes that can be accessed by name. More...

#include <qdom.h>

List of all member functions.

Public Members


Detailed Description

The QDomNamedNodeMap class contains a collection of nodes that can be accessed by name.

Note that QDomNamedNodeMap does not inherit from QDomNodeList; QDomNamedNodeMaps does not provide any specific order of the nodes. Nodes contained in a QDomNamedNodeMap may also be accessed by an ordinal index, but this is simply to allow a convenient enumeration of the contents of a QDomNamedNodeMap and does not imply that the DOM specifies an order on the nodes.

The QDomNamedNodeMap is used in three places:

Items in the map are identified by the name which QDomNode::name() returns. They can be queried using the namedItem() function and set using setNamedItem().

See also namedItem() and setNamedItem().


Member Function Documentation

QDomNamedNodeMap::QDomNamedNodeMap ()

Constructs an empty map.

QDomNamedNodeMap::QDomNamedNodeMap ( const QDomNamedNodeMap & n )

Constructs a copy of n.

QDomNamedNodeMap::~QDomNamedNodeMap ()

Destructor.

bool QDomNamedNodeMap::contains ( const QString & name ) const

Returns TRUE if the map contains a node with the name name, otherwise FALSE.

QDomNode QDomNamedNodeMap::item ( int index ) const

Retrieves the node at position index.

This can be used to iterate over the map.

See also length().

uint QDomNamedNodeMap::length () const

Returns the number of nodes in the map.

See also item().

QDomNode QDomNamedNodeMap::namedItem ( const QString & name ) const

Returns the node associated with they key name.

If the map does not contain such a node, then a null node is returned.

See also setNamedItem() and namedItemNS().

QDomNode QDomNamedNodeMap::namedItemNS ( const QString & nsURI, const QString & localName ) const

Returns the node associated with the local name localName and the namespace URI nsURI.

If the map does not contain such a node, then a null node is returned.

See also setNamedItemNS() and namedItem().

bool QDomNamedNodeMap::operator!= ( const QDomNamedNodeMap & n ) const

Returns TRUE if n and this map are not equal, FALSE otherwise.

QDomNamedNodeMap & QDomNamedNodeMap::operator= ( const QDomNamedNodeMap & n )

Assigns n to this named node map.

bool QDomNamedNodeMap::operator== ( const QDomNamedNodeMap & n ) const

Returns TRUE if n and this map are equal, FALSE otherwise.

QDomNode QDomNamedNodeMap::removeNamedItem ( const QString & name )

Removes the node with the name name from the map.

The function returns the removed node or a null node if the map did not contain a node with the name name.

See also setNamedItem(), namedItem() and removeNamedItemNS().

QDomNode QDomNamedNodeMap::removeNamedItemNS ( const QString & nsURI, const QString & localName )

Removes the node with the local name localName and the namespace URI nsURI from the map.

The function returns the removed node or a null node if the map did not contain a node with the local name localName and the namespace URI nsURI.

See also setNamedItemNS(), namedItemNS() and removeNamedItem().

QDomNode QDomNamedNodeMap::setNamedItem ( const QDomNode & newNode )

Inserts the node newNode in the map. The key for the map is the node name of newNode as returned by QDomNode::nodeName().

If the new node replaces an existing node, the replaced node is returned.

See also namedItem(), removeNamedItem() and setNamedItemNS().

QDomNode QDomNamedNodeMap::setNamedItemNS ( const QDomNode & newNode )

Inserts the node 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.

See also namedItemNS(), removeNamedItemNS() and setNamedItem().


Search the documentation, FAQ, qt-interest archive and more (uses www.trolltech.com):


This file is part of the Qt toolkit, copyright © 1995-2000 Trolltech, all rights reserved.


Copyright © 2000 TrolltechTrademarks
Qt version main-beta1