mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-12-16 04:36:59 +00:00
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:
parent
8b3f36ad50
commit
f65dbe8437
4 changed files with 44 additions and 29 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue