13 #ifndef __STOUT_OS_WINDOWS_REALPATH_HPP__ 14 #define __STOUT_OS_WINDOWS_REALPATH_HPP__ 41 const DWORD length = ::GetFinalPathNameByHandleW(
44 return WindowsError(
"Failed to retrieve realpath buffer size");
47 std::vector<wchar_t> buffer;
48 buffer.reserve(static_cast<size_t>(length));
50 DWORD result = ::GetFinalPathNameByHandleW(
51 handle.
get().
get_handle(), buffer.data(), length, FILE_NAME_NORMALIZED);
65 #endif // __STOUT_OS_WINDOWS_REALPATH_HPP__
Definition: errorbase.hpp:36
T & get()&
Definition: try.hpp:80
HANDLE get_handle() const
Definition: windows.hpp:90
Result< std::string > realpath(const std::string &path)
Definition: realpath.hpp:24
Definition: error.hpp:108
Definition: posix_signalhandler.hpp:23
std::string remove(const std::string &from, const std::string &substring, Mode mode=ANY)
Definition: strings.hpp:41
static Try error(const E &e)
Definition: try.hpp:43
Try< SharedHandle > get_handle_follow(const std::string &absolute_path)
Definition: reparsepoint.hpp:155
bool isError() const
Definition: try.hpp:78
std::string stringify(int flags)