Merge remote-tracking branch 'origin/release/v6.4.0' into develop

This commit is contained in:
Elena.Subbotina
2021-08-23 10:24:30 +03:00
40 changed files with 1218 additions and 716 deletions

View File

@ -53,6 +53,7 @@
#endif
#include <string.h>
#include <regex>
#include "Directory.h"
namespace NSDirectory
@ -583,4 +584,19 @@ 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;
std::wregex regEx(strRegEx);
std::wsmatch wSmath;
for (const auto& path : paths)
{
if (std::regex_match(path, wSmath, regEx))
filtredPaths.push_back(path);
}
return filtredPaths;
}
}

View File

@ -68,6 +68,7 @@ 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);