diff options
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 | ||