mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-30 21:50:47 +01:00
@@ -71,6 +71,9 @@ const std::string ChildrenFirstTraverse::next(Stack* itStack, bool* isFinished)
|
||||
// (if depth limit allows)
|
||||
bool isDepthLimitReached = isFiniteDepth() && _depthDeterminer(*itStack) >= _maxDepth;
|
||||
if (!isDepthLimitReached && isDirectory(*itStack->top()))
|
||||
{
|
||||
// check the dir is iterable
|
||||
try
|
||||
{
|
||||
DirectoryIterator child_it(itStack->top().path());
|
||||
// check if directory is empty
|
||||
@@ -79,6 +82,9 @@ const std::string ChildrenFirstTraverse::next(Stack* itStack, bool* isFinished)
|
||||
itStack->push(child_it);
|
||||
return child_it->path();
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
++(itStack->top());
|
||||
@@ -140,7 +146,17 @@ const std::string SiblingsFirstTraverse::next(Stack* itStack, bool* isFinished)
|
||||
{
|
||||
std::string dir = _dirsStack.top().front();
|
||||
_dirsStack.top().pop();
|
||||
DirectoryIterator child_it(dir);
|
||||
DirectoryIterator child_it;
|
||||
|
||||
// check the dir is iterable
|
||||
try
|
||||
{
|
||||
child_it = dir;
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// check if directory is empty
|
||||
if (child_it != _itEnd)
|
||||
|
||||
Reference in New Issue
Block a user