Return the old file descriptor/pointer from wx(F)File::Detach().
Make Detach() more convenient to use. Closes #15494. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74798 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
2cedd586b5
commit
37961915e7
@ -567,6 +567,7 @@ All:
|
||||
- Add wxFileName::SetPermissions() (Catalin Raceanu).
|
||||
- Fix build with wxUSE_FFILE==0 (jroemmler).
|
||||
- Add wxDEPRECATED_MSG() and use it in a few places.
|
||||
- Return the old file descriptor/pointer from wx(F)File::Detach() (troelsk).
|
||||
|
||||
All (GUI):
|
||||
|
||||
|
@ -49,7 +49,7 @@ public:
|
||||
// assign an existing file descriptor and get it back from wxFFile object
|
||||
void Attach(FILE *lfp, const wxString& name = wxEmptyString)
|
||||
{ Close(); m_fp = lfp; m_name = name; }
|
||||
void Detach() { m_fp = NULL; }
|
||||
FILE* Detach() { FILE* fpOld = m_fp; m_fp = NULL; return fpOld; }
|
||||
FILE *fp() const { return m_fp; }
|
||||
|
||||
// read/write (unbuffered)
|
||||
|
@ -65,7 +65,7 @@ public:
|
||||
|
||||
// assign an existing file descriptor and get it back from wxFile object
|
||||
void Attach(int lfd) { Close(); m_fd = lfd; m_lasterror = 0; }
|
||||
void Detach() { m_fd = fd_invalid; }
|
||||
int Detach() { int fdOld = m_fd; m_fd = fd_invalid; return fdOld; }
|
||||
int fd() const { return m_fd; }
|
||||
|
||||
// read/write (unbuffered)
|
||||
|
@ -76,8 +76,11 @@ public:
|
||||
closing the file if this descriptor is opened.
|
||||
|
||||
IsOpened() will return @false after call to Detach().
|
||||
|
||||
@return The FILE pointer (this is new since wxWidgets 3.0.0, in the
|
||||
previous versions this method didn't return anything).
|
||||
*/
|
||||
void Detach();
|
||||
FILE* Detach();
|
||||
|
||||
/**
|
||||
Returns @true if an attempt has been made to read @e past
|
||||
|
@ -295,8 +295,11 @@ public:
|
||||
Get back a file descriptor from wxFile object - the caller is responsible for
|
||||
closing the file if this descriptor is opened.
|
||||
IsOpened() will return @false after call to Detach().
|
||||
|
||||
@return The file descriptor (this is new since wxWidgets 3.0.0, in the
|
||||
previous versions this method didn't return anything).
|
||||
*/
|
||||
void Detach();
|
||||
int Detach();
|
||||
|
||||
/**
|
||||
Returns @true if the end of the file has been reached.
|
||||
|
Loading…
Reference in New Issue
Block a user