Re: My Usual Confusion

"Ingo Weinhold" <bonefish-CFLBMwTPW48UNGrzBIF7/[email protected]>
Newsgroups gmane.os.openbeos.storage
Message-ID <13543141768-BeMail@graete>
On Sat, 14 Jun 2003 14:40:34 +0200 CEST "Axel Dörfler" <axeld@pinc-
software.de> wrote:
> Tyler Dauwalder <tyler-cyCl/[email protected]> wrote:
> > > PS: How about a BPartition::GetDiskSystem(BDiskSystem*)? Then
> > > BPartition::ContentType() wouldn't even need to have any strong
> > > relationship with the disk system's (pretty) name.
> > Having seen the way types would need to laid down using the 
> > Type()/ContentType() system, I'd actually much rather just go back 
> > to 
> > using Type() only (semantically like our current ContentType()) 
> > than 
> > do 
> > this. Though a GetDiskSystem() call could still be useful.
> > 
> > What do you think? :-)
> 
> 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:
> 
> switch (partition->Type()) {
> 	case BPartition::B_FILE_SYSTEM_TYPE:
> 		...
> 		break;
> 	case BPartition::B_PARTITION_SYSTEM_TYPE:
> 		...
> 		break;
> }
> 
> ?

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.

> BTW is there any way to get to a partition without a disk system 
> object 
> at all? If so, GetDiskSystem() would not only be useful, I think.

Mmh, maybe I misunderstand you, but a BDiskSystem is not necessary to 
get a BPartition. The only we to get a BPartition is via 
BDiskDeviceRoster. I think, GetDiskSystem() is not only useful, but 
even necessary. Since how, otherwise, would one get the responsible 
disk system otherwise? The partition's type can't be translated to a 
disk system name, I believe.

CU, Ingo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.