13 #ifndef __STOUT_INTERNAL_WINDOWS_SYMLINK_HPP__ 14 #define __STOUT_INTERNAL_WINDOWS_SYMLINK_HPP__ 34 ::GetFullPathNameW(
longpath(path).data(), 0,
nullptr,
nullptr);
37 return WindowsError(
"Failed to retrieve fullpath buffer size");
40 std::vector<wchar_t> buffer;
41 buffer.reserve(static_cast<size_t>(length));
44 ::GetFullPathNameW(
longpath(path).data(), length, buffer.data(),
nullptr);
83 if (!absolute_path.
isSome()) {
93 if (is_reparse_point.isError()) {
94 return Error(is_reparse_point.error());
95 }
else if (!is_reparse_point.get()) {
97 "Reparse point attribute is not set for path '" + absolute_path.
get() +
98 "', and therefore it is not a symbolic link");
104 if (symlink_handle.isError()) {
105 return Error(symlink_handle.error());
115 #endif // __STOUT_INTERNAL_WINDOWS_SYMLINK_HPP__ Result< std::string > fullpath(const std::string &path)
Definition: symlink.hpp:30
Try< SharedHandle > get_handle_no_follow(const std::string &absolute_path)
Definition: reparsepoint.hpp:215
Definition: errorbase.hpp:36
static Result< T > error(const std::string &message)
Definition: result.hpp:54
Definition: error.hpp:108
Try< SymbolicLink > query_symbolic_link_data(const std::string &path)
Definition: symlink.hpp:79
Try< bool > reparse_point_attribute_set(const std::wstring &absolute_path)
Definition: reparsepoint.hpp:111
std::string remove(const std::string &from, const std::string &substring, Mode mode=ANY)
Definition: strings.hpp:41
Try< SymbolicLink > get_symbolic_link_data(const HANDLE handle)
Definition: reparsepoint.hpp:271
Definition: attributes.hpp:24
T & get()&
Definition: result.hpp:116
bool isSome() const
Definition: result.hpp:112
std::wstring longpath(const std::string &path)
Definition: longpath.hpp:38
std::string stringify(int flags)