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"))
void NodesDb::LoadDir(const wxString& path)
{
- if (!wxPathExists(path)) return;
+ if (!wxDirExists(path)) return;
wxDir dir(path);
wxString filename;
wxWidgets 2.5 Change Log - For more verbose changes, see the manual
-------------------------------------------------------------------
+2.6
+-----
+
+All:
+
+- wxPathExists deprecated, use wxDirExists instead.
+
2.5.5
-----
- 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
\helpref{wxOnAssert}{wxonassert}\\
\helpref{wxOpenClipboard}{wxopenclipboard}\\
\helpref{wxParseCommonDialogsFilter}{wxparsecommondialogsfilter}\\
-\helpref{wxPathExists}{functionwxpathexists}\\
+\helpref{wxDirExists}{functionwxdirexists}\\
\helpref{wxPathOnly}{wxpathonly}\\
\helpref{wxPostDelete}{wxpostdelete}\\
\helpref{wxPostEvent}{wxpostevent}\\
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.
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 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
}
// 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);
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') ||
- wxPathExists(dirNameLower));
+ wxDirExists(dirNameLower));
}
else
#endif
{
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.
{
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;
if (!wxEndsWithPathSeparator(path))
path += wxFILE_SEP_PATH;
path += new_name;
- if (wxPathExists(path))
+ if (wxDirExists(path))
{
// try NewName0, NewName1 etc.
int i = 0;
path += wxFILE_SEP_PATH;
path += new_name;
i++;
- } while (wxPathExists(path));
+ } while (wxDirExists(path));
}
wxLogNull log;
void wxFileCtrl::GoToDir( const wxString &dir )
{
- if (!wxPathExists(dir)) return;
+ if (!wxDirExists(dir)) return;
m_dirName = dir;
UpdateFiles();
if (!IsTopMostDir(dir))
dir += wxFILE_SEP_PATH;
dir += filename;
- if (wxPathExists(dir)) return;
+ if (wxDirExists(dir)) return;
ignoreChanges = true;
m_text->SetValue( filename );
filename = dir;
}
- if (wxPathExists(filename))
+ if (wxDirExists(filename))
{
m_list->GoToDir( filename );
UpdateControls();
{
wxString newfile;
newfile << WXEXTHELP_SEPARATOR << wxGetLocale()->GetName();
- if(wxPathExists(newfile))
+ if(wxDirExists(newfile))
file = newfile;
else
{
const wxChar *cptr = wxGetLocale()->GetName().c_str();
while(*cptr && *cptr != wxT('_'))
newfile << *(cptr++);
- if(wxPathExists(newfile))
+ if(wxDirExists(newfile))
file = newfile;
}
}
#endif
- if(! wxPathExists(file))
+ if(! wxDirExists(file))
return false;
mapFile << file << WXEXTHELP_SEPARATOR << WXEXTHELP_MAPFILE;
if ( style & wxSAVE )
{
- if ( !defaultDir.IsEmpty() )
+ if ( !defaultDir.empty() )
gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(m_widget),
wxConvFileName->cWX2MB(defaultDir));
}
else
{
- if ( !defaultFileName.IsEmpty() )
+ if ( !defaultFileName.empty() )
{
wxString dir;
- if ( defaultDir.IsEmpty() )
+ if ( defaultDir.empty() )
dir = ::wxGetCwd();
else
dir = defaultDir;
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) );
}
#ifdef __WXGTK24__
if (!gtk_check_version(2,4,0))
{
- if (wxPathExists(dir))
+ if (wxDirExists(dir))
{
gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(m_widget), wxConvFileName->cWX2MB(dir));
}
if ( style & wxSAVE )
{
- if ( !defaultDir.IsEmpty() )
+ if ( !defaultDir.empty() )
gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(m_widget),
wxConvFileName->cWX2MB(defaultDir));
}
else
{
- if ( !defaultFileName.IsEmpty() )
+ if ( !defaultFileName.empty() )
{
wxString dir;
- if ( defaultDir.IsEmpty() )
+ if ( defaultDir.empty() )
dir = ::wxGetCwd();
else
dir = defaultDir;
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) );
}
#ifdef __WXGTK24__
if (!gtk_check_version(2,4,0))
{
- if (wxPathExists(dir))
+ if (wxDirExists(dir))
{
gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(m_widget), wxConvFileName->cWX2MB(dir));
}
#endif // PCH
#include "wx/dir.h"
-#include "wx/filefn.h" // for wxPathExists()
+#include "wx/filefn.h" // for wxDirExists()
#ifndef __DARWIN__
#include <windows.h>
public:
wxDirData(const wxString& dirname);
~wxDirData();
-
+
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 wxDirData::Close()
-{
+{
if ( m_iterator )
{
FSCloseIterator( m_iterator ) ;
}
}
-void wxDirData::Rewind()
+void wxDirData::Rewind()
{
Close() ;
}
bool wxDirData::Read(wxString *filename)
-{
+{
wxString result;
OSStatus err = noErr ;
if ( NULL == m_iterator )
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 ;
+ }
}
-
+
wxString name ;
-
+
while( noErr == err )
{
HFSUniStr255 uniname ;
err = FSGetCatalogInfoBulk( m_iterator, 1, &fetched, NULL, kFSCatInfoNodeFlags | kFSCatInfoFinderInfo , &catalogInfo , &fileRef, NULL, &uniname );
if ( errFSNoMoreItems == err )
return false ;
-
+
wxASSERT( noErr == err ) ;
-
+
if ( noErr != err )
break ;
-
+
name = wxMacHFSUniStrToString( &uniname ) ;
if ( ( name == wxT(".") || name == wxT("..") ) && !(m_flags & wxDIR_DOTDOT) )
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 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) )
{
continue ;
}
-
+
break ;
}
if ( err != noErr )
{
- return FALSE ;
+ return false ;
}
-
+
*filename = name ;
- return TRUE;
+ return true;
}
// ----------------------------------------------------------------------------
/* static */
bool wxDir::Exists(const wxString& dir)
{
- return wxPathExists(dir);
+ return wxDirExists(dir);
}
// ----------------------------------------------------------------------------
delete M_DIR;
m_data = new wxDirData(dirname);
- return TRUE;
+ return true;
}
bool wxDir::IsOpened() 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") );
M_DIR->Rewind();
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);
}
#endif // PCH
#include "wx/dir.h"
-#include "wx/filefn.h" // for wxPathExists()
+#include "wx/filefn.h" // for wxDirExists()
#ifndef __DARWIN__
#include <windows.h>
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; }
: m_dirname(dirname)
{
m_ok = false;
-
+
OSErr err;
-
+
// 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);
-
+
#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 ;
{
}
-void wxDirData::Rewind()
+void wxDirData::Rewind()
{
m_index = 0 ;
}
bool wxDirData::Read(wxString *filename)
{
if ( !m_isDir )
- return FALSE ;
-
+ return false ;
+
wxString result;
short err = noErr ;
-
+
while ( err == noErr )
{
m_index++ ;
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 ;
// 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 ;
-
+
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("*") )
{
continue ;
}
-
+
break ;
}
if ( err != noErr )
{
- return FALSE ;
+ return false ;
}
-
+
*filename = wxMacMakeStringFromPascal( m_name ) ;
- return TRUE;
+ return true;
}
// ----------------------------------------------------------------------------
/* 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())
- return TRUE;
+ return true;
else
{
delete m_data;
m_data = NULL;
- return FALSE;
+ return false;
}
}
const wxString& filespec,
int flags) const
{
- wxCHECK_MSG( IsOpened(), FALSE, _T("must wxDir::Open() first") );
+ wxCHECK_MSG( IsOpened(), false, _T("must wxDir::Open() first") );
M_DIR->Rewind();
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);
}
void wxDirData::SetFileSpec(const wxString& filespec)
{
#ifdef __DOS__
- if ( filespec.IsEmpty() )
+ if ( filespec.empty() )
m_filespec = _T("*.*");
else
#endif
bool wxDirData::Read(wxString *filename)
{
PM_findData data;
- bool matches = FALSE;
+ bool matches = false;
data.dwSize = sizeof(data);
-
+
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) )
- return FALSE;
+ return false;
}
else
{
if ( m_dir == PM_FILE_INVALID )
{
m_dir = NULL;
- return FALSE;
+ return false;
}
}
continue;
}
- matches = m_flags & wxDIR_HIDDEN ? TRUE : !(data.attrib & PM_FILE_HIDDEN);
+ matches = m_flags & wxDIR_HIDDEN ? true : !(data.attrib & PM_FILE_HIDDEN);
}
*filename = data.name;
- return TRUE;
+ return true;
}
/* static */
bool wxDir::Exists(const wxString& dir)
{
- return wxPathExists(dir);
+ return wxDirExists(dir);
}
// ----------------------------------------------------------------------------
{
delete M_DIR;
m_data = NULL;
-
+
if ( !wxDir::Exists(dirname) )
{
wxLogError(_("Directory '%s' doesn't exist!"), dirname.c_str());
- return FALSE;
+ return false;
}
-
+
m_data = new wxDirData(dirname);
- return TRUE;
+ return true;
}
bool wxDir::IsOpened() 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") );
M_DIR->Rewind();
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);
}
#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"
/* 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 ( wxPathExists(ofn->lpstrFile) )
+ if ( wxDirExists(ofn->lpstrFile) )
{
// 1st component is dir => multiple files selected
ofn->nFileOffset = wxStrlen(ofn->lpstrFile)+1;
rc = ::DosFindFirst( rsSpec.c_str()
,&hDir
- ,0x37 // was: FILE_NORMAL
+ ,0x37 // was: FILE_NORMAL
,pFinddata
,sizeof(FILEFINDBUF3)
,&ulFindCount
wxString* psFilename
)
{
- bool bFirst = FALSE;
+ bool bFirst = false;
FILEFINDBUF3 vFinddata;
#define PTR_TO_FINDDATA (&vFinddata)
m_vFinddata = FindFirst( sFilespec
,PTR_TO_FINDDATA
);
- bFirst = TRUE;
+ bFirst = true;
}
if ( !IsFindDataOk(m_vFinddata) )
{
- return FALSE;
+ return false;
}
const wxChar* zName;
{
if (bFirst)
{
- bFirst = FALSE;
+ bFirst = false;
}
else
{
,PTR_TO_FINDDATA
))
{
- return FALSE;
+ return false;
}
}
*psFilename = zName;
break;
}
- return TRUE;
+ return true;
} // end of wxDirData::Read
// ----------------------------------------------------------------------------
const wxString& rsDir
)
{
- return wxPathExists(rsDir);
+ return wxDirExists(rsDir);
} // end of wxDir::Exists
// ----------------------------------------------------------------------------
{
delete M_DIR;
m_data = new wxDirData(rsDirname);
- return TRUE;
+ return true;
} // end of wxDir::Open
bool wxDir::IsOpened() const
, int nFlags
) 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);
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
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&)
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)
#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
bool wxDirData::Read(wxString *filename)
{
dirent *de = (dirent *)NULL; // just to silence compiler warnings
- bool matches = FALSE;
+ bool matches = false;
// 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 )
- return FALSE;
-
+ return false;
+
#if wxUSE_UNICODE
de_d_name = wxConvFileName->cMB2WC( de->d_name );
#else
de_d_name = de->d_name;
-#endif
+#endif
// don't return "." and ".." unless asked for
if ( de->d_name[0] == '.' &&
// 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
{
*filename = de_d_name;
- return TRUE;
+ return true;
}
#else // old VMS (TODO)
bool wxDirData::Read(wxString * WXUNUSED(filename))
{
- return FALSE;
+ return false;
}
#endif // not or new VMS/old VMS
/* static */
bool wxDir::Exists(const wxString& dir)
{
- return wxPathExists(dir);
+ return wxDirExists(dir);
}
// ----------------------------------------------------------------------------
delete M_DIR;
m_data = NULL;
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
bool wxDir::IsOpened() 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") );
M_DIR->Rewind();
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)
{
- wxCHECK_MSG( IsOpened(), FALSE, _T("must wxDir::Open() first") );
+ wxCHECK_MSG( IsOpened(), false, _T("must wxDir::Open() first") );
if ( spec.empty() )
{
{
case 2:
// just "." and ".."
- return FALSE;
+ return false;
case 0:
case 1:
// 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
- return TRUE;
+ return true;
}
}
}
name = m_factory->GetInternalName(
path.substr(rootlen, wxString::npos));
- bool isDir = wxPathExists(path);
+ bool isDir = wxDirExists(path);
if (isDir)
name += _T("/");