TpfgPalmDbFile
The TpfgPalmDbFile class provides the facilities for bothing reading
and creating Palm PDB files on your local computer.
Properties
AppInfo: TpfgModifiedMemoryStream
The stream contains the AppInfo data for the database.
Attributes: Word
Contains the database attributes.
CreationDate: TDateTime
Contains the creation date of the database in GMT time[*].
Creator: LongWord
Contains the Creator Id of the database.
DbType: LongWord
Contains the database type.
LastBackupDate: TDateTime
Contains the last backup date of the database in GMT time[*].
ModificationDate: TDateTime
Contains the last modification date of the database in GMT time[*].
ModificationNumber: LongWord
Contains the modification number of the database.
Modified: Boolean
True if the data in the object has been changed. Not really used
currently, so it should be ignored.
RecordCount: Integer
Contains the number of records in the database. If ceating a database,
then the RecordCount should be set first to the number of records the
database will contain.
SortInfo: TpfgModifiedMemoryStream
The stream contains the SortInfo data for the database.
UniqueIDSeed: LongWord
Contains the seed value for generating Unique ID numbers for the
database.
Version: Word read
Contains the application-defined version of the database.
Methods
constructor Create(AFilename: string; AOpenMode: TDbOpenMode);
Creates the object, and sets the both the filename to use, and the access
mode. TDbOpenMode can be one of the following values:
- dbReadOnly - Reads in the specified file and populates the object
- dbWriteOnly - Writes out the contents of the object to the specified
file when the object is destroyed, or the Flush method is called.
- dbReadWrite - Both reads in the database file specified, and then
writes out a new copy when the object is destroyed.
procedure Flush;
Flushes the contents of the object to the given file, as long as the
access mode is not dbReadOnly.
procedure GetRecord(Index: Integer; out Attributes:
Byte; out ID: LongWord; out Category: Shortint; out Data: Pointer;
out DataSize: Integer);
Gets in the data for the specified record number (records are numbered
from 0 to RecordCount-1). Note that the pointer returned is a direct
pointer to the internal data storage of that record, not a copy.
procedure SetRecord(Index: Integer; Attributes: Byte;
ID: LongWord; Category: Shortint; Data: Pointer; DataSize: Integer);
Sets the data for the specified record number. The data block passed to
the method is copying for internal storage, so the caller is responsbile
for destroying their data block after calling the method.
The unit pfgPalmMisc.pas has two helper methods, DateTimeToGMTDateTime,
and GMTDateTimeToDateTime for converting between local time and GMT time.
|