Minor changes to the KDiskSystem interface.

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3603 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2003-06-22 23:03:17 +00:00
parent 0e2967f9d2
commit b22221ad17
4 changed files with 80 additions and 57 deletions

View File

@ -18,7 +18,7 @@ public:
virtual status_t Init(); virtual status_t Init();
void SetID(disk_system_id id); // void SetID(disk_system_id id);
disk_system_id ID() const; disk_system_id ID() const;
const char *Name() const; const char *Name() const;
virtual const char *PrettyName(); virtual const char *PrettyName();
@ -51,15 +51,17 @@ public:
virtual bool SupportsResizingChild(KPartition *child); virtual bool SupportsResizingChild(KPartition *child);
virtual bool SupportsMoving(KPartition *partition, bool *whileMounted); virtual bool SupportsMoving(KPartition *partition, bool *whileMounted);
virtual bool SupportsMovingChild(KPartition *child); virtual bool SupportsMovingChild(KPartition *child);
virtual bool SupportsCreatingChild(KPartition *partition);
virtual bool SupportsParentSystem(KDiskSystem *system); virtual bool SupportsParentSystem(KDiskSystem *system);
virtual bool SupportsChildSystem(KDiskSystem *system); virtual bool SupportsChildSystem(KDiskSystem *system);
virtual bool ValidateResize(KPartition *partition, off_t *size); virtual bool ValidateResize(KPartition *partition, off_t *size);
virtual bool ValidateMove(KPartition *partition, off_t *start);
virtual bool ValidateResizeChild(KPartition *partition, off_t *size); virtual bool ValidateResizeChild(KPartition *partition, off_t *size);
virtual bool ValidateMove(KPartition *partition, off_t *start);
virtual bool ValidateMoveChild(KPartition *partition, off_t *start); virtual bool ValidateMoveChild(KPartition *partition, off_t *start);
virtual bool ValidateCreateChild(KPartition *partition, off_t *start, virtual bool ValidateCreateChild(KPartition *partition, off_t *start,
off_t *size, const char *parameters); off_t *size, const char *type,
const char *parameters);
virtual bool ValidateInitialize(KPartition *partition, virtual bool ValidateInitialize(KPartition *partition,
const char *parameters); const char *parameters);
virtual bool ValidateSetParameters(KPartition *partition, virtual bool ValidateSetParameters(KPartition *partition,
@ -87,8 +89,8 @@ public:
virtual status_t MoveChild(KPartition *child, off_t offset, virtual status_t MoveChild(KPartition *child, off_t offset,
KDiskDeviceJob *job); KDiskDeviceJob *job);
virtual status_t CreateChild(KPartition *partition, off_t offset, virtual status_t CreateChild(KPartition *partition, off_t offset,
off_t size, const char *parameters, off_t size, const char *type,
KDiskDeviceJob *job, const char *parameters, KDiskDeviceJob *job,
KPartition **child = NULL, KPartition **child = NULL,
partition_id childID = -1); partition_id childID = -1);
virtual status_t DeleteChild(KPartition *child, KDiskDeviceJob *job); virtual status_t DeleteChild(KPartition *child, KDiskDeviceJob *job);

View File

@ -35,15 +35,17 @@ public:
virtual bool SupportsResizingChild(KPartition *child); virtual bool SupportsResizingChild(KPartition *child);
virtual bool SupportsMoving(KPartition *partition, bool *whileMounted); virtual bool SupportsMoving(KPartition *partition, bool *whileMounted);
virtual bool SupportsMovingChild(KPartition *child); virtual bool SupportsMovingChild(KPartition *child);
virtual bool SupportsCreatingChild(KPartition *child);
virtual bool SupportsParentSystem(KDiskSystem *system); virtual bool SupportsParentSystem(KDiskSystem *system);
virtual bool SupportsChildSystem(KDiskSystem *system); virtual bool SupportsChildSystem(KDiskSystem *system);
virtual bool ValidateResize(KPartition *partition, off_t *size); virtual bool ValidateResize(KPartition *partition, off_t *size);
virtual bool ValidateMove(KPartition *partition, off_t *start);
virtual bool ValidateResizeChild(KPartition *partition, off_t *size); virtual bool ValidateResizeChild(KPartition *partition, off_t *size);
virtual bool ValidateMove(KPartition *partition, off_t *start);
virtual bool ValidateMoveChild(KPartition *partition, off_t *start); virtual bool ValidateMoveChild(KPartition *partition, off_t *start);
virtual bool ValidateCreateChild(KPartition *partition, off_t *start, virtual bool ValidateCreateChild(KPartition *partition, off_t *start,
off_t *size, const char *parameters); off_t *size, const char *type,
const char *parameters);
virtual bool ValidateInitialize(KPartition *partition, virtual bool ValidateInitialize(KPartition *partition,
const char *parameters); const char *parameters);
virtual bool ValidateSetParameters(KPartition *partition, virtual bool ValidateSetParameters(KPartition *partition,
@ -69,8 +71,8 @@ public:
virtual status_t MoveChild(KPartition *child, off_t offset, virtual status_t MoveChild(KPartition *child, off_t offset,
KDiskDeviceJob *job); KDiskDeviceJob *job);
virtual status_t CreateChild(KPartition *partition, off_t offset, virtual status_t CreateChild(KPartition *partition, off_t offset,
off_t size, const char *parameters, off_t size, const char *type,
KDiskDeviceJob *job, const char *parameters, KDiskDeviceJob *job,
KPartition **child = NULL, KPartition **child = NULL,
partition_id childID = -1); partition_id childID = -1);
virtual status_t DeleteChild(KPartition *child, KDiskDeviceJob *job); virtual status_t DeleteChild(KPartition *child, KDiskDeviceJob *job);

View File

@ -30,11 +30,11 @@ KDiskSystem::Init()
} }
// SetID // SetID
void /*void
KDiskSystem::SetID(disk_system_id id) KDiskSystem::SetID(disk_system_id id)
{ {
fID = id; fID = id;
} }*/
// ID // ID
disk_system_id disk_system_id
@ -194,6 +194,14 @@ KDiskSystem::SupportsMovingChild(KPartition *child)
return false; return false;
} }
// SupportsCreatingChild
bool
KDiskSystem::SupportsCreatingChild(KPartition *child)
{
// to be implemented by derived classes
return false;
}
// SupportsParentSystem // SupportsParentSystem
bool bool
KDiskSystem::SupportsParentSystem(KDiskSystem *system) KDiskSystem::SupportsParentSystem(KDiskSystem *system)
@ -218,17 +226,17 @@ KDiskSystem::ValidateResize(KPartition *partition, off_t *size)
return false; return false;
} }
// ValidateMove // ValidateResizeChild
bool bool
KDiskSystem::ValidateMove(KPartition *partition, off_t *start) KDiskSystem::ValidateResizeChild(KPartition *partition, off_t *size)
{ {
// to be implemented by derived classes // to be implemented by derived classes
return false; return false;
} }
// ValidateResizeChild // ValidateMove
bool bool
KDiskSystem::ValidateResizeChild(KPartition *partition, off_t *size) KDiskSystem::ValidateMove(KPartition *partition, off_t *start)
{ {
// to be implemented by derived classes // to be implemented by derived classes
return false; return false;
@ -245,7 +253,8 @@ KDiskSystem::ValidateMoveChild(KPartition *partition, off_t *start)
// ValidateCreateChild // ValidateCreateChild
bool bool
KDiskSystem::ValidateCreateChild(KPartition *partition, off_t *start, KDiskSystem::ValidateCreateChild(KPartition *partition, off_t *start,
off_t *size, const char *parameters) off_t *size, const char *type,
const char *parameters)
{ {
// to be implemented by derived classes // to be implemented by derived classes
return false; return false;
@ -347,8 +356,9 @@ KDiskSystem::MoveChild(KPartition *child, off_t offset, KDiskDeviceJob *job)
// CreateChild // CreateChild
status_t status_t
KDiskSystem::CreateChild(KPartition *partition, off_t offset, off_t size, KDiskSystem::CreateChild(KPartition *partition, off_t offset, off_t size,
const char *parameters, KDiskDeviceJob *job, const char *type, const char *parameters,
KPartition **child, partition_id childID) KDiskDeviceJob *job, KPartition **child,
partition_id childID)
{ {
// to be implemented by derived classes // to be implemented by derived classes
return B_ERROR; return B_ERROR;

View File

@ -40,7 +40,7 @@ KPartitioningSystem::Init()
bool bool
KPartitioningSystem::IsFileSystem() const KPartitioningSystem::IsFileSystem() const
{ {
return true; return false;
} }
// Identify // Identify
@ -106,7 +106,7 @@ bool
KPartitioningSystem::SupportsRepairing(KPartition *partition, bool checkOnly, KPartitioningSystem::SupportsRepairing(KPartition *partition, bool checkOnly,
bool *whileMounted) bool *whileMounted)
{ {
// to be implemented by derived classes // to be implemented
if (whileMounted) if (whileMounted)
*whileMounted = false; *whileMounted = false;
return false; return false;
@ -117,7 +117,7 @@ bool
KPartitioningSystem::SupportsResizing(KPartition *partition, KPartitioningSystem::SupportsResizing(KPartition *partition,
bool *whileMounted) bool *whileMounted)
{ {
// to be implemented by derived classes // to be implemented
if (whileMounted) if (whileMounted)
*whileMounted = false; *whileMounted = false;
return false; return false;
@ -127,7 +127,7 @@ KPartitioningSystem::SupportsResizing(KPartition *partition,
bool bool
KPartitioningSystem::SupportsResizingChild(KPartition *child) KPartitioningSystem::SupportsResizingChild(KPartition *child)
{ {
// to be implemented by derived classes // to be implemented
return false; return false;
} }
@ -135,7 +135,7 @@ KPartitioningSystem::SupportsResizingChild(KPartition *child)
bool bool
KPartitioningSystem::SupportsMoving(KPartition *partition, bool *whileMounted) KPartitioningSystem::SupportsMoving(KPartition *partition, bool *whileMounted)
{ {
// to be implemented by derived classes // to be implemented
return false; return false;
} }
@ -143,7 +143,15 @@ KPartitioningSystem::SupportsMoving(KPartition *partition, bool *whileMounted)
bool bool
KPartitioningSystem::SupportsMovingChild(KPartition *child) KPartitioningSystem::SupportsMovingChild(KPartition *child)
{ {
// to be implemented by derived classes // to be implemented
return false;
}
// SupportsCreatingChild
bool
KPartitioningSystem::SupportsCreatingChild(KPartition *child)
{
// to be implemented
return false; return false;
} }
@ -151,7 +159,7 @@ KPartitioningSystem::SupportsMovingChild(KPartition *child)
bool bool
KPartitioningSystem::SupportsParentSystem(KDiskSystem *system) KPartitioningSystem::SupportsParentSystem(KDiskSystem *system)
{ {
// to be implemented by derived classes // to be implemented
return false; return false;
} }
@ -159,7 +167,7 @@ KPartitioningSystem::SupportsParentSystem(KDiskSystem *system)
bool bool
KPartitioningSystem::SupportsChildSystem(KDiskSystem *system) KPartitioningSystem::SupportsChildSystem(KDiskSystem *system)
{ {
// to be implemented by derived classes // to be implemented
return false; return false;
} }
@ -167,15 +175,7 @@ KPartitioningSystem::SupportsChildSystem(KDiskSystem *system)
bool bool
KPartitioningSystem::ValidateResize(KPartition *partition, off_t *size) KPartitioningSystem::ValidateResize(KPartition *partition, off_t *size)
{ {
// to be implemented by derived classes // to be implemented
return false;
}
// ValidateMove
bool
KPartitioningSystem::ValidateMove(KPartition *partition, off_t *start)
{
// to be implemented by derived classes
return false; return false;
} }
@ -183,7 +183,15 @@ KPartitioningSystem::ValidateMove(KPartition *partition, off_t *start)
bool bool
KPartitioningSystem::ValidateResizeChild(KPartition *partition, off_t *size) KPartitioningSystem::ValidateResizeChild(KPartition *partition, off_t *size)
{ {
// to be implemented by derived classes // to be implemented
return false;
}
// ValidateMove
bool
KPartitioningSystem::ValidateMove(KPartition *partition, off_t *start)
{
// to be implemented
return false; return false;
} }
@ -191,16 +199,17 @@ KPartitioningSystem::ValidateResizeChild(KPartition *partition, off_t *size)
bool bool
KPartitioningSystem::ValidateMoveChild(KPartition *partition, off_t *start) KPartitioningSystem::ValidateMoveChild(KPartition *partition, off_t *start)
{ {
// to be implemented by derived classes // to be implemented
return false; return false;
} }
// ValidateCreateChild // ValidateCreateChild
bool bool
KPartitioningSystem::ValidateCreateChild(KPartition *partition, off_t *start, KPartitioningSystem::ValidateCreateChild(KPartition *partition, off_t *start,
off_t *size, const char *parameters) off_t *size, const char *type,
const char *parameters)
{ {
// to be implemented by derived classes // to be implemented
return false; return false;
} }
@ -209,7 +218,7 @@ bool
KPartitioningSystem::ValidateInitialize(KPartition *partition, KPartitioningSystem::ValidateInitialize(KPartition *partition,
const char *parameters) const char *parameters)
{ {
// to be implemented by derived classes // to be implemented
return false; return false;
} }
@ -218,7 +227,7 @@ bool
KPartitioningSystem::ValidateSetParameters(KPartition *partition, KPartitioningSystem::ValidateSetParameters(KPartition *partition,
const char *parameters) const char *parameters)
{ {
// to be implemented by derived classes // to be implemented
return false; return false;
} }
@ -227,7 +236,7 @@ bool
KPartitioningSystem::ValidateSetContentParameters(KPartition *child, KPartitioningSystem::ValidateSetContentParameters(KPartition *child,
const char *parameters) const char *parameters)
{ {
// to be implemented by derived classes // to be implemented
return false; return false;
} }
@ -235,7 +244,7 @@ KPartitioningSystem::ValidateSetContentParameters(KPartition *child,
int32 int32
KPartitioningSystem::CountPartitionableSpaces(KPartition *partition) KPartitioningSystem::CountPartitionableSpaces(KPartition *partition)
{ {
// to be implemented by derived classes // to be implemented
return 0; return 0;
} }
@ -245,7 +254,7 @@ KPartitioningSystem::GetPartitionableSpaces(KPartition *partition,
partitionable_space_data *spaces, partitionable_space_data *spaces,
int32 count, int32 *actualCount) int32 count, int32 *actualCount)
{ {
// to be implemented by derived classes // to be implemented
return false; return false;
} }
@ -254,7 +263,7 @@ status_t
KPartitioningSystem::Repair(KPartition *partition, bool checkOnly, KPartitioningSystem::Repair(KPartition *partition, bool checkOnly,
KDiskDeviceJob *job) KDiskDeviceJob *job)
{ {
// to be implemented by derived classes // to be implemented
return B_ERROR; return B_ERROR;
} }
@ -263,7 +272,7 @@ status_t
KPartitioningSystem::Resize(KPartition *partition, off_t size, KPartitioningSystem::Resize(KPartition *partition, off_t size,
KDiskDeviceJob *job) KDiskDeviceJob *job)
{ {
// to be implemented by derived classes // to be implemented
return B_ERROR; return B_ERROR;
} }
@ -272,7 +281,7 @@ status_t
KPartitioningSystem::ResizeChild(KPartition *child, off_t size, KPartitioningSystem::ResizeChild(KPartition *child, off_t size,
KDiskDeviceJob *job) KDiskDeviceJob *job)
{ {
// to be implemented by derived classes // to be implemented
return B_ERROR; return B_ERROR;
} }
@ -281,7 +290,7 @@ status_t
KPartitioningSystem::Move(KPartition *partition, off_t offset, KPartitioningSystem::Move(KPartition *partition, off_t offset,
KDiskDeviceJob *job) KDiskDeviceJob *job)
{ {
// to be implemented by derived classes // to be implemented
return B_ERROR; return B_ERROR;
} }
@ -290,18 +299,18 @@ status_t
KPartitioningSystem::MoveChild(KPartition *child, off_t offset, KPartitioningSystem::MoveChild(KPartition *child, off_t offset,
KDiskDeviceJob *job) KDiskDeviceJob *job)
{ {
// to be implemented by derived classes // to be implemented
return B_ERROR; return B_ERROR;
} }
// CreateChild // CreateChild
status_t status_t
KPartitioningSystem::CreateChild(KPartition *partition, off_t offset, KPartitioningSystem::CreateChild(KPartition *partition, off_t offset,
off_t size, const char *parameters, off_t size, const char *type,
KDiskDeviceJob *job, KPartition **child, const char *parameters, KDiskDeviceJob *job,
partition_id childID) KPartition **child, partition_id childID)
{ {
// to be implemented by derived classes // to be implemented
return B_ERROR; return B_ERROR;
} }
@ -309,7 +318,7 @@ KPartitioningSystem::CreateChild(KPartition *partition, off_t offset,
status_t status_t
KPartitioningSystem::DeleteChild(KPartition *child, KDiskDeviceJob *job) KPartitioningSystem::DeleteChild(KPartition *child, KDiskDeviceJob *job)
{ {
// to be implemented by derived classes // to be implemented
return B_ERROR; return B_ERROR;
} }
@ -318,7 +327,7 @@ status_t
KPartitioningSystem::Initialize(KPartition *partition, const char *parameters, KPartitioningSystem::Initialize(KPartition *partition, const char *parameters,
KDiskDeviceJob *job) KDiskDeviceJob *job)
{ {
// to be implemented by derived classes // to be implemented
return B_ERROR; return B_ERROR;
} }
@ -327,7 +336,7 @@ status_t
KPartitioningSystem::SetParameters(KPartition *partition, KPartitioningSystem::SetParameters(KPartition *partition,
const char *parameters, KDiskDeviceJob *job) const char *parameters, KDiskDeviceJob *job)
{ {
// to be implemented by derived classes // to be implemented
return B_ERROR; return B_ERROR;
} }
@ -337,7 +346,7 @@ KPartitioningSystem::SetContentParameters(KPartition *partition,
const char *parameters, const char *parameters,
KDiskDeviceJob *job) KDiskDeviceJob *job)
{ {
// to be implemented by derived classes // to be implemented
return B_ERROR; return B_ERROR;
} }