Add wxFile::{Get,Clear}LastError() functions.

Remember the errno of the last file operation instead of just remembering
whether there was an error or not.

See #12636.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66150 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2010-11-14 12:09:59 +00:00
parent 0547ad09cc
commit 65fe93d8a5
4 changed files with 75 additions and 15 deletions

View File

@@ -231,6 +231,32 @@ public:
*/
~wxFile();
/**
Returns the error code for the last unsuccessful operation.
The error code is system-dependent and corresponds to the value of the
standard @c errno variable when the last error occurred.
Notice that only simple accessors such as IsOpened() and Eof() (and
this method itself) don't modify the last error value, all other
methods can potentially change it if an error occurs, including the
const ones such as Tell() or Length().
@since 2.9.2
@see ClearLastError()
*/
int GetLastError() const;
/**
Resets the error code.
GetLastError() will return 0 until the next error occurs.
@since 2.9.2
*/
void ClearLastError();
/**
This function verifies if we may access the given file in specified mode.
Only values of @c wxFile::read or @c wxFile::write really make sense here.