git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33350
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
22 files changed:
for (size_t i = 0; i < tf.GetLineCount(); i++)
{
for (size_t i = 0; i < tf.GetLineCount(); i++)
{
- if (tf[i].IsEmpty() || tf[i][0u] == _T('#')) continue;
+ if (tf[i].empty() || tf[i][0u] == _T('#')) continue;
wxStringTokenizer tkn(tf[i], _T(' '));
wxString s = tkn.GetNextToken();
if (s == _T("node"))
wxStringTokenizer tkn(tf[i], _T(' '));
wxString s = tkn.GetNextToken();
if (s == _T("node"))
void NodesDb::LoadDir(const wxString& path)
{
void NodesDb::LoadDir(const wxString& path)
{
- if (!wxPathExists(path)) return;
+ if (!wxDirExists(path)) return;
wxDir dir(path);
wxString filename;
wxDir dir(path);
wxString filename;
wxWidgets 2.5 Change Log - For more verbose changes, see the manual
-------------------------------------------------------------------
wxWidgets 2.5 Change Log - For more verbose changes, see the manual
-------------------------------------------------------------------
+2.6
+-----
+
+All:
+
+- wxPathExists deprecated, use wxDirExists instead.
+
- wxGetPowerType() and wxGetBatteryState() addition
- wxSystemSettings::GetSystem*() members deprecated and replaced with
wxSystemSettings::Get*()
- wxGetPowerType() and wxGetBatteryState() addition
- wxSystemSettings::GetSystem*() members deprecated and replaced with
wxSystemSettings::Get*()
-- wxWindowBase::DoGetBestSize now includes the difference (if any) between
- the client size and total size of the window. Code that sets the
+- wxWindowBase::DoGetBestSize now includes the difference (if any) between
+ the client size and total size of the window. Code that sets the
client size using the best size, or that added extra space to sizers
to compensate for this bug may need to be changed.
- Changed calculation of scrolling area to not clip away some bits
client size using the best size, or that added extra space to sizers
to compensate for this bug may need to be changed.
- Changed calculation of scrolling area to not clip away some bits
\helpref{wxOnAssert}{wxonassert}\\
\helpref{wxOpenClipboard}{wxopenclipboard}\\
\helpref{wxParseCommonDialogsFilter}{wxparsecommondialogsfilter}\\
\helpref{wxOnAssert}{wxonassert}\\
\helpref{wxOpenClipboard}{wxopenclipboard}\\
\helpref{wxParseCommonDialogsFilter}{wxparsecommondialogsfilter}\\
-\helpref{wxPathExists}{functionwxpathexists}\\
+\helpref{wxDirExists}{functionwxdirexists}\\
\helpref{wxPathOnly}{wxpathonly}\\
\helpref{wxPostDelete}{wxpostdelete}\\
\helpref{wxPostEvent}{wxpostevent}\\
\helpref{wxPathOnly}{wxpathonly}\\
\helpref{wxPostDelete}{wxpostdelete}\\
\helpref{wxPostEvent}{wxpostevent}\\
or drive name at the beginning.
or drive name at the beginning.
-\membersection{::wxPathExists}\label{functionwxpathexists}
+\membersection{::wxDirExists}\label{functionwxdirexists}
-\func{bool}{wxPathExists}{\param{const wxString\& }{dirname}}
+\func{bool}{wxDirExists}{\param{const wxString\& }{dirname}}
Returns true if the path exists.
Returns true if the path exists.
WXDLLIMPEXP_BASE bool wxFileExists(const wxString& filename);
// does the path exist? (may have or not '/' or '\\' at the end)
WXDLLIMPEXP_BASE bool wxFileExists(const wxString& filename);
// does the path exist? (may have or not '/' or '\\' at the end)
-WXDLLIMPEXP_BASE bool wxPathExists(const wxChar *pszPathName);
+WXDLLIMPEXP_BASE bool wxDirExists(const wxChar *pszPathName);
WXDLLIMPEXP_BASE bool wxIsAbsolutePath(const wxString& filename);
WXDLLIMPEXP_BASE bool wxIsAbsolutePath(const wxString& filename);
WXDLLIMPEXP_BASE wxFileKind wxGetFileKind(FILE *fp);
// compatibility defines, don't use in new code
WXDLLIMPEXP_BASE wxFileKind wxGetFileKind(FILE *fp);
// compatibility defines, don't use in new code
-#define wxDirExists wxPathExists
+// consider removal droping 2.4 compatibility
+// #if WXWIN_COMPATIBILITY_2_4
+wxDEPRECATED( inline bool wxPathExists(const wxChar *pszPathName) );
+inline bool wxPathExists(const wxChar *pszPathName)
+{
+ return wxDirExists(pszPathName);
+}
+// #endif //WXWIN_COMPATIBILITY_2_4
// ----------------------------------------------------------------------------
// separators in file names
// ----------------------------------------------------------------------------
// separators in file names
}
// does the path exists? (may have or not '/' or '\\' at the end)
}
// does the path exists? (may have or not '/' or '\\' at the end)
-bool wxPathExists(const wxChar *pszPathName)
+bool wxDirExists(const wxChar *pszPathName)
{
wxString strPath(pszPathName);
{
wxString strPath(pszPathName);
bool wxFileName::DirExists( const wxString &dir )
{
bool wxFileName::DirExists( const wxString &dir )
{
- return ::wxPathExists( dir );
+ return ::wxDirExists( dir );
}
// ----------------------------------------------------------------------------
}
// ----------------------------------------------------------------------------
// like it when MS-DOS app accesses empty floppy drive
return (dirNameLower[0u] == wxT('a') ||
dirNameLower[0u] == wxT('b') ||
// like it when MS-DOS app accesses empty floppy drive
return (dirNameLower[0u] == wxT('a') ||
dirNameLower[0u] == wxT('b') ||
- wxPathExists(dirNameLower));
+ wxDirExists(dirNameLower));
{
wxString dirNameLower(dirName.Lower());
#if defined(__GNUWIN32__) && !(defined(__MINGW32_MAJOR_VERSION) && __MINGW32_MAJOR_VERSION >= 1)
{
wxString dirNameLower(dirName.Lower());
#if defined(__GNUWIN32__) && !(defined(__MINGW32_MAJOR_VERSION) && __MINGW32_MAJOR_VERSION >= 1)
- success = wxPathExists(dirNameLower);
+ success = wxDirExists(dirNameLower);
#else
#if defined(__OS2__)
// Avoid changing to drive since no media may be inserted.
#else
#if defined(__OS2__)
// Avoid changing to drive since no media may be inserted.
{
m_path = m_input->GetValue();
// Does the path exist? (User may have typed anything in m_input)
{
m_path = m_input->GetValue();
// Does the path exist? (User may have typed anything in m_input)
- if (wxPathExists(m_path)) {
+ if (wxDirExists(m_path)) {
// OK, path exists, we're done.
EndModal(wxID_OK);
return;
// OK, path exists, we're done.
EndModal(wxID_OK);
return;
if (!wxEndsWithPathSeparator(path))
path += wxFILE_SEP_PATH;
path += new_name;
if (!wxEndsWithPathSeparator(path))
path += wxFILE_SEP_PATH;
path += new_name;
- if (wxPathExists(path))
{
// try NewName0, NewName1 etc.
int i = 0;
{
// try NewName0, NewName1 etc.
int i = 0;
path += wxFILE_SEP_PATH;
path += new_name;
i++;
path += wxFILE_SEP_PATH;
path += new_name;
i++;
- } while (wxPathExists(path));
+ } while (wxDirExists(path));
void wxFileCtrl::GoToDir( const wxString &dir )
{
void wxFileCtrl::GoToDir( const wxString &dir )
{
- if (!wxPathExists(dir)) return;
+ if (!wxDirExists(dir)) return;
m_dirName = dir;
UpdateFiles();
m_dirName = dir;
UpdateFiles();
if (!IsTopMostDir(dir))
dir += wxFILE_SEP_PATH;
dir += filename;
if (!IsTopMostDir(dir))
dir += wxFILE_SEP_PATH;
dir += filename;
- if (wxPathExists(dir)) return;
+ if (wxDirExists(dir)) return;
ignoreChanges = true;
m_text->SetValue( filename );
ignoreChanges = true;
m_text->SetValue( filename );
- if (wxPathExists(filename))
+ if (wxDirExists(filename))
{
m_list->GoToDir( filename );
UpdateControls();
{
m_list->GoToDir( filename );
UpdateControls();
{
wxString newfile;
newfile << WXEXTHELP_SEPARATOR << wxGetLocale()->GetName();
{
wxString newfile;
newfile << WXEXTHELP_SEPARATOR << wxGetLocale()->GetName();
- if(wxPathExists(newfile))
+ if(wxDirExists(newfile))
const wxChar *cptr = wxGetLocale()->GetName().c_str();
while(*cptr && *cptr != wxT('_'))
newfile << *(cptr++);
const wxChar *cptr = wxGetLocale()->GetName().c_str();
while(*cptr && *cptr != wxT('_'))
newfile << *(cptr++);
- if(wxPathExists(newfile))
+ if(wxDirExists(newfile))
file = newfile;
}
}
#endif
file = newfile;
}
}
#endif
- if(! wxPathExists(file))
+ if(! wxDirExists(file))
return false;
mapFile << file << WXEXTHELP_SEPARATOR << WXEXTHELP_MAPFILE;
return false;
mapFile << file << WXEXTHELP_SEPARATOR << WXEXTHELP_MAPFILE;
- if ( !defaultDir.IsEmpty() )
+ if ( !defaultDir.empty() )
gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(m_widget),
wxConvFileName->cWX2MB(defaultDir));
gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(m_widget),
wxConvFileName->cWX2MB(defaultDir));
- if ( !defaultFileName.IsEmpty() )
+ if ( !defaultFileName.empty() )
- if ( defaultDir.IsEmpty() )
+ if ( defaultDir.empty() )
dir = ::wxGetCwd();
else
dir = defaultDir;
dir = ::wxGetCwd();
else
dir = defaultDir;
GTK_FILE_CHOOSER(m_widget),
wxConvFileName->cWX2MB( wxFileName(dir, defaultFileName).GetFullPath() ) );
}
GTK_FILE_CHOOSER(m_widget),
wxConvFileName->cWX2MB( wxFileName(dir, defaultFileName).GetFullPath() ) );
}
- else if ( !defaultDir.IsEmpty() )
+ else if ( !defaultDir.empty() )
gtk_file_chooser_set_current_folder( GTK_FILE_CHOOSER(m_widget),
wxConvFileName->cWX2MB(defaultDir) );
}
gtk_file_chooser_set_current_folder( GTK_FILE_CHOOSER(m_widget),
wxConvFileName->cWX2MB(defaultDir) );
}
#ifdef __WXGTK24__
if (!gtk_check_version(2,4,0))
{
#ifdef __WXGTK24__
if (!gtk_check_version(2,4,0))
{
{
gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(m_widget), wxConvFileName->cWX2MB(dir));
}
{
gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(m_widget), wxConvFileName->cWX2MB(dir));
}
- if ( !defaultDir.IsEmpty() )
+ if ( !defaultDir.empty() )
gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(m_widget),
wxConvFileName->cWX2MB(defaultDir));
gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(m_widget),
wxConvFileName->cWX2MB(defaultDir));
- if ( !defaultFileName.IsEmpty() )
+ if ( !defaultFileName.empty() )
- if ( defaultDir.IsEmpty() )
+ if ( defaultDir.empty() )
dir = ::wxGetCwd();
else
dir = defaultDir;
dir = ::wxGetCwd();
else
dir = defaultDir;
GTK_FILE_CHOOSER(m_widget),
wxConvFileName->cWX2MB( wxFileName(dir, defaultFileName).GetFullPath() ) );
}
GTK_FILE_CHOOSER(m_widget),
wxConvFileName->cWX2MB( wxFileName(dir, defaultFileName).GetFullPath() ) );
}
- else if ( !defaultDir.IsEmpty() )
+ else if ( !defaultDir.empty() )
gtk_file_chooser_set_current_folder( GTK_FILE_CHOOSER(m_widget),
wxConvFileName->cWX2MB(defaultDir) );
}
gtk_file_chooser_set_current_folder( GTK_FILE_CHOOSER(m_widget),
wxConvFileName->cWX2MB(defaultDir) );
}
#ifdef __WXGTK24__
if (!gtk_check_version(2,4,0))
{
#ifdef __WXGTK24__
if (!gtk_check_version(2,4,0))
{
{
gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(m_widget), wxConvFileName->cWX2MB(dir));
}
{
gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(m_widget), wxConvFileName->cWX2MB(dir));
}
#endif // PCH
#include "wx/dir.h"
#endif // PCH
#include "wx/dir.h"
-#include "wx/filefn.h" // for wxPathExists()
+#include "wx/filefn.h" // for wxDirExists()
#ifndef __DARWIN__
#include <windows.h>
#ifndef __DARWIN__
#include <windows.h>
public:
wxDirData(const wxString& dirname);
~wxDirData();
public:
wxDirData(const wxString& dirname);
~wxDirData();
void Close() ;
void SetFileSpec(const wxString& filespec) { m_filespec = filespec; }
void SetFlags(int flags) { m_flags = flags; }
void Close() ;
void SetFileSpec(const wxString& filespec) { m_filespec = filespec; }
void SetFlags(int flags) { m_flags = flags; }
- bool Read(wxString *filename); // reads the next
+ bool Read(wxString *filename); // reads the next
void Rewind() ;
const wxString& GetName() const { return m_dirname; }
void Rewind() ;
const wxString& GetName() const { return m_dirname; }
}
void wxDirData::Close()
}
void wxDirData::Close()
if ( m_iterator )
{
FSCloseIterator( m_iterator ) ;
if ( m_iterator )
{
FSCloseIterator( m_iterator ) ;
-void wxDirData::Rewind()
+void wxDirData::Rewind()
{
Close() ;
}
bool wxDirData::Read(wxString *filename)
{
Close() ;
}
bool wxDirData::Read(wxString *filename)
wxString result;
OSStatus err = noErr ;
if ( NULL == m_iterator )
wxString result;
OSStatus err = noErr ;
if ( NULL == m_iterator )
err = wxMacPathToFSRef( m_dirname , &dirRef ) ;
if ( err == noErr )
{
err = wxMacPathToFSRef( m_dirname , &dirRef ) ;
if ( err == noErr )
{
- err = FSOpenIterator(&dirRef, kFSIterateFlat, &m_iterator);
- }
- if ( err )
- {
- Close() ;
- return FALSE ;
- }
+ err = FSOpenIterator(&dirRef, kFSIterateFlat, &m_iterator);
+ }
+ if ( err )
+ {
+ Close() ;
+ return false ;
+ }
while( noErr == err )
{
HFSUniStr255 uniname ;
while( noErr == err )
{
HFSUniStr255 uniname ;
err = FSGetCatalogInfoBulk( m_iterator, 1, &fetched, NULL, kFSCatInfoNodeFlags | kFSCatInfoFinderInfo , &catalogInfo , &fileRef, NULL, &uniname );
if ( errFSNoMoreItems == err )
return false ;
err = FSGetCatalogInfoBulk( m_iterator, 1, &fetched, NULL, kFSCatInfoNodeFlags | kFSCatInfoFinderInfo , &catalogInfo , &fileRef, NULL, &uniname );
if ( errFSNoMoreItems == err )
return false ;
wxASSERT( noErr == err ) ;
wxASSERT( noErr == err ) ;
if ( noErr != err )
break ;
if ( noErr != err )
break ;
name = wxMacHFSUniStrToString( &uniname ) ;
if ( ( name == wxT(".") || name == wxT("..") ) && !(m_flags & wxDIR_DOTDOT) )
name = wxMacHFSUniStrToString( &uniname ) ;
if ( ( name == wxT(".") || name == wxT("..") ) && !(m_flags & wxDIR_DOTDOT) )
if ( (((FileInfo*)&catalogInfo.finderInfo)->finderFlags & kIsInvisible ) && !(m_flags & wxDIR_HIDDEN ) )
continue ;
if ( (((FileInfo*)&catalogInfo.finderInfo)->finderFlags & kIsInvisible ) && !(m_flags & wxDIR_HIDDEN ) )
continue ;
// its a dir and we don't want it
if ( (catalogInfo.nodeFlags & kFSNodeIsDirectoryMask) && !(m_flags & wxDIR_DIRS) )
continue ;
// its a dir and we don't want it
if ( (catalogInfo.nodeFlags & kFSNodeIsDirectoryMask) && !(m_flags & wxDIR_DIRS) )
continue ;
// its a file but we don't want it
if ( (catalogInfo.nodeFlags & kFSNodeIsDirectoryMask) == 0 && !(m_flags & wxDIR_FILES ) )
continue ;
// its a file but we don't want it
if ( (catalogInfo.nodeFlags & kFSNodeIsDirectoryMask) == 0 && !(m_flags & wxDIR_FILES ) )
continue ;
-
- if ( m_filespec.IsEmpty() || m_filespec == wxT("*.*") || m_filespec == wxT("*") )
+
+ if ( m_filespec.empty() || m_filespec == wxT("*.*") || m_filespec == wxT("*") )
- else if ( !wxMatchWild(m_filespec, name , FALSE) )
+ else if ( !wxMatchWild(m_filespec, name , false) )
break ;
}
if ( err != noErr )
{
break ;
}
if ( err != noErr )
{
}
// ----------------------------------------------------------------------------
}
// ----------------------------------------------------------------------------
/* static */
bool wxDir::Exists(const wxString& dir)
{
/* static */
bool wxDir::Exists(const wxString& dir)
{
- return wxPathExists(dir);
+ return wxDirExists(dir);
}
// ----------------------------------------------------------------------------
}
// ----------------------------------------------------------------------------
delete M_DIR;
m_data = new wxDirData(dirname);
delete M_DIR;
m_data = new wxDirData(dirname);
}
bool wxDir::IsOpened() const
}
bool wxDir::IsOpened() const
const wxString& filespec,
int flags) const
{
const wxString& filespec,
int flags) const
{
- wxCHECK_MSG( IsOpened(), FALSE, _T("must wxDir::Open() first") );
+ wxCHECK_MSG( IsOpened(), false, _T("must wxDir::Open() first") );
bool wxDir::GetNext(wxString *filename) const
{
bool wxDir::GetNext(wxString *filename) const
{
- wxCHECK_MSG( IsOpened(), FALSE, _T("must wxDir::Open() first") );
+ wxCHECK_MSG( IsOpened(), false, _T("must wxDir::Open() first") );
- wxCHECK_MSG( filename, FALSE, _T("bad pointer in wxDir::GetNext()") );
+ wxCHECK_MSG( filename, false, _T("bad pointer in wxDir::GetNext()") );
return M_DIR->Read(filename);
}
return M_DIR->Read(filename);
}
#endif // PCH
#include "wx/dir.h"
#endif // PCH
#include "wx/dir.h"
-#include "wx/filefn.h" // for wxPathExists()
+#include "wx/filefn.h" // for wxDirExists()
#ifndef __DARWIN__
#include <windows.h>
#ifndef __DARWIN__
#include <windows.h>
void SetFileSpec(const wxString& filespec) { m_filespec = filespec; }
void SetFlags(int flags) { m_flags = flags; }
void SetFileSpec(const wxString& filespec) { m_filespec = filespec; }
void SetFlags(int flags) { m_flags = flags; }
- bool Read(wxString *filename); // reads the next
+ bool Read(wxString *filename); // reads the next
void Rewind() ;
const wxString& GetName() const { return m_dirname; }
void Rewind() ;
const wxString& GetName() const { return m_dirname; }
: m_dirname(dirname)
{
m_ok = false;
: m_dirname(dirname)
{
m_ok = false;
// throw away the trailing slashes
size_t n = m_dirname.length();
wxCHECK_RET( n, _T("empty dir name in wxDir") );
// throw away the trailing slashes
size_t n = m_dirname.length();
wxCHECK_RET( n, _T("empty dir name in wxDir") );
;
m_dirname.Truncate(n + 1);
;
m_dirname.Truncate(n + 1);
#ifdef __DARWIN__
FSRef theRef;
// get the FSRef associated with the POSIX path
err = FSPathMakeRef((const UInt8 *) m_dirname.c_str(), &theRef, NULL);
FSGetVRefNum(&theRef, &(m_CPB.hFileInfo.ioVRefNum));
#ifdef __DARWIN__
FSRef theRef;
// get the FSRef associated with the POSIX path
err = FSPathMakeRef((const UInt8 *) m_dirname.c_str(), &theRef, NULL);
FSGetVRefNum(&theRef, &(m_CPB.hFileInfo.ioVRefNum));
err = FSGetNodeID( &theRef , &m_dirId , &m_isDir ) ;
#else
FSSpec fsspec ;
err = FSGetNodeID( &theRef , &m_dirId , &m_isDir ) ;
#else
FSSpec fsspec ;
-void wxDirData::Rewind()
+void wxDirData::Rewind()
bool wxDirData::Read(wxString *filename)
{
if ( !m_isDir )
bool wxDirData::Read(wxString *filename)
{
if ( !m_isDir )
wxString result;
short err = noErr ;
wxString result;
short err = noErr ;
while ( err == noErr )
{
m_index++ ;
while ( err == noErr )
{
m_index++ ;
err = PBGetCatInfoSync((CInfoPBPtr)&m_CPB);
if ( err != noErr )
break ;
err = PBGetCatInfoSync((CInfoPBPtr)&m_CPB);
if ( err != noErr )
break ;
// its hidden but we don't want it
if ( ( m_CPB.hFileInfo.ioFlFndrInfo.fdFlags & kIsInvisible ) && !(m_flags & wxDIR_HIDDEN) )
continue ;
// its hidden but we don't want it
if ( ( m_CPB.hFileInfo.ioFlFndrInfo.fdFlags & kIsInvisible ) && !(m_flags & wxDIR_HIDDEN) )
continue ;
// we have a directory
if ( ( m_CPB.dirInfo.ioFlAttrib & ioDirMask) != 0 && (m_flags & wxDIR_DIRS) )
break ;
// we have a directory
if ( ( m_CPB.dirInfo.ioFlAttrib & ioDirMask) != 0 && (m_flags & wxDIR_DIRS) )
break ;
// its a file but we don't want it
if ( ( m_CPB.dirInfo.ioFlAttrib & ioDirMask) == 0 && !(m_flags & wxDIR_FILES ) )
continue ;
// its a file but we don't want it
if ( ( m_CPB.dirInfo.ioFlAttrib & ioDirMask) == 0 && !(m_flags & wxDIR_FILES ) )
continue ;
wxString file = wxMacMakeStringFromPascal( m_name ) ;
wxString file = wxMacMakeStringFromPascal( m_name ) ;
- if ( m_filespec.IsEmpty() || m_filespec == wxT("*.*") || m_filespec == wxT("*") )
+ if ( m_filespec.empty() || m_filespec == wxT("*.*") || m_filespec == wxT("*") )
{
}
else if ( m_filespec.Length() > 1 && m_filespec.Left(1) == wxT("*") )
{
}
else if ( m_filespec.Length() > 1 && m_filespec.Left(1) == wxT("*") )
break ;
}
if ( err != noErr )
{
break ;
}
if ( err != noErr )
{
*filename = wxMacMakeStringFromPascal( m_name ) ;
*filename = wxMacMakeStringFromPascal( m_name ) ;
}
// ----------------------------------------------------------------------------
}
// ----------------------------------------------------------------------------
/* static */
bool wxDir::Exists(const wxString& dir)
{
/* static */
bool wxDir::Exists(const wxString& dir)
{
- return wxPathExists(dir);
+ return wxDirExists(dir);
}
// ----------------------------------------------------------------------------
}
// ----------------------------------------------------------------------------
delete M_DIR;
m_data = new wxDirData(dirname);
if (m_data->Ok())
delete M_DIR;
m_data = new wxDirData(dirname);
if (m_data->Ok())
else
{
delete m_data;
m_data = NULL;
else
{
delete m_data;
m_data = NULL;
const wxString& filespec,
int flags) const
{
const wxString& filespec,
int flags) const
{
- wxCHECK_MSG( IsOpened(), FALSE, _T("must wxDir::Open() first") );
+ wxCHECK_MSG( IsOpened(), false, _T("must wxDir::Open() first") );
bool wxDir::GetNext(wxString *filename) const
{
bool wxDir::GetNext(wxString *filename) const
{
- wxCHECK_MSG( IsOpened(), FALSE, _T("must wxDir::Open() first") );
+ wxCHECK_MSG( IsOpened(), false, _T("must wxDir::Open() first") );
- wxCHECK_MSG( filename, FALSE, _T("bad pointer in wxDir::GetNext()") );
+ wxCHECK_MSG( filename, false, _T("bad pointer in wxDir::GetNext()") );
return M_DIR->Read(filename);
}
return M_DIR->Read(filename);
}
void wxDirData::SetFileSpec(const wxString& filespec)
{
#ifdef __DOS__
void wxDirData::SetFileSpec(const wxString& filespec)
{
#ifdef __DOS__
- if ( filespec.IsEmpty() )
+ if ( filespec.empty() )
m_filespec = _T("*.*");
else
#endif
m_filespec = _T("*.*");
else
#endif
bool wxDirData::Read(wxString *filename)
{
PM_findData data;
bool wxDirData::Read(wxString *filename)
{
PM_findData data;
data.dwSize = sizeof(data);
data.dwSize = sizeof(data);
wxString path = m_dirname;
path += wxFILE_SEP_PATH;
path.reserve(path.length() + 255); // speed up string concatenation
wxString path = m_dirname;
path += wxFILE_SEP_PATH;
path.reserve(path.length() + 255); // speed up string concatenation
if ( m_dir )
{
if ( !PM_findNextFile(m_dir, &data) )
if ( m_dir )
{
if ( !PM_findNextFile(m_dir, &data) )
if ( m_dir == PM_FILE_INVALID )
{
m_dir = NULL;
if ( m_dir == PM_FILE_INVALID )
{
m_dir = NULL;
- matches = m_flags & wxDIR_HIDDEN ? TRUE : !(data.attrib & PM_FILE_HIDDEN);
+ matches = m_flags & wxDIR_HIDDEN ? true : !(data.attrib & PM_FILE_HIDDEN);
/* static */
bool wxDir::Exists(const wxString& dir)
{
/* static */
bool wxDir::Exists(const wxString& dir)
{
- return wxPathExists(dir);
+ return wxDirExists(dir);
}
// ----------------------------------------------------------------------------
}
// ----------------------------------------------------------------------------
{
delete M_DIR;
m_data = NULL;
{
delete M_DIR;
m_data = NULL;
if ( !wxDir::Exists(dirname) )
{
wxLogError(_("Directory '%s' doesn't exist!"), dirname.c_str());
if ( !wxDir::Exists(dirname) )
{
wxLogError(_("Directory '%s' doesn't exist!"), dirname.c_str());
m_data = new wxDirData(dirname);
m_data = new wxDirData(dirname);
}
bool wxDir::IsOpened() const
}
bool wxDir::IsOpened() const
const wxString& filespec,
int flags) const
{
const wxString& filespec,
int flags) const
{
- wxCHECK_MSG( IsOpened(), FALSE, _T("must wxDir::Open() first") );
+ wxCHECK_MSG( IsOpened(), false, _T("must wxDir::Open() first") );
bool wxDir::GetNext(wxString *filename) const
{
bool wxDir::GetNext(wxString *filename) const
{
- wxCHECK_MSG( IsOpened(), FALSE, _T("must wxDir::Open() first") );
+ wxCHECK_MSG( IsOpened(), false, _T("must wxDir::Open() first") );
- wxCHECK_MSG( filename, FALSE, _T("bad pointer in wxDir::GetNext()") );
+ wxCHECK_MSG( filename, false, _T("bad pointer in wxDir::GetNext()") );
return M_DIR->Read(filename);
}
return M_DIR->Read(filename);
}
#endif // PCH
#include "wx/dir.h"
#endif // PCH
#include "wx/dir.h"
-#include "wx/filefn.h" // for wxPathExists()
+#include "wx/filefn.h" // for wxDirExists()
#ifdef __WXMSW__
#include "wx/msw/private.h"
#ifdef __WXMSW__
#include "wx/msw/private.h"
/* static */
bool wxDir::Exists(const wxString& dir)
{
/* static */
bool wxDir::Exists(const wxString& dir)
{
- return wxPathExists(dir);
+ return wxDirExists(dir);
}
// ----------------------------------------------------------------------------
}
// ----------------------------------------------------------------------------
if ( (ofn->Flags & OFN_ALLOWMULTISELECT) &&
ofn->lpstrFile[ofn->nFileOffset-1] != wxT('\0') )
{
if ( (ofn->Flags & OFN_ALLOWMULTISELECT) &&
ofn->lpstrFile[ofn->nFileOffset-1] != wxT('\0') )
{
- if ( wxPathExists(ofn->lpstrFile) )
+ if ( wxDirExists(ofn->lpstrFile) )
{
// 1st component is dir => multiple files selected
ofn->nFileOffset = wxStrlen(ofn->lpstrFile)+1;
{
// 1st component is dir => multiple files selected
ofn->nFileOffset = wxStrlen(ofn->lpstrFile)+1;
rc = ::DosFindFirst( rsSpec.c_str()
,&hDir
rc = ::DosFindFirst( rsSpec.c_str()
,&hDir
- ,0x37 // was: FILE_NORMAL
+ ,0x37 // was: FILE_NORMAL
,pFinddata
,sizeof(FILEFINDBUF3)
,&ulFindCount
,pFinddata
,sizeof(FILEFINDBUF3)
,&ulFindCount
FILEFINDBUF3 vFinddata;
#define PTR_TO_FINDDATA (&vFinddata)
FILEFINDBUF3 vFinddata;
#define PTR_TO_FINDDATA (&vFinddata)
m_vFinddata = FindFirst( sFilespec
,PTR_TO_FINDDATA
);
m_vFinddata = FindFirst( sFilespec
,PTR_TO_FINDDATA
);
}
if ( !IsFindDataOk(m_vFinddata) )
{
}
if ( !IsFindDataOk(m_vFinddata) )
{
*psFilename = zName;
break;
}
*psFilename = zName;
break;
}
} // end of wxDirData::Read
// ----------------------------------------------------------------------------
} // end of wxDirData::Read
// ----------------------------------------------------------------------------
const wxString& rsDir
)
{
const wxString& rsDir
)
{
- return wxPathExists(rsDir);
+ return wxDirExists(rsDir);
} // end of wxDir::Exists
// ----------------------------------------------------------------------------
} // end of wxDir::Exists
// ----------------------------------------------------------------------------
{
delete M_DIR;
m_data = new wxDirData(rsDirname);
{
delete M_DIR;
m_data = new wxDirData(rsDirname);
} // end of wxDir::Open
bool wxDir::IsOpened() const
} // end of wxDir::Open
bool wxDir::IsOpened() const
- wxCHECK_MSG( IsOpened(), FALSE, _T("must wxDir::Open() first") );
+ wxCHECK_MSG( IsOpened(), false, _T("must wxDir::Open() first") );
M_DIR->Rewind();
M_DIR->SetFileSpec(rsFilespec);
M_DIR->SetFlags(nFlags);
M_DIR->Rewind();
M_DIR->SetFileSpec(rsFilespec);
M_DIR->SetFlags(nFlags);
wxString* psFilename
) const
{
wxString* psFilename
) const
{
- wxCHECK_MSG( IsOpened(), FALSE, _T("must wxDir::Open() first") );
- wxCHECK_MSG( psFilename, FALSE, _T("bad pointer in wxDir::GetNext()") );
+ wxCHECK_MSG( IsOpened(), false, _T("must wxDir::Open() first") );
+ wxCHECK_MSG( psFilename, false, _T("bad pointer in wxDir::GetNext()") );
return M_DIR->Read(psFilename);
} // end of wxDir::GetNext
return M_DIR->Read(psFilename);
} // end of wxDir::GetNext
wxStripExtension__FPc
;wxPathOnly(const wxString&)
wxPathOnly__FRC8wxString
wxStripExtension__FPc
;wxPathOnly(const wxString&)
wxPathOnly__FRC8wxString
- ;wxPathExists(const char*)
- wxPathExists__FPCc
+ ;wxDirExists(const char*)
+ wxDirExists__FPCc
;wxPathList::FindValidPath(const wxString&)
FindValidPath__10wxPathListFRC8wxString
;wxPathList::FindAbsoluteValidPath(const wxString&)
;wxPathList::FindValidPath(const wxString&)
FindValidPath__10wxPathListFRC8wxString
;wxPathList::FindAbsoluteValidPath(const wxString&)
wxDrawBorder__FUlR6_RECTLT1
;wxShutdown(wxShutdownFlags)
wxShutdown__F15wxShutdownFlags
wxDrawBorder__FUlR6_RECTLT1
;wxShutdown(wxShutdownFlags)
wxShutdown__F15wxShutdownFlags
- ;wxPathExists(const wxString&)
- wxPathExists__FRC8wxString
+ ;wxDirExists(const wxString&)
+ wxDirExists__FRC8wxString
;wxGetWindowText(unsigned long)
wxGetWindowText__FUl
;wxGetWindowId(unsigned long)
;wxGetWindowText(unsigned long)
wxGetWindowText__FUl
;wxGetWindowId(unsigned long)
#endif // PCH
#include "wx/dir.h"
#endif // PCH
#include "wx/dir.h"
-#include "wx/filefn.h" // for wxPathExists()
+#include "wx/filefn.h" // for wxDirExists()
// ----------------------------------------------------------------------------
// define the types and functions used for file searching
// ----------------------------------------------------------------------------
// define the types and functions used for file searching
bool wxDirData::Read(wxString *filename)
{
dirent *de = (dirent *)NULL; // just to silence compiler warnings
bool wxDirData::Read(wxString *filename)
{
dirent *de = (dirent *)NULL; // just to silence compiler warnings
// speed up string concatenation in the loop a bit
wxString path = m_dirname;
path += _T('/');
path.reserve(path.length() + 255);
// speed up string concatenation in the loop a bit
wxString path = m_dirname;
path += _T('/');
path.reserve(path.length() + 255);
wxString de_d_name;
while ( !matches )
{
de = readdir(m_dir);
if ( !de )
wxString de_d_name;
while ( !matches )
{
de = readdir(m_dir);
if ( !de )
#if wxUSE_UNICODE
de_d_name = wxConvFileName->cMB2WC( de->d_name );
#else
de_d_name = de->d_name;
#if wxUSE_UNICODE
de_d_name = wxConvFileName->cMB2WC( de->d_name );
#else
de_d_name = de->d_name;
// don't return "." and ".." unless asked for
if ( de->d_name[0] == '.' &&
// don't return "." and ".." unless asked for
if ( de->d_name[0] == '.' &&
// finally, check the name
if ( m_filespec.empty() )
{
// finally, check the name
if ( m_filespec.empty() )
{
- matches = m_flags & wxDIR_HIDDEN ? TRUE : de->d_name[0] != '.';
+ matches = m_flags & wxDIR_HIDDEN ? true : de->d_name[0] != '.';
}
#else // old VMS (TODO)
}
#else // old VMS (TODO)
bool wxDirData::Read(wxString * WXUNUSED(filename))
{
bool wxDirData::Read(wxString * WXUNUSED(filename))
{
}
#endif // not or new VMS/old VMS
}
#endif // not or new VMS/old VMS
/* static */
bool wxDir::Exists(const wxString& dir)
{
/* static */
bool wxDir::Exists(const wxString& dir)
{
- return wxPathExists(dir);
+ return wxDirExists(dir);
}
// ----------------------------------------------------------------------------
}
// ----------------------------------------------------------------------------
delete M_DIR;
m_data = NULL;
delete M_DIR;
m_data = NULL;
}
bool wxDir::IsOpened() const
}
bool wxDir::IsOpened() const
const wxString& filespec,
int flags) const
{
const wxString& filespec,
int flags) const
{
- wxCHECK_MSG( IsOpened(), FALSE, _T("must wxDir::Open() first") );
+ wxCHECK_MSG( IsOpened(), false, _T("must wxDir::Open() first") );
bool wxDir::GetNext(wxString *filename) const
{
bool wxDir::GetNext(wxString *filename) const
{
- wxCHECK_MSG( IsOpened(), FALSE, _T("must wxDir::Open() first") );
+ wxCHECK_MSG( IsOpened(), false, _T("must wxDir::Open() first") );
- wxCHECK_MSG( filename, FALSE, _T("bad pointer in wxDir::GetNext()") );
+ wxCHECK_MSG( filename, false, _T("bad pointer in wxDir::GetNext()") );
return M_DIR->Read(filename);
}
bool wxDir::HasSubDirs(const wxString& spec)
{
return M_DIR->Read(filename);
}
bool wxDir::HasSubDirs(const wxString& spec)
{
- wxCHECK_MSG( IsOpened(), FALSE, _T("must wxDir::Open() first") );
+ wxCHECK_MSG( IsOpened(), false, _T("must wxDir::Open() first") );
{
case 2:
// just "." and ".."
{
case 2:
// just "." and ".."
// assume we have subdirs - may turn out to be wrong if we
// have other hard links to this directory but it's not
// that bad as explained above
// assume we have subdirs - may turn out to be wrong if we
// have other hard links to this directory but it's not
// that bad as explained above
name = m_factory->GetInternalName(
path.substr(rootlen, wxString::npos));
name = m_factory->GetInternalName(
path.substr(rootlen, wxString::npos));
- bool isDir = wxPathExists(path);
+ bool isDir = wxDirExists(path);
if (isDir)
name += _T("/");
if (isDir)
name += _T("/");