summaryrefslogtreecommitdiff
path: root/xsd/options-parser.hxx
blob: 26a078230fa272b8433ab157478c39fedd1d84de (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
30
// file      : xsd/options-parser.hxx
// author    : Boris Kolpackov <boris@codesynthesis.com>
// 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 <types.hxx>
#include <options.hxx>

namespace cli
{
  template <>
  struct parser<NarrowString>
  {
    static void
    parse (NarrowString& x, scanner& s)
    {
      const char* o (s.next ());

      if (s.more ())
        x = s.next ();
      else
        throw missing_value (o);
    }
  };
}

#endif // OPTIONS_PARSER_HXX