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:
@@ -185,6 +185,7 @@ All:
|
||||
- fixed duplicate wxFontEncoding values
|
||||
- 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
|
||||
- added wxFileName::MakeAbsolute
|
||||
|
||||
Unix (GUI):
|
||||
|
||||
|
@@ -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
|
||||
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
|
||||
filename is absolute you may use \helpref{Normalize}{wxfilenamenormalize}. There
|
||||
is also an inverse function \helpref{MakeRelativeTo}{wxfilenamemakerelativeto}
|
||||
which undoes what \helpref{Normalize(wxPATH\_NORM\_DOTS)}{wxfilenamenormalize}
|
||||
does.
|
||||
filename is absolute you may use
|
||||
\helpref{MakeAbsolute}{wxfilenamemakeabsolute}. There is also an inverse
|
||||
function \helpref{MakeRelativeTo}{wxfilenamemakerelativeto} which undoes what
|
||||
\helpref{Normalize(wxPATH\_NORM\_DOTS)}{wxfilenamenormalize} does.
|
||||
|
||||
Other functions returning information about the file format provided by this
|
||||
class are \helpref{GetVolumeSeparator}{wxfilenamegetvolumeseparator},\rtfsp
|
||||
@@ -525,6 +525,23 @@ directory or file really exists, you should use
|
||||
\helpref{DirExists}{wxfilenamedirexists} or
|
||||
\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}
|
||||
|
||||
\func{bool}{MakeRelativeTo}{\param{const wxString\& }{pathBase = ""}, \param{wxPathFormat }{format = wxPATH\_NATIVE}}
|
||||
|
@@ -271,6 +271,10 @@ public:
|
||||
bool MakeRelativeTo(const wxString& pathBase = _T(""),
|
||||
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
|
||||
|
||||
|
Reference in New Issue
Block a user