Mercurial > libanimone
diff include/animone/util/win32.h @ 14:27b988a1048c
*: convert all files CRLF -> LF
some files were in DOS format, others were in unix. now everything
(that at least is under our control) should all be the same format
author | Paper <paper@paper.us.eu.org> |
---|---|
date | Mon, 13 May 2024 15:04:51 -0400 |
parents | aa55bcfb5b79 |
children | 1cfa7d57c022 |
line wrap: on
line diff
--- a/include/animone/util/win32.h Mon May 13 14:15:47 2024 -0400 +++ b/include/animone/util/win32.h Mon May 13 15:04:51 2024 -0400 @@ -1,35 +1,35 @@ -#ifndef ANIMONE_ANIMONE_UTIL_WIN32_H_ -#define ANIMONE_ANIMONE_UTIL_WIN32_H_ - -#include <windef.h> -#include <subauth.h> -#include <handleapi.h> - -#include <memory> -#include <string> - -namespace animone::internal::win32 { - -struct HandleDeconstructor { - using pointer = HANDLE; - void operator()(pointer t) const { ::CloseHandle(t); }; -}; - -using Handle = std::unique_ptr<HANDLE, HandleDeconstructor>; - -/* ----------------------------------------------- */ - -std::string ToUtf8String(const std::wstring& string); -std::string ToUtf8String(const UNICODE_STRING& string); -std::wstring ToWstring(const std::string& string); - -std::wstring GetProcessPath(DWORD process_id); -std::wstring GetFileNameFromPath(const std::wstring& path); -std::wstring GetFileNameWithoutExtension(const std::wstring& filename); - -bool IsSystemDirectory(const std::string& path); -bool IsSystemDirectory(std::wstring path); - -} // namespace animone::internal::win32 - +#ifndef ANIMONE_ANIMONE_UTIL_WIN32_H_ +#define ANIMONE_ANIMONE_UTIL_WIN32_H_ + +#include <windef.h> +#include <subauth.h> +#include <handleapi.h> + +#include <memory> +#include <string> + +namespace animone::internal::win32 { + +struct HandleDeconstructor { + using pointer = HANDLE; + void operator()(pointer t) const { ::CloseHandle(t); }; +}; + +using Handle = std::unique_ptr<HANDLE, HandleDeconstructor>; + +/* ----------------------------------------------- */ + +std::string ToUtf8String(const std::wstring& string); +std::string ToUtf8String(const UNICODE_STRING& string); +std::wstring ToWstring(const std::string& string); + +std::wstring GetProcessPath(DWORD process_id); +std::wstring GetFileNameFromPath(const std::wstring& path); +std::wstring GetFileNameWithoutExtension(const std::wstring& filename); + +bool IsSystemDirectory(const std::string& path); +bool IsSystemDirectory(std::wstring path); + +} // namespace animone::internal::win32 + #endif // ANIMONE_ANIMONE_UTIL_WIN32_H_ \ No newline at end of file