MB2WC/WC2MB are not pure virtual any longer, implement them in terms of To/FromWChar()

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38542 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2006-04-04 13:04:47 +00:00
parent 483b0434bf
commit 509da4510f
2 changed files with 32 additions and 2 deletions

View File

@@ -316,6 +316,30 @@ wxMBConv::FromWChar(char *dst, size_t dstLen,
return dstWritten;
}
size_t wxMBConv::MB2WC(wchar_t *out, const char *in, size_t outLen) const
{
size_t rc = ToWChar(out, outLen, in);
if ( rc != wxCONV_FAILED )
{
// ToWChar() returns the buffer length, i.e. including the trailing
// NUL, while this method doesn't take it into account
rc--;
}
return rc;
}
size_t wxMBConv::WC2MB(char *out, const wchar_t *in, size_t outLen) const
{
size_t rc = FromWChar(out, outLen, in);
if ( rc != wxCONV_FAILED )
{
rc -= GetMBNulLen();
}
return rc;
}
wxMBConv::~wxMBConv()
{
// nothing to do here (necessary for Darwin linking probably)