#pragma once #include #include namespace vcpkg { enum class InstallState { ERROR_STATE, NOT_INSTALLED, HALF_INSTALLED, INSTALLED, }; enum class Want { ERROR_STATE, UNKNOWN, INSTALL, HOLD, DEINSTALL, PURGE }; /// /// Installed package metadata /// struct StatusParagraph { StatusParagraph(); explicit StatusParagraph(std::unordered_map&& fields); bool is_installed() const { return want == Want::INSTALL && state == InstallState::INSTALLED; } BinaryParagraph package; Want want; InstallState state; }; void serialize(const StatusParagraph& pgh, std::string& out_str); std::string to_string(InstallState f); std::string to_string(Want f); struct InstalledPackageView { InstalledPackageView() : core(nullptr) {} InstalledPackageView(const StatusParagraph* c, std::vector&& fs) : core(c), features(std::move(fs)) { } std::vector dependencies() const; const StatusParagraph* core; std::vector features; }; }