2016-11-08 08:06:36 +08:00
|
|
|
#pragma once
|
|
|
|
|
2017-06-17 17:39:14 +08:00
|
|
|
#include <map>
|
|
|
|
|
2017-02-28 07:45:56 +08:00
|
|
|
#include "BinaryParagraph.h"
|
2017-04-04 07:29:11 +08:00
|
|
|
#include "VcpkgPaths.h"
|
2017-04-04 07:13:46 +08:00
|
|
|
#include "VersionT.h"
|
2017-04-28 08:56:06 +08:00
|
|
|
#include "filesystem_fs.h"
|
2017-06-17 17:39:14 +08:00
|
|
|
#include "vcpkg_Parse.h"
|
2017-04-28 08:56:06 +08:00
|
|
|
#include "vcpkg_expected.h"
|
2016-11-08 08:06:36 +08:00
|
|
|
|
2017-01-06 06:25:50 +08:00
|
|
|
namespace vcpkg::Paragraphs
|
2016-11-08 08:06:36 +08:00
|
|
|
{
|
2017-06-17 17:39:14 +08:00
|
|
|
using RawParagraph = Parse::RawParagraph;
|
2017-04-01 18:30:52 +08:00
|
|
|
|
2017-06-17 17:39:14 +08:00
|
|
|
Expected<RawParagraph> get_single_paragraph(const Files::Filesystem& fs, const fs::path& control_path);
|
|
|
|
Expected<std::vector<RawParagraph>> get_paragraphs(const Files::Filesystem& fs, const fs::path& control_path);
|
|
|
|
Expected<RawParagraph> parse_single_paragraph(const std::string& str);
|
|
|
|
Expected<std::vector<RawParagraph>> parse_paragraphs(const std::string& str);
|
2017-02-28 07:45:56 +08:00
|
|
|
|
2017-06-17 17:39:14 +08:00
|
|
|
Parse::ParseExpected<SourceControlFile> try_load_port(const Files::Filesystem& fs, const fs::path& control_path);
|
2017-02-28 07:45:56 +08:00
|
|
|
|
2017-04-04 07:29:11 +08:00
|
|
|
Expected<BinaryParagraph> try_load_cached_package(const VcpkgPaths& paths, const PackageSpec& spec);
|
2017-02-28 07:45:56 +08:00
|
|
|
|
2017-06-08 15:36:17 +08:00
|
|
|
struct LoadResults
|
|
|
|
{
|
2017-06-17 17:39:14 +08:00
|
|
|
std::vector<std::unique_ptr<SourceControlFile>> paragraphs;
|
|
|
|
std::vector<std::unique_ptr<Parse::ParseControlErrorInfo>> errors;
|
2017-06-08 15:36:17 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
LoadResults try_load_all_ports(const Files::Filesystem& fs, const fs::path& ports_dir);
|
|
|
|
|
2017-06-17 17:39:14 +08:00
|
|
|
std::vector<std::unique_ptr<SourceControlFile>> load_all_ports(const Files::Filesystem& fs,
|
|
|
|
const fs::path& ports_dir);
|
2017-02-28 08:14:36 +08:00
|
|
|
|
2017-06-17 17:39:14 +08:00
|
|
|
std::map<std::string, VersionT> load_all_port_names_and_versions(const Files::Filesystem& fs,
|
|
|
|
const fs::path& ports_dir);
|
2017-01-06 06:25:50 +08:00
|
|
|
}
|