added wxTextOutputStream::Flush(): this is necessary with the stateful encodings, such as UTF-7

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53890 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2008-06-01 03:09:25 +00:00
parent 9d653e810c
commit ca8cf4fffb
4 changed files with 33 additions and 2 deletions

View File

@@ -426,6 +426,19 @@ wxTextOutputStream& wxTextOutputStream::PutChar(wxChar c)
return *this;
}
void wxTextOutputStream::Flush()
{
#if wxUSE_UNICODE
const size_t len = m_conv->FromWChar(NULL, 0, L"", 1);
if ( len > m_conv->GetMBNulLen() )
{
wxCharBuffer buf(len);
m_conv->FromWChar(buf.data(), len, L"", 1);
m_output.Write(buf, len - m_conv->GetMBNulLen());
}
#endif // wxUSE_UNICODE
}
wxTextOutputStream& wxTextOutputStream::operator<<(const wxString& string)
{
WriteString( string );