X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/489468feaa08b8f504735eecca522fb8d0f825d2..71a09c3579dd5cb4cd8fa7fdc143561cbff74e12:/src/osx/carbon/dirmac.cpp?ds=sidebyside diff --git a/src/osx/carbon/dirmac.cpp b/src/osx/carbon/dirmac.cpp index 52e9a61e0f..f565a30688 100644 --- a/src/osx/carbon/dirmac.cpp +++ b/src/osx/carbon/dirmac.cpp @@ -1,10 +1,9 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: mac/dirmac.cpp +// Name: src/osx/carbon/dirmac.cpp // Purpose: wxDir implementation for Mac // Author: Stefan Csomor // Modified by: // Created: 08.12.99 -// RCS-ID: $Id$ // Copyright: (c) 1999 Stefan Csomor // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -31,9 +30,8 @@ #include "wx/log.h" #endif // PCH -#include "wx/filefn.h" // for wxDirExists() #include "wx/filename.h" -#include "wx/mac/private.h" +#include "wx/osx/private.h" // ---------------------------------------------------------------------------- // private classes @@ -77,7 +75,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 +133,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 +183,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 +213,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 +225,7 @@ wxString wxDir::GetName() const wxDir::~wxDir() { - delete m_data; - m_data = NULL; + wxDELETE(m_data); } // ---------------------------------------------------------------------------- @@ -249,7 +236,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 +248,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); }