30 using std::regex_search;
41 Cmdline::Cmdline (
int argc,
const char** argv)
42 : vector<string> (noneg(argc-1))
44 for (
int i=1; i<argc; ++i)
47 (*this)[i-1] = argv[i];
55 Cmdline::Cmdline (
const string cmdline)
57 static regex TOKENDEF{
"\\S+"};
59 string::const_iterator it = cmdline.begin();
60 string::const_iterator end = cmdline.end();
62 while (regex_search(it, end, match, TOKENDEF))
73 Cmdline::operator string ()
const 75 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.