aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2022-02-07 13:11:43 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2022-02-07 13:11:43 +0300
commit2e59c78e0c12f639c3334450509b5f158c9ce38e (patch)
tree200a89500b4e74685ebb1e5469c9e7897c454585
parent440ad866c75f9c24d49ea63df53d2f2ad0df38ca (diff)
Add constructor for dependency_alternative class
-rw-r--r--libbpkg/manifest.hxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/libbpkg/manifest.hxx b/libbpkg/manifest.hxx
index 364255b..6428e3a 100644
--- a/libbpkg/manifest.hxx
+++ b/libbpkg/manifest.hxx
@@ -561,6 +561,22 @@ namespace bpkg
accept (std::move (a)),
require (std::move (q)) {}
+ // Can be used to copy a dependency alternative object, while omitting
+ // some clauses which are no longer needed.
+ //
+ dependency_alternative (butl::optional<std::string> e,
+ butl::optional<std::string> r,
+ butl::optional<std::string> p,
+ butl::optional<std::string> a,
+ butl::optional<std::string> q,
+ butl::small_vector<dependency, 1> ds)
+ : small_vector<dependency, 1> (move (ds)),
+ enable (std::move (e)),
+ reflect (std::move (r)),
+ prefer (std::move (p)),
+ accept (std::move (a)),
+ require (std::move (q)) {}
+
// Return the single-line representation if possible (the prefer and
// require clauses are absent and the reflect clause either absent or
// contains no newlines).