[haiku-development] Re: People/Person format extension

  • From: Barrett <barrett666@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Wed, 2 Nov 2011 16:24:20 +0100

2011/11/2 Adrien Destugues <pulkomandy@xxxxxxxxxxxxxxxxx>

> Barrett <barrett666@xxxxxxxxx> a écrit :
> > Since i think that the format must be keep simple, there's no need to
> > store
> > all data as attributes.
> > My idea is something similar to what is already done for contacts
> > image, by
> > extending the format to store some basic set of fields (i.e. name,
> > address,
> > email, notes etc.) into attributes, and extended fields (i.e. various
> > type
> > of images, like personal or organization, file revision field, format
> > version, timezone etc.) into the file with a defined structure, like
> > flattened BContactFields. However, the possibility to add user defined
> > attributes will be preserved.
>
> Sounds like a job for BResource ?
> It allows arbitrary data (including flatenned BMessages) to be stored
> in the file.
>

Actually, it's already supported by BContact API i made during gsoc.
A BContact is a BArchivable object, a BContactField is a BFlattenable.
BContact is really a list of BContactFields, so when one need can Archive()
the contact and then write the message into a file.

The work of People2 will be similar, when the translator receive a
BContactField* that must be saved into the file, they will simply flatten
it into a BMessage.

You can see here, if you have curiosity.

https://github.com/Barrett17/Haiku-services-branch/tree/master/headers/private/contact

Other related posts: