25 #include "common/scummsys.h" 26 #include "common/util.h" 27 #include "common/str-enc.h" 28 #include "common/str-base.h" 75 U32String(
const value_type *beginP,
const value_type *endP) :
BaseString<u32char_type_t>(beginP, endP) {}
84 explicit U32String(
const char *str, CodePage page = kUtf8);
87 U32String(
const char *str, uint32 len, CodePage page = kUtf8);
90 U32String(
const char *beginP,
const char *endP, CodePage page = kUtf8);
145 StringEncodingResult
encode(
String &outString, CodePage page,
char errorChar)
const;
153 template<
class... TParam>
163 static int vformat(
const value_type *fmt,
const value_type *fmtEnd,
U32String &output, va_list args);
169 return (
const uint32 *)
_str;
200 static value_type* ustr_helper_itoa(
int num, value_type* str, uint base);
206 static value_type* ustr_helper_uitoa(uint num, value_type* str, uint base);
208 void decodeInternal(
const char *str, uint32 len, CodePage page);
209 void decodeOneByte(
const char *str, uint32 len, CodePage page);
210 void decodeWindows932(
const char *src, uint32 len);
211 void decodeWindows936(
const char *src, uint32 len);
212 void decodeWindows949(
const char *src, uint32 len);
213 void decodeWindows950(
const char *src, uint32 len);
214 void decodeJohab(
const char *src, uint32 len);
215 void decodeUTF8(
const char *str, uint32 len);
220 template<
class... TParam>
222 return formatInternal(&fmt, Common::forward<TParam>(param)...);
U32String(const value_type *str, uint32 len)
Definition: ustr.h:68
U32String(const U32String &str)
Definition: ustr.h:78
static int vformat(const value_type *fmt, const value_type *fmtEnd, U32String &output, va_list args)
static Common::U32String decodeUTF16Native(const uint16 *start, uint len)
bool operator==(const String &x) const
U32String transcodeChineseT2S() const
uint16 * encodeUTF16Native(uint *len=nullptr) const
uint32 unsigned_type
Definition: ustr.h:59
U32String & operator+=(const U32String &str)
Definition: str-base.h:32
U32String & operator=(const U32String &str)
String encode(CodePage page=kUtf8) const
uint16 * encodeUTF16BE(uint *len=nullptr) const
String toPrintable(const String &src, bool keepNewLines=true)
static U32String format(const U32String &fmt, TParam... param)
Definition: ustr.h:221
Definition: algorithm.h:29
DBCSString operator+(const DBCSString &x, const DBCSString &y)
U32String(const value_type *beginP, const value_type *endP)
Definition: ustr.h:75
U32String(U32String &&str)
Definition: ustr.h:81
char32_t u32char_type_t
Definition: ustr.h:41
uint16 * encodeUTF16LE(uint *len=nullptr) const
constexpr U32String()
Definition: ustr.h:62
const uint32 * u32_str() const
Definition: ustr.h:168
value_type * _str
Definition: str-base.h:60
U32String substr(size_t pos=0, size_t len=npos) const
U32String(const value_type *str)
Definition: ustr.h:65
bool operator!=(const String &x) const
static Common::U32String decodeUTF16BE(const uint16 *start, uint len)
static Common::U32String decodeUTF16LE(const uint16 *start, uint len)