[openbeosstorage] Re: My Usual Confusion

On Sat, 14 Jun 2003 15:35:53 +0200 CEST "Axel Dörfler" <axeld@pinc-
software.de> wrote:
> "Ingo Weinhold" <bonefish@xxxxxxxxxxxxxxx> wrote:
> > > What about leaving ContentType() to what it is now and change 
> > > Type() 
> > > so that you can use the partition type in a switch case statement 
> > > like:
> > > ...
> > What your switch statement does can easily be done using 
> > BPartition::IsPartitionable(), which (unless I'm mistaken -- I 
> > remember, we discussed that) returns whether the partition's disk 
> > system is a partitioning system.
> 
> Sure, but the basic idea was to be able to use switch() for this 
> thing 
> - but since we only have two different types (AFAICT), it really 
> doesn't matter to have something like this.
> Anyway, I would expect BPartition::Type() to return something like 
> this, but I would also be fine if it returned the information 
> ContentType() returns right now.

Regarding being able to switch() the types listed in <DiskDeviceType.h>
, I remember vaguely, that we more or less agreed, that this shouldn't 
be necessary in practice. Moreover a uint32 representation works well 
for known types, but has a problem with unknown types. A string can 
easily report something like "unrecognized type (0x93)", though.

CU, Ingo


Other related posts: