Changed wxFileName::SetExt() as per the discussion, added

ClearExt() and SetEmptyExt() and documented it.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32597 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
2005-03-04 17:31:18 +00:00
parent de5dc0febd
commit 0b40f3d80b
2 changed files with 38 additions and 3 deletions

View File

@@ -127,6 +127,8 @@ following functions:
\helpref{HasName}{wxfilenamehasname}\\
\helpref{HasVolume}{wxfilenamehasvolume}\\
\helpref{SetExt}{wxfilenamesetext}\\
\helpref{ClearExt}{wxfilenameclearext}\\
\helpref{SetEmptyExt}{wxfilenamesetemptyext}\\
\helpref{SetName}{wxfilenamesetname}\\
\helpref{SetVolume}{wxfilenamesetvolume}\\
@@ -252,6 +254,18 @@ temporary file couldn't be created, the object is put into the\rtfsp
Reset all components to default, uninitialized state.
\membersection{wxFileName::ClearExt}\label{wxfilenameclearext}
\func{void}{SetClearExt}{\void}
Removes the extension from the file name resulting in a
file name with no trailing dot.
\wxheading{See also}
\helpref{SetExt}{wxfilenamesetext}
\helpref{SetEmptyExt}{wxfilenamesetemptyext}
\membersection{wxFileName::CreateTempFileName}\label{wxfilenamecreatetempfilename}
\func{static wxString}{CreateTempFileName}{\param{const wxString\& }{prefix}, \param{wxFile *}{fileTemp = {\tt NULL}}}
@@ -754,8 +768,28 @@ Changes the current working directory.
\func{void}{SetExt}{\param{const wxString\& }{ext}}
Sets the extension of this file name.
Sets the extension of the file name. Setting an empty string
as the extension will remove the extension resulting in a file
name without a trailing dot, unlike a call to
\helpref{SetEmptyExt}{wxfilenamesetemptyext}.
\wxheading{See also}
\helpref{SetEmptyExt}{wxfilenamesetemptyext}
\helpref{ClearExt}{wxfilenameclearext}
\membersection{wxFileName::SetEmptyExt}\label{wxfilenamesetemptyext}
\func{void}{SetEmptyExt}{\void}
Sets the extension of the file name to be an empty extension.
This is different from having no extension at all as the file
name will have a trailing dot after a call to this method.
\wxheading{See also}
\helpref{SetExt}{wxfilenamesetext}
\helpref{ClearExt}{wxfilenameclearext}
\membersection{wxFileName::SetFullName}\label{wxfilenamesetfullname}

View File

@@ -367,8 +367,9 @@ public:
void RemoveLastDir() { RemoveDir(GetDirCount() - 1); }
// Other accessors
void SetExt( const wxString &ext ) { m_ext = ext; m_hasExt = true; }
void SetNoExt() { m_ext = wxEmptyString; m_hasExt = false; }
void SetExt( const wxString &ext ) { m_ext = ext; m_hasExt = !m_ext.empty(); }
void ClearExt() { m_ext = wxEmptyString; m_hasExt = false; }
void SetEmptyExt() { m_ext = wxT(""); m_hasExt = true; }
wxString GetExt() const { return m_ext; }
bool HasExt() const { return m_hasExt; }