aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/include/ParagraphParseResult.h
blob: eaa7e6327469e95c699198f6cd6a69a564e94bb6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#pragma once
#include <system_error>

namespace vcpkg
{
    enum class ParagraphParseResult
    {
        SUCCESS = 0,
        EXPECTED_ONE_PARAGRAPH
    };

    struct ParagraphParseResultCategoryImpl final : std::error_category
    {
        virtual const char* name() const noexcept override;

        virtual std::string message(int ev) const noexcept override;
    };

    const std::error_category& paragraph_parse_result_category();

    std::error_code make_error_code(ParagraphParseResult e);

    ParagraphParseResult to_paragraph_parse_result(int i);

    ParagraphParseResult to_paragraph_parse_result(std::error_code ec);
}

// Enable implicit conversion to std::error_code
template<>
struct std::is_error_code_enum<vcpkg::ParagraphParseResult> : ::std::true_type
{
};