acme
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages Concepts
file_find.h
1#pragma once
2
3
4namespace universal_windows
5{
6
7#ifdef WINDOWS_DESKTOP
8
9 class CLASS_DECL_ACME file_find : public ::matter
10 {
11 public:
12
13
14 WIN32_FIND_DATAW * m_pFoundInfo;
15 WIN32_FIND_DATAW * m_pNextInfo;
16 HANDLE m_hContext;
17 bool m_bGotLast;
18 string m_strRoot;
19 char m_chDirSeparator; // not '\\' for Internet classes
20
21
22 file_find();
23 virtual ~file_find();
24
25 void dump(dump_context & dumpcontext) const;
26 void assert_ok() const;
27
28
29 long long get_length() const;
30 virtual string GetFileName() const;
31 virtual string GetFilePath() const;
32 virtual string GetFileTitle() const;
33 virtual string GetFileURL() const;
34 virtual string GetRoot() const;
35
36 virtual bool GetLastWriteTime(FILETIME* pTimeStamp) const;
37 virtual bool GetLastAccessTime(FILETIME* pTimeStamp) const;
38 virtual bool GetCreationTime(FILETIME* pTimeStamp) const;
39 virtual bool GetLastWriteTime(::earth::time& refTime) const;
40 virtual bool GetLastAccessTime(::earth::time& refTime) const;
41 virtual bool GetCreationTime(::earth::time& refTime) const;
42
43 virtual bool MatchesMask(unsigned int dwMask) const;
44
45 virtual bool IsDots() const;
46 // these aren't virtual because they all use MatchesMask(), which is
47 bool IsReadOnly() const;
48 bool IsDirectory() const;
49 bool IsCompressed() const;
50 bool IsSystem() const;
51 bool IsHidden() const;
52 bool IsTemporary() const;
53 bool IsNormal() const;
54 bool IsArchived() const;
55
56
57 void close();
58 virtual bool FindFile(const char * pstrName = nullptr, unsigned int dwUnused = 0);
59 virtual bool FindNextFile();
60
61 virtual void CloseContext();
62
63
64
65
66 };
67
68 // file_find
69 inline bool file_find::IsReadOnly() const
70 { return MatchesMask(FILE_ATTRIBUTE_READONLY); }
71 inline bool file_find::IsDirectory() const
72 { return MatchesMask(FILE_ATTRIBUTE_DIRECTORY); }
73 inline bool file_find::IsCompressed() const
74 { return MatchesMask(FILE_ATTRIBUTE_COMPRESSED); }
75 inline bool file_find::IsSystem() const
76 { return MatchesMask(FILE_ATTRIBUTE_SYSTEM); }
77 inline bool file_find::IsHidden() const
78 { return MatchesMask(FILE_ATTRIBUTE_HIDDEN); }
79 inline bool file_find::IsTemporary() const
80 { return MatchesMask(FILE_ATTRIBUTE_TEMPORARY); }
81 inline bool file_find::IsNormal() const
82 { return MatchesMask(FILE_ATTRIBUTE_NORMAL); }
83 inline bool file_find::IsArchived() const
84 { return MatchesMask(FILE_ATTRIBUTE_ARCHIVE); }
85
86#endif
87
88} // namespace universal_windows