From c04f7d6ed04d62efafa79a87bcde6c5f62e95327 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 20 Jun 2012 11:54:24 +0200 Subject: Completion of the CLI port --- xsd/options-parser.hxx | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 xsd/options-parser.hxx (limited to 'xsd/options-parser.hxx') diff --git a/xsd/options-parser.hxx b/xsd/options-parser.hxx new file mode 100644 index 0000000..9ea1e09 --- /dev/null +++ b/xsd/options-parser.hxx @@ -0,0 +1,31 @@ +// file : xsd/options-parser.hxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +#ifndef OPTIONS_PARSER_HXX +#define OPTIONS_PARSER_HXX + +#include + +#include + +namespace cli +{ + template <> + struct parser + { + static void + parse (Cult::Types::NarrowString& x, scanner& s) + { + const char* o (s.next ()); + + if (s.more ()) + x = s.next (); + else + throw missing_value (o); + } + }; +} + +#endif // OPTIONS_PARSER_HXX -- cgit v1.1