Hydra 0.20
hydra::Cursor Class Reference

#include <DB.h>

List of all members.

Public Member Functions

 Cursor (hydra::DB &db)
 Cursor (hydra::DB &db, const QString &prefix)
bool isValid (void) const
bool next (void)
const char * getKey (void)
void get (std::string &value)
void get (QString &value)
bool get (hydra::Record &value)

Detailed Description

A iterator though a DB.

Author:
Aleksander Demko

Constructor & Destructor Documentation

hydra::Cursor::Cursor ( hydra::DB db)

Constructor. This will iterate though all the entries in the DB.

The cursor will initially be inValid. You must use next() to move to the first valid row (if any).

Author:
Aleksander Demko
hydra::Cursor::Cursor ( hydra::DB db,
const QString &  prefix 
)

Constructor. This will iterate though all the entries in the DB whos key has the given prefix

The cursor will initially be inValid. You must use next() to move to the first valid row (if any).

Author:
Aleksander Demko

Member Function Documentation

void hydra::Cursor::get ( std::string &  value)

Loads the current value. The current row must be valid.

Author:
Aleksander Demko
void hydra::Cursor::get ( QString &  value)

Loads the current value. The current row must be valid.

Author:
Aleksander Demko
bool hydra::Cursor::get ( hydra::Record value)

Loads the current value. The current row must be valid.

Returns false if the record failed to deserialize (ie. it threw an exception)

Author:
Aleksander Demko
const char* hydra::Cursor::getKey ( void  )

Returns the key value at the current row. The current row must be valid.

Author:
Aleksander Demko
bool hydra::Cursor::isValid ( void  ) const [inline]

Is the cursot at a valid row?

Author:
Aleksander Demko
bool hydra::Cursor::next ( void  )

Move the cursor to the next row, returns true if this was successul and the cursor is at the next row and is valid.

Author:
Aleksander Demko

The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables