vcpkg/toolsrc/include/StatusParagraph.h

45 lines
814 B
C
Raw Normal View History

2016-09-19 11:50:08 +08:00
#pragma once
#include "BinaryParagraph.h"
#include <unordered_map>
2016-09-19 11:50:08 +08:00
namespace vcpkg
{
2017-04-04 06:14:17 +08:00
enum class InstallState
2016-09-19 11:50:08 +08:00
{
ERROR_STATE,
NOT_INSTALLED,
HALF_INSTALLED,
INSTALLED,
2016-09-19 11:50:08 +08:00
};
2017-04-04 06:25:53 +08:00
enum class Want
2016-09-19 11:50:08 +08:00
{
ERROR_STATE,
UNKNOWN,
INSTALL,
HOLD,
DEINSTALL,
PURGE
2016-09-19 11:50:08 +08:00
};
2017-05-25 06:54:12 +08:00
/// <summary>
/// Installed package metadata
/// </summary>
2016-09-19 11:50:08 +08:00
struct StatusParagraph
{
StatusParagraph();
explicit StatusParagraph(std::unordered_map<std::string, std::string>&& fields);
2016-09-19 11:50:08 +08:00
BinaryParagraph package;
2017-04-04 06:25:53 +08:00
Want want;
2017-04-04 06:14:17 +08:00
InstallState state;
2016-09-19 11:50:08 +08:00
};
void serialize(const StatusParagraph& pgh, std::string& out_str);
2016-09-19 11:50:08 +08:00
2017-04-04 06:14:17 +08:00
std::string to_string(InstallState f);
2016-09-19 11:50:08 +08:00
2017-04-04 06:25:53 +08:00
std::string to_string(Want f);
2016-09-19 11:50:08 +08:00
}