0
|
1 #ifndef ANIMONE_ANIMONE_UTIL_WIN32_H_
|
|
2 #define ANIMONE_ANIMONE_UTIL_WIN32_H_
|
|
3
|
|
4 #include <subauth.h>
|
|
5 #include <windows.h>
|
|
6
|
|
7 #include <memory>
|
|
8 #include <string>
|
|
9
|
|
10 namespace animone::internal::win32 {
|
|
11
|
|
12 struct HandleDeconstructor {
|
|
13 using pointer = HANDLE;
|
|
14 void operator()(pointer t) const { ::CloseHandle(t); };
|
|
15 };
|
|
16
|
|
17 using Handle = std::unique_ptr<HANDLE, HandleDeconstructor>;
|
|
18
|
|
19 /* ----------------------------------------------- */
|
|
20
|
|
21 std::string ToUtf8String(const std::wstring& string);
|
|
22 std::string ToUtf8String(const UNICODE_STRING& string);
|
|
23 std::wstring ToWstring(const std::string& string);
|
|
24
|
|
25 std::wstring GetFileNameFromPath(const std::wstring& path);
|
|
26 std::wstring GetFileNameWithoutExtension(const std::wstring& filename);
|
|
27
|
|
28 bool IsSystemDirectory(const std::string& path);
|
|
29 bool IsSystemDirectory(std::wstring path);
|
|
30
|
|
31 } // namespace animone::internal::win32
|
|
32
|
|
33 #endif // ANIMONE_ANIMONE_UTIL_WIN32_H_ |