s/wxSplitPath/wxFileName::SplitPath

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57873 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Francesco Montorsi
2009-01-07 01:47:47 +00:00
parent 47d281e6b7
commit bd365871aa
19 changed files with 46 additions and 45 deletions

View File

@@ -304,7 +304,7 @@ public:
virtual wxDirTraverseResult OnDir(const wxString& dirname)
{
wxString path, name, ext;
wxSplitPath(dirname, &path, &name, &ext);
wxFileName::SplitPath(dirname, &path, &name, &ext);
if ( !ext.empty() )
name << _T('.') << ext;

View File

@@ -189,7 +189,7 @@ void wxFileDialog::GetFilenames(wxArrayString& files) const
void wxFileDialog::SetPath(const wxString& path)
{
wxString ext;
wxSplitPath(path, &m_dir, &m_fileName, &ext);
wxFileName::SplitPath(path, &m_dir, &m_fileName, &ext);
if ( !ext.empty() )
m_fileName << _T('.') << ext;
}

View File

@@ -323,7 +323,7 @@ bool wxDocument::SaveAs()
wxString fileName(tmp);
wxString path, name, ext;
wxSplitPath(fileName, & path, & name, & ext);
wxFileName::SplitPath(fileName, & path, & name, & ext);
if (ext.empty())
{

View File

@@ -1373,7 +1373,7 @@ bool wxFileName::GetShortcutTarget(const wxString& shortcutPath,
wxString* arguments)
{
wxString path, file, ext;
wxSplitPath(shortcutPath, & path, & file, & ext);
wxFileName::SplitPath(shortcutPath, & path, & file, & ext);
HRESULT hres;
IShellLink* psl;

View File

@@ -80,6 +80,7 @@ license is as follows:
#include "wx/imagxpm.h"
#include "wx/wfstream.h"
#include "wx/xpmdecod.h"
#include "wx/filename.h"
IMPLEMENT_DYNAMIC_CLASS(wxXPMHandler,wxImageHandler)
@@ -123,7 +124,7 @@ bool wxXPMHandler::SaveFile(wxImage * image,
wxString sName;
if ( image->HasOption(wxIMAGE_OPTION_FILENAME) )
{
wxSplitPath(image->GetOption(wxIMAGE_OPTION_FILENAME),
wxFileName::SplitPath(image->GetOption(wxIMAGE_OPTION_FILENAME),
NULL, &sName, NULL);
sName << wxT("_xpm");
}

View File

@@ -193,7 +193,7 @@ void wxFileData::ReadData()
m_type |= (fileAttribs & FILE_ATTRIBUTE_DIRECTORY) != 0 ? is_dir : 0;
wxString p, f, ext;
wxSplitPath(m_filePath, & p, & f, & ext);
wxFileName::SplitPath(m_filePath, & p, & f, & ext);
if (wxStricmp(ext, wxT("exe")) == 0)
m_type |= is_exe;
@@ -1428,7 +1428,7 @@ bool wxGenericFileCtrl::SetPath( const wxString& path )
return false;
wxString ext;
wxSplitPath( path, &m_dir, &m_fileName, &ext );
wxFileName::SplitPath( path, &m_dir, &m_fileName, &ext );
if ( !ext.empty() )
{
m_fileName += wxT( "." );

View File

@@ -240,7 +240,7 @@ void wxHtmlHelpController::UseConfig(wxConfigBase *config, const wxString& rootp
bool wxHtmlHelpController::Initialize(const wxString& file)
{
wxString dir, filename, ext;
wxSplitPath(file, & dir, & filename, & ext);
wxFileName::SplitPath(file, & dir, & filename, & ext);
if (!dir.empty())
dir = dir + wxFILE_SEP_PATH;

View File

@@ -200,7 +200,7 @@ const wxChar* wxGetHomeDir(wxString *home)
#endif
// it needs to be a full path to be usable
if ( prog.compare(1, 2, _T(":\\")) == 0 )
wxSplitPath(prog, &strDir, NULL, NULL);
wxFileName::SplitPath(prog, &strDir, NULL, NULL);
}
if ( strDir.empty() )
{

View File

@@ -167,7 +167,7 @@ void wxFileDialog::GetFilenames(wxArrayString& files) const
void wxFileDialog::SetPath(const wxString& path)
{
wxString ext;
wxSplitPath(path, &m_dir, &m_fileName, &ext);
wxFileName::SplitPath(path, &m_dir, &m_fileName, &ext);
if ( !ext.empty() )
m_fileName << _T('.') << ext;
}

View File

@@ -219,7 +219,7 @@ bool wxCHMHelpController::Quit()
wxString wxCHMHelpController::GetValidFilename() const
{
wxString path, name, ext;
wxSplitPath(m_helpFile, &path, &name, &ext);
wxFileName::SplitPath(m_helpFile, &path, &name, &ext);
wxString fullName;
if (path.IsEmpty())

View File

@@ -112,7 +112,7 @@ bool wxWinHelpController::Quit(void)
wxString wxWinHelpController::GetValidFilename(const wxString& file) const
{
wxString path, name, ext;
wxSplitPath(file, & path, & name, & ext);
wxFileName::SplitPath(file, & path, & name, & ext);
wxString fullName;
if (path.empty())

View File

@@ -733,7 +733,7 @@ bool wxFileTypeImpl::SetMimeType(const wxString& mimeTypeOrig)
{
// make up a default value for it
wxString cmd;
wxSplitPath(GetCommand(_T("open")), NULL, &cmd, NULL);
wxFileName::SplitPath(GetCommand(_T("open")), NULL, &cmd, NULL);
mimeType << _T("application/x-") << cmd;
}
else

View File

@@ -431,7 +431,7 @@ const wxChar* wxGetHomeDir(wxString *pstr)
else // fall back to the program directory
{
// extract the directory component of the program file name
wxSplitPath(wxGetFullModuleName(), &strDir, NULL, NULL);
wxFileName::SplitPath(wxGetFullModuleName(), &strDir, NULL, NULL);
}
#endif // UNIX/Win

View File

@@ -105,7 +105,7 @@ void wxFileDialog::GetPaths(wxArrayString& paths) const
void wxFileDialog::SetPath(const wxString& path)
{
wxString ext;
wxSplitPath(path, &m_dir, &m_fileName, &ext);
wxFileName::SplitPath(path, &m_dir, &m_fileName, &ext);
if ( !ext.empty() )
m_fileName << _T('.') << ext;
}

View File

@@ -90,7 +90,7 @@ bool wxWinceHelpController::Quit()
wxString wxWinceHelpController::GetValidFilename(const wxString& file) const
{
wxString path, name, ext;
wxSplitPath(file, & path, & name, & ext);
wxFileName::SplitPath(file, & path, & name, & ext);
wxString fullName;
if (path.empty())

View File

@@ -248,7 +248,7 @@ int wxFileDialog::ShowModal()
int nIdx = wxStrlen(zFileNameBuffer) - 1;
wxString sExt;
wxSplitPath( zFileNameBuffer
wxFileName::SplitPath( zFileNameBuffer
,&m_path
,&m_fileName
,&sExt

View File

@@ -335,7 +335,7 @@ void wxFileDialog::GetFilenames(wxArrayString& files) const
void wxFileDialog::SetPath(const wxString& path)
{
wxString ext;
wxSplitPath(path, &m_dir, &m_fileName, &ext);
wxFileName::SplitPath(path, &m_dir, &m_fileName, &ext);
if ( !ext.empty() )
m_fileName << _T('.') << ext;
}

View File

@@ -53,7 +53,7 @@ wxRichTextHTMLHandler::wxRichTextHTMLHandler(const wxString& name, const wxStrin
bool wxRichTextHTMLHandler::CanHandle(const wxString& filename) const
{
wxString path, file, ext;
wxSplitPath(filename, & path, & file, & ext);
wxFileName::SplitPath(filename, & path, & file, & ext);
return (ext.Lower() == wxT("html") || ext.Lower() == wxT("htm"));
}

View File

@@ -416,7 +416,7 @@ wxArrayString XmlResApp::PrepareTempFiles()
}
wxString name, ext, path;
wxSplitPath(parFiles[i], &path, &name, &ext);
wxFileName::SplitPath(parFiles[i], &path, &name, &ext);
FindFilesInXML(doc.GetRoot(), flist, path);
if (flagH)