made SameAs() and operator==() const, added operator!=() and docs for it
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@17756 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -598,7 +598,7 @@ Deletes the specified directory from the file system.
|
|||||||
|
|
||||||
\membersection{wxFileName::SameAs}\label{wxfilenamesameas}
|
\membersection{wxFileName::SameAs}\label{wxfilenamesameas}
|
||||||
|
|
||||||
\func{bool}{SameAs}{\param{const wxFileName\& }{filepath}, \param{wxPathFormat }{format = wxPATH\_NATIVE}}
|
\constfunc{bool}{SameAs}{\param{const wxFileName\& }{filepath}, \param{wxPathFormat }{format = wxPATH\_NATIVE}}
|
||||||
|
|
||||||
Compares the filename using the rules of this platform.
|
Compares the filename using the rules of this platform.
|
||||||
|
|
||||||
@@ -674,9 +674,19 @@ Assigns the new value to this filename object.
|
|||||||
|
|
||||||
\membersection{wxFileName::operator==}\label{wxfilenameoperatorequal}
|
\membersection{wxFileName::operator==}\label{wxfilenameoperatorequal}
|
||||||
|
|
||||||
\func{bool operator}{operator==}{\param{const wxFileName\& }{filename}}
|
\constfunc{bool operator}{operator==}{\param{const wxFileName\& }{filename}}
|
||||||
|
|
||||||
\func{bool operator}{operator==}{\param{const wxString\& }{filename}}
|
\constfunc{bool operator}{operator==}{\param{const wxString\& }{filename}}
|
||||||
|
|
||||||
Returns {\tt TRUE} if the filenames are equal for the native file format.
|
Returns {\tt TRUE} if the filenames are equal. The string {\it filenames} is
|
||||||
|
interpreted as a path in the native filename format.
|
||||||
|
|
||||||
|
\membersection{wxFileName::operator!=}\label{wxfilenameoperatornotequal}
|
||||||
|
|
||||||
|
\constfunc{bool operator}{operator!=}{\param{const wxFileName\& }{filename}}
|
||||||
|
|
||||||
|
\constfunc{bool operator}{operator!=}{\param{const wxString\& }{filename}}
|
||||||
|
|
||||||
|
Returns {\tt TRUE} if the filenames are different. The string {\it filenames}
|
||||||
|
is interpreted as a path in the native filename format.
|
||||||
|
|
||||||
|
@@ -274,14 +274,21 @@ public:
|
|||||||
|
|
||||||
// Comparison
|
// Comparison
|
||||||
|
|
||||||
// compares with the rules of this platform
|
// compares with the rules of the given platforms format
|
||||||
bool SameAs(const wxFileName &filepath,
|
bool SameAs(const wxFileName& filepath,
|
||||||
wxPathFormat format = wxPATH_NATIVE);
|
wxPathFormat format = wxPATH_NATIVE) const;
|
||||||
|
|
||||||
// uses the current platform settings
|
// compare with another filename object
|
||||||
bool operator==(const wxFileName& filename) { return SameAs(filename); }
|
bool operator==(const wxFileName& filename) const
|
||||||
bool operator==(const wxString& filename)
|
{ return SameAs(filename); }
|
||||||
{ return *this == wxFileName(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?
|
// are the file names of this type cases sensitive?
|
||||||
static bool IsCaseSensitive( wxPathFormat format = wxPATH_NATIVE );
|
static bool IsCaseSensitive( wxPathFormat format = wxPATH_NATIVE );
|
||||||
|
@@ -1022,7 +1022,7 @@ bool wxFileName::MakeRelativeTo(const wxString& pathBase, wxPathFormat format)
|
|||||||
// filename kind tests
|
// filename kind tests
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
bool wxFileName::SameAs(const wxFileName &filepath, wxPathFormat format)
|
bool wxFileName::SameAs(const wxFileName& filepath, wxPathFormat format) const
|
||||||
{
|
{
|
||||||
wxFileName fn1 = *this,
|
wxFileName fn1 = *this,
|
||||||
fn2 = filepath;
|
fn2 = filepath;
|
||||||
|
Reference in New Issue
Block a user