]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/filename.h
added selecting-while-dragging
[wxWidgets.git] / include / wx / filename.h
index 64a48aa5edca0fd44031a7e3d2486a9d360c0138..e8a87042b8e95c3f5b588ea7846fdd2f4bab207b 100644 (file)
@@ -6,13 +6,13 @@
 // Created:     28.12.00
 // RCS-ID:      $Id$
 // Copyright:   (c) 2000 Robert Roebling
-// Licence:     wxWindows license
+// Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 #ifndef   _WX_FILENAME_H_
 #define   _WX_FILENAME_H_
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(__APPLE__)
     #pragma interface "filename.h"
 #endif
 
@@ -175,17 +175,17 @@ 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)
 
     // time functions
-
+#if wxUSE_DATETIME
         // set the file last access/mod and creation times
         // (any of the pointers may be NULL)
     bool SetTimes(const wxDateTime *dtAccess,
@@ -208,6 +208,7 @@ public:
         (void)GetTimes(NULL, &dtMod, NULL);
         return dtMod;
     }
+#endif // wxUSE_DATETIME
 
 #ifdef __WXMAC__
     bool MacSetTypeAndCreator( wxUint32 type , wxUint32 creator ) ;
@@ -271,17 +272,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);
+        // compares with the rules of the given platforms format
+    bool SameAs(const wxFileNamefilepath,
+                wxPathFormat format = wxPATH_NATIVE) const;
 
-        // uses the current platform settings
-    bool operator==(const wxFileName& filename) { return SameAs(filename); }
-    bool operator==(const wxString& filename)
-        { return *this == wxFileName(filename); }
+        // 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 );
@@ -379,9 +394,10 @@ public:
     // deprecated methods, don't use any more
     // --------------------------------------
 
+#ifndef __DIGITALMARS__
     wxString GetPath( bool withSep, wxPathFormat format = wxPATH_NATIVE ) const
         { return GetPath(withSep ? wxPATH_GET_SEPARATOR : 0, format); }
-
+#endif
     wxString GetPathWithSep(wxPathFormat format = wxPATH_NATIVE ) const
         { return GetPath(wxPATH_GET_SEPARATOR, format); }