2016-09-19 11:50:08 +08:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "BinaryParagraph.h"
|
2017-04-28 08:56:06 +08:00
|
|
|
#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
|
|
|
{
|
2017-04-04 06:25:34 +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
|
|
|
{
|
2017-04-04 06:42:26 +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();
|
2017-06-17 17:39:14 +08:00
|
|
|
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
|
|
|
};
|
|
|
|
|
2017-04-13 13:48:52 +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
|
|
|
}
|