]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/filename.h
compilation fix for non-PCH
[wxWidgets.git] / include / wx / filename.h
index 491e7deecc842cae10fe5f9a8f27967730258d5b..7e9ee03a7bc8300e84496a1ea85af7d1b0e0fa5d 100644 (file)
@@ -175,11 +175,11 @@ public:
     bool IsOk() const { return !m_dirs.IsEmpty() || !m_name.IsEmpty(); }
 
         // does the file with this name exists?
-    bool FileExists();
+    bool FileExists() const;
     static bool FileExists( const wxString &file );
 
         // does the directory with this name exists?
-    bool DirExists();
+    bool DirExists() const;
     static bool DirExists( const wxString &dir );
 
         // VZ: also need: IsDirWritable(), IsFileExecutable() &c (TODO)
@@ -271,17 +271,31 @@ public:
     bool MakeRelativeTo(const wxString& pathBase = _T(""),
                         wxPathFormat format = wxPATH_NATIVE);
 
+        // make the path absolute
+        //
+        // this may be done using another (than current) value of cwd
+    bool MakeAbsolute(const wxString& cwd = wxEmptyString,
+                      wxPathFormat format = wxPATH_NATIVE)
+        { return Normalize(wxPATH_NORM_DOTS | wxPATH_NORM_ABSOLUTE |
+                           wxPATH_NORM_TILDE, cwd, format); }
 
     // Comparison
 
-        // compares with the rules of this platform
-    bool SameAs(const wxFileName &filepath,
-                wxPathFormat format = wxPATH_NATIVE);
-
-        // uses the current platform settings
-    bool operator==(const wxFileName& filename) { return SameAs(filename); }
-    bool operator==(const wxString& filename)
-        { return *this == wxFileName(filename); }
+        // compares with the rules of the given platforms format
+    bool SameAs(const wxFileName& filepath,
+                wxPathFormat format = wxPATH_NATIVE) const;
+
+        // compare with another filename object
+    bool operator==(const wxFileName& filename) const
+        { return SameAs(filename); }
+    bool operator!=(const wxFileName& filename) const
+        { return !SameAs(filename); }
+
+        // compare with a filename string interpreted as a native file name
+    bool operator==(const wxString& filename) const
+        { return SameAs(wxFileName(filename)); }
+    bool operator!=(const wxString& filename) const
+        { return !SameAs(wxFileName(filename)); }
 
         // are the file names of this type cases sensitive?
     static bool IsCaseSensitive( wxPathFormat format = wxPATH_NATIVE );