[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [coldsync-hackers] p5-palm
On Wed, 1 Nov 2000, Ryan VanderBijl wrote:
> I think i miscommunicated. I never meant to suggest that any of the
> functionality was missing. I just think that the functionality is,
> perhaps, in the wrong place -- if that makes any sense? For example,
> the Palm::PDB seems like it should be a relatively simple thing --
> read's in a given file, etc. It doesn't seem to need to need any
> smarts of how to handle the various creator/type matching. When I
> first tried using it, i didn't expect that, and it bothered me.
Palm/PDB.pm does parse PDB files in a generic way. Perhaps
Palm::Raw shouldn't have been made separate from Palm::PDB. Oh, well.
But Palm::PDB has to decide, at some point, how to parse the
database records. One obvious approach is to extract the creator/type and
pass the buck to a set of specialized functions. This is what the current
Palm::PDB does.
The other obvious approach would be to read the PDB without
parsing the records, i.e., return a list of data strings. Then have the
user's script call some set of specialized functions to parse those
strings. This strikes me as inelegant and wasteful.
> So what kind of structure would the Palm::PRC have. If you say that
> the Palm::PRC files are fairly different that ::PDB, then I definitely
> think that a Palm::PRC should be made. What other functionality would
> be common for a PRC file?
The way I envision it, Palm::PRC would be very similar to
Palm::Raw : if you have
use Palm::PRC;
my $prc = new Palm::PDB;
$prc->Load("myfile.prc");
then @{$prc->{resources}} will just be a list of raw data strings.
However, Palm::PRC should allow you to define functions or classes
to parse specific types of resources (based on the resource type). Thus,
you might write
use Bitmaps; # Parses 'tBMP' resources
use Forms; # Parses 'tFRM' resources
my $prc = new Palm::PDB;
$prc->Load("myfile.prc");
Now, @{$prc->{resources}} will contained references to parsed bitmaps and
forms; all other resources will be raw data strings, as above.
--
Andrew Arensburger Actually, these _do_ represent the
arensb@ooblick.com opinions of ooblick.com!
Generic Tagline V 6.01
--
This message was sent through the coldsync-hackers mailing list. To remove
yourself from this mailing list, send a message to majordomo@thedotin.net
with the words "unsubscribe coldsync-hackers" in the message body. For more
information on Coldsync, send mail to coldsync-hackers-owner@thedotin.net.