aboutsummaryrefslogtreecommitdiff
path: root/src/unstable/utfstring.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/unstable/utfstring.cpp')
-rw-r--r--src/unstable/utfstring.cpp15
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"
14using Bu::sio; 15using Bu::sio;
15 16
16Bu::UtfString::UtfString() 17Bu::UtfString::UtfString()
@@ -86,6 +87,13 @@ void Bu::UtfString::append( UtfChar ch )
86 } 87 }
87} 88}
88 89
90void Bu::UtfString::append( const UtfString &rSrc )
91{
92 aData.append( rSrc.aData );
93 iRawLen += rSrc.iRawLen;
94 iCharLen += rSrc.iCharLen;
95}
96
89void Bu::UtfString::setUtf8( const Bu::String &sInput ) 97void 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
479Bu::String Bu::UtfString::get( Encoding eEnc )
480{
481 Bu::MemBuf mb;
482 write( mb, eEnc );
483 return mb.getString();
484}
485
471void Bu::UtfString::debug() 486void Bu::UtfString::debug()
472{ 487{
473 sio << "Raw Utf16: "; 488 sio << "Raw Utf16: ";