]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/filename.h
cb0a6f7253ea8c4051ff8b1021b03ad4aaf88ec8
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxFileName - encapsulates ice cream
4 // Author: Robert Roebling
8 // Copyright: (c) 2000 Robert Roebling
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_FILENAME_H_
13 #define _WX_FILENAME_H_
16 #pragma interface "filename.h"
20 #include "wx/string.h"
23 // ridiculously enough, this will replace DirExists with wxDirExists etc
24 #include "wx/filefn.h"
33 wxPATH_BEOS
= wxPATH_UNIX
,
34 wxPATH_WIN
= wxPATH_DOS
,
35 wxPATH_OS2
= wxPATH_DOS
39 class WXDLLEXPORT wxFileName
42 // constructors and assignment
45 wxFileName( const wxFileName
&filename
);
46 wxFileName( const wxString
&path
, bool dir_only
= FALSE
, wxPathFormat format
= wxPATH_NATIVE
)
47 { Assign( path
, dir_only
, format
); }
48 void Assign( const wxString
&path
, bool dir_only
= FALSE
, wxPathFormat format
= wxPATH_NATIVE
);
57 void AssignTempFileName( const wxString
&prefix
);
59 void Mkdir( int perm
= 0777 );
62 // Remove . and .. (under Unix ~ as well)
66 bool SameAs( const wxFileName
&filename
, bool upper_on_dos
= TRUE
);
69 bool IsCaseSensitive( wxPathFormat format
= wxPATH_NATIVE
);
70 bool IsRelative( wxPathFormat format
= wxPATH_NATIVE
);
71 bool IsAbsolute( wxPathFormat format
= wxPATH_NATIVE
);
72 bool IsWild( wxPathFormat format
= wxPATH_NATIVE
);
75 void AppendDir( const wxString
&dir
);
76 void PrependDir( const wxString
&dir
);
77 void InsertDir( int before
, const wxString
&dir
);
78 void RemoveDir( int pos
);
79 size_t GetDirCount() { return m_dirs
.GetCount(); }
82 void SetExt( const wxString
&ext
) { m_ext
= ext
; }
83 wxString
GetExt() const { return m_ext
; }
84 bool HasExt() const { return !m_ext
.IsEmpty(); }
86 void SetName( const wxString
&name
) { m_name
= name
; }
87 wxString
GetName() const { return m_name
; }
88 bool HasName() const { return !m_name
.IsEmpty(); }
90 const wxArrayString
&GetDirs() const { return m_dirs
; }
92 // Construct path only
93 wxString
GetPath( wxPathFormat format
= wxPATH_NATIVE
) const;
95 // Construct full path with name and ext
96 wxString
GetFullPath( wxPathFormat format
= wxPATH_NATIVE
) const;
99 static wxPathFormat
GetFormat( wxPathFormat format
= wxPATH_NATIVE
);
102 wxArrayString m_dirs
;
109 #endif // _WX_FFILENAME_H_