summaryrefslogtreecommitdiff
path: root/xsd/xsd/options-parser.hxx
blob: afcdf80b8df8cee70fc016a276a7083d1f59babd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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