mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-23 02:14:50 +00:00
Make ASCII test more explicit.
I will need isASCII() in tex2lyx as well.
This commit is contained in:
parent
c51449cac6
commit
6c54a081fa
@ -170,6 +170,12 @@ bool isAlnumASCII(char_type c)
|
||||
}
|
||||
|
||||
|
||||
bool isASCII(char_type c)
|
||||
{
|
||||
return c < 0x80;
|
||||
}
|
||||
|
||||
|
||||
namespace support {
|
||||
|
||||
int compare_no_case(docstring const & s, docstring const & s2)
|
||||
@ -403,14 +409,14 @@ bool isAscii(string const & str)
|
||||
|
||||
char lowercase(char c)
|
||||
{
|
||||
LASSERT(static_cast<unsigned char>(c) < 0x80, /**/);
|
||||
LASSERT(isASCII(c), /**/);
|
||||
return char(tolower(c));
|
||||
}
|
||||
|
||||
|
||||
char uppercase(char c)
|
||||
{
|
||||
LASSERT(static_cast<unsigned char>(c) < 0x80, /**/);
|
||||
LASSERT(isASCII(c), /**/);
|
||||
return char(toupper(c));
|
||||
}
|
||||
|
||||
|
@ -50,6 +50,9 @@ bool isDigitASCII(char_type c);
|
||||
/// return whether \p c is alpha or a digit in the ASCII range
|
||||
bool isAlnumASCII(char_type c);
|
||||
|
||||
/// return whether \p c is in the ASCII range
|
||||
bool isASCII(char_type c);
|
||||
|
||||
} // namespace lyx
|
||||
|
||||
#endif // TEXTUTILS_H
|
||||
|
Loading…
Reference in New Issue
Block a user