Next: A very simple conduit:
Up: How the conduits work
Previous: The PilotDatabase classes for
  Contents
Each database consists of several database records, so we also need a
class PilotRecord to work with records. A PilotRecord is just
a long string of binary data, without any meaning so far. You will
have to implement your own classes that take the data from the record
and turn it into usable values (use the database format specification
for the database you are working with). The class PilotAppCategory
can be used as base class for this, and the pack() method packs
the human-readable variable values into one whole binary string that
is then sent to the handheld as the data of the record. Usually you
don't create an instance of PilotRecord yourself, but either
get a PilotRecord* from one of the methods of the PilotDatabase
class, or you pack your own subclass of PilotAppCategory (e.g.
PilotTodoEntry, PilotAddress, PilotDateEntry) with a call to pack().
The PilotRecord class has the following important methods:
- char* getData() ... gets the binary data directly from the
database. You need to "unpack" the data yourself.
- void setData(const char* data, int len) ... sets the packed
binary data of the record.
- int getLen() ... Returns the length of the record data.
- int getAttrib( ... Returns the attributes of the record
(e.g. modified, archived, deleted, secret etc.). For possible values
see the pilot-link header files.
- void setAttrib(int attrib) ... Sets the record attributes.
- int getCat() ... Returns the category of the record (0-15).
The names of the categories are stored in the database's header.
- void setCat(int cat) ... Sets the category of the record.
cat needs to be in the range 0-15.
- unsigned long getID() ... Returns the unique record ID.
- void setID(unsigned long id) ... Sets the record ID. If you
already have a record with that ID, it will be overwritten!
- bool isDeleted() ... Self-explaining
- bool isSecret() ... Self-explaining
- bool isArchived() ... Self-explaining
- void makeDeleted() ... Self-explaining
- void makeSecret() ... Self-explaining
Next: A very simple conduit:
Up: How the conduits work
Previous: The PilotDatabase classes for
  Contents
Reinhold Kainhofer
2003-01-13