MCPcopy Create free account
hub / github.com/HO-COOH/FastCopy / Attributes

Class Attributes

UnitTest/UnitTest.cpp:46–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44namespace UnitTest
45{
46 class Attributes
47 {
48 LPCTSTR m_fileName;
49 public:
50 constexpr static inline DWORD Archive = FILE_ATTRIBUTE_ARCHIVE;
51 constexpr static inline DWORD Hidden = FILE_ATTRIBUTE_HIDDEN;
52 constexpr static inline DWORD Normal = FILE_ATTRIBUTE_NORMAL;
53 constexpr static inline DWORD NotContentIndexed = FILE_ATTRIBUTE_NOT_CONTENT_INDEXED;
54 constexpr static inline DWORD Offline = FILE_ATTRIBUTE_OFFLINE;
55 constexpr static inline DWORD ReadOnly = FILE_ATTRIBUTE_READONLY;
56 constexpr static inline DWORD System = FILE_ATTRIBUTE_SYSTEM;
57 constexpr static inline DWORD Temporary = FILE_ATTRIBUTE_TEMPORARY;
58
59
60
61 Attributes(LPCTSTR fileName) :m_fileName{ fileName } {}
62
63 void set(DWORD attribute)
64 {
65 if (!SetFileAttributes(m_fileName, attribute))
66 throw std::exception{};
67 }
68
69 auto get()
70 {
71 return GetFileAttributes(m_fileName);
72 }
73
74 bool operator==(Attributes rhs)
75 {
76 return get() == rhs.get();
77 }
78 };
79
80 template<typename T>
81 concept StdString =

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected