use MoreFiles under Mac OS X

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11985 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Gilles Depeyrot
2001-10-14 08:25:45 +00:00
parent 24fcf68943
commit f4ac069301
3 changed files with 43 additions and 19 deletions

View File

@@ -68,8 +68,8 @@
#endif // __WXPM__ #endif // __WXPM__
#if defined(__WXMAC__) && !defined(__UNIX__) #if defined(__WXMAC__)
#include "moreextr.h" # include "MoreFilesExtras.h"
#endif #endif
#ifdef __BORLANDC__ #ifdef __BORLANDC__
@@ -598,7 +598,7 @@ void wxGenericDirCtrl::SetupSections()
} }
} }
#endif #endif
#elif defined(__WXMAC__) && !defined(__UNIX__) #elif defined(__WXMAC__)
FSSpec volume ; FSSpec volume ;
short index = 1 ; short index = 1 ;
while(1) { while(1) {

View File

@@ -40,10 +40,8 @@
#include <windows.h> #include <windows.h>
#endif #endif
#ifndef __DARWIN__ #include "MoreFiles.h"
#include "MoreFiles.h" #include "MoreFilesExtras.h"
#include "MoreFilesExtras.h"
#endif
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// constants // constants
@@ -76,6 +74,8 @@ public:
bool Read(wxString *filename); // reads the next bool Read(wxString *filename); // reads the next
void Rewind() ; void Rewind() ;
const wxString& GetName() const { return m_dirname; }
private: private:
CInfoPBRec m_CPB ; CInfoPBRec m_CPB ;
wxInt16 m_index ; wxInt16 m_index ;
@@ -116,11 +116,7 @@ wxDirData::wxDirData(const wxString& dirname)
m_CPB.hFileInfo.ioNamePtr = m_name ; m_CPB.hFileInfo.ioNamePtr = m_name ;
m_index = 0 ; m_index = 0 ;
#ifdef __DARWIN__
// TODO: what are we supposed to do for Mac OS X
#else
FSpGetDirectoryID( &fsspec , &m_dirId , &m_isDir ) ; FSpGetDirectoryID( &fsspec , &m_dirId , &m_isDir ) ;
#endif
} }
wxDirData::~wxDirData() wxDirData::~wxDirData()
@@ -237,6 +233,22 @@ bool wxDir::IsOpened() const
return m_data != NULL; 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() wxDir::~wxDir()
{ {
delete M_DIR; delete M_DIR;

View File

@@ -40,10 +40,8 @@
#include <windows.h> #include <windows.h>
#endif #endif
#ifndef __DARWIN__ #include "MoreFiles.h"
#include "MoreFiles.h" #include "MoreFilesExtras.h"
#include "MoreFilesExtras.h"
#endif
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// constants // constants
@@ -76,6 +74,8 @@ public:
bool Read(wxString *filename); // reads the next bool Read(wxString *filename); // reads the next
void Rewind() ; void Rewind() ;
const wxString& GetName() const { return m_dirname; }
private: private:
CInfoPBRec m_CPB ; CInfoPBRec m_CPB ;
wxInt16 m_index ; wxInt16 m_index ;
@@ -116,11 +116,7 @@ wxDirData::wxDirData(const wxString& dirname)
m_CPB.hFileInfo.ioNamePtr = m_name ; m_CPB.hFileInfo.ioNamePtr = m_name ;
m_index = 0 ; m_index = 0 ;
#ifdef __DARWIN__
// TODO: what are we supposed to do for Mac OS X
#else
FSpGetDirectoryID( &fsspec , &m_dirId , &m_isDir ) ; FSpGetDirectoryID( &fsspec , &m_dirId , &m_isDir ) ;
#endif
} }
wxDirData::~wxDirData() wxDirData::~wxDirData()
@@ -237,6 +233,22 @@ bool wxDir::IsOpened() const
return m_data != NULL; 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() wxDir::~wxDir()
{ {
delete M_DIR; delete M_DIR;