Nix 2.26.3
Nix, the purely functional package manager; unstable internal interfaces
 
Loading...
Searching...
No Matches
file-path.hh
Go to the documentation of this file.
1#pragma once
3
4#include <filesystem>
5
6#include "types.hh"
7#include "os-string.hh"
8
9namespace nix {
10
16typedef std::list<std::filesystem::path> PathsNG;
17typedef std::set<std::filesystem::path> PathSetNG;
18
25struct PathViewNG : OsStringView
26{
27 using string_view = OsStringView;
28
29 using string_view::string_view;
30
31 PathViewNG(const std::filesystem::path & path)
32 : OsStringView{path.native()}
33 { }
34
35 PathViewNG(const OsString & path)
36 : OsStringView{path}
37 { }
38
39 const string_view & native() const { return *this; }
40 string_view & native() { return *this; }
41};
42
43std::optional<std::filesystem::path> maybePath(PathView path);
44
45std::filesystem::path pathNG(PathView path);
46
47}
std::list< std::filesystem::path > PathsNG
Definition file-path.hh:16
std::basic_string< OsChar > OsString
Definition os-string.hh:32
std::basic_string_view< OsChar > OsStringView
Definition os-string.hh:37