+// ----------------------------------------------------------------------------
+// wxMBConvUTF16Base: for both LE and BE variants
+// ----------------------------------------------------------------------------
+
+class WXDLLIMPEXP_BASE wxMBConvUTF16Base : public wxMBConv
+{
+public:
+ enum { BYTES_PER_CHAR = 2 };
+
+ virtual size_t GetMBNulLen() const { return BYTES_PER_CHAR; }
+
+protected:
+ // return the length of the buffer using srcLen if it's not wxNO_LEN and
+ // computing the length ourselves if it is; also checks that the length is
+ // even if specified as we need an entire number of UTF-16 characters and
+ // returns wxNO_LEN which indicates error if it is odd
+ static size_t GetLength(const char *src, size_t srcLen);
+};
+
+// ----------------------------------------------------------------------------
+// wxMBConvUTF16LE (for conversion using UTF16 Little Endian encoding)
+// ----------------------------------------------------------------------------
+
+class WXDLLIMPEXP_BASE wxMBConvUTF16LE : public wxMBConvUTF16Base
+{
+public:
+ virtual size_t ToWChar(wchar_t *dst, size_t dstLen,
+ const char *src, size_t srcLen = wxNO_LEN) const;
+ virtual size_t FromWChar(char *dst, size_t dstLen,
+ const wchar_t *src, size_t srcLen = wxNO_LEN) const;
+ virtual wxMBConv *Clone() const { return new wxMBConvUTF16LE; }
+};
+
+// ----------------------------------------------------------------------------
+// wxMBConvUTF16BE (for conversion using UTF16 Big Endian encoding)
+// ----------------------------------------------------------------------------
+
+class WXDLLIMPEXP_BASE wxMBConvUTF16BE : public wxMBConvUTF16Base
+{
+public:
+ virtual size_t ToWChar(wchar_t *dst, size_t dstLen,
+ const char *src, size_t srcLen = wxNO_LEN) const;
+ virtual size_t FromWChar(char *dst, size_t dstLen,
+ const wchar_t *src, size_t srcLen = wxNO_LEN) const;
+ virtual wxMBConv *Clone() const { return new wxMBConvUTF16BE; }
+};
+
+// ----------------------------------------------------------------------------
+// wxMBConvUTF32Base: base class for both LE and BE variants
+// ----------------------------------------------------------------------------
+
+class WXDLLIMPEXP_BASE wxMBConvUTF32Base : public wxMBConv
+{
+public:
+ enum { BYTES_PER_CHAR = 4 };
+
+ virtual size_t GetMBNulLen() const { return BYTES_PER_CHAR; }
+
+protected:
+ // this is similar to wxMBConvUTF16Base method with the same name except
+ // that, of course, it verifies that length is divisible by 4 if given and
+ // not by 2
+ static size_t GetLength(const char *src, size_t srcLen);
+};
+
+// ----------------------------------------------------------------------------
+// wxMBConvUTF32LE (for conversion using UTF32 Little Endian encoding)
+// ----------------------------------------------------------------------------
+
+class WXDLLIMPEXP_BASE wxMBConvUTF32LE : public wxMBConvUTF32Base
+{
+public:
+ virtual size_t ToWChar(wchar_t *dst, size_t dstLen,
+ const char *src, size_t srcLen = wxNO_LEN) const;
+ virtual size_t FromWChar(char *dst, size_t dstLen,
+ const wchar_t *src, size_t srcLen = wxNO_LEN) const;
+ virtual wxMBConv *Clone() const { return new wxMBConvUTF32LE; }
+};
+
+// ----------------------------------------------------------------------------
+// wxMBConvUTF32BE (for conversion using UTF32 Big Endian encoding)
+// ----------------------------------------------------------------------------
+
+class WXDLLIMPEXP_BASE wxMBConvUTF32BE : public wxMBConvUTF32Base
+{
+public:
+ virtual size_t ToWChar(wchar_t *dst, size_t dstLen,
+ const char *src, size_t srcLen = wxNO_LEN) const;
+ virtual size_t FromWChar(char *dst, size_t dstLen,
+ const wchar_t *src, size_t srcLen = wxNO_LEN) const;
+ virtual wxMBConv *Clone() const { return new wxMBConvUTF32BE; }
+};