X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1f0c8f31f407ecfce909060464c0ea655221cdab..6178debcd342963974dbdce6ac2ddb2fbe89e42a:/src/osx/carbon/dirmac.cpp diff --git a/src/osx/carbon/dirmac.cpp b/src/osx/carbon/dirmac.cpp index 06ccef1960..1932960d97 100644 --- a/src/osx/carbon/dirmac.cpp +++ b/src/osx/carbon/dirmac.cpp @@ -31,7 +31,6 @@ #include "wx/log.h" #endif // PCH -#include "wx/filefn.h" // for wxDirExists() #include "wx/filename.h" #include "wx/osx/private.h" @@ -77,7 +76,7 @@ wxDirData::wxDirData(const wxString& dirname) { // throw away the trailing slashes size_t n = m_dirname.length(); - wxCHECK_RET( n, _T("empty dir name in wxDir") ); + wxCHECK_RET( n, wxT("empty dir name in wxDir") ); while ( n > 0 && wxIsPathSeparator(m_dirname[--n]) ) ; @@ -135,9 +134,9 @@ bool wxDirData::Read(wxString *filename) ItemCount fetched = 0; err = FSGetCatalogInfoBulk( m_iterator, 1, &fetched, NULL, kFSCatInfoNodeFlags | kFSCatInfoFinderInfo , &catalogInfo , &fileRef, NULL, &uniname ); - - // expected error codes - + + // expected error codes + if ( errFSNoMoreItems == err ) return false ; if ( afpAccessDenied == err ) @@ -185,16 +184,6 @@ bool wxDirData::Read(wxString *filename) return true; } -// ---------------------------------------------------------------------------- -// wxDir helpers -// ---------------------------------------------------------------------------- - -/* static */ -bool wxDir::Exists(const wxString& dir) -{ - return wxDirExists(dir); -} - // ---------------------------------------------------------------------------- // wxDir construction/destruction // ---------------------------------------------------------------------------- @@ -225,7 +214,7 @@ wxString wxDir::GetName() const if ( m_data ) { name = m_data->GetName(); - if ( !name.empty() && (name.Last() == _T('/')) ) + if ( !name.empty() && (name.Last() == wxT('/')) ) { // chop off the last (back)slash name.Truncate(name.length() - 1); @@ -237,8 +226,7 @@ wxString wxDir::GetName() const wxDir::~wxDir() { - delete m_data; - m_data = NULL; + wxDELETE(m_data); } // ---------------------------------------------------------------------------- @@ -249,7 +237,7 @@ bool wxDir::GetFirst(wxString *filename, const wxString& filespec, int flags) const { - wxCHECK_MSG( IsOpened(), false, _T("must wxDir::Open() first") ); + wxCHECK_MSG( IsOpened(), false, wxT("must wxDir::Open() first") ); m_data->Rewind(); @@ -261,9 +249,9 @@ bool wxDir::GetFirst(wxString *filename, bool wxDir::GetNext(wxString *filename) const { - wxCHECK_MSG( IsOpened(), false, _T("must wxDir::Open() first") ); + wxCHECK_MSG( IsOpened(), false, wxT("must wxDir::Open() first") ); - wxCHECK_MSG( filename, false, _T("bad pointer in wxDir::GetNext()") ); + wxCHECK_MSG( filename, false, wxT("bad pointer in wxDir::GetNext()") ); return m_data->Read(filename); }