This is trivial to have and can sometimes be useful and also is symmetric to
Open().
Closes #14493.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72204
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
2.9.5: (released ????-??-??)
----------------------------
2.9.5: (released ????-??-??)
----------------------------
+All:
+
+- Add wxDir::Close() method (Silverstorm82).
+
All (GUI):
- Add possibility to hide and show again wxRibbonBar pages (wxBen).
All (GUI):
- Add possibility to hide and show again wxRibbonBar pages (wxBen).
// opens the directory for enumeration, use IsOpened() to test success
wxDir(const wxString& dir);
// opens the directory for enumeration, use IsOpened() to test success
wxDir(const wxString& dir);
- // dtor cleans up the associated resources
- ~wxDir();
+ // dtor calls Close() automatically
+ ~wxDir() { Close(); }
// open the directory for enumerating
bool Open(const wxString& dir);
// open the directory for enumerating
bool Open(const wxString& dir);
+ // close the directory, Open() can be called again later
+ void Close();
+
// returns true if the directory was successfully opened
bool IsOpened() const;
// returns true if the directory was successfully opened
bool IsOpened() const;
wxDir(const wxString& dir);
/**
wxDir(const wxString& dir);
/**
- Destructor cleans up the associated resources. It is not virtual and so
- this class is not meant to be used polymorphically.
+ Destructor cleans up the associated resources by calling Close().
+
+ It is not virtual and so this class is not meant to be used
+ polymorphically.
+ /**
+ Close the directory.
+
+ The object can't be used after closing it, but Open() may be called
+ again to reopen it later.
+
+ @since 2.9.5
+ */
+ void Close();
+
/**
Test for existence of a directory with the given name.
*/
/**
Test for existence of a directory with the given name.
*/
+ if ( m_data )
+ {
+ delete m_data;
+ m_data = NULL;
+ }
}
// ----------------------------------------------------------------------------
}
// ----------------------------------------------------------------------------
+ if ( m_data )
+ {
+ delete m_data;
+ m_data = NULL;
+ }
}
// ----------------------------------------------------------------------------
}
// ----------------------------------------------------------------------------