summaryrefslogtreecommitdiff
path: root/Source/Kernel/Library/WChar.class.h
diff options
context:
space:
mode:
authorAlexis211 <alexis211@gmail.com>2009-09-15 18:59:24 +0200
committerAlexis211 <alexis211@gmail.com>2009-09-15 18:59:24 +0200
commite2e0f21d932224434cb6121165dc00f0c1bb3bdd (patch)
treed54e5d2c6cfb3aa734d974728ee1fe5ac97482a2 /Source/Kernel/Library/WChar.class.h
parent0211692f62cdd934ea9c802bc5b09d63eb4399af (diff)
downloadMelon-e2e0f21d932224434cb6121165dc00f0c1bb3bdd.tar.gz
Melon-e2e0f21d932224434cb6121165dc00f0c1bb3bdd.zip
cat command now uses the File class.
Diffstat (limited to 'Source/Kernel/Library/WChar.class.h')
-rw-r--r--Source/Kernel/Library/WChar.class.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/Source/Kernel/Library/WChar.class.h b/Source/Kernel/Library/WChar.class.h
index 9ddccd1..fc00577 100644
--- a/Source/Kernel/Library/WChar.class.h
+++ b/Source/Kernel/Library/WChar.class.h
@@ -3,20 +3,32 @@
#include <Core/common.wtf.h>
+enum {
+ UE_UTF8,
+ UE_UTF16,
+ UE_UTF32,
+};
+
+union uchar_repr_t {
+ char c[4];
+ u32int i;
+};
+
struct WChar {
u32int value;
- static WChar CP437[];
+ static WChar CP437[]; //Codepage 437, used for conversion from/to ascii
WChar(); //Creates a null character
WChar(char c); //From ascii character
- WChar(const char* c); //From utf8 string
+ WChar(const char* c, u8int encoding = UE_UTF8); //From utf8 string
- static u32int utf8len(const char* c); //Returns count of utf8 characters in string
+ static u32int utfLen(const char* c, u8int encoding = UE_UTF8); //Returns count of utf8 characters in string
void affectAscii(char c);
u32int affectUtf8(const char* c);
void affectUtf16(const char* c);
void affectUtf32(const char* c);
+
u8int toAscii();
inline WChar operator+ (u32int other) {