From ae2b1c4450434f6da9c25ee245359423f5728ed3 Mon Sep 17 00:00:00 2001 From: Bowon Ryu Date: Thu, 23 Feb 2023 21:47:11 +0900 Subject: [PATCH] [Tizen] Add IsSpace in TextAbstraction Change-Id: Ic615aa2c20e22bfa013f81fa28fa5a393ea946b5 Signed-off-by: Bowon Ryu --- dali/devel-api/text-abstraction/script.cpp | 6 ++++++ dali/devel-api/text-abstraction/script.h | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/dali/devel-api/text-abstraction/script.cpp b/dali/devel-api/text-abstraction/script.cpp index ef4ecff..bac6f8d 100644 --- a/dali/devel-api/text-abstraction/script.cpp +++ b/dali/devel-api/text-abstraction/script.cpp @@ -26,6 +26,7 @@ namespace { //TODO: Move the below defined characters to "defined-characters.h" constexpr unsigned int WHITE_SPACE_THRESHOLD = 0x21; ///< All characters below 0x21 are considered white spaces. +constexpr unsigned int CHAR_SPACE = 0x20; ///< Space. constexpr unsigned int CHAR_LF = 0x000A; ///< NL Line feed, new line. constexpr unsigned int CHAR_VT = 0x000B; ///< Vertical tab. constexpr unsigned int CHAR_FF = 0x000C; ///< NP Form feed, new page. @@ -993,6 +994,11 @@ bool IsWhiteSpace(Character character) return character < WHITE_SPACE_THRESHOLD; } +bool IsSpace(Character character) +{ + return CHAR_SPACE == character; +} + bool IsNewParagraph(Character character) { return ((CHAR_LF == character) || diff --git a/dali/devel-api/text-abstraction/script.h b/dali/devel-api/text-abstraction/script.h index 71d3087..f79d8ec 100644 --- a/dali/devel-api/text-abstraction/script.h +++ b/dali/devel-api/text-abstraction/script.h @@ -214,6 +214,15 @@ DALI_ADAPTOR_API Script GetCharacterScript(Character character); DALI_ADAPTOR_API bool IsWhiteSpace(Character character); /** + * @brief Whether the character is a space. + * + * @param[in] character The character. + * + * @return @e true if the character is a space. + */ +DALI_ADAPTOR_API bool IsSpace(Character character); + +/** * @brief Whether the character is a new paragraph character. * * @param[in] character The character. -- 2.7.4