diff options
Diffstat (limited to 'src/unstable/utfstring.h')
-rw-r--r-- | src/unstable/utfstring.h | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/src/unstable/utfstring.h b/src/unstable/utfstring.h index 5a72948..3c64a75 100644 --- a/src/unstable/utfstring.h +++ b/src/unstable/utfstring.h | |||
@@ -72,6 +72,7 @@ namespace Bu | |||
72 | 72 | ||
73 | UtfString(); | 73 | UtfString(); |
74 | UtfString( const Bu::String &sInput, Encoding eEnc=Utf8 ); | 74 | UtfString( const Bu::String &sInput, Encoding eEnc=Utf8 ); |
75 | UtfString( const Bu::Blob &sInput, Encoding eEnc=Utf8 ); | ||
75 | UtfString( const char *sInput, Encoding eEnc=Utf8 ); | 76 | UtfString( const char *sInput, Encoding eEnc=Utf8 ); |
76 | virtual ~UtfString(); | 77 | virtual ~UtfString(); |
77 | 78 | ||
@@ -182,6 +183,14 @@ namespace Bu | |||
182 | * string literals in code. | 183 | * string literals in code. |
183 | */ | 184 | */ |
184 | void set( const Bu::String &sInput, Encoding eEnc=Utf8 ); | 185 | void set( const Bu::String &sInput, Encoding eEnc=Utf8 ); |
186 | |||
187 | /** | ||
188 | * Set the value of the entire string based on the given input and | ||
189 | * encoding. The default encoding is Utf8, which is compatible with | ||
190 | * 7-bit ascii, so it's a great choice for setting UtfStrings from | ||
191 | * string literals in code. | ||
192 | */ | ||
193 | void set( const Bu::Blob &bInput, Encoding eEnc=Utf8 ); | ||
185 | 194 | ||
186 | /** | 195 | /** |
187 | * This encodes the UtfString in the given encoding and outputs it to | 196 | * This encodes the UtfString in the given encoding and outputs it to |
@@ -204,10 +213,10 @@ namespace Bu | |||
204 | 213 | ||
205 | /** | 214 | /** |
206 | * This encodes the UtfString in the given encoding and returns it as | 215 | * This encodes the UtfString in the given encoding and returns it as |
207 | * a binary Bu::String. Like write, this also includes the proper BOM | 216 | * a binary Bu::Blob. Like write, this also includes the proper BOM |
208 | * at the begining. | 217 | * at the begining. |
209 | */ | 218 | */ |
210 | Bu::String get( Encoding eEnc=Utf8 ) const; | 219 | Bu::Blob get( Encoding eEnc=Utf8 ) const; |
211 | 220 | ||
212 | void debug() const; | 221 | void debug() const; |
213 | 222 | ||
@@ -228,7 +237,7 @@ namespace Bu | |||
228 | UtfChar nextChar( int &iIndex ) const; | 237 | UtfChar nextChar( int &iIndex ) const; |
229 | 238 | ||
230 | bool operator==( const Bu::UtfString &rhs ) const; | 239 | bool operator==( const Bu::UtfString &rhs ) const; |
231 | bool operator==( const Bu::String &rhs ) const; | 240 | bool operator==( const Bu::Blob &rhs ) const; |
232 | bool operator==( const char *rhs ) const; | 241 | bool operator==( const char *rhs ) const; |
233 | UtfString &operator+=( const Bu::UtfString &rhs ); | 242 | UtfString &operator+=( const Bu::UtfString &rhs ); |
234 | UtfString &operator+=( const UtfChar &rhs ); | 243 | UtfString &operator+=( const UtfChar &rhs ); |
@@ -241,13 +250,13 @@ namespace Bu | |||
241 | private: | 250 | private: |
242 | void append16( uint16_t i ) { aData.append( i ); } | 251 | void append16( uint16_t i ) { aData.append( i ); } |
243 | 252 | ||
244 | void setUtf8( const Bu::String &sInput ); | 253 | void setUtf8( const Bu::Blob &sInput ); |
245 | void setUtf16( const Bu::String &sInput ); | 254 | void setUtf16( const Bu::Blob &sInput ); |
246 | void setUtf16be( const Bu::String &sInput ); | 255 | void setUtf16be( const Bu::Blob &sInput ); |
247 | void setUtf16le( const Bu::String &sInput ); | 256 | void setUtf16le( const Bu::Blob &sInput ); |
248 | void setUtf32( const Bu::String &sInput ); | 257 | void setUtf32( const Bu::Blob &sInput ); |
249 | void setUtf32be( const Bu::String &sInput ); | 258 | void setUtf32be( const Bu::Blob &sInput ); |
250 | void setUtf32le( const Bu::String &sInput ); | 259 | void setUtf32le( const Bu::Blob &sInput ); |
251 | 260 | ||
252 | void writeUtf8( Bu::Stream &sOut ) const; | 261 | void writeUtf8( Bu::Stream &sOut ) const; |
253 | void writeUtf16be( Bu::Stream &sOut ) const; | 262 | void writeUtf16be( Bu::Stream &sOut ) const; |