diff options
| author | Robert Schumacher <roschuma@microsoft.com> | 2017-10-13 18:37:41 -0700 |
|---|---|---|
| committer | Robert Schumacher <roschuma@microsoft.com> | 2017-10-13 18:37:41 -0700 |
| commit | e17de99599a2f114faab1bb4821fbaad4d266c95 (patch) | |
| tree | 397fec8a85af3ef002c125ce013eceb60d27116d /toolsrc/include/PackageSpec.h | |
| parent | 1fb5313a881fe0fcfd90dff5255045c8367ee00b (diff) | |
| download | vcpkg-e17de99599a2f114faab1bb4821fbaad4d266c95.tar.gz vcpkg-e17de99599a2f114faab1bb4821fbaad4d266c95.zip | |
[vcpkg] Re-layout all files using new organization scheme.
All filenames and directories are lowercase. Use dots for namespace separation.
Diffstat (limited to 'toolsrc/include/PackageSpec.h')
| -rw-r--r-- | toolsrc/include/PackageSpec.h | 95 |
1 files changed, 0 insertions, 95 deletions
diff --git a/toolsrc/include/PackageSpec.h b/toolsrc/include/PackageSpec.h deleted file mode 100644 index c5ce767f9..000000000 --- a/toolsrc/include/PackageSpec.h +++ /dev/null @@ -1,95 +0,0 @@ -#pragma once - -#include "PackageSpecParseResult.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 ExpectedT<PackageSpec, PackageSpecParseResult> from_name_and_triplet(const std::string& name, - const Triplet& triplet); - - const std::string& name() const; - - const Triplet& triplet() const; - - std::string dir() const; - - std::string to_string() const; - - private: - std::string m_name; - 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); -} - -template<> -struct std::hash<vcpkg::PackageSpec> -{ - size_t operator()(const vcpkg::PackageSpec& value) const - { - size_t hash = 17; - hash = hash * 31 + std::hash<std::string>()(value.name()); - hash = hash * 31 + std::hash<vcpkg::Triplet>()(value.triplet()); - return hash; - } -}; - -template<> -struct std::equal_to<vcpkg::PackageSpec> -{ - bool operator()(const vcpkg::PackageSpec& left, const vcpkg::PackageSpec& right) const { return left == right; } -}; |
