aboutsummaryrefslogtreecommitdiff
path: root/xsde/options-parser.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2012-06-21 10:20:42 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2012-06-21 10:20:42 +0200
commitc34158508eafb020fbb7bbb7c0b2479982c426cd (patch)
tree49e7fcbde369f01ecc5524853dddbbf4a109c603 /xsde/options-parser.hxx
parentef4efbab2664232aa35b0111a6d430d2c67ababd (diff)
Completion of the CLI port
Diffstat (limited to 'xsde/options-parser.hxx')
-rw-r--r--xsde/options-parser.hxx31
1 files changed, 31 insertions, 0 deletions
diff --git a/xsde/options-parser.hxx b/xsde/options-parser.hxx
new file mode 100644
index 0000000..a16cd67
--- /dev/null
+++ b/xsde/options-parser.hxx
@@ -0,0 +1,31 @@
+// file : xsde/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 <cult/types.hxx>
+
+#include <options.hxx>
+
+namespace cli
+{
+ template <>
+ struct parser<Cult::Types::NarrowString>
+ {
+ 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