haiku/headers/private/storage/PartitioningInfo.h
Stephan Aßmus 96418817f9 * added a PrintToStream() method
* added optional tracing for the main operations
* fixed bad pointer arithmetic when reallocating/moving the object's data
* it was impossible to remove the very first space via _RemoveSpaces()
* added a little more variaty to error return codes for some
  functions to make them a little more helpful

-> This fixes the bogus space values in DriveSetup (#1737)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23824 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-02 12:38:15 +00:00

45 lines
1.1 KiB
C++

//----------------------------------------------------------------------
// This software is part of the OpenBeOS distribution and is covered
// by the OpenBeOS license.
//---------------------------------------------------------------------
#ifndef _PARTITIONING_INFO_H
#define _PARTITIONING_INFO_H
#include <DiskDeviceDefs.h>
struct partitionable_space_data;
class BPartitioningInfo {
public:
BPartitioningInfo();
virtual ~BPartitioningInfo();
status_t SetTo(off_t offset, off_t size);
void Unset();
status_t ExcludeOccupiedSpace(off_t offset,
off_t size);
// 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;
void PrintToStream() const;
private:
status_t _InsertSpaces(int32 index, int32 count);
void _RemoveSpaces(int32 index, int32 count);
friend class BPartition;
partition_id fPartitionID;
partitionable_space_data* fSpaces;
int32 fCount;
int32 fCapacity;
};
#endif // _PARTITIONING_INFO_H