aboutsummaryrefslogtreecommitdiff
path: root/libbpkg/manifest.hxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2021-12-03 15:13:15 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2021-12-08 16:04:18 +0300
commitf01e037f65f4896d65979c5f25a7169ba3d696f9 (patch)
tree09404897b733dc3cb65b47789495abb055379a7e /libbpkg/manifest.hxx
parentcfe0ccfabcb84589fe38a56e05e1cb581d3c9c57 (diff)
Adjust types for future support of multiple dependencies in an alternative
Diffstat (limited to 'libbpkg/manifest.hxx')
-rw-r--r--libbpkg/manifest.hxx23
1 files changed, 21 insertions, 2 deletions
diff --git a/libbpkg/manifest.hxx b/libbpkg/manifest.hxx
index f487a90..ef44fcb 100644
--- a/libbpkg/manifest.hxx
+++ b/libbpkg/manifest.hxx
@@ -455,7 +455,26 @@ namespace bpkg
// depends
//
- class dependency_alternatives: public butl::small_vector<dependency, 1>
+ class dependency_alternative: public butl::small_vector<dependency, 1>
+ {
+ public:
+ butl::optional<std::string> enable;
+
+ dependency_alternative () = default;
+ dependency_alternative (butl::optional<std::string> e)
+ : enable (std::move (e)) {}
+
+ // Parse the dependency alternative string representation.
+ //
+ explicit LIBBPKG_EXPORT
+ dependency_alternative (const std::string&);
+
+ LIBBPKG_EXPORT std::string
+ string () const;
+ };
+
+ class dependency_alternatives:
+ public butl::small_vector<dependency_alternative, 1>
{
public:
bool conditional;
@@ -468,7 +487,7 @@ namespace bpkg
// Parse the dependency alternatives string representation in the
// `[?][*] <dependency> [ '|' <dependency>]* [; <comment>]` form. Throw
- // std::invalid_argument if the value is invalid.
+ // std::invalid_argument if the value is invalid. @@ DEP @@ TMP update.
//
explicit LIBBPKG_EXPORT
dependency_alternatives (const std::string&);