本文整理汇总了C++中Directory::FindChild方法的典型用法代码示例。如果您正苦于以下问题:C++ Directory::FindChild方法的具体用法?C++ Directory::FindChild怎么用?C++ Directory::FindChild使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Directory
的用法示例。
在下文中一共展示了Directory::FindChild方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: endPackageNode
/*! Recursively iterates through the descendents of the given package root node
and removes all package nodes from the node tree in post-order, until
encountering \a endPackageNode (if non-null).
Due to limited kernel stack space we avoid deep recursive function calls
and rather use the package node stack implied by the tree.
*/
void
Volume::_RemovePackageContentRootNode(Package* package,
PackageNode* rootPackageNode, PackageNode* endPackageNode, bool notify)
{
PackageNode* packageNode = rootPackageNode;
Directory* directory = fRootDirectory;
directory->WriteLock();
do {
if (packageNode == endPackageNode)
break;
// recurse into directory
if (PackageDirectory* packageDirectory
= dynamic_cast<PackageDirectory*>(packageNode)) {
if (packageDirectory->FirstChild() != NULL) {
if (Directory* childDirectory = dynamic_cast<Directory*>(
directory->FindChild(packageNode->Name()))) {
directory = childDirectory;
packageNode = packageDirectory->FirstChild();
directory->WriteLock();
continue;
}
}
}
// continue with the next available (ancestors's) sibling
do {
PackageDirectory* packageDirectory = packageNode->Parent();
PackageNode* sibling = packageDirectory != NULL
? packageDirectory->NextChild(packageNode) : NULL;
// we're done with the node -- remove it
_RemovePackageNode(directory, packageNode,
directory->FindChild(packageNode->Name()), notify);
if (sibling != NULL) {
packageNode = sibling;
break;
}
// no more siblings -- go back up the tree
packageNode = packageDirectory;
directory->WriteUnlock();
directory = directory->Parent();
// the parent is still locked, so this is safe
} while (packageNode != NULL/* && packageNode != rootPackageNode*/);
} while (packageNode != NULL/* && packageNode != rootPackageNode*/);
}