2017-03-25 01:46:49 +08:00
|
|
|
#pragma once
|
|
|
|
#include <system_error>
|
|
|
|
|
|
|
|
namespace vcpkg
|
|
|
|
{
|
2017-04-04 05:48:24 +08:00
|
|
|
enum class ParagraphParseResult
|
2017-03-25 01:46:49 +08:00
|
|
|
{
|
|
|
|
SUCCESS = 0,
|
|
|
|
EXPECTED_ONE_PARAGRAPH
|
|
|
|
};
|
|
|
|
|
2017-04-04 05:48:24 +08:00
|
|
|
struct ParagraphParseResultCategoryImpl final : std::error_category
|
2017-03-25 01:46:49 +08:00
|
|
|
{
|
|
|
|
virtual const char* name() const noexcept override;
|
|
|
|
|
|
|
|
virtual std::string message(int ev) const noexcept override;
|
|
|
|
};
|
|
|
|
|
|
|
|
const std::error_category& paragraph_parse_result_category();
|
|
|
|
|
2017-04-04 05:48:24 +08:00
|
|
|
std::error_code make_error_code(ParagraphParseResult e);
|
2017-03-25 01:46:49 +08:00
|
|
|
|
2017-04-04 05:48:24 +08:00
|
|
|
ParagraphParseResult to_paragraph_parse_result(int i);
|
2017-03-25 01:46:49 +08:00
|
|
|
|
2017-04-04 05:48:24 +08:00
|
|
|
ParagraphParseResult to_paragraph_parse_result(std::error_code ec);
|
2017-03-25 01:46:49 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// Enable implicit conversion to std::error_code
|
2017-04-28 08:56:06 +08:00
|
|
|
template<>
|
|
|
|
struct std::is_error_code_enum<vcpkg::ParagraphParseResult> : ::std::true_type
|
2017-03-25 01:46:49 +08:00
|
|
|
{
|
2017-04-28 08:56:06 +08:00
|
|
|
};
|