diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2023-04-17 10:16:57 -0400 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2023-04-17 10:16:57 -0400 |
commit | e12efa365462bf7c65e6b531a7ace4fc1660e2cc (patch) | |
tree | e11959347637a16cd85a9e104f87c2fe97ce3e26 /src/libstore/derived-path.hh | |
parent | 1fcd49dbbdf13d673ab7a94b5dd9f9c8b55f5321 (diff) | |
parent | e641de085b625e56b723f45e8355deaa01ea3a1a (diff) |
Merge remote-tracking branch 'upstream/master' into ca-drv-exotic
Diffstat (limited to 'src/libstore/derived-path.hh')
-rw-r--r-- | src/libstore/derived-path.hh | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/src/libstore/derived-path.hh b/src/libstore/derived-path.hh index 72dbcc128..5f7acbebc 100644 --- a/src/libstore/derived-path.hh +++ b/src/libstore/derived-path.hh @@ -1,4 +1,5 @@ #pragma once +///@file #include "util.hh" #include "path.hh" @@ -47,8 +48,18 @@ struct DerivedPathBuilt { StorePath drvPath; OutputsSpec outputs; + /** + * Uses `^` as the separator + */ std::string to_string(const Store & store) const; - static DerivedPathBuilt parse(const Store & store, std::string_view, std::string_view); + /** + * Uses `!` as the separator + */ + std::string to_string_legacy(const Store & store) const; + /** + * The caller splits on the separator, so it works for both variants. + */ + static DerivedPathBuilt parse(const Store & store, std::string_view drvPath, std::string_view outputs); nlohmann::json toJSON(ref<Store> store) const; GENERATE_CMP(DerivedPathBuilt, me->drvPath, me->outputs); @@ -80,8 +91,22 @@ struct DerivedPath : _DerivedPathRaw { return static_cast<const Raw &>(*this); } + /** + * Uses `^` as the separator + */ std::string to_string(const Store & store) const; + /** + * Uses `!` as the separator + */ + std::string to_string_legacy(const Store & store) const; + /** + * Uses `^` as the separator + */ static DerivedPath parse(const Store & store, std::string_view); + /** + * Uses `!` as the separator + */ + static DerivedPath parseLegacy(const Store & store, std::string_view); }; /** |