Qt Toolkit - QGDict Class

# QGDict Class Reference

The QGDict class is an internal class for implementing QDict and QIntDict. More...

`#include <qgdict.h>`

Inherits QCollection.

Inherited by QDict, QIntDict and QPtrDict.

List of all member functions.

## Public Members

- virtual uint count () const
- uint size () const
- GCI look ( const char * key, GCI, int )
- QDataStream& read ( QDataStream & )
- QDataStream& write ( QDataStream & ) const

## Protected Members

- QGDict ( uint len, bool cs, bool ck, bool th )
- QGDict ( const QGDict & )
- ~QGDict ()
- QGDict& operator= ( const QGDict & )
- bool remove ( const char * key )
- bool removeItem ( const char * key, GCI item )
- GCI take ( const char * key )
- virtual void clear ()
- void resize ( uint )
- virtual int hashKey ( const char * )
- void statistics () const
- virtual QDataStream& read ( QDataStream &, GCI & )
- virtual QDataStream& write ( QDataStream &, GCI ) const

## Detailed Description

The QGDict class is an internal class for implementing QDict and QIntDict.

QGDict is a strictly internal class that acts as a base class for the collection classes QDict and QIntDict.

QGDict has some virtual functions that can be reimplemented to customize the subclasses.

- hashKey() implements the hashing function for the dictionary.
- read() reads a collection/dictionary item from a QDataStream.
- write() writes a collection/dictionary item to a QDataStream.

Normally, you do not have to reimplement any of these functions.

## Member Function Documentation

### QGDict::QGDict ( const QGDict & dict ) `[protected]`

For internal use only.

### QGDict::QGDict ( uint len, bool cs, bool ck, bool th ) `[protected]`

For internal use only.

### QGDict::~QGDict () `[protected]`

For internal use only.

### void QGDict::clear () `[virtual protected]`

For internal use only.

Reimplemented from QCollection.

### uint QGDict::count () const `[virtual]`

For internal use only.

Reimplemented from QCollection.

### int QGDict::hashKey ( const char * key ) `[virtual protected]`

Returns the hash key for key, when key is a string.

### GCI QGDict::look ( const char * key, GCI d, int op )

For internal use only.

### QGDict & QGDict::operator= ( const QGDict & dict ) `[protected]`

For internal use only.

### QDataStream & QGDict::read ( QDataStream & s )

For internal use only.

### QDataStream& QGDict::read ( QDataStream & s, GCI & item ) `[virtual protected]`

Reads a collection/dictionary item from the stream s and returns a reference to the stream.

The default implementation sets item to 0.

See also: write().

### bool QGDict::remove ( const char * key ) `[protected]`

For internal use only.

### bool QGDict::removeItem ( const char * key, GCI item ) `[protected]`

For internal use only.

### void QGDict::resize ( uint newsize ) `[protected]`

For internal use only.

### uint QGDict::size () const

For internal use only.

### void QGDict::statistics () const `[protected]`

For internal use only.

### GCI QGDict::take ( const char * key ) `[protected]`

For internal use only.

### QDataStream& QGDict::write ( QDataStream & s ) const

For internal use only.

### QDataStream& QGDict::write ( QDataStream & s, GCI ) const `[virtual protected]`

Writes a collection/dictionary item to the stream s and returns a reference to the stream.

The default implementation does nothing.

See also: read().

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

This file is part of the Qt toolkit, copyright © 1995-99 Troll Tech, all rights reserved.

It was generated from the following files:

- qgdict.h: 1998/11/26
- qgdict.cpp: 1998/11/26