KDbmIterator Class Reference

[kdbm Index] [kdbm Hierarchy]


KDbmIterator provides an iterator for KDbm databases More...

#include <kdbm.h>

Inherits: KGDbmIterator

Public Members


Detailed Description

KDbmIterator provides an iterator for KDbm databases.

The access is not `key' sequential, but it is guaranteed to visit every `key' in the database once.

Example:

   KDbmIterator it(db);

  for (char* key = it.getFirstKey(); !it.eof(); it.getNextKey()) {   cout << key << " = " << db[key] << endl;   }


KDbmIterator(KGDbm& _db)

Construct an iterator for `_db'.

~KDbmIterator()

Destroy the iterator.

char* getFirstKey()

Set the iterator to point to the first item in the database and return a pointer to its key. The pointer is null if the database is empty. Note: the returned pointer is owned by the iterator and should not be released.

See Also:
getNextKey

char* getNextKey()

Set the iterator to point to next item in the database and return a pointer to its key. The pointer is null if the previous current item was the last one. Note: the returned pointer is owned by the iterator and should not be released.

See Also:
getFirstKey

Documentation generated by iglio@localhost on Thu Oct 15 19:05:38 GMT 1998
Kdoc