backported wxFileName::MakeAbsolute

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@20201 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2003-04-13 17:09:37 +00:00
parent 919d1806cc
commit a24ce8f811
3 changed files with 26 additions and 4 deletions

View File

@@ -185,6 +185,7 @@ All:
- fixed duplicate wxFontEncoding values - fixed duplicate wxFontEncoding values
- wxFileConfig now always uses UTF-8 to store settings in Unicode build; - wxFileConfig now always uses UTF-8 to store settings in Unicode build;
it will be possible to set different charset in wxWindows >= 2.5.0 it will be possible to set different charset in wxWindows >= 2.5.0
- added wxFileName::MakeAbsolute
Unix (GUI): Unix (GUI):

View File

@@ -87,10 +87,10 @@ File names can be case-sensitive or not, the function\rtfsp
The rules for determining if the file name is absolute or relative also depends The rules for determining if the file name is absolute or relative also depends
on the file name format and the only portable way to answer to this question is on the file name format and the only portable way to answer to this question is
to use \helpref{IsAbsolute}{wxfilenameisabsolute} method. To ensure that the to use \helpref{IsAbsolute}{wxfilenameisabsolute} method. To ensure that the
filename is absolute you may use \helpref{Normalize}{wxfilenamenormalize}. There filename is absolute you may use
is also an inverse function \helpref{MakeRelativeTo}{wxfilenamemakerelativeto} \helpref{MakeAbsolute}{wxfilenamemakeabsolute}. There is also an inverse
which undoes what \helpref{Normalize(wxPATH\_NORM\_DOTS)}{wxfilenamenormalize} function \helpref{MakeRelativeTo}{wxfilenamemakerelativeto} which undoes what
does. \helpref{Normalize(wxPATH\_NORM\_DOTS)}{wxfilenamenormalize} does.
Other functions returning information about the file format provided by this Other functions returning information about the file format provided by this
class are \helpref{GetVolumeSeparator}{wxfilenamegetvolumeseparator},\rtfsp class are \helpref{GetVolumeSeparator}{wxfilenamegetvolumeseparator},\rtfsp
@@ -525,6 +525,23 @@ directory or file really exists, you should use
\helpref{DirExists}{wxfilenamedirexists} or \helpref{DirExists}{wxfilenamedirexists} or
\helpref{FileExists}{wxfilenamefileexists} for this. \helpref{FileExists}{wxfilenamefileexists} for this.
\membersection{wxFileName::MakeAbsolute}\label{wxfilenamemakeabsolute}
\func{bool}{MakeAbsolute}{\param{const wxString\& }{cwd = wxEmptyString}, \param{wxPathFormat }{format = wxPATH\_NATIVE}}
Make the file name absolute. This is a shortcut for
{\tt \helpref{Normalize}{wxfilenamenormalize}(wxPATH\_NORM\_DOTS | wxPATH\_NORM\_ABSOLUTE | wxPATH\_NORM\_TILDE, cwd, format)}.
\wxheading{See also}
\helpref{MakeRelativeTo}{wxfilenamemakerelativeto},
\helpref{Normalize}{wxfilenamenormalize},
\helpref{IsAbsolute}{wxfilenameisabsolute}
\wxheading{Note}
This method was added in wxWindows 2.4.1.
\membersection{wxFileName::MakeRelativeTo}\label{wxfilenamemakerelativeto} \membersection{wxFileName::MakeRelativeTo}\label{wxfilenamemakerelativeto}
\func{bool}{MakeRelativeTo}{\param{const wxString\& }{pathBase = ""}, \param{wxPathFormat }{format = wxPATH\_NATIVE}} \func{bool}{MakeRelativeTo}{\param{const wxString\& }{pathBase = ""}, \param{wxPathFormat }{format = wxPATH\_NATIVE}}

View File

@@ -271,6 +271,10 @@ public:
bool MakeRelativeTo(const wxString& pathBase = _T(""), bool MakeRelativeTo(const wxString& pathBase = _T(""),
wxPathFormat format = wxPATH_NATIVE); wxPathFormat format = wxPATH_NATIVE);
bool MakeAbsolute(const wxString& cwd = wxEmptyString,
wxPathFormat format = wxPATH_NATIVE)
{ return Normalize(wxPATH_NORM_DOTS | wxPATH_NORM_ABSOLUTE |
wxPATH_NORM_TILDE, cwd, format); }
// Comparison // Comparison