diff options
Diffstat (limited to 'common/ustr.h')
-rw-r--r-- | common/ustr.h | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/common/ustr.h b/common/ustr.h index 3d76eda765..affa167ae4 100644 --- a/common/ustr.h +++ b/common/ustr.h @@ -24,6 +24,7 @@ #define COMMON_USTR_H #include "common/scummsys.h" +#include "common/str-enc.h" namespace Common { @@ -214,6 +215,9 @@ public: return begin() + size(); } + /** Python-like method **/ + String encode(CodePage page = kUtf8) const; + private: void makeUnique(); void ensureCapacity(uint32 new_size, bool keep_old); @@ -221,28 +225,12 @@ private: void decRefCount(int *oldRefCount); void initWithCStr(const value_type *str, uint32 len); void initWithCStr(const char *str, uint32 len); -}; -U32String convertUtf8ToUtf32(const String &str); -String convertUtf32ToUtf8(const U32String &str); - -enum CodePage { - kUtf8, - kWindows1250, - kWindows1251, - kWindows1252, - kWindows1253, - kWindows1254, - kWindows1255, - kWindows1257 + void encodeUTF8(String &dst) const; + void encodeOneByte(String &dst, CodePage page) const; }; - U32String operator+(const U32String &x, const U32String &y); - -U32String convertToU32String(const char *str, CodePage page = kUtf8); -String convertFromU32String(const U32String &str, CodePage page = kUtf8); - } // End of namespace Common #endif |