diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2020-10-16 18:13:24 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2020-10-16 21:20:11 +0300 |
commit | 182bff76382d59f44f0ac3c69beb55dacde75eb5 (patch) | |
tree | a1a90b748831594eeb14def8eef1c13c98ca5aa6 /include/winapi/path.hpp | |
parent | Process: add get_exit_code() (diff) | |
download | winapi-common-182bff76382d59f44f0ac3c69beb55dacde75eb5.tar.gz winapi-common-182bff76382d59f44f0ac3c69beb55dacde75eb5.zip |
add path.hpp: CanonicalPath class, etc.
Apparently, relative paths in the Win32 namespace (e.g. \\?\test.txt)
are not a thing.
Diffstat (limited to '')
-rw-r--r-- | include/winapi/path.hpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/include/winapi/path.hpp b/include/winapi/path.hpp new file mode 100644 index 0000000..f2b0aa9 --- /dev/null +++ b/include/winapi/path.hpp @@ -0,0 +1,25 @@ +// Copyright (c) 2020 Egor Tensin <Egor.Tensin@gmail.com> +// This file is part of the "winapi-common" project. +// For details, see https://github.com/egor-tensin/winapi-common. +// Distributed under the MIT License. + +#pragma once + +#include <string> + +namespace winapi { + +class CanonicalPath { +public: + static std::string canonicalize(const std::string&); + + explicit CanonicalPath(const std::string&); + + std::string get() const { return m_path; } + std::string path() const { return get(); } + +private: + std::string m_path; +}; + +} // namespace winapi |