diff --git a/inc/hgl/type/UnicodeBlocks.h b/inc/hgl/type/UnicodeBlocks.h index 1980122..76b75a8 100644 --- a/inc/hgl/type/UnicodeBlocks.h +++ b/inc/hgl/type/UnicodeBlocks.h @@ -338,9 +338,10 @@ namespace hgl */ bool IsInUnicodeBlock(const UnicodeBlock &type,const u32char ch); - bool isLatin(const u32char ch); //判断当前字符是否是拉丁字符 - bool isCJK (const u16char ch); //判断当前字符是否是CJK字符 - bool isCJK (const u32char ch); //判断当前字符是否是CJK字符 - bool isEmoji(const u32char ch); //判断当前字符是否是表情符号 + bool isLatin (const u32char ch); ///判断当前字符是否是拉丁字符 + bool isCJK (const u16char ch); ///判断当前字符是否是CJK字符 + bool isCJK (const u32char ch); ///判断当前字符是否是CJK字符 + bool isEmoji (const u32char ch); ///判断当前字符是否是表情符号 + bool isPunctuation (const u32char ch); ///判断当前字符是否是标点符号 }//namespace hgl #endif//HGL_UNICODE_BLOCKS_INCLUDE diff --git a/src/Other/UnicodeBlocks.cpp b/src/Other/UnicodeBlocks.cpp index f0666c6..8d27b9c 100644 --- a/src/Other/UnicodeBlocks.cpp +++ b/src/Other/UnicodeBlocks.cpp @@ -452,5 +452,19 @@ namespace hgl 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 }//namespace hgl \ No newline at end of file