The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Palm::ListDB - Handler for ListDB databases

SYNOPSIS

  use Palm::ListDB;

  $pdb = new Palm::PDB;
  $pdb->Load("my_listdb_file.pdb");

DESCRIPTION

The ListDB PDB handler is a helper class for the Palm::PDB package. It parses ListDB databases. ListDB is a lightweight flat file database tool for PalmOS (tm) handhelds written by Andrew Low <roo@magma.ca>.

AppInfo block

The AppInfo block begins with standard category support. See Palm::StdAppInfo for details.

Other fields include:

    $pdb->{appinfo}{lastUniqueID}

This is a scalar, the ID of the last category assigned. Note that this is not the index in the array of categories stored in $pdb->{appinfo}{categories}!

    $pdb->{appinfo}{lastCategory}

This is a scalar, the index of the selected category. Category Unfiled should always be zero. Category All is 0xff. Note that this field does refer to the index in the array of categories stored in $pdb->{appinfo}{categories}.

    $pdb->{appinfo}{writeProtect}

This is a scalar indicating the write protection within the ListDB tool. If set, ListDB will not allow the PDA user to edit database records. (Of course she can always customize the database settings.)

    $pdb->{appinfo}{field1}
    $pdb->{appinfo}{field2}

These are both scalars, the names of the to fields the database records have.

Sort block

    $pdb->{sort}

This is not defined. ListDB databases do not have a sort block.

Records

    $record = $pdb->{records}[n]

    $record->{field1}
    $record->{field1}
    $record->{note}

These are scalars, the values for the to database fields of a record and an optional note. If a field does not exist, the corresponding field of the record have will either not exists or contain the empty string.

    $record->{category}

This is a scalar that contains the index of the category this record belongs to. This field refers to the index in the array of categories stored in $pdb->{appinfo}{categories}.

METHODS

new

    $pdb = new Palm::ListDB;

Create a new PDB, initialized with the various Palm::ListDB fields and an empty record list.

Use this method if you want to create a ListDB PDB from scratch.

new_Record

    $record = $pdb->new_ Record( category => $cat,
                                 field1   => 'field1',
                                 field1   => 'field1',
                                 note     => 'note' );

Creates and appends a new record to $pdb. All arguments are optional. The value to category can either be an index from the $pdb->{appinfo}{categories} array or an existing category's name. Empty category strings will silently be mapped the the Unfiled category.

new_Record does not add the new record to $pdb. For that, you want $pdb->append_Record.

AUTHOR

Rudiger Peusquens <rudy@peusquens.net>

Palm::PDB is written by Andrew Arensburger <arensb@ooblick.com>

ListDB is written by Andrew Low <roo@magma.ca>. You can get a copy at http://www.magma.ca/~roo.

SEE ALSO

Palm::PDB(3)

Palm::StdAppInfo(3)