/////////////////////////////////////////////////////////////////////////////
-// 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 <csomor@advanced.ch>
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#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
{
// 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]) )
;
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 )
return true;
}
-// ----------------------------------------------------------------------------
-// wxDir helpers
-// ----------------------------------------------------------------------------
-
-/* static */
-bool wxDir::Exists(const wxString& dir)
-{
- return wxDirExists(dir);
-}
-
// ----------------------------------------------------------------------------
// wxDir construction/destruction
// ----------------------------------------------------------------------------
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);
wxDir::~wxDir()
{
- delete m_data;
- m_data = NULL;
+ wxDELETE(m_data);
}
// ----------------------------------------------------------------------------
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();
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);
}