diff options
author | Jörg Frings-Fürst <debian@jff.email> | 2024-03-06 10:24:08 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff.email> | 2024-03-06 10:24:08 +0100 |
commit | aad5ad9bf0c02aa4e79bc6b7d6c934612fff4026 (patch) | |
tree | 9cc224b059f248a6229ab0dcdc64eb4a73fa9800 /xsd/options-parser.hxx | |
parent | c1034fc5e99197f507caf450aa15bc178698b26e (diff) |
New upstream version 4.2.0upstream/4.2.0upstream
Diffstat (limited to 'xsd/options-parser.hxx')
-rw-r--r-- | xsd/options-parser.hxx | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/xsd/options-parser.hxx b/xsd/options-parser.hxx new file mode 100644 index 0000000..afcdf80 --- /dev/null +++ b/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 |