From: Vadim Zeitlin Date: Fri, 12 Jun 2009 15:28:45 +0000 (+0000) Subject: make more wxFileName methods const (closes #10887) X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/d9e80dce156d700ec0140a5f84909c6d2be608d1?ds=inline make more wxFileName methods const (closes #10887) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61022 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/filename.h b/include/wx/filename.h index c5edc822c4..2c04ebb8a4 100644 --- a/include/wx/filename.h +++ b/include/wx/filename.h @@ -243,10 +243,10 @@ public: // (any of the pointers may be NULL) bool SetTimes(const wxDateTime *dtAccess, const wxDateTime *dtMod, - const wxDateTime *dtCreate); + const wxDateTime *dtCreate) const; // set the access and modification times to the current moment - bool Touch(); + bool Touch() const; // return the last access, last modification and create times // (any of the pointers may be NULL) @@ -265,7 +265,7 @@ public: #if defined( __WXOSX_MAC__ ) && wxOSX_USE_CARBON bool MacSetTypeAndCreator( wxUint32 type , wxUint32 creator ) ; - bool MacGetTypeAndCreator( wxUint32 *type , wxUint32 *creator ) ; + bool MacGetTypeAndCreator( wxUint32 *type , wxUint32 *creator ) const; // gets the 'common' type and creator for a certain extension static bool MacFindDefaultTypeAndCreator( const wxString& ext , wxUint32 *type , wxUint32 *creator ) ; // registers application defined extensions and their default type and creator @@ -281,7 +281,7 @@ public: static wxString GetCwd(const wxString& volume = wxEmptyString); // change the current working directory - bool SetCwd(); + bool SetCwd() const; static bool SetCwd( const wxString &cwd ); // get the value of user home (Unix only mainly) @@ -358,7 +358,7 @@ public: // the arguments bool GetShortcutTarget(const wxString& shortcutPath, wxString& targetFilename, - wxString* arguments = NULL); + wxString* arguments = NULL) const; #endif #ifndef __WXWINCE__ diff --git a/interface/wx/filename.h b/interface/wx/filename.h index 4e1697c7b8..e4bd0a4dca 100644 --- a/interface/wx/filename.h +++ b/interface/wx/filename.h @@ -1035,7 +1035,7 @@ public: /** Changes the current working directory. */ - bool SetCwd(); + bool SetCwd() const; /** Changes the current working directory. @@ -1080,7 +1080,7 @@ public: */ bool SetTimes(const wxDateTime* dtAccess, const wxDateTime* dtMod, - const wxDateTime* dtCreate); + const wxDateTime* dtCreate) const; /** Sets the volume specifier. @@ -1162,7 +1162,7 @@ public: /** Sets the access and modification times to the current moment. */ - bool Touch(); + bool Touch() const; /** Returns @true if the filenames are different. The string @e filenames diff --git a/src/common/filename.cpp b/src/common/filename.cpp index 2f668ec457..b0274b5863 100644 --- a/src/common/filename.cpp +++ b/src/common/filename.cpp @@ -592,7 +592,7 @@ wxString wxFileName::GetCwd(const wxString& volume) return cwd; } -bool wxFileName::SetCwd() +bool wxFileName::SetCwd() const { return wxFileName::SetCwd( GetPath() ); } @@ -1433,7 +1433,7 @@ bool wxFileName::ReplaceHomeDir(wxPathFormat format) bool wxFileName::GetShortcutTarget(const wxString& shortcutPath, wxString& targetFilename, - wxString* arguments) + wxString* arguments) const { wxString path, file, ext; wxFileName::SplitPath(shortcutPath, & path, & file, & ext); @@ -2277,7 +2277,7 @@ wxString wxFileName::StripExtension(const wxString& fullpath) bool wxFileName::SetTimes(const wxDateTime *dtAccess, const wxDateTime *dtMod, - const wxDateTime *dtCreate) + const wxDateTime *dtCreate) const { #if defined(__WIN32__) FILETIME ftAccess, ftCreate, ftWrite; @@ -2350,7 +2350,7 @@ bool wxFileName::SetTimes(const wxDateTime *dtAccess, return false; } -bool wxFileName::Touch() +bool wxFileName::Touch() const { #if defined(__UNIX_LIKE__) // under Unix touching file is simple: just pass NULL to utime() @@ -2608,7 +2608,7 @@ bool wxFileName::MacSetTypeAndCreator( wxUint32 type , wxUint32 creator ) return false ; } -bool wxFileName::MacGetTypeAndCreator( wxUint32 *type , wxUint32 *creator ) +bool wxFileName::MacGetTypeAndCreator( wxUint32 *type , wxUint32 *creator ) const { FSRef fsRef ; FSCatalogInfo catInfo;