From 6d3d1c2e04d33bd387a4a3cd7794f52189d29a7b Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 28 Mar 2002 11:44:30 +0000 Subject: [PATCH] committing the file which I forgot to commit yesterday (sorry) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14833 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/filename.h | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/include/wx/filename.h b/include/wx/filename.h index d565187e62..9553b4c0e8 100644 --- a/include/wx/filename.h +++ b/include/wx/filename.h @@ -273,26 +273,26 @@ public: static bool IsCaseSensitive( wxPathFormat format = wxPATH_NATIVE ); // is this filename absolute? - bool IsAbsolute( wxPathFormat format = wxPATH_NATIVE ) const; + bool IsAbsolute(wxPathFormat format = wxPATH_NATIVE) const; // is this filename relative? - bool IsRelative() const - { return m_relative; } - - // forcibly set the flag - void SetAbsolute() - { m_relative = FALSE; } - void SetRelative() - { m_relative = TRUE; } + bool IsRelative(wxPathFormat format = wxPATH_NATIVE) const + { return !IsAbsolute(format); } // Information about path format - // get the string separating the volume from the path for this format + // get the string separating the volume from the path for this format, + // return an empty string if this format doesn't support the notion of + // volumes at all static wxString GetVolumeSeparator(wxPathFormat format = wxPATH_NATIVE); // get the string of path separators for this format static wxString GetPathSeparators(wxPathFormat format = wxPATH_NATIVE); + // get the canonical path separator for this format + static wxChar GetPathSeparator(wxPathFormat format = wxPATH_NATIVE) + { return GetPathSeparators(format)[0u]; } + // is the char a path separator for this format? static bool IsPathSeparator(wxChar ch, wxPathFormat format = wxPATH_NATIVE); @@ -375,8 +375,15 @@ private: // the file name and extension (empty for directories) wxString m_name, m_ext; - - // is the path relative + + // when m_dirs is empty it may mean either that we have no path at all or + // that our path is '/', i.e. the root directory + // + // we use m_relative to distinguish between these two cases, it will be + // TRUE in the former and FALSE in the latter + // + // NB: the path is not absolute just because m_relative is FALSE, it still + // needs the drive (i.e. volume) in some formats (Windows) bool m_relative; };