]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/ffile.cpp
WX_PRECOMP, not WXPRECOMP
[wxWidgets.git] / src / common / ffile.cpp
index 997bf03d2b56a5bb7a3fbb2cde74a9a5d7b72865..c60271dbd5d21974c1f50bd75fa4b9b266575dd0 100644 (file)
@@ -161,13 +161,21 @@ size_t wxFFile::Write(const void *pBuf, size_t nCount)
     return nWritten;
 }
 
+bool wxFFile::Write(const wxString& s, const wxMBConv& conv)
+{
+  const wxWX2MBbuf buf = s.mb_str(conv);
+  if ( !buf )
+      return false;
+
+  const size_t size = strlen(buf); // FIXME: use buf.length() when available
+  return Write(buf, size) == size;
+}
+
 bool wxFFile::Flush()
 {
     if ( IsOpened() )
     {
-        // fflush returns non-zero on error
-        //
-        if ( fflush(m_fp) )
+        if ( fflush(m_fp) != 0 )
         {
             wxLogSysError(_("failed to flush the file '%s'"), m_name.c_str());