From 723a15c5390d0c5eb42f2082fcedb7262e7bc856 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Wed, 22 Mar 2023 13:18:24 +0300 Subject: Add package_manifest::effective_type_sub_options() --- libbpkg/manifest.hxx | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'libbpkg/manifest.hxx') diff --git a/libbpkg/manifest.hxx b/libbpkg/manifest.hxx index 1d45edf..c922cc4 100644 --- a/libbpkg/manifest.hxx +++ b/libbpkg/manifest.hxx @@ -1168,12 +1168,12 @@ namespace bpkg butl::optional sha256sum; butl::optional fragment; - // Translate optional type to either `exe`, `lib`, or `other`. + // Extract the name from optional type, returning either `exe`, `lib`, or + // `other`. // - // Specifically, if type is present but is not one of the recognized - // names, then return `other`. If type is absent and the package name - // starts with the `lib` prefix, then return `lib`. Otherwise, return - // `exe`. + // Specifically, if type is present but the name is not recognized, then + // return `other`. If type is absent and the package name starts with the + // `lib` prefix, then return `lib`. Otherwise, return `exe`. // std::string effective_type () const; @@ -1181,6 +1181,14 @@ namespace bpkg static std::string effective_type (const butl::optional&, const package_name&); + // Extract sub-options from optional type. + // + strings + effective_type_sub_options () const; + + static strings + effective_type_sub_options (const butl::optional&); + // Translate the potentially empty list of languages to a non-empty one. // // Specifically, if the list of languages is not empty, then return it as -- cgit v1.1