本文整理汇总了C++中BDiskDevice::Unset方法的典型用法代码示例。如果您正苦于以下问题:C++ BDiskDevice::Unset方法的具体用法?C++ BDiskDevice::Unset怎么用?C++ BDiskDevice::Unset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BDiskDevice
的用法示例。
在下文中一共展示了BDiskDevice::Unset方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Visit
/*! \brief Pre-order traverses the trees spanned by the BDiskDevices and their
subobjects.
The supplied visitor's Visit(BDiskDevice*) method is invoked for each
disk device and Visit(BPartition*) for each (non-disk device) partition.
If Visit() returns \c true, the iteration is terminated and this method
returns \c true. If supplied, \a device is set to the concerned device
and in \a partition the pointer to the partition object is returned.
\param visitor The visitor.
\param device Pointer to a pre-allocated BDiskDevice to be initialized
to the device at which the iteration was terminated.
May be \c NULL.
\param partition Pointer to a pre-allocated BPartition pointer to be set
to the partition at which the iteration was terminated.
May be \c NULL.
\return \c true, if the iteration was terminated, \c false otherwise.
*/
bool
BDiskDeviceRoster::VisitEachPartition(BDiskDeviceVisitor* visitor,
BDiskDevice* device, BPartition** partition)
{
bool terminatedEarly = false;
if (visitor) {
int32 oldCookie = fDeviceCookie;
fDeviceCookie = 0;
BDiskDevice deviceOnStack;
BDiskDevice* useDevice = device ? device : &deviceOnStack;
BPartition* foundPartition = NULL;
while (GetNextDevice(useDevice) == B_OK) {
foundPartition = useDevice->VisitEachDescendant(visitor);
if (foundPartition) {
terminatedEarly = true;
break;
}
}
fDeviceCookie = oldCookie;
if (!terminatedEarly)
useDevice->Unset();
else if (device && partition)
*partition = foundPartition;
}
return terminatedEarly;
}