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:
Vadim Zeitlin
2013-09-12 20:49:10 +00:00
parent 2cedd586b5
commit 37961915e7
5 changed files with 11 additions and 4 deletions

View File

@@ -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)