Nix 2.26.3
Nix, the purely functional package manager; unstable internal interfaces
 
Loading...
Searching...
No Matches
store-reference.hh
Go to the documentation of this file.
1#pragma once
3
4#include <variant>
5
6#include "types.hh"
7
8namespace nix {
9
43{
44 using Params = std::map<std::string, std::string>;
45
49 struct Auto
50 {
51 inline bool operator==(const Auto & rhs) const = default;
52 inline auto operator<=>(const Auto & rhs) const = default;
53 };
54
58 struct Specified
59 {
60 std::string scheme;
61 std::string authority = "";
62
63 bool operator==(const Specified & rhs) const = default;
64 auto operator<=>(const Specified & rhs) const = default;
65 };
66
67 typedef std::variant<Auto, Specified> Variant;
68
69 Variant variant;
70
71 Params params;
72
73 bool operator==(const StoreReference & rhs) const = default;
74
78 std::string render() const;
79
83 static StoreReference parse(const std::string & uri, const Params & extraParams = Params{});
84};
85
89std::pair<std::string, StoreReference::Params> splitUriAndParams(const std::string & uri);
90
91}
Definition store-reference.hh:50
Definition store-reference.hh:59
Definition store-reference.hh:43
std::string render() const
Definition store-reference.cc:21
static StoreReference parse(const std::string &uri, const Params &extraParams=Params{})
Definition store-reference.cc:44