2016-09-19 11:50:08 +08:00
|
|
|
#pragma once
|
|
|
|
#include <system_error>
|
|
|
|
|
|
|
|
namespace vcpkg
|
|
|
|
{
|
2017-04-04 05:47:30 +08:00
|
|
|
enum class PackageSpecParseResult
|
2016-09-19 11:50:08 +08:00
|
|
|
{
|
2016-10-05 05:48:39 +08:00
|
|
|
SUCCESS = 0,
|
|
|
|
TOO_MANY_COLONS,
|
|
|
|
INVALID_CHARACTERS
|
2016-09-19 11:50:08 +08:00
|
|
|
};
|
|
|
|
|
2017-04-04 05:47:30 +08:00
|
|
|
struct PackageSpecParseResultCategoryImpl final : std::error_category
|
2016-09-19 11:50:08 +08:00
|
|
|
{
|
|
|
|
virtual const char* name() const noexcept override;
|
|
|
|
|
|
|
|
virtual std::string message(int ev) const noexcept override;
|
|
|
|
};
|
|
|
|
|
|
|
|
const std::error_category& package_spec_parse_result_category();
|
|
|
|
|
2017-04-04 05:47:30 +08:00
|
|
|
std::error_code make_error_code(PackageSpecParseResult e);
|
2016-09-19 11:50:08 +08:00
|
|
|
|
2017-04-04 05:47:30 +08:00
|
|
|
PackageSpecParseResult to_package_spec_parse_result(int i);
|
2016-09-19 11:50:08 +08:00
|
|
|
|
2017-04-04 05:47:30 +08:00
|
|
|
PackageSpecParseResult to_package_spec_parse_result(std::error_code ec);
|
2016-09-19 11:50:08 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// Enable implicit conversion to std::error_code
|
|
|
|
namespace std
|
|
|
|
{
|
|
|
|
template <>
|
2017-04-04 05:47:30 +08:00
|
|
|
struct is_error_code_enum<vcpkg::PackageSpecParseResult> : ::std::true_type
|
2016-10-05 05:46:40 +08:00
|
|
|
{
|
|
|
|
};
|
2016-09-19 11:50:08 +08:00
|
|
|
}
|