HomeHome

ClassesAnnotated - TreeFunctionsHomeStructure

QDomNamedNodeMap Class Reference
[ XML module ]


The QDomNamedNodeMap class is a map for QDomNode objects. More...

#include <qdom.h>

List of all member functions.

Public Members


Detailed Description

The QDomNamedNodeMap class is a map for QDomNode objects.

Objects implementing the NamedNodeMap interface are used to represent collections of nodes that can be accessed by name. Note that NamedNodeMap does not inherit from NodeList ; NamedNodeMaps are not maintained in any particular order. Objects contained in an object implementing NamedNodeMap may also be accessed by an ordinal index, but this is simply to allow convenient enumeration of the contents of a NamedNodeMap , and does not imply that the DOM specifies an order to these Nodes.

The QDomNamedNodeMap is used in three places:

Items in the Map are identified by the value QDomNode::name() returns. They can be queried using the namedItem() method and set using setNamedItem().

See also: namedItem() and setNamedItem().


Member Function Documentation

QDomNamedNodeMap::QDomNamedNodeMap ()

Constructs an empty map.

QDomNamedNodeMap::QDomNamedNodeMap ( const QDomNamedNodeMap & n )

Copy constructor.

QDomNamedNodeMap::~QDomNamedNodeMap ()

Destructor.

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

Returns TRUE if the map contains a node for which QDomNode::nodeName() returns name.

QDomNode QDomNamedNodeMap::item ( int index ) const

Retrieve 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 on 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().

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

Returns TRUE if both QDomNamedNodeMap objects are different.

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

Assignement.

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

Compares wether both QDomNamedNodeMap objects are equal.

QDomNode QDomNamedNodeMap::setNamedItem ( const QDomNode & newNode )

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

Returns the newly inserted node.

See also: removeNamedItem().

QDomNode QDomNamedNodeMap::removeNamedItem ( const QString & name )

Remove the node named Returns the removed node or a null node if the map did not contain a node with the name name.

See also: 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 2.2.0-beta2