X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6d44bf31a6f0b4a261280e57842bbd53b5e26cd5..d1427b705318677afe28b1291867f6930c8823a7:/src/common/stream.cpp diff --git a/src/common/stream.cpp b/src/common/stream.cpp index 0186a9548c..44226e5721 100644 --- a/src/common/stream.cpp +++ b/src/common/stream.cpp @@ -18,6 +18,7 @@ #include #include #include +#include #ifdef __BORLANDC__ #pragma hdrstop @@ -202,12 +203,14 @@ wxInputStream::wxInputStream() { m_i_destroybuf = TRUE; m_i_streambuf = new wxStreamBuffer(*this); + m_eof = FALSE; } wxInputStream::wxInputStream(wxStreamBuffer *buffer) { m_i_destroybuf = FALSE; m_i_streambuf = buffer; + m_eof = FALSE; } wxInputStream::~wxInputStream() @@ -268,6 +271,15 @@ wxInputStream& wxInputStream::operator>>(short& i) return *this; } +wxInputStream& wxInputStream::operator>>(int& i) +{ + long l; + + *this >> l; + i = (short)l; + return *this; +} + wxInputStream& wxInputStream::operator>>(long& i) { /* I only implemented a simple integer parser */ @@ -339,6 +351,13 @@ wxInputStream& wxInputStream::operator>>(float& f) return *this; } +wxInputStream& wxInputStream::operator>>(wxObject *& obj) +{ + wxObjectInputStream obj_s(*this); + obj = obj_s.LoadObject(); + return *this; +} + off_t wxInputStream::SeekI(off_t pos, wxSeekMode mode) { off_t ret_off; @@ -502,6 +521,13 @@ wxOutputStream& wxOutputStream::operator<<(double f) return Write(strfloat, strfloat.Len()); } +wxOutputStream& wxOutputStream::operator<<(wxObject& obj) +{ + wxObjectOutputStream obj_s(*this); + obj_s.SaveObject(obj); + return *this; +} + // ---------------------------------------------------------------------------- // wxFilterInputStream // ----------------------------------------------------------------------------