aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src/paragraph_parse_result.cpp
diff options
context:
space:
mode:
authorTobias Kohlbau <tobias@kohlbau.de>2017-03-28 10:48:26 +0200
committerTobias Kohlbau <tobias@kohlbau.de>2017-03-28 10:51:53 +0200
commita9aaead2d19c60a51edbaaddd97b745c51714220 (patch)
treee0632fa068b11edd4be13e1ee191d65616a4cffb /toolsrc/src/paragraph_parse_result.cpp
parent4fbcf0df4dd14176eda7d686bf122d0b65c0585a (diff)
parenta1cfa18481f9ea0f7eaaaeb34832d89c51f5f4f1 (diff)
downloadvcpkg-a9aaead2d19c60a51edbaaddd97b745c51714220.tar.gz
vcpkg-a9aaead2d19c60a51edbaaddd97b745c51714220.zip
Merge branch 'master' of github.com:Microsoft/vcpkg into opencv_contrib
Diffstat (limited to 'toolsrc/src/paragraph_parse_result.cpp')
-rw-r--r--toolsrc/src/paragraph_parse_result.cpp45
1 files changed, 45 insertions, 0 deletions
diff --git a/toolsrc/src/paragraph_parse_result.cpp b/toolsrc/src/paragraph_parse_result.cpp
new file mode 100644
index 000000000..4715f7a16
--- /dev/null
+++ b/toolsrc/src/paragraph_parse_result.cpp
@@ -0,0 +1,45 @@
+#include "pch.h"
+#include "vcpkg_Checks.h"
+#include "paragraph_parse_result.h"
+
+namespace vcpkg
+{
+ const char* paragraph_parse_result_category_impl::name() const noexcept
+ {
+ return "paragraph_parse_result";
+ }
+
+ std::string paragraph_parse_result_category_impl::message(int ev) const noexcept
+ {
+ switch (static_cast<paragraph_parse_result>(ev))
+ {
+ case paragraph_parse_result::SUCCESS:
+ return "OK";
+ case paragraph_parse_result::EXPECTED_ONE_PARAGRAPH:
+ return "There should be exactly one paragraph";
+ default:
+ Checks::unreachable(VCPKG_LINE_INFO);
+ }
+ }
+
+ const std::error_category& paragraph_parse_result_category()
+ {
+ static paragraph_parse_result_category_impl instance;
+ return instance;
+ }
+
+ std::error_code make_error_code(paragraph_parse_result e)
+ {
+ return std::error_code(static_cast<int>(e), paragraph_parse_result_category());
+ }
+
+ paragraph_parse_result to_paragraph_parse_result(int i)
+ {
+ return static_cast<paragraph_parse_result>(i);
+ }
+
+ paragraph_parse_result to_paragraph_parse_result(std::error_code ec)
+ {
+ return to_paragraph_parse_result(ec.value());
+ }
+}