kpilot/lib

PilotSerialDatabase Class Reference

#include <pilotSerialDatabase.h>

Inheritance diagram for PilotSerialDatabase:

PilotDatabase

List of all members.


Detailed Description

PilotSerialDatabase represents databases stored on the handheld and accessed through the SLP / DLP protocol.

Definition at line 48 of file pilotSerialDatabase.h.


Public Member Functions

virtual int readAppBlock (unsigned char *buffer, int maxLen)
virtual int writeAppBlock (unsigned char *buffer, int len)
virtual unsigned int recordCount () const
virtual QValueList< recordid_t > idList ()
virtual PilotRecordreadRecordById (recordid_t id)
virtual PilotRecordreadRecordByIndex (int index)
virtual PilotRecordreadNextRecInCategory (int category)
virtual PilotRecordreadNextModifiedRec (int *ind=NULL)
virtual recordid_t writeRecord (PilotRecord *newRecordb)
virtual int deleteRecord (recordid_t id, bool all=false)
virtual int resetSyncFlags ()
virtual int resetDBIndex ()
virtual int cleanup ()
virtual QString dbPathName () const
virtual int deleteDatabase ()
virtual bool createDatabase (long creator=0, long type=0, int cardno=0, int flags=0, int version=0)
QString getDBName ()
virtual DBType dbType () const

Protected Member Functions

 PilotSerialDatabase (KPilotDeviceLink *l, const QString &dbName)
 PilotSerialDatabase (KPilotDeviceLink *l, const DBInfo *info)
virtual void openDatabase ()
virtual void closeDatabase ()
int getDBHandle () const

Friends

class KPilotDeviceLink

Member Function Documentation

int PilotSerialDatabase::readAppBlock ( unsigned char *  buffer,
int  maxLen 
) [virtual]

Reads the application block info, returns size.

Implements PilotDatabase.

Definition at line 97 of file pilotSerialDatabase.cc.

int PilotSerialDatabase::writeAppBlock ( unsigned char *  buffer,
int  len 
) [virtual]

Writes the application block info.

Implements PilotDatabase.

Definition at line 116 of file pilotSerialDatabase.cc.

unsigned int PilotSerialDatabase::recordCount (  )  const [virtual]

returns the number of records in the database, 0 if not open

Implements PilotDatabase.

Definition at line 128 of file pilotSerialDatabase.cc.

QValueList< recordid_t > PilotSerialDatabase::idList (  )  [virtual]

Returns a QValueList of all record ids in the database.

Reimplemented from PilotDatabase.

Definition at line 144 of file pilotSerialDatabase.cc.

PilotRecord * PilotSerialDatabase::readRecordById ( recordid_t  id  )  [virtual]

Reads a record from database by id, returns record length.

Implements PilotDatabase.

Definition at line 171 of file pilotSerialDatabase.cc.

PilotRecord * PilotSerialDatabase::readRecordByIndex ( int  index  )  [virtual]

Reads a record from database, returns the record length.

Implements PilotDatabase.

Definition at line 196 of file pilotSerialDatabase.cc.

PilotRecord * PilotSerialDatabase::readNextRecInCategory ( int  category  )  [virtual]

Reads the next record from database in category 'category'.

Implements PilotDatabase.

Definition at line 222 of file pilotSerialDatabase.cc.

PilotRecord * PilotSerialDatabase::readNextModifiedRec ( int *  ind = NULL  )  [virtual]

Reads the next record from database that has the dirty flag set.

ind (if a valid pointer is given) will receive the index of the returned record.

Implements PilotDatabase.

Definition at line 241 of file pilotSerialDatabase.cc.

recordid_t PilotSerialDatabase::writeRecord ( PilotRecord newRecordb  )  [virtual]

Writes a new record to database (if 'id' == 0, one will be assigned to newRecord).

Implements PilotDatabase.

Definition at line 262 of file pilotSerialDatabase.cc.

int PilotSerialDatabase::deleteRecord ( recordid_t  id,
bool  all = false 
) [virtual]

Deletes a record with the given recordid_t from the database, or all records, if all is set to true.

The recordid_t will be ignored in this case. Return value is negative on error, 0 otherwise.

Implements PilotDatabase.

Definition at line 294 of file pilotSerialDatabase.cc.

int PilotSerialDatabase::resetSyncFlags (  )  [virtual]

Resets all records in the database to not dirty.

Implements PilotDatabase.

Definition at line 307 of file pilotSerialDatabase.cc.

int PilotSerialDatabase::resetDBIndex (  )  [virtual]

Resets next record index to beginning.

Implements PilotDatabase.

Definition at line 319 of file pilotSerialDatabase.cc.

int PilotSerialDatabase::cleanup (  )  [virtual]

Purges all Archived/Deleted records from Palm Pilot database.

Implements PilotDatabase.

Definition at line 331 of file pilotSerialDatabase.cc.

QString PilotSerialDatabase::dbPathName (  )  const [virtual]

Returns some sensible human-readable identifier for the database.

Serial databases get Pilot:, local databases return the full path.

Implements PilotDatabase.

Definition at line 89 of file pilotSerialDatabase.cc.

int PilotSerialDatabase::deleteDatabase (  )  [virtual]

Deletes the database (by name, as given in the constructor and stored in the fDBName field).

Implements PilotDatabase.

Definition at line 417 of file pilotSerialDatabase.cc.

bool PilotSerialDatabase::createDatabase ( long  creator = 0,
long  type = 0,
int  cardno = 0,
int  flags = 0,
int  version = 0 
) [virtual]

Creates the database with the given creator, type and flags on the given card (default is RAM).

If the database already exists, this function does nothing.

Implements PilotDatabase.

Definition at line 382 of file pilotSerialDatabase.cc.

int PilotSerialDatabase::getDBHandle (  )  const [inline, protected]

Returns the file handle used to communicate with the handheld.

This is an internal value to be passed to DLP functions.

Definition at line 124 of file pilotSerialDatabase.h.


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys