diff options
| author | Willem Jan Palenstijn | 2012-02-21 11:33:32 -0800 |
|---|---|---|
| committer | Willem Jan Palenstijn | 2012-02-21 11:33:32 -0800 |
| commit | 9ffe3e11d905b5af194dd3265e2fe11545bf5020 (patch) | |
| tree | f9fb97d7eb2368d0123aa3bd9d91c560cded3315 /common/util.h | |
| parent | 80b34398174973b6d70673fce94a8a1f670c3f4d (diff) | |
| parent | 02ebd552141173775b9462f4414083d3b8d49a80 (diff) | |
| download | scummvm-rg350-9ffe3e11d905b5af194dd3265e2fe11545bf5020.tar.gz scummvm-rg350-9ffe3e11d905b5af194dd3265e2fe11545bf5020.tar.bz2 scummvm-rg350-9ffe3e11d905b5af194dd3265e2fe11545bf5020.zip | |
Merge pull request #182 from fingolfin/forbid-ctype
ALL: Avoid using is* macros from ctype.h
Diffstat (limited to 'common/util.h')
| -rw-r--r-- | common/util.h | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/common/util.h b/common/util.h index dfa57d7259..617bc3dcfa 100644 --- a/common/util.h +++ b/common/util.h @@ -133,6 +133,70 @@ extern void hexdump(const byte * data, int len, int bytesPerLine = 16, int start */ bool parseBool(const String &val, bool &valAsBool); + +/** + * Test whether the given character is alphanumeric (a-z, A-Z, 0-9). + * If the parameter is outside the range of a signed or unsigned char, then + * false is returned. + * + * @param c the character to test + * @return true if the character is alphanumeric, false otherwise. + */ +bool isAlnum(int c); + +/** + * Test whether the given character is an alphabetic letter (a-z, A-Z). + * If the parameter is outside the range of a signed or unsigned char, then + * false is returned. + * + * @param c the character to test + * @return true if the character is TODO, false otherwise. + */ +bool isAlpha(int c); + +/** + * Test whether the given character is a decimal-digit (0-9). + * If the parameter is outside the range of a signed or unsigned char, then + * false is returned. + * + * @param c the character to test + * @return true if the character is a decimal-digit, false otherwise. + */ +bool isDigit(int c); + +/** + * Test whether the given character is a lower-case letter (a-z). + * If the parameter is outside the range of a signed or unsigned char, then + * false is returned. + * + * @param c the character to test + * @return true if the character is a lower-case letter, false otherwise. + */ +bool isLower(int c); + +/** + * Test whether the given character is a white-space. + * White-space characters are ' ', '\t', '\r', '\n', '\v', '\f'. + * + * If the parameter is outside the range of a signed or unsigned char, then + * false is returned. + * + * @param c the character to test + * @return true if the character is a white-space, false otherwise. + */ +bool isSpace(int c); + +/** + * Test whether the given character is an upper-case letter (A-Z). + * If the parameter is outside the range of a signed or unsigned char, then + * false is returned. + * + * @param c the character to test + * @return true if the character is an upper-case letter, false otherwise. + */ +bool isUpper(int c); + + /** * List of game language. */ |
