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:
@@ -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;
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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())
|
||||
{
|
||||
|
@@ -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;
|
||||
|
@@ -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,8 +124,8 @@ bool wxXPMHandler::SaveFile(wxImage * image,
|
||||
wxString sName;
|
||||
if ( image->HasOption(wxIMAGE_OPTION_FILENAME) )
|
||||
{
|
||||
wxSplitPath(image->GetOption(wxIMAGE_OPTION_FILENAME),
|
||||
NULL, &sName, NULL);
|
||||
wxFileName::SplitPath(image->GetOption(wxIMAGE_OPTION_FILENAME),
|
||||
NULL, &sName, NULL);
|
||||
sName << wxT("_xpm");
|
||||
}
|
||||
|
||||
|
@@ -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;
|
||||
|
||||
@@ -1295,7 +1295,7 @@ void wxGenericFileCtrl::OnSelected( wxListEvent &event )
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
m_ignoreChanges = true;
|
||||
m_text->SetValue( filename );
|
||||
@@ -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( "." );
|
||||
|
@@ -157,7 +157,7 @@ wxHtmlHelpFrame* wxHtmlHelpController::CreateHelpFrame(wxHtmlHelpData *data)
|
||||
wxHtmlHelpFrame* frame = new wxHtmlHelpFrame(data);
|
||||
frame->SetController(this);
|
||||
frame->Create(m_parentWindow, -1, wxEmptyString, m_FrameStyle, m_Config, m_ConfigRoot);
|
||||
frame->SetTitleFormat(m_titleFormat);
|
||||
frame->SetTitleFormat(m_titleFormat);
|
||||
m_helpFrame = frame;
|
||||
return frame;
|
||||
}
|
||||
@@ -166,7 +166,7 @@ wxHtmlHelpDialog* wxHtmlHelpController::CreateHelpDialog(wxHtmlHelpData *data)
|
||||
{
|
||||
wxHtmlHelpDialog* dialog = new wxHtmlHelpDialog(data);
|
||||
dialog->SetController(this);
|
||||
dialog->SetTitleFormat(m_titleFormat);
|
||||
dialog->SetTitleFormat(m_titleFormat);
|
||||
dialog->Create(m_parentWindow, -1, wxEmptyString, m_FrameStyle);
|
||||
m_helpDialog = dialog;
|
||||
return dialog;
|
||||
@@ -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;
|
||||
|
@@ -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() )
|
||||
{
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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())
|
||||
|
@@ -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())
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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())
|
||||
|
@@ -248,11 +248,11 @@ int wxFileDialog::ShowModal()
|
||||
int nIdx = wxStrlen(zFileNameBuffer) - 1;
|
||||
wxString sExt;
|
||||
|
||||
wxSplitPath( zFileNameBuffer
|
||||
,&m_path
|
||||
,&m_fileName
|
||||
,&sExt
|
||||
);
|
||||
wxFileName::SplitPath( zFileNameBuffer
|
||||
,&m_path
|
||||
,&m_fileName
|
||||
,&sExt
|
||||
);
|
||||
if (zFileNameBuffer[nIdx] == wxT('.') || sExt.empty())
|
||||
{
|
||||
zFileNameBuffer[nIdx] = wxT('\0');
|
||||
|
@@ -55,7 +55,7 @@ NSArray* GetTypesFromFilter( const wxString filter )
|
||||
{
|
||||
wxArrayString names ;
|
||||
wxArrayString extensions;
|
||||
|
||||
|
||||
wxString filter2(filter) ;
|
||||
int filterIndex = 0;
|
||||
bool isName = true ;
|
||||
@@ -109,22 +109,22 @@ NSArray* GetTypesFromFilter( const wxString filter )
|
||||
if (extension.length() && (extension.GetChar(0) == '.'))
|
||||
extension = extension.Mid( 1 );
|
||||
|
||||
if ( extension.IsEmpty() )
|
||||
if ( extension.IsEmpty() )
|
||||
{
|
||||
if ( types != nil )
|
||||
[types release];
|
||||
return nil;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if ( types == nil )
|
||||
types = [[NSMutableArray alloc] init];
|
||||
|
||||
|
||||
wxCFStringRef cfext(extension);
|
||||
[types addObject: (NSString*)cfext.AsNSString() ];
|
||||
#if 0
|
||||
#if 0
|
||||
wxUint32 fileType, creator;
|
||||
|
||||
|
||||
// extension -> mactypes
|
||||
#endif
|
||||
}
|
||||
@@ -135,17 +135,17 @@ NSArray* GetTypesFromFilter( const wxString filter )
|
||||
int wxFileDialog::ShowModal()
|
||||
{
|
||||
int result = wxID_CANCEL;
|
||||
|
||||
|
||||
NSSavePanel *panel = nil;
|
||||
|
||||
|
||||
wxCFStringRef cf( m_message );
|
||||
|
||||
|
||||
wxCFStringRef dir( m_path );
|
||||
wxCFStringRef file( m_fileName );
|
||||
|
||||
|
||||
m_path = wxEmptyString;
|
||||
m_fileNames.Clear();
|
||||
|
||||
|
||||
if (HasFlag(wxFD_SAVE))
|
||||
{
|
||||
NSSavePanel* sPanel = [NSSavePanel savePanel];
|
||||
@@ -153,7 +153,7 @@ int wxFileDialog::ShowModal()
|
||||
[sPanel setCanCreateDirectories:YES];
|
||||
[sPanel setMessage:cf.AsNSString()];
|
||||
[sPanel setTreatsFilePackagesAsDirectories:NO];
|
||||
|
||||
|
||||
if ( HasFlag(wxFD_OVERWRITE_PROMPT) )
|
||||
{
|
||||
}
|
||||
@@ -162,7 +162,7 @@ int wxFileDialog::ShowModal()
|
||||
{
|
||||
panel = sPanel;
|
||||
result = wxID_OK;
|
||||
|
||||
|
||||
wxCFStringRef filename( [[sPanel filename] retain] );
|
||||
|
||||
m_path = filename.AsString();
|
||||
@@ -179,7 +179,7 @@ int wxFileDialog::ShowModal()
|
||||
[oPanel setResolvesAliases:YES];
|
||||
[oPanel setCanChooseFiles:YES];
|
||||
[oPanel setMessage:cf.AsNSString()];
|
||||
|
||||
|
||||
if ( [oPanel runModalForDirectory:dir.AsNSString() file:file.AsNSString() types:types] == NSOKButton )
|
||||
{
|
||||
panel = oPanel;
|
||||
@@ -202,7 +202,7 @@ int wxFileDialog::ShowModal()
|
||||
if ( types != nil )
|
||||
[types release];
|
||||
}
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
@@ -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"));
|
||||
}
|
||||
|
@@ -273,7 +273,7 @@ int XmlResApp::OnRun()
|
||||
wxCMD_LINE_VAL_STRING,
|
||||
wxCMD_LINE_PARAM_MULTIPLE | wxCMD_LINE_OPTION_MANDATORY },
|
||||
|
||||
wxCMD_LINE_DESC_END
|
||||
wxCMD_LINE_DESC_END
|
||||
};
|
||||
|
||||
wxCmdLineParser parser(cmdLineDesc, argc, argv);
|
||||
@@ -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)
|
||||
|
Reference in New Issue
Block a user