#pragma once #include #include #include #include #include #include #include namespace vcpkg { struct Dependency { Features depend; std::string qualifier; std::string name() const; static Dependency parse_dependency(std::string name, std::string qualifier); }; std::vector filter_dependencies(const std::vector& deps, const Triplet& t); std::vector filter_dependencies_to_specs(const std::vector& deps, const Triplet& t); // zlib[uwp] becomes Dependency{"zlib", "uwp"} std::vector expand_qualified_dependencies(const std::vector& depends); std::string to_string(const Dependency& dep); /// /// Port metadata of additional feature in a package (part of CONTROL file) /// struct FeatureParagraph { std::string name; std::string description; std::vector depends; }; /// /// Port metadata of the core feature of a package (part of CONTROL file) /// struct SourceParagraph { std::string name; std::string version; std::string description; std::string maintainer; std::string homepage; std::vector supports; std::vector depends; std::vector default_features; }; /// /// Full metadata of a package: core and other features. /// struct SourceControlFile { static Parse::ParseExpected parse_control_file( std::vector&& control_paragraphs); std::unique_ptr core_paragraph; std::vector> feature_paragraphs; Optional find_feature(const std::string& featurename) const; }; /// /// Full metadata of a package: core and other features. As well as the location the SourceControlFile was loaded from. /// struct SourceControlFileLocation { std::unique_ptr source_control_file; fs::path source_location; }; void print_error_message(Span> error_info_list); inline void print_error_message(const std::unique_ptr& error_info_list) { return print_error_message({&error_info_list, 1}); } struct Supports { static ExpectedT> parse(const std::vector& strs); using Architecture = System::CPUArchitecture; enum class Platform { WINDOWS, UWP, }; enum class Linkage { DYNAMIC, STATIC, }; enum class ToolsetVersion { V140, V141, }; bool is_supported(Architecture arch, Platform plat, Linkage crt, ToolsetVersion tools); private: std::vector architectures; std::vector platforms; std::vector crt_linkages; std::vector toolsets; }; }