]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/datstrm.cpp
split wxGrid implementation in grideditors.cpp (for wxGridCellEditor-derived classes...
[wxWidgets.git] / src / common / datstrm.cpp
index 50e4eb4b2e6dc2b81e1d0d76c54523258481e726..d568c6d7c0c5aa282b0644bd1000e0de443f4ffe 100644 (file)
@@ -92,7 +92,7 @@ double wxDataInputStream::ReadDouble()
   char buf[10];
 
   m_input->Read(buf, 10);
-  return ConvertFromIeeeExtended((const wxInt8 *)buf);
+  return wxConvertFromIeeeExtended((const wxInt8 *)buf);
 #else
   return 0.0;
 #endif
@@ -100,25 +100,27 @@ double wxDataInputStream::ReadDouble()
 
 wxString wxDataInputStream::ReadString()
 {
-  size_t len;
-
-  len = Read32();
+    wxString ret;
 
-  if (len > 0)
-  {
+    const size_t len = Read32();
+    if ( len > 0 )
+    {
 #if wxUSE_UNICODE
-    wxCharBuffer tmp(len + 1);
-    m_input->Read(tmp.data(), len);
-    tmp.data()[len] = '\0';
-    wxString ret(m_conv->cMB2WX(tmp.data()));
+        wxCharBuffer tmp(len + 1);
+        if ( tmp )
+        {
+            m_input->Read(tmp.data(), len);
+            tmp.data()[len] = '\0';
+            ret = m_conv->cMB2WX(tmp.data());
+        }
 #else
-    wxString ret;
-    m_input->Read( wxStringBuffer(ret, len), len);
+        wxStringBuffer buf(ret, len);
+        if ( buf )
+            m_input->Read(buf, len);
 #endif
+    }
+
     return ret;
-  }
-  else
-    return wxEmptyString;
 }
 
 #if wxUSE_LONGLONG
@@ -529,7 +531,7 @@ void wxDataOutputStream::WriteDouble(double d)
   char buf[10];
 
 #if wxUSE_APPLE_IEEE
-  ConvertToIeeeExtended(d, (wxInt8 *)buf);
+  wxConvertToIeeeExtended(d, (wxInt8 *)buf);
 #else
 #if !defined(__VMS__) && !defined(__GNUG__)
 # pragma warning "wxDataOutputStream::WriteDouble() not using IeeeExtended - will not work!"
@@ -650,13 +652,6 @@ void wxDataOutputStream::WriteDouble(const double *buffer, size_t size)
   }
 }
 
-wxDataOutputStream& wxDataOutputStream::operator<<(const wxChar *string)
-{
-  Write32(wxStrlen(string));
-  m_output->Write((const char *)string, wxStrlen(string)*sizeof(wxChar));
-  return *this;
-}
-
 wxDataOutputStream& wxDataOutputStream::operator<<(const wxString& string)
 {
   WriteString(string);