btrfs: [] on the end of a struct field is a variable length array.
[haiku.git] / headers / private / storage / PartitioningInfo.h
blobb4428afeeda657e60164b38035945ce74b679d75
1 //----------------------------------------------------------------------
2 // This software is part of the OpenBeOS distribution and is covered
3 // by the MIT License.
4 //---------------------------------------------------------------------
6 #ifndef _PARTITIONING_INFO_H
7 #define _PARTITIONING_INFO_H
9 #include <DiskDeviceDefs.h>
11 struct partitionable_space_data;
13 class BPartitioningInfo {
14 public:
15 BPartitioningInfo();
16 virtual ~BPartitioningInfo();
18 status_t SetTo(off_t offset, off_t size);
19 void Unset();
21 status_t ExcludeOccupiedSpace(off_t offset,
22 off_t size);
24 // TODO: We don't need the partition ID.
25 partition_id PartitionID() const;
27 status_t GetPartitionableSpaceAt(int32 index,
28 off_t* offset, off_t*size) const;
29 int32 CountPartitionableSpaces() const;
31 void PrintToStream() const;
32 private:
33 status_t _InsertSpaces(int32 index, int32 count);
34 void _RemoveSpaces(int32 index, int32 count);
36 friend class BPartition;
38 partition_id fPartitionID;
39 partitionable_space_data* fSpaces;
40 int32 fCount;
41 int32 fCapacity;
44 #endif // _PARTITIONING_INFO_H