replace grepPaths() to PPT Converter.h/cpp

This commit is contained in:
Ivan Morozov
2021-09-13 12:41:50 +03:00
parent 14f0249708
commit 0a702d44e4
5 changed files with 23 additions and 25 deletions

View File

@ -53,7 +53,6 @@
#endif
#include <string.h>
#include <boost/regex.hpp>
#include "Directory.h"
namespace NSDirectory
@ -584,19 +583,4 @@ namespace NSDirectory
{
return Exists(pathName);
}
std::vector<std::wstring> GrepPaths(const std::vector<std::wstring> &paths, const std::wstring &strRegEx)
{
std::vector<std::wstring> filtredPaths;
boost::wregex regEx(strRegEx);
boost::wsmatch wSmath;
for (const auto& path : paths)
{
if (boost::regex_match(path, wSmath, regEx))
filtredPaths.push_back(path);
}
return filtredPaths;
}
}

View File

@ -68,7 +68,6 @@ namespace NSDirectory
KERNEL_DECL void GetFiles2(std::wstring strDirectory, std::vector<std::wstring>& oArray, bool bIsRecursion = false);
KERNEL_DECL std::vector<std::wstring> GetFiles(std::wstring strDirectory, bool bIsRecursion = false);
KERNEL_DECL std::vector<std::wstring> GrepPaths(const std::vector<std::wstring>& paths, const std::wstring& strRegEx);
KERNEL_DECL std::vector<std::wstring> GetDirectories(std::wstring strDirectory);
KERNEL_DECL bool Exists(const std::wstring& strDirectory);
KERNEL_DECL bool CreateDirectory(const std::wstring& strDirectory);