#include <cmdline.hpp>


Public Member Functions | |
| template<class In> | |
| Cmdline (In first, In last) | |
| Cmdline (const string cmdline) | |
| create by tokenizing a string (e.g. | |
| Cmdline (int argc, char *argv[]) | |
| create as a tokenized copy of the current commandline. | |
| operator string () const | |
| conversion to string by joining the tokens | |
| VectS & | operator= (const VectS &source) |
Definition at line 48 of file cmdline.hpp.
| util::Cmdline::Cmdline | ( | int | argc, | |
| char * | argv[] | |||
| ) |
Note that argv[0] is allways ignored.
Definition at line 55 of file cmdline.cpp.
00056 : vector<string> (noneg(argc-1)) 00057 { 00058 for (int i=1; i<argc; ++i) 00059 { 00060 ASSERT (argv[i]); 00061 (*this)[i-1] = argv[i]; 00062 } 00063 }
| util::Cmdline::Cmdline | ( | const string | cmdline | ) | [explicit] |
"fake" cmdline, separated by whitespace)
Definition at line 69 of file cmdline.cpp.
00070 { 00071 regex tokendef("[^ \r\n\t]+"); 00072 smatch match; 00073 string::const_iterator it = cmdline.begin(); 00074 string::const_iterator end = cmdline.end(); 00075 00076 while (regex_search(it, end, match, tokendef)) 00077 { 00078 string ss(match[0]); 00079 this->push_back(ss); 00080 it = match[0].second; 00081 } 00082 00083 }
1.5.5