kpilot

PilotSerialDatabase Class Reference

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

#include <pilotSerialDatabase.h>

Inheritance diagram for PilotSerialDatabase:

List of all members.


Public Member Functions

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

Protected Member Functions

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

Detailed Description

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

Definition at line 48 of file pilotSerialDatabase.h.


Constructor & Destructor Documentation

PilotSerialDatabase::PilotSerialDatabase ( KPilotDeviceLink l,
const QString dbName 
) [protected]

Definition at line 47 of file pilotSerialDatabase.cc.

PilotSerialDatabase::PilotSerialDatabase ( KPilotDeviceLink l,
const DBInfo *  info 
) [protected]

Definition at line 58 of file pilotSerialDatabase.cc.

PilotSerialDatabase::~PilotSerialDatabase (  )  [virtual]

Definition at line 83 of file pilotSerialDatabase.cc.


Member Function Documentation

int PilotSerialDatabase::cleanup (  )  [virtual]

Purges all Archived/Deleted records from Palm Pilot database.

Implements PilotDatabase.

Definition at line 331 of file pilotSerialDatabase.cc.

void PilotSerialDatabase::closeDatabase (  )  [protected, virtual]

Implements PilotDatabase.

Definition at line 403 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.

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.

PilotDatabase::DBType PilotSerialDatabase::dbType (  )  const [virtual]

Implements PilotDatabase.

Definition at line 428 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.

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::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.

QString PilotSerialDatabase::getDBName (  )  [inline]

Definition at line 113 of file pilotSerialDatabase.h.

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.

void PilotSerialDatabase::openDatabase (  )  [protected, virtual]

Implements PilotDatabase.

Definition at line 342 of file pilotSerialDatabase.cc.

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.

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.

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::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.

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.

int PilotSerialDatabase::resetDBIndex (  )  [virtual]

Resets next record index to beginning.

Implements PilotDatabase.

Definition at line 319 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::writeAppBlock ( unsigned char *  buffer,
int  len 
) [virtual]

Writes the application block info.

Implements PilotDatabase.

Definition at line 116 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.


The documentation for this class was generated from the following files: