2 * Copyright 2007, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Distributed under the terms of the MIT License.
5 #ifndef _MUTABLE_PARTITION_H
6 #define _MUTABLE_PARTITION_H
12 struct user_partition_data
;
15 class BMutablePartition
{
17 void UninitializeContents();
20 void SetOffset(off_t offset
);
23 void SetSize(off_t size
);
25 off_t
ContentSize() const;
26 void SetContentSize(off_t size
);
28 off_t
BlockSize() const;
29 void SetBlockSize(off_t blockSize
);
31 uint32
Status() const;
32 void SetStatus(uint32 status
);
35 void SetFlags(uint32 flags
);
36 void ClearFlags(uint32 flags
);
38 dev_t
VolumeID() const;
39 void SetVolumeID(dev_t volumeID
);
43 const char* Name() const;
44 status_t
SetName(const char* name
);
46 const char* ContentName() const;
47 status_t
SetContentName(const char* name
);
49 const char* Type() const;
50 status_t
SetType(const char* type
);
52 const char* ContentType() const;
53 status_t
SetContentType(const char* type
);
55 const char* Parameters() const;
56 status_t
SetParameters(const char* parameters
);
58 const char* ContentParameters() const;
59 status_t
SetContentParameters(const char* parameters
);
61 status_t
CreateChild(int32 index
,
62 BMutablePartition
** child
);
63 status_t
CreateChild(int32 index
, const char* type
,
64 const char* name
, const char* parameters
,
65 BMutablePartition
** child
);
66 status_t
DeleteChild(int32 index
);
67 status_t
DeleteChild(BMutablePartition
* child
);
68 void DeleteAllChildren();
70 BMutablePartition
* Parent() const;
71 BMutablePartition
* ChildAt(int32 index
) const;
72 int32
CountChildren() const;
73 int32
IndexOfChild(BMutablePartition
* child
) const;
75 void SetChangeFlags(uint32 flags
);
76 uint32
ChangeFlags() const;
77 void Changed(uint32 flags
, uint32 clearFlags
= 0);
79 // for the partitioning system managing the parent
80 void* ChildCookie() const;
81 void SetChildCookie(void* cookie
);
85 BPartition::Delegate
* delegate
);
88 status_t
Init(const user_partition_data
* partitionData
,
89 BMutablePartition
* parent
);
91 const user_partition_data
* PartitionData() const;
94 friend class BPartition::Delegate
;
96 BPartition::Delegate
* GetDelegate() const;
98 BPartition::Delegate
* fDelegate
;
99 user_partition_data
* fData
;
100 BMutablePartition
* fParent
;
107 #endif // _MUTABLE_PARTITION_H