]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/stream.cpp
static wxFile::Access() added
[wxWidgets.git] / src / common / stream.cpp
index 66538c9ddd1892d1ab7d2a24d5fb81777a6aee5f..44226e57210d7eaedc0a7e513d1251b081f507a0 100644 (file)
@@ -18,6 +18,7 @@
 #include <ctype.h>
 #include <wx/stream.h>
 #include <wx/datstrm.h>
+#include <wx/objstrm.h>
 
 #ifdef __BORLANDC__
 #pragma hdrstop
@@ -270,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 */
@@ -341,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;
@@ -504,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
 // ----------------------------------------------------------------------------