diff --git a/include/wx/filename.h b/include/wx/filename.h index 76f9e2169e..67a153d895 100644 --- a/include/wx/filename.h +++ b/include/wx/filename.h @@ -224,12 +224,15 @@ public: wxString GetName() const { return m_name; } bool HasName() const { return !m_name.IsEmpty(); } + // full name is the file name + extension (but without the path) + void SetFullName(const wxString& fullname); wxString GetFullName() const; const wxArrayString &GetDirs() const { return m_dirs; } // Construct path only - possibly with the trailing separator - wxString GetPath( bool add_separator = FALSE, wxPathFormat format = wxPATH_NATIVE ) const; + wxString GetPath( bool add_separator = FALSE, + wxPathFormat format = wxPATH_NATIVE ) const; // more readable synonym wxString GetPathWithSep(wxPathFormat format = wxPATH_NATIVE ) const diff --git a/src/common/filename.cpp b/src/common/filename.cpp index e0c45c36ff..ef07caccef 100644 --- a/src/common/filename.cpp +++ b/src/common/filename.cpp @@ -432,6 +432,11 @@ void wxFileName::RemoveDir( int pos ) // accessors // ---------------------------------------------------------------------------- +void wxFileName::SetFullName(const wxString& fullname) +{ + SplitPath(fullname, NULL /* no path */, &m_name, &m_ext); +} + wxString wxFileName::GetFullName() const { wxString fullname = m_name;