[haiku-development] Re: BFlattenable BStringList? Was: Re: [haiku] Fetching mail via pop3 from GMail

  • From: "Ingo Weinhold" <ingo_weinhold@xxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Wed, 14 Dec 2011 00:36:00 +0100

Clemens wrote:
> just tried to replace the private BStringList used in POP3 by the official 
> BStringList. The pop add-on flattens its BStringList into an attribute to 
> store the mail manifest.
> 
> The problem is the public BStringList is not BFlattenable. Think it makes 
> sense to flatten a BStringList but can this be done compatibly wise?

I introduced the class as the package kit uses quite a few string lists in 
public API and BObjectList<BString> is rather inconvenient to use. It seems I 
forgot to label the class experimental. It is, though. It needs to go public 
for general consumption at the latest when the package kit does.

So, long story short, the API can still be freely modified. I suppose making 
BStringList BFlattenable is fine (the B_STRING_LIST_TYPE should be added to 
<TypeConstants.h> accordingly).

Looking at the mail daemon BStringList, I'd be very much against copying some 
of the API verbatim. NotHere() and NotThere() are horrible method names and, 
like the operators that perform a set operation, might seem convenient in 
certain cases, but are definitely slow by design. I'd either omit them 
completely or only add them as methods with suitable names and an explicit 
warning.

CU, Ingo

Other related posts: