1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-14 22:42:41 +01:00

Add StoreReference::render

This will be needed for the next step.

Also allows us to write round trip tests.
This commit is contained in:
John Ericson 2024-01-23 15:36:44 -05:00
parent c036d75f9e
commit b59a7a14c4
15 changed files with 233 additions and 3 deletions

View file

@ -58,7 +58,7 @@ struct StoreReference
struct Specified
{
std::string scheme;
std::string authority;
std::string authority = "";
bool operator==(const Specified & rhs) const = default;
auto operator<=>(const Specified & rhs) const = default;
@ -73,6 +73,14 @@ struct StoreReference
bool operator==(const StoreReference & rhs) const = default;
auto operator<=>(const StoreReference & rhs) const = default;
/**
* Render the whole store reference as a URI, including parameters.
*/
std::string render() const;
/**
* Parse a URI into a store reference.
*/
static StoreReference parse(const std::string & uri, const Params & extraParams = Params{});
};