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:
parent
24fcf68943
commit
f4ac069301
@ -68,8 +68,8 @@
|
||||
|
||||
#endif // __WXPM__
|
||||
|
||||
#if defined(__WXMAC__) && !defined(__UNIX__)
|
||||
#include "moreextr.h"
|
||||
#if defined(__WXMAC__)
|
||||
# include "MoreFilesExtras.h"
|
||||
#endif
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
@ -598,7 +598,7 @@ void wxGenericDirCtrl::SetupSections()
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#elif defined(__WXMAC__) && !defined(__UNIX__)
|
||||
#elif defined(__WXMAC__)
|
||||
FSSpec volume ;
|
||||
short index = 1 ;
|
||||
while(1) {
|
||||
|
@ -40,10 +40,8 @@
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#ifndef __DARWIN__
|
||||
#include "MoreFiles.h"
|
||||
#include "MoreFilesExtras.h"
|
||||
#endif
|
||||
#include "MoreFiles.h"
|
||||
#include "MoreFilesExtras.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// constants
|
||||
@ -76,6 +74,8 @@ public:
|
||||
bool Read(wxString *filename); // reads the next
|
||||
void Rewind() ;
|
||||
|
||||
const wxString& GetName() const { return m_dirname; }
|
||||
|
||||
private:
|
||||
CInfoPBRec m_CPB ;
|
||||
wxInt16 m_index ;
|
||||
@ -116,11 +116,7 @@ wxDirData::wxDirData(const wxString& dirname)
|
||||
m_CPB.hFileInfo.ioNamePtr = m_name ;
|
||||
m_index = 0 ;
|
||||
|
||||
#ifdef __DARWIN__
|
||||
// TODO: what are we supposed to do for Mac OS X
|
||||
#else
|
||||
FSpGetDirectoryID( &fsspec , &m_dirId , &m_isDir ) ;
|
||||
#endif
|
||||
}
|
||||
|
||||
wxDirData::~wxDirData()
|
||||
@ -237,6 +233,22 @@ bool wxDir::IsOpened() const
|
||||
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;
|
||||
|
@ -40,10 +40,8 @@
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#ifndef __DARWIN__
|
||||
#include "MoreFiles.h"
|
||||
#include "MoreFilesExtras.h"
|
||||
#endif
|
||||
#include "MoreFiles.h"
|
||||
#include "MoreFilesExtras.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// constants
|
||||
@ -76,6 +74,8 @@ public:
|
||||
bool Read(wxString *filename); // reads the next
|
||||
void Rewind() ;
|
||||
|
||||
const wxString& GetName() const { return m_dirname; }
|
||||
|
||||
private:
|
||||
CInfoPBRec m_CPB ;
|
||||
wxInt16 m_index ;
|
||||
@ -116,11 +116,7 @@ wxDirData::wxDirData(const wxString& dirname)
|
||||
m_CPB.hFileInfo.ioNamePtr = m_name ;
|
||||
m_index = 0 ;
|
||||
|
||||
#ifdef __DARWIN__
|
||||
// TODO: what are we supposed to do for Mac OS X
|
||||
#else
|
||||
FSpGetDirectoryID( &fsspec , &m_dirId , &m_isDir ) ;
|
||||
#endif
|
||||
}
|
||||
|
||||
wxDirData::~wxDirData()
|
||||
@ -237,6 +233,22 @@ bool wxDir::IsOpened() const
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user