From fd1818e7cc30a928859a82e910f7c2825e585352 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 9 Dec 2021 13:10:10 +0300 Subject: Adjust types for future support of multiple requirements in an alternative --- libbpkg/manifest.hxx | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'libbpkg/manifest.hxx') diff --git a/libbpkg/manifest.hxx b/libbpkg/manifest.hxx index ef44fcb..08f8a8e 100644 --- a/libbpkg/manifest.hxx +++ b/libbpkg/manifest.hxx @@ -504,7 +504,26 @@ namespace bpkg // requires // - class requirement_alternatives: public butl::small_vector + class requirement_alternative: public butl::small_vector + { + public: + butl::optional enable; + + requirement_alternative () = default; + requirement_alternative (butl::optional e) + : enable (std::move (e)) {} + + // Parse the requirement alternative string representation. + // + explicit LIBBPKG_EXPORT + requirement_alternative (const std::string&); + + LIBBPKG_EXPORT std::string + string () const; + }; + + class requirement_alternatives: + public butl::small_vector { public: bool conditional; @@ -517,7 +536,7 @@ namespace bpkg // Parse the requirement alternatives string representation in the // `[?] [ [ '|' ]*] [; ]` form. Throw - // std::invalid_argument if the value is invalid. + // std::invalid_argument if the value is invalid. @@ DEP @@ TMP update. // explicit LIBBPKG_EXPORT requirement_alternatives (const std::string&); -- cgit v1.1