]> git.saurik.com Git - wxWidgets.git/commitdiff
changed Remove/InsertDir() parameter type to size_t from int; added RemoveLastDir()
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 13 Feb 2005 00:55:27 +0000 (00:55 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 13 Feb 2005 00:55:27 +0000 (00:55 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31978 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/latex/wx/filename.tex
include/wx/filename.h
src/common/filename.cpp

index ccffbd00cc82bb3edaff74aabe29125747a29d1b..2270beb00907ebab710492fc81dd69d70b112210 100644 (file)
@@ -107,13 +107,15 @@ or \helpref{$==$}{wxfilenameoperatorequal}.
 
 \membersection{File name components}\label{filenamecomponents}
 
-These functions allow to examine and modify the directories of the path:
+These functions allow to examine and modify the individual directories of the
+path:
 
 \helpref{AppendDir}{wxfilenameappenddir}\\
 \helpref{InsertDir}{wxfilenameinsertdir}\\
 \helpref{GetDirCount}{wxfilenamegetdircount}
 \helpref{PrependDir}{wxfilenameprependdir}\\
-\helpref{RemoveDir}{wxfilenameremovedir}
+\helpref{RemoveDir}{wxfilenameremovedir}\\
+\helpref{RemoveLastDir}{wxfilenameremovelastdir}
 
 To change the components of the file name individually you can use the
 following functions:
@@ -535,7 +537,7 @@ Returns {\tt true} if a volume specifier is present.
 
 \membersection{wxFileName::InsertDir}\label{wxfilenameinsertdir}
 
-\func{void}{InsertDir}{\param{int }{before}, \param{const wxString\& }{dir}}
+\func{void}{InsertDir}{\param{size\_t }{before}, \param{const wxString\& }{dir}}
 
 Inserts a directory component before the zero-based position in the directory
 list. Please see \helpref{AppendDir}{wxfilenameappenddir} for important notes.
@@ -705,9 +707,20 @@ Prepends a directory to the file path. Please see
 
 \membersection{wxFileName::RemoveDir}\label{wxfilenameremovedir}
 
-\func{void}{RemoveDir}{\param{int }{pos}}
+\func{void}{RemoveDir}{\param{size\_t }{pos}}
 
-Removes a directory name.
+Removes the specified directory component from the path.
+
+\wxheading{See also}
+
+\helpref{GetDirCount}{wxfilenamegetdircount}
+
+
+\membersection{wxFileName::RemoveLastDir}\label{wxfilenameremovelastdir}
+
+\func{void}{RemoveLastDir}{\void}
+
+Removes last directory component from the path.
 
 
 \membersection{wxFileName::Rmdir}\label{wxfilenamermdir}
index 954f4f349f216e7f168bf09006c42fb903f7c2fd..9711cd6fa820875c25359361b4a75f3f07becc12 100644 (file)
@@ -346,11 +346,12 @@ public:
     static bool IsPathSeparator(wxChar ch, wxPathFormat format = wxPATH_NATIVE);
 
     // Dir accessors
-    void AppendDir( const wxString &dir );
-    void PrependDir( const wxString &dir );
-    void InsertDir( int before, const wxString &dir );
-    void RemoveDir( int pos );
     size_t GetDirCount() const { return m_dirs.size(); }
+    void AppendDir(const wxString& dir);
+    void PrependDir(const wxString& dir);
+    void InsertDir(size_t before, const wxString& dir);
+    void RemoveDir(size_t pos);
+    void RemoveLastDir() { RemoveDir(GetDirCount() - 1); }
 
     // Other accessors
     void SetExt( const wxString &ext )          { m_ext = ext; }
index a288d75c78e22fd789ff378f9f14539773900b57..9553e92a27433643d46379caee24d7561f384432 100644 (file)
@@ -1320,26 +1320,26 @@ bool wxFileName::IsPathSeparator(wxChar ch, wxPathFormat format)
     return true;
 }
 
-void wxFileName::AppendDir( const wxString &dir )
+void wxFileName::AppendDir( const wxStringdir )
 {
     if ( IsValidDirComponent(dir) )
         m_dirs.Add( dir );
 }
 
-void wxFileName::PrependDir( const wxString &dir )
+void wxFileName::PrependDir( const wxStringdir )
 {
     InsertDir(0, dir);
 }
 
-void wxFileName::InsertDir( int before, const wxString &dir )
+void wxFileName::InsertDir(size_t before, const wxString& dir)
 {
     if ( IsValidDirComponent(dir) )
-        m_dirs.Insert( dir, before );
+        m_dirs.Insert(dir, before);
 }
 
-void wxFileName::RemoveDir( int pos )
+void wxFileName::RemoveDir(size_t pos)
 {
-    m_dirs.RemoveAt( (size_t)pos );
+    m_dirs.RemoveAt(pos);
 }
 
 // ----------------------------------------------------------------------------