Next: The PilotRecord classes for
Up: How the conduits work
Previous: The KPilotDeviceLink class for
  Contents
KPilot's class library knows two types of databases: local databases from
a .pdb file on your PC's harddisk, and serial databases on a PalmOS device
connected through a serial or USB cable. To work with a database, you just
create an instance of either a PilotLocalDatabase or a
PilotSerialDatabase, both of which are derived from
PilotDatabase. This base class has the following important members:
- virtual int recordCount() ... returns the number of records
in the database
- virtual QValueList<recordid_t> idList() ... Returns a list
of all record ids in the database.
- virtual PilotRecord* readRecordById(recordid_t id) ... Reads
a record from database by id.
- virtual PilotRecord* readRecordByIndex(int index) ... Reads a
record from database.
- virtual PilotRecord* readNextRecInCategory(int category) ...
Reads the next record from database in category 'category'
- virtual PilotRecord* readNextModifiedRec() ... Reads the next
record from database that has the dirty flag set.
- virtual recordid_t writeRecord(PilotRecord* newRecord) ... Writes
a new record to database (if 'id' == 0 for a serial database, one will be
assigned to newRecord)
- virtual int resetSyncFlags() ... Resets all records in the
database to not dirty.
- virtual int resetDBIndex() ... Resets next record index to beginning
- virtual int cleanup() ... Purges all Archived/Deleted records
from Palm Pilot database
- bool isDBOpen() ... Returns false if the database could not be
opened, e.g. no connection to the handheld or file could not be created.
- virtual QString dbPathName() ... Returns some sensible human-readable
identifier for the database. Serial databases get Pilot:, local databases
return the full path.
- virtual int readAppBlock(unsigned char* buffer, int maxLen) ...
Reads the application block info, returns size.
- virtual int writeAppBlock(unsigned char* buffer, int len) ...
Writes the application block info.
- static void listAppInfo(const struct CategoryAppInfo *) ... Primarily
meant for debugging, dumps an appinfo block to stdoutv
The constructors of PilotLocalDatabase and PilotSerialDatabase are:
- PilotSerialDatabase(int linksocket, const char* dbName) ... linksocket
- PilotLocalDatabase( const QString& path, const QString& name)
- PilotLocalDatabase(const QString &name) ... open database by name only
(no explicit path). The path $KDEHOME/share/apps/kpilot/DBBackup/PalmUserName/
is set by KPilot automatically.
Next: The PilotRecord classes for
Up: How the conduits work
Previous: The KPilotDeviceLink class for
  Contents
Reinhold Kainhofer
2003-01-13