* Glob from start path, for platforms where it is not possible to transverse from root (Android)

This commit is contained in:
Rangell Reale
2014-01-21 13:24:56 -02:00
committed by Rangel Reale
parent 70c467c56c
commit 12c2b3d290
3 changed files with 32 additions and 0 deletions

View File

@@ -106,6 +106,18 @@ void Glob::glob(const Path& pathPattern, std::set<std::string>& files, int optio
}
void Glob::glob(const Path& pathPattern, const Path& basePath, std::set<std::string>& files, int options)
{
Path pattern(pathPattern);
pattern.makeDirectory(); // to simplify pattern handling later on
Path absBase(basePath);
absBase.makeAbsolute();
if (pathPattern.isDirectory())
options |= GLOB_DIRS_ONLY;
collect(pattern, absBase, basePath, pathPattern[basePath.depth()], files, options);
}
bool Glob::match(TextIterator& itp, const TextIterator& endp, TextIterator& its, const TextIterator& ends)
{
while (itp != endp)