include "wx/filefn.h" instead of just "filefn.h".

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9018 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
David Webster
2000-12-29 17:39:00 +00:00
parent eb53bce493
commit ee66f09217

View File

@@ -21,7 +21,7 @@
#endif #endif
// ridiculously enough, this will replace DirExists with wxDirExists etc // ridiculously enough, this will replace DirExists with wxDirExists etc
#include "filefn.h" #include "wx/filefn.h"
enum wxPathFormat enum wxPathFormat
{ {
@@ -29,75 +29,75 @@ enum wxPathFormat
wxPATH_UNIX, wxPATH_UNIX,
wxPATH_MAC, wxPATH_MAC,
wxPATH_DOS, wxPATH_DOS,
wxPATH_BEOS = wxPATH_UNIX, wxPATH_BEOS = wxPATH_UNIX,
wxPATH_WIN = wxPATH_DOS, wxPATH_WIN = wxPATH_DOS,
wxPATH_OS2 = wxPATH_DOS wxPATH_OS2 = wxPATH_DOS
}; };
class WXDLLEXPORT wxFileName class WXDLLEXPORT wxFileName
{ {
public: public:
// constructors and assignment // constructors and assignment
wxFileName() wxFileName()
{ } { }
wxFileName( const wxFileName &filename ); wxFileName( const wxFileName &filename );
wxFileName( const wxString &path, bool dir_only = FALSE, wxPathFormat format = wxPATH_NATIVE ) wxFileName( const wxString &path, bool dir_only = FALSE, wxPathFormat format = wxPATH_NATIVE )
{ Assign( path, dir_only, format ); } { Assign( path, dir_only, format ); }
void Assign( const wxString &path, bool dir_only = FALSE, wxPathFormat format = wxPATH_NATIVE ); void Assign( const wxString &path, bool dir_only = FALSE, wxPathFormat format = wxPATH_NATIVE );
// Only native form // Only native form
bool FileExists(); bool FileExists();
bool DirExists(); bool DirExists();
void AssignCwd(); void AssignCwd();
void SetCwd(); void SetCwd();
void AssignTempFileName( const wxString &prefix ); void AssignTempFileName( const wxString &prefix );
void Mkdir( int perm = 0777 ); void Mkdir( int perm = 0777 );
void Rmdir(); void Rmdir();
// Remove . and .. (under Unix ~ as well) // Remove . and .. (under Unix ~ as well)
void MakeAbsolute(); void MakeAbsolute();
// Comparison // Comparison
bool SameAs( const wxFileName &filename, bool upper_on_dos = TRUE ); bool SameAs( const wxFileName &filename, bool upper_on_dos = TRUE );
// Tests // Tests
bool IsCaseSensitive( wxPathFormat format = wxPATH_NATIVE ); bool IsCaseSensitive( wxPathFormat format = wxPATH_NATIVE );
bool IsRelative( wxPathFormat format = wxPATH_NATIVE ); bool IsRelative( wxPathFormat format = wxPATH_NATIVE );
bool IsAbsolute( wxPathFormat format = wxPATH_NATIVE ); bool IsAbsolute( wxPathFormat format = wxPATH_NATIVE );
bool IsWild( wxPathFormat format = wxPATH_NATIVE ); bool IsWild( wxPathFormat format = wxPATH_NATIVE );
// Dir accessors // Dir accessors
void AppendDir( const wxString &dir ); void AppendDir( const wxString &dir );
void PrependDir( const wxString &dir ); void PrependDir( const wxString &dir );
void InsertDir( int before, const wxString &dir ); void InsertDir( int before, const wxString &dir );
void RemoveDir( int pos ); void RemoveDir( int pos );
size_t GetDirCount() { return m_dirs.GetCount(); } size_t GetDirCount() { return m_dirs.GetCount(); }
// Other accessors // Other accessors
void SetExt( const wxString &ext ) { m_ext = ext; } void SetExt( const wxString &ext ) { m_ext = ext; }
wxString GetExt() const { return m_ext; } wxString GetExt() const { return m_ext; }
bool HasExt() const { return !m_ext.IsEmpty(); } bool HasExt() const { return !m_ext.IsEmpty(); }
void SetName( const wxString &name ) { m_name = name; } void SetName( const wxString &name ) { m_name = name; }
wxString GetName() const { return m_name; } wxString GetName() const { return m_name; }
bool HasName() const { return !m_name.IsEmpty(); } bool HasName() const { return !m_name.IsEmpty(); }
const wxArrayString &GetDirs() const { return m_dirs; } const wxArrayString &GetDirs() const { return m_dirs; }
// Construct path only // Construct path only
wxString GetPath( wxPathFormat format = wxPATH_NATIVE ) const; wxString GetPath( wxPathFormat format = wxPATH_NATIVE ) const;
// Construct full path with name and ext // Construct full path with name and ext
wxString GetFullPath( wxPathFormat format = wxPATH_NATIVE ) const; wxString GetFullPath( wxPathFormat format = wxPATH_NATIVE ) const;
static wxPathFormat GetFormat( wxPathFormat format = wxPATH_NATIVE ); static wxPathFormat GetFormat( wxPathFormat format = wxPATH_NATIVE );
private: private:
wxArrayString m_dirs; wxArrayString m_dirs;
wxString m_name; wxString m_name;