diff options
author | 2013-01-24 07:42:19 +0000 | |
---|---|---|
committer | 2013-01-24 07:42:20 +0000 | |
commit | 447e96c057b9fd15697b5ef86d187e146a8754b4 (patch) | |
tree | c4f2806ff03f7ec31c90b517b4463f2d4a1158ea /native/jni/src | |
parent | 7324052ad73d9ead3612ddd3b64f9ed96e6bbcab (diff) | |
parent | 75070a519a4ead5a19cbd8bed92fe9ce279f49e7 (diff) | |
download | latinime-447e96c057b9fd15697b5ef86d187e146a8754b4.tar.gz latinime-447e96c057b9fd15697b5ef86d187e146a8754b4.tar.xz latinime-447e96c057b9fd15697b5ef86d187e146a8754b4.zip |
Merge "add a function to char utils"
Diffstat (limited to 'native/jni/src')
-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 |