From de91921561092689369b56c54950474e0a86e66f Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Mon, 15 Oct 2018 21:08:04 +0300 Subject: Add implementation --- openssl/types-parsers.cxx | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 openssl/types-parsers.cxx (limited to 'openssl/types-parsers.cxx') 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 + +#include // openssl::cli namespace + +namespace openssl +{ + namespace cli + { + void parser:: + 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); + } + } + } +} -- cgit v1.1