// 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);
+ // close the directory, Open() can be called again later
+ void Close();
+
// returns true if the directory was successfully opened
bool IsOpened() const;
// get the full name of the directory (without '/' at the end)
wxString GetName() const;
+ // Same as GetName() but does include the trailing separator, unless the
+ // string is empty (only for invalid directories).
+ wxString GetNameWithSep() const;
+
// file enumeration routines
// -------------------------