diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2015-11-16 20:02:06 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2015-11-25 20:35:10 +0200 |
commit | 2700ed6a3e1092a064f28b07f8e2c4e5b9b830e7 (patch) | |
tree | a54ffc979dde42e609bc9877120fa010887c6b66 /brep/types-parsers.cxx | |
parent | 48a3c47d34c2acc0a39e2db5acfd437dace499c1 (diff) |
Implement new URL path schema for the web interface
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); + } } } |