2016-09-18 20:50:08 -07:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "BinaryParagraph.h"
|
2017-04-27 17:56:06 -07:00
|
|
|
#include <unordered_map>
|
2016-09-18 20:50:08 -07:00
|
|
|
|
|
|
|
namespace vcpkg
|
|
|
|
{
|
2017-04-03 15:14:17 -07:00
|
|
|
enum class InstallState
|
2016-09-18 20:50:08 -07:00
|
|
|
{
|
2017-04-03 15:25:34 -07:00
|
|
|
ERROR_STATE,
|
|
|
|
NOT_INSTALLED,
|
|
|
|
HALF_INSTALLED,
|
|
|
|
INSTALLED,
|
2016-09-18 20:50:08 -07:00
|
|
|
};
|
|
|
|
|
2017-04-03 15:25:53 -07:00
|
|
|
enum class Want
|
2016-09-18 20:50:08 -07:00
|
|
|
{
|
2017-04-03 15:42:26 -07:00
|
|
|
ERROR_STATE,
|
|
|
|
UNKNOWN,
|
|
|
|
INSTALL,
|
|
|
|
HOLD,
|
|
|
|
DEINSTALL,
|
|
|
|
PURGE
|
2016-09-18 20:50:08 -07:00
|
|
|
};
|
|
|
|
|
2017-05-24 15:54:12 -07:00
|
|
|
/// <summary>
|
|
|
|
/// Installed package metadata
|
|
|
|
/// </summary>
|
2016-09-18 20:50:08 -07:00
|
|
|
struct StatusParagraph
|
|
|
|
{
|
|
|
|
StatusParagraph();
|
2017-06-17 02:39:14 -07:00
|
|
|
explicit StatusParagraph(std::unordered_map<std::string, std::string>&& fields);
|
2016-09-18 20:50:08 -07:00
|
|
|
|
|
|
|
BinaryParagraph package;
|
2017-04-03 15:25:53 -07:00
|
|
|
Want want;
|
2017-04-03 15:14:17 -07:00
|
|
|
InstallState state;
|
2016-09-18 20:50:08 -07:00
|
|
|
};
|
|
|
|
|
2017-04-12 22:48:52 -07:00
|
|
|
void serialize(const StatusParagraph& pgh, std::string& out_str);
|
2016-09-18 20:50:08 -07:00
|
|
|
|
2017-04-03 15:14:17 -07:00
|
|
|
std::string to_string(InstallState f);
|
2016-09-18 20:50:08 -07:00
|
|
|
|
2017-04-03 15:25:53 -07:00
|
|
|
std::string to_string(Want f);
|
2016-09-18 20:50:08 -07:00
|
|
|
}
|