// file : brep/types-parsers.cxx -*- C++ -*- // copyright : Copyright (c) 2014-2015 Code Synthesis Ltd // license : MIT; see accompanying LICENSE file #include #include #include using namespace butl; namespace brep { namespace cli { template static void parse_path (T& x, scanner& s) { const char* o (s.next ()); if (!s.more ()) throw missing_value (o); const char* v (s.next ()); try { x = T (v); if (x.empty ()) throw invalid_value (o, v); } catch (const invalid_path&) { throw invalid_value (o, v); } } void parser:: parse (dir_path& x, scanner& s) { parse_path (x, s); } } }