diff options
author | Mike Buland <eichlan@xagasoft.com> | 2011-04-04 03:12:32 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2011-04-04 03:12:32 +0000 |
commit | bc5fc82538f220f62f231d5bdda5910752156a32 (patch) | |
tree | ee121aa5aaa076217f9ca8a9587efc1b38715c58 /src/utfstring.h | |
parent | f95c109bd7a0df99cdc34f1e8d77b8d8a767802c (diff) | |
download | libbu++-bc5fc82538f220f62f231d5bdda5910752156a32.tar.gz libbu++-bc5fc82538f220f62f231d5bdda5910752156a32.tar.bz2 libbu++-bc5fc82538f220f62f231d5bdda5910752156a32.tar.xz libbu++-bc5fc82538f220f62f231d5bdda5910752156a32.zip |
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.
Diffstat (limited to 'src/utfstring.h')
-rw-r--r-- | src/utfstring.h | 29 |
1 files changed, 24 insertions, 5 deletions
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 @@ | |||
12 | 12 | ||
13 | namespace Bu | 13 | namespace Bu |
14 | { | 14 | { |
15 | class String; | 15 | /** |
16 | * UtfChar isn't actually a character, unicode specifies "code points" not | ||
17 | * characters. The main reason for this is that not all code points define | ||
18 | * usable characters. Some control text directionality, some apply | ||
19 | * properties to other code points which are characters. However, most of | ||
20 | * these distinctions are only important when implementing displays that | ||
21 | * comply with the Unicode standard fully. | ||
22 | */ | ||
23 | typedef uint32_t UtfChar; | ||
16 | 24 | ||
17 | class UtfString | 25 | class UtfString |
18 | { | 26 | { |
19 | public: | 27 | public: |
28 | enum Encoding | ||
29 | { | ||
30 | Utf8, | ||
31 | Utf16, | ||
32 | Utf16be, | ||
33 | Utf16le, | ||
34 | Utf32, | ||
35 | Ucs16, | ||
36 | GuessEncoding | ||
37 | }; | ||
38 | |||
20 | UtfString(); | 39 | UtfString(); |
40 | UtfString( const Bu::String &sInput, Encoding eEnc=Utf8 ); | ||
21 | virtual ~UtfString(); | 41 | virtual ~UtfString(); |
22 | 42 | ||
23 | typedef uint32_t point; | ||
24 | |||
25 | static void debugUtf8( const Bu::String &sUtf8 ); | 43 | static void debugUtf8( const Bu::String &sUtf8 ); |
26 | 44 | ||
27 | private: | 45 | private: |
28 | // typedef BasicString<uint16_t> RawString; | 46 | uint16_t *pData; |
29 | // RawString rsStore; | 47 | int iRawLen; |
48 | int iCharLen; | ||
30 | }; | 49 | }; |
31 | }; | 50 | }; |
32 | 51 | ||