]> git.saurik.com Git - wxWidgets.git/commitdiff
1) added wxSplitFile() to decompose a file name into path + name + ext
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 14 Jul 1998 21:55:17 +0000 (21:55 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 14 Jul 1998 21:55:17 +0000 (21:55 +0000)
2) added a macro wxARE_FILENAMES_CASE_SENSITIVE which is either 1 or 0
   (for usage with wxString::IsSameAs)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@265 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/filefn.h

index 64ff0521deebc1afbab49879b59cbe677b7e562e..e0ad458fb54408f08077ce3ce7a02c2170231bde 100644 (file)
@@ -133,6 +133,14 @@ bool WXDLLEXPORT wxRmdir(const wxString& dir, int flags = 0);
   #define PATH_SEP          PATH_SEP_DOS
 #endif  // Unix/Windows
 
+// this is useful for wxString::IsSameAs(): to compare two file names use
+// filename1.IsSameAs(filename2, wxARE_FILENAMES_CASE_SENSITIVE)
+#ifdef  __UNIX__
+  #define wxARE_FILENAMES_CASE_SENSITIVE  TRUE
+#else   // Windows
+  #define wxARE_FILENAMES_CASE_SENSITIVE  FALSE
+#endif  // Unix/Windows
+
 // is the char a path separator?
 inline bool wxIsPathSeparator(char c)
   { return c == FILE_SEP_PATH_DOS || c == FILE_SEP_PATH_UNIX; }
@@ -140,6 +148,13 @@ inline bool wxIsPathSeparator(char c)
 // does the string ends with path separator?
 bool WXDLLEXPORT wxEndsWithPathSeparator(const char *pszFileName);
 
+// split the full path into path (including drive for DOS), name and extension
+// (understands both '/' and '\\')
+void WXDLLEXPORT wxSplitPath(const char *pszFileName,
+                             wxString *pstrPath,
+                             wxString *pstrName,
+                             wxString *pstrExt);
+
 // find a file in a list of directories, returns false if not found
 bool WXDLLEXPORT wxFindFileInPath(wxString *pStr, const char *pszPath, const char *pszFile);