2003-05-29 01:51:24 +04:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// This software is part of the OpenBeOS distribution and is covered
|
|
|
|
// by the OpenBeOS license.
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
|
|
|
|
#ifndef _PARTITIONING_INFO_H
|
|
|
|
#define _PARTITIONING_INFO_H
|
|
|
|
|
2003-07-20 21:21:06 +04:00
|
|
|
#include <DiskDeviceDefs.h>
|
|
|
|
|
|
|
|
struct partitionable_space_data;
|
2003-05-29 01:51:24 +04:00
|
|
|
|
|
|
|
class BPartitioningInfo {
|
|
|
|
public:
|
2007-10-14 01:17:26 +04:00
|
|
|
BPartitioningInfo();
|
|
|
|
virtual ~BPartitioningInfo();
|
2003-07-20 21:21:06 +04:00
|
|
|
|
2007-10-14 01:17:26 +04:00
|
|
|
status_t SetTo(off_t offset, off_t size);
|
|
|
|
void Unset();
|
2003-07-20 21:21:06 +04:00
|
|
|
|
2007-10-14 01:17:26 +04:00
|
|
|
status_t ExcludeOccupiedSpace(off_t offset,
|
|
|
|
off_t size);
|
2003-07-20 21:21:06 +04:00
|
|
|
|
2007-10-14 01:17:26 +04:00
|
|
|
// TODO: We don't need the partition ID.
|
|
|
|
partition_id PartitionID() const;
|
|
|
|
|
|
|
|
status_t GetPartitionableSpaceAt(int32 index,
|
|
|
|
off_t* offset, off_t*size) const;
|
|
|
|
int32 CountPartitionableSpaces() const;
|
2003-06-10 03:02:16 +04:00
|
|
|
|
2003-05-29 01:51:24 +04:00
|
|
|
private:
|
2007-10-14 01:17:26 +04:00
|
|
|
status_t _InsertSpaces(int32 index, int32 count);
|
|
|
|
void _RemoveSpaces(int32 index, int32 count);
|
2003-07-20 21:21:06 +04:00
|
|
|
|
|
|
|
friend class BPartition;
|
|
|
|
|
2007-10-14 01:17:26 +04:00
|
|
|
partition_id fPartitionID;
|
|
|
|
partitionable_space_data* fSpaces;
|
|
|
|
int32 fCount;
|
|
|
|
int32 fCapacity;
|
2003-05-29 01:51:24 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _PARTITIONING_INFO_H
|