xref: /haiku/headers/private/storage/PartitioningInfo.h (revision 893988af824e65e49e55f517b157db8386e8002b)
1 //----------------------------------------------------------------------
2 //  This software is part of the OpenBeOS distribution and is covered
3 //  by the OpenBeOS license.
4 //---------------------------------------------------------------------
5 
6 #ifndef _PARTITIONING_INFO_H
7 #define _PARTITIONING_INFO_H
8 
9 #include <DiskDeviceDefs.h>
10 
11 struct partitionable_space_data;
12 
13 class BPartitioningInfo {
14 public:
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;
32 private:
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