add isPunctuation()

This commit is contained in:
hyzboy 2020-07-21 16:32:19 +08:00
parent 517128965c
commit 0e9bb594d7
2 changed files with 19 additions and 4 deletions

View File

@ -338,9 +338,10 @@ namespace hgl
*/ */
bool IsInUnicodeBlock(const UnicodeBlock &type,const u32char ch); bool IsInUnicodeBlock(const UnicodeBlock &type,const u32char ch);
bool isLatin(const u32char ch); //判断当前字符是否是拉丁字符 bool isLatin (const u32char ch); ///判断当前字符是否是拉丁字符
bool isCJK (const u16char ch); //判断当前字符是否是CJK字符 bool isCJK (const u16char ch); ///判断当前字符是否是CJK字符
bool isCJK (const u32char ch); //判断当前字符是否是CJK字符 bool isCJK (const u32char ch); ///判断当前字符是否是CJK字符
bool isEmoji(const u32char ch); //判断当前字符是否是表情符号 bool isEmoji (const u32char ch); ///判断当前字符是否是表情符号
bool isPunctuation (const u32char ch); ///判断当前字符是否是标点符号
}//namespace hgl }//namespace hgl
#endif//HGL_UNICODE_BLOCKS_INCLUDE #endif//HGL_UNICODE_BLOCKS_INCLUDE

View File

@ -452,5 +452,19 @@ namespace hgl
return(false); return(false);
} }
/**
*
*/
bool isPunctuation(const u32char ch)
{
CHECK_UNICODE_BLOCKS(general_punctuation)
CHECK_UNICODE_BLOCKS(supplemental_punctuation)
CHECK_UNICODE_BLOCKS(cjk_symbols_and_punctuation)
CHECK_UNICODE_BLOCKS(cuneiform_numbers_and_punctuation)
CHECK_UNICODE_BLOCKS(ideographic_symbols_and_punctuation)
return(false);
}
#undef CHECK_UNICODE_BLOCKS #undef CHECK_UNICODE_BLOCKS
}//namespace hgl }//namespace hgl