Nix 2.36.0
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 "nix/util/types.hh"
9
10namespace nix {
11
15typedef std::list<std::filesystem::path> Paths;
16typedef std::set<std::filesystem::path> PathSet;
17
22struct PathView : OsStringView
23{
24 using string_view = OsStringView;
25
26 using string_view::string_view;
27
28 PathView(const std::filesystem::path & path)
29 : OsStringView{path.native()}
30 {
31 }
32
33 PathView(const OsString & path)
34 : OsStringView{path}
35 {
36 }
37
38 const string_view & native() const
39 {
40 return *this;
41 }
42
43 string_view & native()
44 {
45 return *this;
46 }
47};
48
49template<>
50struct json_avoids_null<std::filesystem::path> : std::true_type
51{};
52
53} // namespace nix
std::list< std::filesystem::path > Paths
Definition file-path.hh:15
std::basic_string< OsChar > OsString
Definition os-string.hh:36
std::basic_string_view< OsChar > OsStringView
Definition os-string.hh:41