1//----------------------------------------------------------------------
2//  This software is part of the OpenBeOS distribution and is covered
3//  by the MIT License.
4//---------------------------------------------------------------------
5
6#ifndef _PARTITIONING_INFO_H
7#define _PARTITIONING_INFO_H
8
9#include <DiskDeviceDefs.h>
10
11struct partitionable_space_data;
12
13class BPartitioningInfo {
14public:
15								BPartitioningInfo();
16	virtual						~BPartitioningInfo();
17
18			status_t			SetTo(off_t offset, off_t size);
19			void				Unset();
20
21			status_t			ExcludeOccupiedSpace(off_t offset,
22									off_t size);
23
24// TODO: We don't need the partition ID.
25			partition_id		PartitionID() const;
26
27			status_t			GetPartitionableSpaceAt(int32 index,
28									off_t* offset, off_t*size) const;
29			int32				CountPartitionableSpaces() const;
30
31			void				PrintToStream() const;
32private:
33			status_t			_InsertSpaces(int32 index, int32 count);
34			void				_RemoveSpaces(int32 index, int32 count);
35
36	friend class BPartition;
37
38			partition_id		fPartitionID;
39			partitionable_space_data* fSpaces;
40			int32				fCount;
41			int32				fCapacity;
42};
43
44#endif	// _PARTITIONING_INFO_H
45