#pragma once ///@file #include #include #include "types.hh" namespace nix { /** * Paths are just `std::filesystem::path`s. * * @todo drop `NG` suffix and replace the ones in `types.hh`. */ typedef std::filesystem::path PathNG; typedef std::list PathsNG; typedef std::set PathSetNG; /** * Stop gap until `std::filesystem::path_view` from P1030R6 exists in a * future C++ standard. * * @todo drop `NG` suffix and replace the one in `types.hh`. */ struct PathViewNG : std::basic_string_view { using string_view = std::basic_string_view; using string_view::string_view; PathViewNG(const PathNG & path) : std::basic_string_view(path.native()) { } PathViewNG(const PathNG::string_type & path) : std::basic_string_view(path) { } const string_view & native() const { return *this; } string_view & native() { return *this; } }; std::string os_string_to_string(PathViewNG::string_view path); PathNG::string_type string_to_os_string(std::string_view s); std::optional maybePathNG(PathView path); PathNG pathNG(PathView path); }