Simplify wxFileNameFromPath() implementation to avoid redundancy.
No real changes, just use wxFileName::GetFullName() in wxFileNameFromPath() instead of reimplementing it there. Closes #12818. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66527 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -735,16 +735,7 @@ wxChar *wxFileNameFromPath (wxChar *path)
|
|||||||
|
|
||||||
wxString wxFileNameFromPath (const wxString& path)
|
wxString wxFileNameFromPath (const wxString& path)
|
||||||
{
|
{
|
||||||
wxString name, ext;
|
return wxFileName(path).GetFullName();
|
||||||
wxFileName::SplitPath(path, NULL, &name, &ext);
|
|
||||||
|
|
||||||
wxString fullname = name;
|
|
||||||
if ( !ext.empty() )
|
|
||||||
{
|
|
||||||
fullname << wxFILE_SEP_EXT << ext;
|
|
||||||
}
|
|
||||||
|
|
||||||
return fullname;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return just the directory, or NULL if no directory
|
// Return just the directory, or NULL if no directory
|
||||||
|
Reference in New Issue
Block a user