25 #include "common/scummsys.h" 26 #include "common/util.h" 27 #include "common/str-enc.h" 28 #include "common/str-base.h" 71 U32String(
const value_type *beginP,
const value_type *endP) :
BaseString<u32char_type_t>(beginP, endP) {}
80 explicit U32String(
const char *str, CodePage page = kUtf8);
83 U32String(
const char *str, uint32 len, CodePage page = kUtf8);
86 U32String(
const char *beginP,
const char *endP, CodePage page = kUtf8);
144 StringEncodingResult
encode(
String &outString, CodePage page,
char errorChar)
const;
152 template<
class... TParam>
162 static int vformat(
const value_type *fmt,
const value_type *fmtEnd,
U32String &output, va_list args);
195 static value_type* ustr_helper_itoa(
int num, value_type* str, uint base);
201 static value_type* ustr_helper_uitoa(uint num, value_type* str, uint base);
203 void decodeInternal(
const char *str, uint32 len, CodePage page);
204 void decodeOneByte(
const char *str, uint32 len, CodePage page);
205 void decodeWindows932(
const char *src, uint32 len);
206 void decodeWindows936(
const char *src, uint32 len);
207 void decodeWindows949(
const char *src, uint32 len);
208 void decodeWindows950(
const char *src, uint32 len);
209 void decodeJohab(
const char *src, uint32 len);
210 void decodeUTF8(
const char *str, uint32 len);
215 template<
class... TParam>
217 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:74
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
U32String(size_t n, value_type c)
Definition: ustr.h:95
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:216
Definition: algorithm.h:29
DBCSString operator+(const DBCSString &x, const DBCSString &y)
U32String(const value_type *beginP, const value_type *endP)
Definition: ustr.h:71
U32String(U32String &&str)
Definition: ustr.h:77
char32_t u32char_type_t
Definition: ustr.h:41
uint16 * encodeUTF16LE(uint *len=nullptr) const
constexpr U32String()
Definition: ustr.h:62
constexpr U32String(value_type c)
Definition: ustr.h:92
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)