diff options
author | Paul Gilbert | 2016-05-14 15:48:15 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-07-10 16:39:35 -0400 |
commit | 68e230182c1f0524a536422bbb669788cf388782 (patch) | |
tree | 392d519196a1c3b966589b95d39064a0c03369ce /common | |
parent | e862d80cd2f57b3eebdedb9f87c11fa3b5106e6a (diff) | |
download | scummvm-rg350-68e230182c1f0524a536422bbb669788cf388782.tar.gz scummvm-rg350-68e230182c1f0524a536422bbb669788cf388782.tar.bz2 scummvm-rg350-68e230182c1f0524a536422bbb669788cf388782.zip |
TITANIC: Implement TTparser normalize
Diffstat (limited to 'common')
-rw-r--r-- | common/util.cpp | 7 | ||||
-rw-r--r-- | common/util.h | 11 |
2 files changed, 18 insertions, 0 deletions
diff --git a/common/util.cpp b/common/util.cpp index 8e0a2fd61f..62a1baf6ac 100644 --- a/common/util.cpp +++ b/common/util.cpp @@ -28,6 +28,7 @@ #define FORBIDDEN_SYMBOL_EXCEPTION_isspace #define FORBIDDEN_SYMBOL_EXCEPTION_isupper #define FORBIDDEN_SYMBOL_EXCEPTION_isprint +#define FORBIDDEN_SYMBOL_EXCEPTION_ispunct #include "common/util.h" @@ -150,4 +151,10 @@ bool isPrint(int c) { ENSURE_ASCII_CHAR(c); return isprint((byte)c); } + +bool isPunct(int c) { + ENSURE_ASCII_CHAR(c); + return ispunct((byte)c); +} + } // End of namespace Common diff --git a/common/util.h b/common/util.h index f51aa00925..1f635f3654 100644 --- a/common/util.h +++ b/common/util.h @@ -177,6 +177,17 @@ bool isUpper(int c); * @return true if the character is printable, false otherwise. */ bool isPrint(int c); + + +/** + * Test whether the given character is a punctuation character, + * (i.e not alphanumeric. + * + * @param c the character to test + * @return true if the character is punctuation, false otherwise. + */ +bool isPunct(int c); + } // End of namespace Common #endif |