-
Notifications
You must be signed in to change notification settings - Fork 1
/
DiskObject.h
75 lines (56 loc) · 2.54 KB
/
DiskObject.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#ifndef _DISKOBJECT_H_
#define _DISKOBJECT_H_
#define EF_ONLY_FILENAMES 0
#define EF_FULLY_QUALIFIED 1
class CDiskObject
{
public:
// ctor(s)
CDiskObject();
CDiskObject( CWnd* feedbackWindow );
// dtor
~CDiskObject();
// - - -
// Operations
// Files
BOOL FileExists( const CString& file );
BOOL FileInformation( const CString& file, BY_HANDLE_FILE_INFORMATION &file_info);
BOOL CreateFile( const CString& file );
BOOL CopyFile( const CString& sourceFile, const CString& destDirectory );
BOOL CopyFile( const CString& sourceFile, const CString& destDirectory, const CString& destFile );
BOOL RemoveFile( const CString& sourceFile );
BOOL RenameFile( const CString& sourceFile, const CString& destFile );
BOOL MoveFile( const CString& sourceFile, const CString& destFile );
BOOL CopyFiles( const CString& sourceDirectory, const CString& destDirectory );
BOOL CopyFiles( CStringArray& files, const CString& destDirectory );
// Directories
BOOL DirectoryExists( const CString& file );
BOOL CreateDirectory( const CString& directory );
BOOL CopyDirectory( const CString& sourceDirectory, const CString& destDirectory );
BOOL EmptyDirectory( const CString& directory );
BOOL RemoveDirectory( const CString& directory );
BOOL CopyDirectories( const CString& sourceDirectory, const CString& destDirectory );
BOOL EmptyDirectories( const CString& directory );
BOOL RemoveDirectories( const CString& directory );
BOOL EnumFilesInDirectoryWithFilter( const CString& filter, const CString& sourceDirectory, CStringArray& files, int mode = EF_ONLY_FILENAMES );
BOOL EnumAllDirectories( const CString& sourceDirectory, CStringArray& directories );
BOOL EnumDirectories( const CString& sourceDirectory, CStringArray& directories );
BOOL EnumFilesInDirectory( const CString& sourceDirectory, CStringArray& files, int mode = EF_ONLY_FILENAMES );
BOOL EnumAllFiles( const CString& sourceDirectory, CStringArray& files );
BOOL EnumAllFilesWithFilter( const CString& filter, const CString& sourceDirectory, CStringArray& files );
// Error handling
CString GetErrorMessage();
private:
// Error handling
CString m_errorMessage;
void ClearError();
void SetInternalErrorMessage();
void SetSystemErrorMessage( int error, const CString& elements = _T( "" ) );
// Helpers
CWnd* m_feedbackWindow;
void QualifyPath( CString& str );
void QualifyFile( CString& str );
CString GetFileName( const CString& str );
CString GetDirectoryName( const CString& str );
};
#endif // _DISKOBJECT_H_