39 using std::regex_search;
50 Cmdline::Cmdline (
int argc,
const char** argv)
51 : vector<string> (noneg(argc-1))
53 for (
int i=1; i<argc; ++i)
56 (*this)[i-1] = argv[i];
64 Cmdline::Cmdline (
const string cmdline)
66 static regex TOKENDEF{
"\\S+"};
68 string::const_iterator it = cmdline.begin();
69 string::const_iterator end = cmdline.end();
71 while (regex_search(it, end, match, TOKENDEF))
82 Cmdline::operator string ()
const 84 return join(*
this,
" ");
NUM constexpr noneg(NUM val)
cut a numeric value to be >=0
This header is for including and configuring NoBug.
Implementation namespace for support and library code.
Class to encapsulate the typical C-style commandline definition.
Helper to use a single extension point for specialised hash functions.