diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2020-12-18 18:48:46 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2021-02-24 22:20:33 +0300 |
commit | a8ce5c380c69539fe0c7c62c397634d9d0c9fde2 (patch) | |
tree | c8db5c9b99416ca4686af953387f474af15bc92e /xsd/xsd/options-parser.hxx | |
parent | 7420f85ea19b0562ffdd8123442f32bc8bac1267 (diff) |
Switch to build2
Diffstat (limited to 'xsd/xsd/options-parser.hxx')
-rw-r--r-- | xsd/xsd/options-parser.hxx | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/xsd/xsd/options-parser.hxx b/xsd/xsd/options-parser.hxx new file mode 100644 index 0000000..afcdf80 --- /dev/null +++ b/xsd/xsd/options-parser.hxx @@ -0,0 +1,29 @@ +// file : xsd/options-parser.hxx +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +#ifndef XSD_OPTIONS_PARSER_HXX +#define XSD_OPTIONS_PARSER_HXX + +#include <xsd/types.hxx> +#include <xsd/options.hxx> + +namespace cli +{ + template <> + struct parser<NarrowString> + { + static void + parse (NarrowString& x, bool& xs, scanner& s) + { + xs = true; + const char* o (s.next ()); + + if (s.more ()) + x = s.next (); + else + throw missing_value (o); + } + }; +} + +#endif // XSD_OPTIONS_PARSER_HXX |