mirror of
https://github.com/pocoproject/poco.git
synced 2025-04-17 23:23:47 +02:00
parent
75502b81b1
commit
6d0e71e68d
@ -72,12 +72,18 @@ const std::string ChildrenFirstTraverse::next(Stack* itStack, bool* isFinished)
|
||||
bool isDepthLimitReached = isFiniteDepth() && _depthDeterminer(*itStack) >= _maxDepth;
|
||||
if (!isDepthLimitReached && isDirectory(*itStack->top()))
|
||||
{
|
||||
DirectoryIterator child_it(itStack->top().path());
|
||||
// check if directory is empty
|
||||
if (child_it != _itEnd)
|
||||
// check the dir is iterable
|
||||
try
|
||||
{
|
||||
DirectoryIterator child_it(itStack->top().path());
|
||||
// check if directory is empty
|
||||
if (child_it != _itEnd)
|
||||
{
|
||||
itStack->push(child_it);
|
||||
return child_it->path();
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
itStack->push(child_it);
|
||||
return child_it->path();
|
||||
}
|
||||
}
|
||||
|
||||
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user