2 * Copyright 2003-2006, Haiku Inc.
3 * Distributed under the terms of the MIT License.
6 * Ingo Weinhold, bonefish@users.sf.net
10 #include <DiskDevicePrivate.h>
11 #include <DiskDevice.h>
12 #include <Partition.h>
15 PartitionFilter::~PartitionFilter()
20 // #pragma mark - PartitionFilterVisitor
23 PartitionFilterVisitor::PartitionFilterVisitor(BDiskDeviceVisitor
*visitor
,
24 PartitionFilter
*filter
)
25 : BDiskDeviceVisitor(),
33 PartitionFilterVisitor::Visit(BDiskDevice
*device
)
35 if (fFilter
->Filter(device
, 0))
36 return fVisitor
->Visit(device
);
42 PartitionFilterVisitor::Visit(BPartition
*partition
, int32 level
)
44 if (fFilter
->Filter(partition
, level
))
45 return fVisitor
->Visit(partition
, level
);
55 IDFinderVisitor::IDFinderVisitor(int32 id
)
56 : BDiskDeviceVisitor(),
63 IDFinderVisitor::Visit(BDiskDevice
*device
)
65 return (device
->ID() == fID
);
70 IDFinderVisitor::Visit(BPartition
*partition
, int32 level
)
72 return (partition
->ID() == fID
);