aboutsummaryrefslogtreecommitdiff
path: root/openssl/types-parsers.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2018-10-15 21:08:04 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2018-10-17 15:02:42 +0300
commitde91921561092689369b56c54950474e0a86e66f (patch)
treea9949058021d911db1106b1a2e4d9e0e9281de16 /openssl/types-parsers.cxx
parentfb65c93daaf369157bd712f2c4c20161c4840b94 (diff)
Add implementation
Diffstat (limited to 'openssl/types-parsers.cxx')
-rw-r--r--openssl/types-parsers.cxx34
1 files changed, 34 insertions, 0 deletions
diff --git a/openssl/types-parsers.cxx b/openssl/types-parsers.cxx
new file mode 100644
index 0000000..4b96c65
--- /dev/null
+++ b/openssl/types-parsers.cxx
@@ -0,0 +1,34 @@
+// file : openssl/types-parsers.cxx -*- C++ -*-
+// copyright : Copyright (c) 2014-2018 Code Synthesis Ltd
+// license : MIT; see accompanying LICENSE file
+
+#include <openssl/types-parsers.hxx>
+
+#include <openssl/options.hxx> // openssl::cli namespace
+
+namespace openssl
+{
+ namespace cli
+ {
+ void parser<simulate_outcome>::
+ parse (simulate_outcome& x, bool& xs, scanner& s)
+ {
+ xs = true;
+ const char* o (s.next ());
+
+ if (!s.more ())
+ throw missing_value (o);
+
+ const string v (s.next ());
+
+ try
+ {
+ x = to_simulate_outcome (v);
+ }
+ catch (const invalid_argument&)
+ {
+ throw invalid_value (o, v);
+ }
+ }
+ }
+}