X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9cfebe8ccc68d126a5a85bd63e21940a2bdc01d0..57cc93eb59cc89992eb136015979effbaa0dd43e:/interface/wx/file.h diff --git a/interface/wx/file.h b/interface/wx/file.h index bc1fc15016..10efe6534d 100644 --- a/interface/wx/file.h +++ b/interface/wx/file.h @@ -102,6 +102,8 @@ class wxTempFile public: /** Associates wxTempFile with the file to be replaced and opens it. + + @warning You should use IsOpened() to verify that the constructor succeeded. */ wxTempFile(const wxString& strName); @@ -127,6 +129,18 @@ public: */ void Discard(); + /** + Flush the data written to the file to disk. + + This simply calls wxFile::Flush() for the underlying file and may be + necessary with file systems such as XFS and Ext4 under Linux. Calling + this function may however have serious performance implications and + also is not necessary with many other file systems so it is not done by + default -- but you can call it before calling Commit() to absolutely + ensure that the data was indeed written to the disk correctly. + */ + bool Flush(); + /** Returns @true if the file was successfully opened. */ @@ -135,7 +149,7 @@ public: /** Returns the length of the file. - This method may return wxInvalidOffset if the length couldn't be + This method may return ::wxInvalidOffset if the length couldn't be determined or 0 even for non-empty files if the file is not seekable. In general, the only way to determine if the file for which this function @@ -160,7 +174,7 @@ public: wxSeekMode mode = wxFromStart); /** - Returns the current position or wxInvalidOffset if file is not opened or + Returns the current position or ::wxInvalidOffset if file is not opened or if another error occurred. */ wxFileOffset Tell() const; @@ -248,6 +262,9 @@ public: The filename. @param mode The mode in which to open the file. + + @warning + You should use IsOpened() to verify that the constructor succeeded. */ wxFile(const wxString& filename, wxFile::OpenMode mode = wxFile::read); @@ -365,7 +382,7 @@ public: @param mode The mode in which to open the file. @param access - An OR-combination of wxPosixPermissions enumeration values. + An OR-combination of ::wxPosixPermissions enumeration values. */ bool Open(const wxString& filename, wxFile::OpenMode mode = wxFile::read, int access = wxS_DEFAULT); @@ -378,7 +395,7 @@ public: @param count Bytes to read - @return The number of bytes read, or the symbol wxInvalidOffset. + @return The number of bytes read, or the symbol ::wxInvalidOffset. */ ssize_t Read(void* buffer, size_t count); @@ -390,7 +407,7 @@ public: @param mode One of wxFromStart, wxFromEnd, wxFromCurrent. - @return The actual offset position achieved, or wxInvalidOffset on + @return The actual offset position achieved, or ::wxInvalidOffset on failure. */ wxFileOffset Seek(wxFileOffset ofs, @@ -404,13 +421,13 @@ public: @param ofs Number of bytes before the end of the file. - @return The actual offset position achieved, or wxInvalidOffset on + @return The actual offset position achieved, or ::wxInvalidOffset on failure. */ wxFileOffset SeekEnd(wxFileOffset ofs = 0); /** - Returns the current position or wxInvalidOffset if file is not opened or + Returns the current position or ::wxInvalidOffset if file is not opened or if another error occurred. */ wxFileOffset Tell() const;