arabica/Utils/utf16beucs2codecvt.h

57 lines
1.7 KiB
C
Raw Normal View History

2003-09-02 13:23:52 +02:00
#ifndef ARABICA_UTF16BEUCS2_CODECVT_H
#define ARABICA_UTF16BEUCS2_CODECVT_H
2002-06-21 13:16:28 +02:00
//---------------------------------------------------------------------------
2003-09-02 13:23:52 +02:00
// class utf16beucs2codecvt
2002-06-21 13:16:28 +02:00
// This facet converts from Unicode (UCS-2) wchar_ts to
2003-09-02 13:23:52 +02:00
// a big-endian UTF16 byte stream
2002-06-21 13:16:28 +02:00
//
// $Id$
//---------------------------------------------------------------------------
#include <locale>
2003-08-29 23:09:00 +02:00
#if(_MSC_VER < 1300)
2002-06-21 13:16:28 +02:00
namespace std {
typedef ::mbstate_t mbstate_t;
}
#endif
2003-09-02 13:23:52 +02:00
class utf16beucs2codecvt : public std::codecvt<wchar_t, char, std::mbstate_t>
2002-06-21 13:16:28 +02:00
{
protected:
2003-09-02 13:23:52 +02:00
virtual ~utf16beucs2codecvt() { }
2002-06-21 13:16:28 +02:00
virtual result do_out(std::mbstate_t&,
const wchar_t* from,
const wchar_t* from_end,
const wchar_t*& from_next,
char* to,
char* to_limit,
char*& to_next) const;
virtual result do_in(std::mbstate_t&,
const char* from,
const char* from_end,
const char*& from_next,
wchar_t* to,
wchar_t* to_limit,
wchar_t*& to_next) const;
virtual result do_unshift(std::mbstate_t&,
char*,
char*,
char*&) const;
2003-09-02 13:23:52 +02:00
virtual int do_encoding() const throw() { return 2; }
2002-06-21 13:16:28 +02:00
2003-08-29 23:09:00 +02:00
virtual bool do_always_noconv() const throw() { return false; }
2002-06-21 13:16:28 +02:00
virtual int do_length(const std::mbstate_t&,
const char* from,
const char* end,
size_t max) const;
2003-09-02 13:23:52 +02:00
virtual int do_max_length() const throw() { return 2; }
}; // class utf16beucs2codecvt
2002-06-21 13:16:28 +02:00
#endif