Move parts of MappingCommon out of DolphinQt

Some of the functions in MappingCommon would be useful to use on
mobile in the future.
This commit is contained in:
JosJuice
2022-02-20 18:32:39 +01:00
parent 9af9e791f6
commit 1bc057614e
8 changed files with 204 additions and 154 deletions

View File

@ -235,6 +235,14 @@ inline bool IsPrintableCharacter(char c)
return std::isprint(c, std::locale::classic());
}
/// Returns whether a character is a letter, i.e. whether 'a' <= c <= 'z' || 'A' <= c <= 'Z'
/// is true. Use this instead of calling std::isalpha directly to ensure
/// the C locale is being used and to avoid possibly undefined behaviour.
inline bool IsAlpha(char c)
{
return std::isalpha(c, std::locale::classic());
}
#ifdef _WIN32
std::vector<std::string> CommandLineToUtf8Argv(const wchar_t* command_line);
#endif