#include "Codepack.h" LazyList SearchFiles( const Folder& folder, const WString& extension, List& exceptions ) { auto files = Ptr(new List); auto folders = Ptr(new List); folder.GetFiles(*files.Obj()); folder.GetFolders(*folders.Obj()); return LazyList(files) .Select([](const File& file) { return file.GetFilePath(); }) .Where([&](const FilePath& filePath) { return From(exceptions) .All([&](const WString& except) { return INVLOC.FindFirst(filePath.GetFullPath(), except, Locale::IgnoreCase).key == -1; }); }) .Where([=](const FilePath& path) { return INVLOC.EndsWith(path.GetName(), extension, Locale::IgnoreCase); }) .Concat( LazyList(folders) .SelectMany([&](const Folder& folder) { return SearchFiles(folder, extension, exceptions); }) ); } LazyList GetCppFiles( const FilePath& folder, List& exceptions ) { return SearchFiles(folder, L".cpp", exceptions); } LazyList GetHeaderFiles( const FilePath& folder, List& exceptions ) { return SearchFiles(folder, L".h", exceptions); }