diff options
Diffstat (limited to 'brep/types-parsers.cxx')
-rw-r--r-- | brep/types-parsers.cxx | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/brep/types-parsers.cxx b/brep/types-parsers.cxx index 6236000..f7f1c1b 100644 --- a/brep/types-parsers.cxx +++ b/brep/types-parsers.cxx @@ -4,16 +4,17 @@ #include <brep/types-parsers> -#include <butl/path> - +#include <brep/types> #include <brep/options> -using namespace butl; +using namespace std; namespace brep { namespace cli { + // Parse path. + // template <typename T> static void parse_path (T& x, scanner& s) @@ -40,5 +41,24 @@ namespace brep { parse_path (x, s); } + + // Parse page_form. + // + void parser<page_form>:: + parse (page_form& x, scanner& s) + { + const char* o (s.next ()); + + if (!s.more ()) + throw missing_value (o); + + const string v (s.next ()); + if (v == "full") + x = page_form::full; + else if (v == "brief") + x = page_form::brief; + else + throw invalid_value (o, v); + } } } |