diff options
author | 2013-01-24 16:14:19 -0800 | |
---|---|---|
committer | 2013-01-24 16:14:19 -0800 | |
commit | c33fc5f79c1dc95438027d6901e8c905e73b751a (patch) | |
tree | 1f039b539ca38d2a9fa2a87182227862a59e4bcc | |
parent | aca66ac9427267950eb8072f0bc691da146074d5 (diff) | |
parent | 447e96c057b9fd15697b5ef86d187e146a8754b4 (diff) | |
download | latinime-c33fc5f79c1dc95438027d6901e8c905e73b751a.tar.gz latinime-c33fc5f79c1dc95438027d6901e8c905e73b751a.tar.xz latinime-c33fc5f79c1dc95438027d6901e8c905e73b751a.zip |
am 447e96c0: Merge "add a function to char utils"
# Via Android (Google) Code Review (1) and Satoshi Kataoka (1)
* commit '447e96c057b9fd15697b5ef86d187e146a8754b4':
add a function to char utils
-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 |