本文整理汇总了C++中BPartition::_SupportsChildOperation方法的典型用法代码示例。如果您正苦于以下问题:C++ BPartition::_SupportsChildOperation方法的具体用法?C++ BPartition::_SupportsChildOperation怎么用?C++ BPartition::_SupportsChildOperation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BPartition
的用法示例。
在下文中一共展示了BPartition::_SupportsChildOperation方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Parent
// CanMove
bool
BPartition::CanMove(BObjectList<BPartition>* unmovableDescendants,
BObjectList<BPartition>* movableOnlyIfUnmounted) const
{
BPartition* parent = Parent();
if (!parent || !fDelegate)
return false;
if (!parent->_SupportsChildOperation(this,
B_DISK_SYSTEM_SUPPORTS_MOVING_CHILD)) {
return false;
}
bool whileMounted;
bool movable = _SupportsOperation(B_DISK_SYSTEM_SUPPORTS_MOVING,
B_DISK_SYSTEM_SUPPORTS_MOVING_WHILE_MOUNTED, &whileMounted);
if (!movable)
return false;
if (!whileMounted)
movableOnlyIfUnmounted->AddItem(const_cast<BPartition*>(this));
// collect descendent partitions
// TODO: ...
// TODO: Currently there's no interface for asking descendents. They'll still
// have the same offset (relative to their parent) after moving. The only thing
// we really have to ask is whether they need to be unmounted.
return true;
}
示例2: _SupportsOperation
// CanResize
bool
BPartition::CanResize(bool* canResizeContents, bool* whileMounted) const
{
BPartition* parent = Parent();
if (!parent)
return false;
if (!parent->_SupportsChildOperation(this,
B_DISK_SYSTEM_SUPPORTS_RESIZING_CHILD)) {
return false;
}
if (!_HasContent())
return true;
return _SupportsOperation(B_DISK_SYSTEM_SUPPORTS_RESIZING,
B_DISK_SYSTEM_SUPPORTS_RESIZING_WHILE_MOUNTED, whileMounted);
}