Fix encoding error in input profile filenames

- Controller profile filenames now encode unicode characters correctly
- Removed dependency on boost::filesystem. There is still an indirect dependency on it from another boost module it seems
- Refactored some code to use FileStream instead of ifstream/ofstream
This commit is contained in:
Exzap 2022-10-12 14:18:24 +02:00
parent 8b3f36ad50
commit f65dbe8437
4 changed files with 44 additions and 29 deletions

View file

@ -231,6 +231,26 @@ inline uint64 MakeU64(uint32 high, uint32 low)
return ((uint64)high << 32) | ((uint64)low);
}
static bool IsValidFilename(std::string_view sv)
{
for (auto& it : sv)
{
uint8 c = (uint8)it;
if (c < 0x20)
return false;
if (c == '.' || c == '#' || c == '/' || c == '\\' ||
c == '<' || c == '>' || c == '|' || c == ':' ||
c == '\"')
return false;
}
if (!sv.empty())
{
if (sv.back() == ' ' || sv.back() == '.')
return false;
}
return true;
}
// MAJOR; MINOR
std::pair<DWORD, DWORD> GetWindowsVersion();
bool IsWindows81OrGreater();