diff options
Diffstat (limited to '')
-rw-r--r-- | src/unstable/utfstring.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/unstable/utfstring.cpp b/src/unstable/utfstring.cpp index a5d6605..1c6813c 100644 --- a/src/unstable/utfstring.cpp +++ b/src/unstable/utfstring.cpp | |||
@@ -11,6 +11,7 @@ | |||
11 | #include "bu/stream.h" | 11 | #include "bu/stream.h" |
12 | #include "bu/config.h" | 12 | #include "bu/config.h" |
13 | #include "bu/sio.h" | 13 | #include "bu/sio.h" |
14 | #include "bu/membuf.h" | ||
14 | using Bu::sio; | 15 | using Bu::sio; |
15 | 16 | ||
16 | Bu::UtfString::UtfString() | 17 | Bu::UtfString::UtfString() |
@@ -86,6 +87,13 @@ void Bu::UtfString::append( UtfChar ch ) | |||
86 | } | 87 | } |
87 | } | 88 | } |
88 | 89 | ||
90 | void Bu::UtfString::append( const UtfString &rSrc ) | ||
91 | { | ||
92 | aData.append( rSrc.aData ); | ||
93 | iRawLen += rSrc.iRawLen; | ||
94 | iCharLen += rSrc.iCharLen; | ||
95 | } | ||
96 | |||
89 | void Bu::UtfString::setUtf8( const Bu::String &sInput ) | 97 | void Bu::UtfString::setUtf8( const Bu::String &sInput ) |
90 | { | 98 | { |
91 | static uint8_t lmask[8] = { | 99 | static uint8_t lmask[8] = { |
@@ -468,6 +476,13 @@ Bu::UtfChar Bu::UtfString::nextChar( int &iIndex ) | |||
468 | } | 476 | } |
469 | } | 477 | } |
470 | 478 | ||
479 | Bu::String Bu::UtfString::get( Encoding eEnc ) | ||
480 | { | ||
481 | Bu::MemBuf mb; | ||
482 | write( mb, eEnc ); | ||
483 | return mb.getString(); | ||
484 | } | ||
485 | |||
471 | void Bu::UtfString::debug() | 486 | void Bu::UtfString::debug() |
472 | { | 487 | { |
473 | sio << "Raw Utf16: "; | 488 | sio << "Raw Utf16: "; |