X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/79c3e0e1aeebb64da2ac893e6ed7b27edca01a64..4632781333f28d116a5f2d0b937d822ceadb833b:/include/wx/file.h diff --git a/include/wx/file.h b/include/wx/file.h index e3f8ab1fc3..125ddaff87 100644 --- a/include/wx/file.h +++ b/include/wx/file.h @@ -17,20 +17,8 @@ #pragma interface "file.h" #endif -// ---------------------------------------------------------------------------- -// simple types -// ---------------------------------------------------------------------------- - #include "wx/string.h" #include "wx/filefn.h" -#include "wx/stream.h" // for wxSeekMode - -// define off_t -#include - -#ifdef _MSC_VER - #define off_t _off_t -#endif // ---------------------------------------------------------------------------- // constants @@ -72,7 +60,7 @@ public: // open/close bool Create(const char *szFileName, bool bOverwrite = FALSE); bool Open(const char *szFileName, OpenMode mode = read); - inline bool Close(); // Close is a NOP if not opened + bool Close(); // Close is a NOP if not opened // assign an existing file descriptor and get it back from wxFile object void Attach(int fd) { Close(); m_fd = fd; } @@ -85,7 +73,7 @@ public: // returns true on success uint Write(const void *pBuf, uint nCount); // returns true on success - bool Write(const wxString& str) { return Write(str.c_str(), str.Len()); } + bool Write(const wxString& s) { return Write(s.c_str(), s.Len()) != 0; } // flush data not yet written bool Flush(); @@ -144,8 +132,8 @@ public: bool IsOpened() const { return m_file.IsOpened(); } // I/O (both functions return true on success, false on failure) - bool Write(const void *p, uint n) { return m_file.Write(p, n); } - bool Write(const wxString& str) { return m_file.Write(str); } + bool Write(const void *p, uint n) { return m_file.Write(p, n) != 0; } + bool Write(const wxString& str) { return m_file.Write(str); } // different ways to close the file // validate changes and delete the old file of name m_strName @@ -163,4 +151,4 @@ private: }; #endif - // __FILEH__ + // __FILEH__