diff options
| author | Alexander Karatarakis <alkarata@microsoft.com> | 2017-03-24 10:46:49 -0700 |
|---|---|---|
| committer | Alexander Karatarakis <alkarata@microsoft.com> | 2017-03-27 12:43:14 -0700 |
| commit | d2bab3c370fca9fa5216d97495810faaeeaebc2d (patch) | |
| tree | 205fd2130c93e9fe40975a271dd11381b562fead /toolsrc/include/paragraph_parse_result.h | |
| parent | 90bb4a2eeb316fbc5055d507044229cbc8bc5337 (diff) | |
| download | vcpkg-d2bab3c370fca9fa5216d97495810faaeeaebc2d.tar.gz vcpkg-d2bab3c370fca9fa5216d97495810faaeeaebc2d.zip | |
Rework Paragraph parsing error handling. Add single paragraph functions
Diffstat (limited to 'toolsrc/include/paragraph_parse_result.h')
| -rw-r--r-- | toolsrc/include/paragraph_parse_result.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/toolsrc/include/paragraph_parse_result.h b/toolsrc/include/paragraph_parse_result.h new file mode 100644 index 000000000..47f20c08e --- /dev/null +++ b/toolsrc/include/paragraph_parse_result.h @@ -0,0 +1,35 @@ +#pragma once +#include <system_error> + +namespace vcpkg +{ + enum class paragraph_parse_result + { + SUCCESS = 0, + EXPECTED_ONE_PARAGRAPH + }; + + struct paragraph_parse_result_category_impl 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(paragraph_parse_result e); + + paragraph_parse_result to_paragraph_parse_result(int i); + + paragraph_parse_result to_paragraph_parse_result(std::error_code ec); +} + +// Enable implicit conversion to std::error_code +namespace std +{ + template <> + struct is_error_code_enum<vcpkg::paragraph_parse_result> : ::std::true_type + { + }; +} |
