Added CountDescendants().
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4174 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -130,6 +130,7 @@ public:
|
|||||||
bool RemoveAllChildren();
|
bool RemoveAllChildren();
|
||||||
KPartition *ChildAt(int32 index) const;
|
KPartition *ChildAt(int32 index) const;
|
||||||
int32 CountChildren() const;
|
int32 CountChildren() const;
|
||||||
|
int32 CountDescendants() const;
|
||||||
|
|
||||||
// Shadow Partition
|
// Shadow Partition
|
||||||
|
|
||||||
|
|||||||
@@ -656,6 +656,16 @@ KPartition::CountChildren() const
|
|||||||
return fPartitionData.child_count;
|
return fPartitionData.child_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// CountDescendants
|
||||||
|
int32
|
||||||
|
KPartition::CountDescendants() const
|
||||||
|
{
|
||||||
|
int32 count = 1;
|
||||||
|
for (int32 i = 0; KPartition *child = ChildAt(i); i++)
|
||||||
|
count += child->CountDescendants();
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
// CreateShadowPartition
|
// CreateShadowPartition
|
||||||
status_t
|
status_t
|
||||||
KPartition::CreateShadowPartition()
|
KPartition::CreateShadowPartition()
|
||||||
|
|||||||
Reference in New Issue
Block a user