#pragma once #include #include #include #include #include #include #include #include #include #include namespace vcpkg { /// /// A registry package pattern (e.g.: boost*) and the in-file location where it was declared. /// struct PackagePatternDeclaration { std::string pattern; std::string location; }; struct RegistryConfig { // Missing kind means "null" Optional kind; Optional baseline; Optional location; Optional name; Optional path; Optional reference; Optional repo; Optional> packages; Optional> package_declarations; Json::Value serialize() const; ExpectedL> get_latest_baseline(const VcpkgPaths& paths) const; StringView pretty_location() const; }; struct Configuration { Optional default_reg; std::vector registries; Json::Object ce_metadata; Json::Object extra_info; std::vector overlay_ports; std::vector overlay_triplets; Json::Object serialize() const; void validate_as_active() const; std::unique_ptr instantiate_registry_set(const VcpkgPaths& paths, const Path& config_dir) const; bool requests_ce() const; static View known_fields(); }; enum class ConfigurationSource { None, VcpkgConfigurationFile, ManifestFile, }; struct ConfigurationAndSource { Configuration config; Path directory; ConfigurationSource source = ConfigurationSource::None; std::unique_ptr instantiate_registry_set(const VcpkgPaths& paths) const { return config.instantiate_registry_set(paths, directory); } }; struct ManifestConfiguration { Optional builtin_baseline; Optional config; }; Json::IDeserializer& get_configuration_deserializer(); // Parse configuration from a file containing a valid vcpkg-configuration.json file Optional parse_configuration(StringView contents, StringView origin, vcpkg::MessageSink& messageSink); // Parse a configuration JSON object Optional parse_configuration(const Json::Object& object, StringView origin, vcpkg::MessageSink& messageSink); std::vector find_unknown_fields(const Configuration& config); // Exposed for testing bool is_package_pattern(StringView sv); }