diff options
author | 2013-01-24 16:10:31 +0900 | |
---|---|---|
committer | 2013-01-24 16:26:58 +0900 | |
commit | 75070a519a4ead5a19cbd8bed92fe9ce279f49e7 (patch) | |
tree | 02354cce43c4bc9348f966d54a4a3fbb7f802312 | |
parent | 9d18c6dd38c4d5632a5d5a5c26f567b9f6f7f969 (diff) | |
download | latinime-75070a519a4ead5a19cbd8bed92fe9ce279f49e7.tar.gz latinime-75070a519a4ead5a19cbd8bed92fe9ce279f49e7.tar.xz latinime-75070a519a4ead5a19cbd8bed92fe9ce279f49e7.zip |
add a function to char utils
Change-Id: Id0b45a824a4655d8aba1bf6e1c6df3acd2cbe850
Diffstat (limited to '')
-rw-r--r-- | native/jni/src/char_utils.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/native/jni/src/char_utils.h b/native/jni/src/char_utils.h index 60da203b9..7a4384dbb 100644 --- a/native/jni/src/char_utils.h +++ b/native/jni/src/char_utils.h @@ -72,5 +72,16 @@ inline static bool isSkippableCodePoint(const int codePoint) { // TODO: Do not hardcode here return codePoint == KEYCODE_SINGLE_QUOTE || codePoint == KEYCODE_HYPHEN_MINUS; } + +inline static int getCodePointCount(const int arraySize, const int *const codePoints) { + int size = 0; + for (; size < arraySize; ++size) { + if (codePoints[size] == '\0') { + break; + } + } + return size; +} + } // namespace latinime #endif // LATINIME_CHAR_UTILS_H |