diff options
| author | Robert Schumacher <roschuma@microsoft.com> | 2017-08-22 15:14:59 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-08-22 15:14:59 -0700 |
| commit | 651ab5cef2c9742869185a181e1db529dc937d21 (patch) | |
| tree | d9b2239e97a6351c1a6a28cf7c8cf0cadf8c54e2 /toolsrc/include/PackageSpec.h | |
| parent | 6035c3228bcef651d342b3a31827157ad2ed6a85 (diff) | |
| parent | 92dd1b77ed043da376c86874aacc1233270fedae (diff) | |
| download | vcpkg-651ab5cef2c9742869185a181e1db529dc937d21.tar.gz vcpkg-651ab5cef2c9742869185a181e1db529dc937d21.zip | |
Merge pull request #1566 from Microsoft/feature_package_end_to_end
end to end hdf5 feature packages
Diffstat (limited to 'toolsrc/include/PackageSpec.h')
| -rw-r--r-- | toolsrc/include/PackageSpec.h | 42 |
1 files changed, 40 insertions, 2 deletions
diff --git a/toolsrc/include/PackageSpec.h b/toolsrc/include/PackageSpec.h index 15b5e5b9b..c5ce767f9 100644 --- a/toolsrc/include/PackageSpec.h +++ b/toolsrc/include/PackageSpec.h @@ -1,14 +1,22 @@ #pragma once + #include "PackageSpecParseResult.h" -#include "SourceParagraph.h" #include "Triplet.h" #include "vcpkg_expected.h" namespace vcpkg { + struct ParsedSpecifier + { + std::string name; + std::vector<std::string> features; + std::string triplet; + + static ExpectedT<ParsedSpecifier, PackageSpecParseResult> from_string(const std::string& input); + }; + struct PackageSpec { - static std::string to_string(const std::string& name, const Triplet& triplet); static ExpectedT<PackageSpec, PackageSpecParseResult> from_name_and_triplet(const std::string& name, const Triplet& triplet); @@ -25,15 +33,45 @@ 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; } + + std::string to_string() const; + + 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); }; + struct Features + { + std::string name; + std::vector<std::string> features; + + static ExpectedT<Features, PackageSpecParseResult> from_string(const std::string& input); + }; + bool operator==(const PackageSpec& left, const PackageSpec& right); bool operator!=(const PackageSpec& left, const PackageSpec& right); } |
