2 * Copyright 2003-2011, Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
6 * Ingo Weinhold <bonefish@cs.tu-berlin.de>
8 #ifndef _K_PARTITIONING_DISK_DEVICE_SYSTEM_H
9 #define _K_PARTITIONING_DISK_DEVICE_SYSTEM_H
11 #include "KDiskSystem.h"
14 struct partition_module_info
;
18 namespace DiskDevice
{
22 * \brief Wrapper for the C interface of a partitioning system add-on.
24 * See \ref ddm_modules.h for better description of the interface.
26 class KPartitioningSystem
: public KDiskSystem
{
28 KPartitioningSystem(const char* name
);
29 virtual ~KPartitioningSystem();
31 virtual status_t
Init();
35 virtual float Identify(KPartition
* partition
, void** cookie
);
36 virtual status_t
Scan(KPartition
* partition
, void* cookie
);
37 virtual void FreeIdentifyCookie(KPartition
* partition
,
39 virtual void FreeCookie(KPartition
* partition
);
40 virtual void FreeContentCookie(KPartition
* partition
);
44 virtual status_t
Repair(KPartition
* partition
, bool checkOnly
,
46 virtual status_t
Resize(KPartition
* partition
, off_t size
,
48 virtual status_t
ResizeChild(KPartition
* child
, off_t size
,
50 virtual status_t
Move(KPartition
* partition
, off_t offset
,
52 virtual status_t
MoveChild(KPartition
* child
, off_t offset
,
54 virtual status_t
SetName(KPartition
* partition
, const char* name
,
56 virtual status_t
SetContentName(KPartition
* partition
,
57 const char* name
, disk_job_id job
);
58 virtual status_t
SetType(KPartition
* partition
, const char* type
,
60 virtual status_t
SetParameters(KPartition
* partition
,
61 const char* parameters
, disk_job_id job
);
62 virtual status_t
SetContentParameters(KPartition
* partition
,
63 const char* parameters
, disk_job_id job
);
64 virtual status_t
Initialize(KPartition
* partition
,
65 const char* name
, const char* parameters
,
67 virtual status_t
Uninitialize(KPartition
* partition
,
69 virtual status_t
CreateChild(KPartition
* partition
, off_t offset
,
70 off_t size
, const char* type
,
71 const char* name
, const char* parameters
,
72 disk_job_id job
, KPartition
** child
= NULL
,
73 partition_id childID
= -1);
74 virtual status_t
DeleteChild(KPartition
* child
, disk_job_id job
);
77 virtual status_t
LoadModule();
78 virtual void UnloadModule();
81 partition_module_info
* fModule
;
85 } // namespace DiskDevice
86 } // namespace BPrivate
88 using BPrivate::DiskDevice::KPartitioningSystem
;
90 #endif // _K_PARTITIONING_DISK_DEVICE_SYSTEM_H