From bc5fc82538f220f62f231d5bdda5910752156a32 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Mon, 4 Apr 2011 03:12:32 +0000 Subject: Really just made some decisions about the overall functionality of the UtfString and now I'm ready to put some more of the basics into action. --- src/utfstring.h | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/utfstring.h b/src/utfstring.h index 3bdf51c..6f85e93 100644 --- a/src/utfstring.h +++ b/src/utfstring.h @@ -12,21 +12,40 @@ namespace Bu { - class String; + /** + * UtfChar isn't actually a character, unicode specifies "code points" not + * characters. The main reason for this is that not all code points define + * usable characters. Some control text directionality, some apply + * properties to other code points which are characters. However, most of + * these distinctions are only important when implementing displays that + * comply with the Unicode standard fully. + */ + typedef uint32_t UtfChar; class UtfString { public: + enum Encoding + { + Utf8, + Utf16, + Utf16be, + Utf16le, + Utf32, + Ucs16, + GuessEncoding + }; + UtfString(); + UtfString( const Bu::String &sInput, Encoding eEnc=Utf8 ); virtual ~UtfString(); - typedef uint32_t point; - static void debugUtf8( const Bu::String &sUtf8 ); private: -// typedef BasicString RawString; -// RawString rsStore; + uint16_t *pData; + int iRawLen; + int iCharLen; }; }; -- cgit v1.2.3