Added FindDescendant() and _IsShadow().
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3978 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -60,6 +60,7 @@ public:
|
|||||||
BPartition *Parent() const;
|
BPartition *Parent() const;
|
||||||
BPartition *ChildAt(int32 index) const;
|
BPartition *ChildAt(int32 index) const;
|
||||||
int32 CountChildren() const;
|
int32 CountChildren() const;
|
||||||
|
BPartition *FindDescendant(partition_id id) const;
|
||||||
|
|
||||||
status_t GetPartitioningInfo(BPartitioningInfo *info) const;
|
status_t GetPartitioningInfo(BPartitioningInfo *info) const;
|
||||||
|
|
||||||
@@ -132,6 +133,8 @@ private:
|
|||||||
user_partition_data *data);
|
user_partition_data *data);
|
||||||
void _Unset();
|
void _Unset();
|
||||||
|
|
||||||
|
bool _IsShadow() const;
|
||||||
|
|
||||||
int32 _Level() const;
|
int32 _Level() const;
|
||||||
virtual bool _AcceptVisitor(BDiskDeviceVisitor *visitor, int32 level);
|
virtual bool _AcceptVisitor(BDiskDeviceVisitor *visitor, int32 level);
|
||||||
BPartition *_VisitEachDescendant(BDiskDeviceVisitor *visitor,
|
BPartition *_VisitEachDescendant(BDiskDeviceVisitor *visitor,
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
#include <Partition.h>
|
#include <Partition.h>
|
||||||
|
|
||||||
#include <DiskDevice.h>
|
#include <DiskDevice.h>
|
||||||
|
#include <DiskDevicePrivate.h>
|
||||||
#include <DiskDeviceVisitor.h>
|
#include <DiskDeviceVisitor.h>
|
||||||
#include <Message.h>
|
#include <Message.h>
|
||||||
#include <Volume.h>
|
#include <Volume.h>
|
||||||
@@ -358,6 +359,14 @@ BPartition::CountChildren() const
|
|||||||
return (fPartitionData ? fPartitionData->child_count : 0);
|
return (fPartitionData ? fPartitionData->child_count : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FindDescendant
|
||||||
|
BPartition *
|
||||||
|
BPartition::FindDescendant(partition_id id) const
|
||||||
|
{
|
||||||
|
IDFinderVisitor visitor(id);
|
||||||
|
return const_cast<BPartition*>(this)->VisitEachDescendant(&visitor);
|
||||||
|
}
|
||||||
|
|
||||||
// GetPartitioningInfo
|
// GetPartitioningInfo
|
||||||
status_t
|
status_t
|
||||||
BPartition::GetPartitioningInfo(BPartitioningInfo *info) const
|
BPartition::GetPartitioningInfo(BPartitioningInfo *info) const
|
||||||
@@ -435,6 +444,13 @@ BPartition::_Unset()
|
|||||||
fPartitionData = NULL;
|
fPartitionData = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// _IsShadow
|
||||||
|
bool
|
||||||
|
BPartition::_IsShadow() const
|
||||||
|
{
|
||||||
|
return (fPartitionData && fPartitionData->shadow_id >= 0);
|
||||||
|
}
|
||||||
|
|
||||||
// _Level
|
// _Level
|
||||||
int32
|
int32
|
||||||
BPartition::_Level() const
|
BPartition::_Level() const
|
||||||
|
|||||||
Reference in New Issue
Block a user