- Inherits from:
- Object
- Declared in:
- DDbm.h
Object
|
+---DDbm
Class Description
The Dbm class implements a wrapper around the gdbm database manager.
The naming of the methods is identical to the hashtable class, but this
class is not a collection. It stores data, not objects. Open modes: r = read,
w = write, n = write in new database, c = write in new database if not exist.
- Last modified:
- 21-Nov-2005 (DDbm.h)
Instance Variables
- private void *_dbf
- the database
- private char _mode
- the database mode
- Constructors
- - (DDbm *) init
- Initialise without a database
- Returns:
- the object
- - (DDbm *) init :(const char *) name :(const char *) mode
- Initialise with a database
- Parameters:
- name - the database name
mode - the mode for the database (r,w,n,c)
- Returns:
- the object
- Deconstructor
- - free
- Free the object
- Copy related methods
- - deepen
- Deepen the object (not implemented)
- Member methods
- - (int) error
- Return the last error
- Returns:
- the last error
- - (BOOL) isOpen
- Check if the database is open
- Returns:
- is it ?
- - (BOOL) isReadOnly
- Check if the the database is read only ?
- Returns:
- is it ?
- Main methods
- - (DDbm *) close
- Close the database
- Returns:
- the object
- - (BOOL) delete :(void *) key :(unsigned) klen
- Delete a key,data from the database (only writer)
- Parameters:
- key - the key
klen - the length of the key
- Returns:
- success
- - (DData *) get :(void *) key :(unsigned) klen
- Return the data related to a key
- Parameters:
- key - the key
klen - the length of the key
- Returns:
- the data in a new DData object (or nil if not found)
- - (BOOL) has :(void *) key :(unsigned) klen
- Check if the database has a key
- Parameters:
- key - the key
klen - the length of the key
- Returns:
- is the key present ?
- - (BOOL) insert :(void *) key :(unsigned) klen :(void *) data :(unsigned) dlen
- Insert data in the database (only writer)
- Parameters:
- key - the key
klen - the length of the key
data - the data
dlen - the length of the data
- Returns:
- success
- - (BOOL) open :(const char *) name :(const char *) mode
- Open a database
- Parameters:
- name - the name of the database
mode - the mode for the database (r,w,c,n)
- Returns:
- is the dbm open ?
- - (BOOL) reorganize
- Reorganize the database (only writer)
- Returns:
- the object
- List related methods
- - (DList *) keys
- Return a list with all the keys in the database
- Returns:
- the (new) list with all the keys in DData objects (or nil for error)
- - (DList *) objects
- Return a list with all the data in the database
- Returns:
- the (new) list with all the data in DData objects (or nil for error)
generated 08-Jan-2006 by ObjcDoc 3.0.0