2015-07-04 06:03:59 +00:00
|
|
|
#include "HECL/HECL.hpp"
|
2015-07-06 01:35:08 +00:00
|
|
|
|
|
|
|
namespace HECL
|
|
|
|
{
|
|
|
|
LogVisor::LogModule LogModule("HECL");
|
2015-08-05 01:54:35 +00:00
|
|
|
|
|
|
|
void SanitizePath(std::string& path)
|
|
|
|
{
|
|
|
|
path.erase(std::remove(path.begin(), path.end(), '\n'), path.end());
|
|
|
|
path.erase(std::remove(path.begin(), path.end(), '\r'), path.end());
|
2015-08-05 02:40:54 +00:00
|
|
|
std::transform(path.begin(), path.end(), path.begin(), [](const char a) -> char {
|
|
|
|
static const std::string illegals {"<>?*\"|"};
|
|
|
|
if (illegals.find_first_of(a) != std::string::npos)
|
|
|
|
return '_';
|
|
|
|
return a;
|
|
|
|
});
|
2015-08-05 01:54:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void SanitizePath(std::wstring& path)
|
|
|
|
{
|
|
|
|
path.erase(std::remove(path.begin(), path.end(), L'\n'), path.end());
|
|
|
|
path.erase(std::remove(path.begin(), path.end(), L'\r'), path.end());
|
2015-08-05 02:40:54 +00:00
|
|
|
std::transform(path.begin(), path.end(), path.begin(), [](const wchar_t a) -> wchar_t {
|
|
|
|
static const std::wstring illegals {L"<>?*\"|"};
|
|
|
|
if (illegals.find_first_of(a) != std::wstring::npos)
|
|
|
|
return L'_';
|
|
|
|
return a;
|
|
|
|
});
|
2015-08-05 01:54:35 +00:00
|
|
|
}
|
|
|
|
|
2015-07-06 01:35:08 +00:00
|
|
|
}
|