aboutsummaryrefslogtreecommitdiff
path: root/src/libjin/Graphics/Utf8.h
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2018-10-05 15:40:31 +0800
committerchai <chaifix@163.com>2018-10-05 15:40:31 +0800
commit789895b4b9f99668b8b772f271d07d1ce3115742 (patch)
tree3ae85381358445b2c29c9a0afb59375de9a7ce66 /src/libjin/Graphics/Utf8.h
parent846d6ab0ec1033481574e8324a43fc547ecf5882 (diff)
*update
Diffstat (limited to 'src/libjin/Graphics/Utf8.h')
-rw-r--r--src/libjin/Graphics/Utf8.h44
1 files changed, 44 insertions, 0 deletions
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ıսij */
+ 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