// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+ #pragma hdrstop
+#endif
+
+#ifndef WX_PRECOMP
+ #include "wx/defs.h"
+#endif
+
+#if wxUSE_STREAMS
+
#include <ctype.h>
#include <wx/stream.h>
#include <wx/datstrm.h>
#include <wx/objstrm.h>
-#ifdef __BORLANDC__
-#pragma hdrstop
-#endif
-
#define BUF_TEMP_SIZE 10000
// ----------------------------------------------------------------------------
if (m_mode == write)
return 0;
- while (bytes_read == BUF_TEMP_SIZE) {
+ while (bytes_read != 0) {
bytes_read = Read(buf, bytes_read);
bytes_read = s_buf->Write(buf, bytes_read);
s += bytes_read;
wxOutputStream& wxOutputStream::operator<<(wxString& string)
{
+#if wxUSE_UNICODE
+ const wxWX2MBbuf buf = string.mb_str();
+ return *this << buf;
+#else
return Write(string, string.Len());
+#endif
}
wxOutputStream& wxOutputStream::operator<<(char c)
{
wxString strint;
- strint.Printf("%i", i);
- return Write(strint, strint.Len());
+ strint.Printf(_T("%i"), i);
+ return *this << strint;
}
wxOutputStream& wxOutputStream::operator<<(int i)
{
wxString strint;
- strint.Printf("%i", i);
- return Write(strint, strint.Len());
+ strint.Printf(_T("%i"), i);
+ return *this << strint;
}
wxOutputStream& wxOutputStream::operator<<(long i)
{
wxString strlong;
- strlong.Printf("%i", i);
- return Write((const char *)strlong, strlong.Len());
+ strlong.Printf(_T("%i"), i);
+ return *this << strlong;
}
wxOutputStream& wxOutputStream::operator<<(double f)
{
wxString strfloat;
- strfloat.Printf("%f", f);
- return Write(strfloat, strfloat.Len());
+ strfloat.Printf(_T("%f"), f);
+ return *this << strfloat;
}
#if wxUSE_SERIAL
return stream.Write("\n", 1);
#endif
}
+
+#endif
+ // wxUSE_STREAMS