]> git.saurik.com Git - wxWidgets.git/commitdiff
s/wxSplitPath/wxFileName::SplitPath
authorFrancesco Montorsi <f18m_cpp217828@yahoo.it>
Wed, 7 Jan 2009 01:47:47 +0000 (01:47 +0000)
committerFrancesco Montorsi <f18m_cpp217828@yahoo.it>
Wed, 7 Jan 2009 01:47:47 +0000 (01:47 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57873 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

19 files changed:
samples/console/console.cpp
src/cocoa/filedlg.mm
src/common/docview.cpp
src/common/filename.cpp
src/common/imagxpm.cpp
src/generic/filectrlg.cpp
src/html/helpctrl.cpp
src/msdos/utilsdos.cpp
src/msw/filedlg.cpp
src/msw/helpchm.cpp
src/msw/helpwin.cpp
src/msw/mimetype.cpp
src/msw/utils.cpp
src/msw/wince/filedlgwce.cpp
src/msw/wince/helpwce.cpp
src/os2/filedlg.cpp
src/osx/cocoa/filedlg.mm
src/richtext/richtexthtml.cpp
utils/wxrc/wxrc.cpp

index 8fb03b87d1a255bd317c4da0a39516dadb70dc82..5fb1832dbc9c18520af10cd57122c36063ab1ec2 100644 (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;
index 57a8a2fbaf90153760f3593cfdd21f5b873155a0..d3d988c21591b339d139dea9dcc88a8f95e1d2fa 100644 (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;
 }
index b09fc26b15464fba7a5ff8232a413e5bf72a2cad..11f9b7b6737d9844605f29dcff5a7a4ac1d777fe 100644 (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())
     {
index 7cdc249d29b4fdb7cbbb22d09e66a5391317e8f9..508954f955161f594ca10a78cf995247e7ae988d 100644 (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;
index 5aa6dded4392573a8c0372f77b49e9c8d777c733..3f1caeaf46a07610a520c1b70674ffc7341f767e 100644 (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,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");
     }
 
index e58ada1f59a257bcd05acd4195493244edb78756..f8b612952b901a0d012761cc2627515b8c4b7921 100644 (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;
 
@@ -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( "." );
index 206e868051e9f343791ca42e4b57d08a3e0ec4db..28e07592b7b2fa1bad8fafcfbc2db1be91cd1372 100644 (file)
@@ -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;
index 93d9b31006c9c4ea5dcb0a5ff0e5203defb09568..d5c8a1a0fe2cb0357431f3f69dcd48b76d27b802 100644 (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() )
         {
index d1bb4157092629ef348156ea617ce905186a05bb..0cc25b19d6a77f1aba06954f35e0ed158cba216a 100644 (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;
 }
index c991d47a3c5450dc47f33af285feab89dfd5414c..a9c663e74a790e20bcee04bbff3cf46726f67c57 100644 (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())
index e33ad6c8de11f64d02ba42a8d35f494333cffc6c..919c311214e03d9572251f51940d02fcbee46f6c 100644 (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())
index e10c79bd5171871e38fdd8387be381affe537487..a7d29114c96519a84e8bfbe9be04b28d86840bc2 100644 (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
index 328839265aec279761462467f174546c0e2b17b1..ff23655ecb55b643fa2ff3f8866b07a6a2817842 100644 (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
 
index 20dbe03368cd40ac72cf8829a038c77bf3f4fd92..e5c59407a6e79ba790e8af3af834914cea86d927 100644 (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;
 }
index 10aed8a102d07d87d5528494971b17a4b6dc66b4..63a91351c0b860e5c4ce2738ce91e5582628c707 100644 (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())
index 77dcc5c30db45f9ab1a2b0e76ed14ee6f7629272..24887d4bf5a065748ad1a6019e96313519ac336b 100644 (file)
@@ -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');
index 3297a3398459bae7e43e5302795abd090291b311..6d13927ecf8c12ce88461040aed986984534c105 100644 (file)
@@ -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;
 }
index 2c8694d0c73f04c7e9eeabc550fba3c58c58f4e2..301065a91ec9244be0584cf809dff0b88572770a 100644 (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"));
 }
index 940913e55524ed81decd839cee275f65538c19af..620e8d025caa2de1990c850a0a1ad0c6c2fabe6e 100644 (file)
@@ -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)