#pragma once #include #include #include "vcpkg_expected.h" #include "vcpkg_optional.h" namespace vcpkg::Parse { struct ParseControlErrorInfo { std::string name; std::vector missing_fields; std::vector extra_fields; std::error_code error; }; template using ParseExpected = ExpectedT, std::unique_ptr>; using RawParagraph = std::unordered_map; struct ParagraphParser { ParagraphParser(RawParagraph&& fields) : fields(std::move(fields)) {} void required_field(const std::string& fieldname, std::string& out); std::string optional_field(const std::string& fieldname); std::unique_ptr error_info(const std::string& name) const; private: RawParagraph&& fields; std::vector missing_fields; }; std::vector parse_comma_list(const std::string& str); }