#include <GenericDB.h>
Inheritance diagram for GenericDB:
Public Methods | |
DmOpenRef | getRef () DB_SECTION2 |
get the pointer to the db (to use for calling PalmOS db functions directly). More... | |
Boolean | isNew () DB_SECTION2 |
| |
UInt32 | getSelectedUid () DB_SECTION2 |
| |
UInt32 | getRecordUid (UInt16 id) DB_SECTION2 |
Fetch the uid of a record. More... | |
UInt32 | getRecordUid () DB_SECTION2 |
Fetch the uid of the current record. More... | |
UInt16 | getRecordId (UInt32 uid) DB_SECTION2 |
Fetch the uid of a record. More... | |
UInt16 | getRecordCategory (UInt16 id) DB_SECTION2 |
Returns the category of a given record. More... | |
UInt16 | getRecordCategory (UInt32 uid) DB_SECTION2 |
Returns the category of a given record. More... | |
void | setRecordCategory (UInt16 id, UInt16 cat) DB_SECTION2 |
sets the category of a given record. More... | |
void | setRecordCategory (UInt32 uid, UInt16 cat) DB_SECTION2 |
sets the category of a given record. More... | |
UInt16 | findCategory (Char *cat_name) DB_SECTION2 |
finds a category in this db by its name. More... | |
void | getCategoryName (UInt16 cat_id, Char *cat_name) DB_SECTION2 |
fetches the name of a category in an allocated buffer. More... | |
void | selectRecord (UInt16 id) DB_SECTION2 |
sets the selected_record to id and sets record_selected flag to false. More... | |
void | selectRecord (UInt32 uid) DB_SECTION2 |
sets the selected_record from an unique and sets record_selected flag to false. More... | |
void | unselectRecord () DB_SECTION2 |
if a record is selected this function unselects it (by setting the record_selected flag). More... | |
Boolean | isRecordSelected () DB_SECTION2 |
use this function to find out whether a record from the database is currently selected. More... | |
UInt16 | getSelectedRecord () DB_SECTION2 |
use this function to retrieve the currently selected record. More... | |
GenericDB (DmOpenRef db_open_ref) DB_SECTION2 | |
create a database using a reference to an already opened database. More... | |
GenericDB (UInt32 type, UInt32 creator, Char *db_name) DB_SECTION2 | |
create a database without using categories. More... | |
GenericDB (UInt32 type, UInt32 creator, Char *db_name, UInt16 categ_string) DB_SECTION2 | |
create a database with category support. More... | |
virtual | ~GenericDB () DB_SECTION2 |
void | writeAndAdvance (MemPtr s, UInt32 &offset, Char *str) DB_SECTION2 |
This function writes a given string into a structure; it is meant as a helper function for Database::packRecord. More... | |
template<class Field> void | writeAndAdvance (MemPtr s, UInt32 &offset, Field *f) DB_SECTION2 |
This is a helper function for pack record. More... | |
virtual bool | deleteRecord (UInt16 id) DB_SECTION2 |
Deletes a record given by its id. More... | |
virtual bool | deleteRecord (UInt32 uid) DB_SECTION2 |
Deletes a record given by its uid. More... | |
Public Attributes | |
UInt16 | current_cat |
the currenct category. More... | |
Protected Methods | |
Err | openOrCreate (UInt32 type, UInt32 creator, UInt16 mode, UInt16 cardNo, Char *name) DB_SECTION2 |
opens or creates a database. More... | |
MemPtr | getLockedAppInfo () DB_SECTION2 |
returns a pointer to the app info record. More... | |
MemPtr | getLockedAppInfo (UInt16 categ_string) DB_SECTION2 |
returns a pointer to the app info record. More... | |
MemPtr | appInfoInit (LocalID dbID, UInt16 cardNo) DB_SECTION2 |
used by the func above to initialise the app info rec if it is empty. More... | |
MemPtr | appInfoInit (LocalID dbID, UInt16 cardNo, UInt16 categ_string) DB_SECTION2 |
used by the func above to initialise the app info rec if it is empty. More... | |
Protected Attributes | |
DmOpenRef | ref |
reference to the database. More... | |
UInt32 | num_cat |
total number of categories. More... | |
Boolean | created |
true if the db had to be created when it was opened. More... | |
Boolean | record_selected |
true if a record is selected, false otherwise. More... | |
UInt16 | selected_record |
the current record. More... |
Definition at line 41 of file GenericDB.h.
|
create a database using a reference to an already opened database.
|
|
create a database without using categories.
|
|
create a database with category support.
|
|
|
|
used by the func above to initialise the app info rec if it is empty.
|
|
used by the func above to initialise the app info rec if it is empty.
|
|
Deletes a record given by its uid.
|
|
Deletes a record given by its id.
Reimplemented in AccountsDB. |
|
finds a category in this db by its name.
|
|
fetches the name of a category in an allocated buffer.
|
|
returns a pointer to the app info record.
|
|
returns a pointer to the app info record.
|
|
Returns the category of a given record.
|
|
Returns the category of a given record.
|
|
Fetch the uid of a record.
Referenced by Database::getUnpackedRecord. |
|
Fetch the uid of the current record.
|
|
Fetch the uid of a record.
|
|
get the pointer to the db (to use for calling PalmOS db functions directly).
|
|
use this function to retrieve the currently selected record.
|
|
|
|
|
|
use this function to find out whether a record from the database is currently selected.
Referenced by Database::getUnpackedRecord. |
|
opens or creates a database.
|
|
sets the selected_record from an unique and sets record_selected flag to false.
|
|
sets the selected_record to id and sets record_selected flag to false.
|
|
sets the category of a given record.
|
|
sets the category of a given record.
Referenced by Database::newRecord. |
|
if a record is selected this function unselects it (by setting the record_selected flag).
|
|
This is a helper function for pack record. Given a field from a structure together with a destination pointer and an offset it will write the field in the specified location.
Definition at line 155 of file Database.h. |
|
This function writes a given string into a structure; it is meant as a helper function for Database::packRecord. Also see Database::writeAndAdvance.
|
|
true if the db had to be created when it was opened.
Definition at line 163 of file GenericDB.h. |
|
the currenct category.
Definition at line 45 of file GenericDB.h. Referenced by Database::newRecord. |
|
total number of categories.
Definition at line 161 of file GenericDB.h. |
|
true if a record is selected, false otherwise.
Definition at line 165 of file GenericDB.h. |
|
reference to the database.
Definition at line 159 of file GenericDB.h. Referenced by Database::getUnpackedRecord, and Database::newRecord. |
|
the current record.
Definition at line 167 of file GenericDB.h. Referenced by Database::getUnpackedRecord. |