aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/include/PackageSpec.h
diff options
context:
space:
mode:
Diffstat (limited to 'toolsrc/include/PackageSpec.h')
-rw-r--r--toolsrc/include/PackageSpec.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/toolsrc/include/PackageSpec.h b/toolsrc/include/PackageSpec.h
index 8e986b4d6..8b485316f 100644
--- a/toolsrc/include/PackageSpec.h
+++ b/toolsrc/include/PackageSpec.h
@@ -33,11 +33,31 @@ namespace vcpkg
Triplet m_triplet;
};
+ struct FeatureSpec
+ {
+ FeatureSpec(const PackageSpec& spec, const std::string& feature) : m_spec(spec), m_feature(feature) {}
+
+ const std::string& name() const { return m_spec.name(); }
+ const std::string& feature() const { return m_feature; }
+ const Triplet& triplet() const { return m_spec.triplet(); }
+
+ const PackageSpec& spec() const { return m_spec; }
+
+ static std::vector<FeatureSpec> from_strings_and_triplet(const std::vector<std::string>& depends,
+ const Triplet& t);
+
+ private:
+ PackageSpec m_spec;
+ std::string m_feature;
+ };
+
struct FullPackageSpec
{
PackageSpec package_spec;
std::vector<std::string> features;
+ static std::vector<FeatureSpec> to_feature_specs(const std::vector<FullPackageSpec>& specs);
+
static ExpectedT<FullPackageSpec, PackageSpecParseResult> from_string(const std::string& spec_as_string,
const Triplet& default_triplet);
};