mirror of
https://github.com/cemu-project/vcpkg.git
synced 2025-02-24 19:43:33 +01:00

* [vcpkg] Consolidate several internal parsers together (packagespecs + logicexpression + control) and enhance error messages * [vcpkg] Migrate Build-Depends parsing to new framework * [vcpkg] Fix tests. Re-enable underscores in feature names due to libwebp[vwebp_sdl] -- todo: rename this feature and remove underscores.
39 lines
1.5 KiB
C++
39 lines
1.5 KiB
C++
#pragma once
|
|
|
|
#include <vcpkg/base/expected.h>
|
|
#include <vcpkg/base/util.h>
|
|
#include <vcpkg/sourceparagraph.h>
|
|
#include <vcpkg/vcpkgpaths.h>
|
|
|
|
namespace vcpkg::PortFileProvider
|
|
{
|
|
struct PortFileProvider
|
|
{
|
|
virtual ExpectedS<const SourceControlFileLocation&> get_control_file(const std::string& src_name) const = 0;
|
|
virtual std::vector<const SourceControlFileLocation*> load_all_control_files() const = 0;
|
|
};
|
|
|
|
struct MapPortFileProvider : Util::ResourceBase, PortFileProvider
|
|
{
|
|
explicit MapPortFileProvider(const std::unordered_map<std::string, SourceControlFileLocation>& map);
|
|
ExpectedS<const SourceControlFileLocation&> get_control_file(const std::string& src_name) const override;
|
|
std::vector<const SourceControlFileLocation*> load_all_control_files() const override;
|
|
|
|
private:
|
|
const std::unordered_map<std::string, SourceControlFileLocation>& ports;
|
|
};
|
|
|
|
struct PathsPortFileProvider : Util::ResourceBase, PortFileProvider
|
|
{
|
|
explicit PathsPortFileProvider(const vcpkg::VcpkgPaths& paths,
|
|
const std::vector<std::string>* ports_dirs_paths);
|
|
ExpectedS<const SourceControlFileLocation&> get_control_file(const std::string& src_name) const override;
|
|
std::vector<const SourceControlFileLocation*> load_all_control_files() const override;
|
|
|
|
private:
|
|
Files::Filesystem& filesystem;
|
|
std::vector<fs::path> ports_dirs;
|
|
mutable std::unordered_map<std::string, SourceControlFileLocation> cache;
|
|
};
|
|
}
|