mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
StringUtil: Move IsPrintableCharacter() into Common namespace
This commit is contained in:
@ -230,14 +230,6 @@ std::string ThousandSeparate(I value, int spaces = 0)
|
||||
#endif
|
||||
}
|
||||
|
||||
/// Returns whether a character is printable, i.e. whether 0x20 <= c <= 0x7e is true.
|
||||
/// Use this instead of calling std::isprint directly to ensure
|
||||
/// the C locale is being used and to avoid possibly undefined behaviour.
|
||||
inline bool IsPrintableCharacter(char c)
|
||||
{
|
||||
return std::isprint(c, std::locale::classic());
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
std::vector<std::string> CommandLineToUtf8Argv(const wchar_t* command_line);
|
||||
#endif
|
||||
@ -246,6 +238,14 @@ std::string GetEscapedHtml(std::string html);
|
||||
|
||||
namespace Common
|
||||
{
|
||||
/// Returns whether a character is printable, i.e. whether 0x20 <= c <= 0x7e is true.
|
||||
/// Use this instead of calling std::isprint directly to ensure
|
||||
/// the C locale is being used and to avoid possibly undefined behaviour.
|
||||
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.
|
||||
|
Reference in New Issue
Block a user