home *** CD-ROM | disk | FTP | other *** search
-
- //***************************************************************************
- //
- // Class: CFileSystem
- //
- // Purpose: To encapsulate access to the file system.
- //
- // Copyright: Copyright 1993, 1994 Scott P. Leslie, All Rights Reserved.
- //
- // Version: Version 1.0 for MS Windows 3.1 and MSVC 1.0.
- //
- // Shareware: This class is ShareWare. If you use it, you should register
- // it with the author. If you do not register it after 14 days
- // of use, you must discontinue using it.
- //
- // Contact the author at ScotLeslie@aol.com for more info.
- //
- // Distribution: You may distribute this class unmodified as long as all
- // accompanying documentation and notes are also distributed.
- // Object code generated from this class (or any derivation
- // of this class) can only be distributed by registered users.
- //
- // Disclaimer: This class is provided as is with no implied or express
- // warranties. You should test this class for your particular
- // use on non-critical data before using it in a production
- // system.
- //
- //***************************************************************************
-
- #ifndef _CFileSystem_h_
- #define _CFileSystem_h_
-
- #include "dos.h"
- #include "direct.h"
-
- #include "stdafx.h"
-
- class CFileSystem : public CObject
- {
- public:
- CFileSystem();
- ~CFileSystem();
-
- enum Attribute {
- normal = CFile::normal,
- readOnly = CFile::readOnly,
- hidden = CFile::hidden,
- system = CFile::system,
- volume = CFile::volume,
- directory = CFile::directory,
- archive = CFile::archive,
- }; // Attribute
-
- CString * GetDirectoryEntry(CString Wildcard = "", Attribute eFileAttrib = normal);
-
- CString GetCurrentDirectory();
- BOOL ChangeDirectory(CString NewDirectory);
- BOOL MakeDirectory(CString NewDirectory);
- BOOL MakePath(CString NewDirectory);
- BOOL DeleteDirectory(CString Directory);
-
- CString GetCurrentFileSystem();
- BOOL ChangeFileSystem(char cFileSystem);
- CStringList * GetFileSystemList();
-
- BOOL RenameFile(CString OldFileName, CString NewFileName);
- BOOL DeleteFile(CString FileName);
- BOOL CopyFile(CString SourceFileName, CString DestFileName, unsigned long lBuffSize = 10240);
-
- BOOL CloseFile(CFile *pFile) const;
-
- CString GetFileName(CString PathAndFileName);
- CString GetPath(CString PathAndFileName);
-
- CStringList * GetDirectory(CString SearchString, Attribute eFileAttrib, BOOL bRecurseSubDirs=FALSE, CStringList *pStringList = NULL);
-
-
- CStringList * GetSubdirList(CString SearchDir, BOOL bPathInName = TRUE);
- CStringList * GetFileList(CString SearchString, Attribute eFileAttrib);
-
- static void LoadListBox(CListBox *pListBox, CStringList * pStringList);
- static void LoadComboBox(CComboBox *pComboBox, CStringList * pStringList);
-
- int MaxFileNameLength;
-
- private:
- struct _find_t m_FileInfo;
-
- }; // CFileSystem
-
- #endif // _CFileSystem_h_
-
-