minor fix to wxFileName::MakeRelativeTo(), removed broken and misleading IsWild() method, added IsDir() one

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14948 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2002-04-05 11:14:09 +00:00
parent 808ef6d2e8
commit 2db991f457
4 changed files with 30 additions and 18 deletions

View File

@@ -955,6 +955,17 @@ bool wxFileName::MakeRelativeTo(const wxString& pathBase, wxPathFormat format)
m_dirs.Insert(wxT(".."), 0u);
}
if ( format == wxPATH_UNIX || format == wxPATH_DOS )
{
// a directory made relative with respect to itself is '.' under Unix
// and DOS, by definition (but we don't have to insert "./" for the
// files)
if ( m_dirs.IsEmpty() && IsDir() )
{
m_dirs.Add(_T('.'));
}
}
m_relative = TRUE;
// we were modified
@@ -1048,13 +1059,6 @@ bool wxFileName::IsPathSeparator(wxChar ch, wxPathFormat format)
return GetPathSeparators(format).Find(ch) != wxNOT_FOUND;
}
bool wxFileName::IsWild( wxPathFormat WXUNUSED(format) )
{
// FIXME: this is probably false for Mac and this is surely wrong for most
// of Unix shells (think about "[...]")
return m_name.find_first_of(_T("*?")) != wxString::npos;
}
// ----------------------------------------------------------------------------
// path components manipulation
// ----------------------------------------------------------------------------