From 789895b4b9f99668b8b772f271d07d1ce3115742 Mon Sep 17 00:00:00 2001 From: chai Date: Fri, 5 Oct 2018 15:40:31 +0800 Subject: *update --- src/libjin/Graphics/Utf8.h | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 src/libjin/Graphics/Utf8.h (limited to 'src/libjin/Graphics/Utf8.h') diff --git a/src/libjin/Graphics/Utf8.h b/src/libjin/Graphics/Utf8.h new file mode 100644 index 0000000..d2d11fb --- /dev/null +++ b/src/libjin/Graphics/Utf8.h @@ -0,0 +1,44 @@ +#ifndef __LIBJIN_UTF8_H +#define __LIBJIN_UTF8_H + +namespace jin +{ +namespace graphics +{ + + typedef unsigned int Codepoint; + + class Utf8 + { + public: + class Iterator + { + public: + /* 返回unicode codepoint */ + Codepoint get(); + + private: + friend class Utf8; + Iterator(const Utf8&); + + const char* _p; + const Utf8& _utf8; + }; + + /* 拷贝raw包含文本终结符的长度 */ + Utf8(const char* raw, unsigned int length); + Iterator getIterator(); + + private: + friend class Utf8::Iterator; + ~Utf8(); + + char* _raw; + unsigned int _length; + + }; + +} +} + +#endif \ No newline at end of file -- cgit v1.1-26-g67d0