From e60108713590ccee83da7e2581a43fd5fda5c8ce Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Tue, 12 Jul 2016 17:26:45 +0300 Subject: Add repository certificate info to the About page --- load/types-parsers.cxx | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 load/types-parsers.cxx (limited to 'load/types-parsers.cxx') diff --git a/load/types-parsers.cxx b/load/types-parsers.cxx new file mode 100644 index 0000000..6c61daf --- /dev/null +++ b/load/types-parsers.cxx @@ -0,0 +1,43 @@ +// file : load/types-parsers.cxx -*- C++ -*- +// copyright : Copyright (c) 2014-2016 Code Synthesis Ltd +// license : MIT; see accompanying LICENSE file + +#include + +#include // cli namespace + +using namespace brep; + +namespace cli +{ + template + static void + parse_path (T& x, scanner& s) + { + const char* o (s.next ()); + + if (!s.more ()) + throw missing_value (o); + + const char* v (s.next ()); + + try + { + x = T (v); + + if (x.empty ()) + throw invalid_value (o, v); + } + catch (const invalid_path&) + { + throw invalid_value (o, v); + } + } + + void parser:: + parse (path& x, bool& xs, scanner& s) + { + xs = true; + parse_path (x, s); + } +} -- cgit v1.1