void Rewind() { rewinddir(m_dir); }
bool Read(wxString *filename);
+ const wxString& GetName() const { return m_dirname; }
+
private:
DIR *m_dir;
bool wxDirData::Read(wxString *filename)
{
- dirent *de;
+ dirent *de = (dirent *)NULL; // just to silent compiler warnings
bool matches = FALSE;
while ( !matches )
return m_data != NULL;
}
+wxString wxDir::GetName() const
+{
+ wxString name;
+ if ( m_data )
+ {
+ name = M_DIR->GetName();
+ if ( !name.empty() && (name.Last() == _T('/')) )
+ {
+ // chop off the last (back)slash
+ name.Truncate(name.length() - 1);
+ }
+ }
+
+ return name;
+}
+
wxDir::~wxDir()
{
delete M_DIR;