72 "usage: stringtest [-r r] [-p] [-s]" "\n" 73 " or: stringtest --help|-h" "\n" 80 "-r r read ranges from \'r\'" "\n" 81 "-p test pattern substitution" "\n" 82 "-s split functions" "\n" 105 cerr << usage_text << endl;
113 if (cmdline.optset(0))
115 cerr << usage_text << endl;
116 cerr << help_text << endl;
129 std::string a(
"a:bc:def:ghij");
130 std::list<std::string> splitted;
132 cout << a <<
" is splitted to:" << endl;
133 for (std::list<std::string>::const_iterator I=splitted.begin();
134 I!=splitted.end(); ++I)
145 rnglist=tfxx::string::rangelist<Trangelist::Tvalue>(opt.
rangestring);
146 Trangelist::Tlist rlist=rnglist.
list();
147 Trangelist::Tlist::const_iterator i=rlist.begin();
148 while (i!=rlist.end())
150 std::cout << *i << std::endl;
153 std::cout <<
"values contained in all ranges:" << std::endl;
154 for (
int i=1; i<=100; ++i)
156 if (rnglist.contains(i)) { std::cout << i <<
" "; }
158 std::cout << std::endl;
168 "This is a string that will be modified by string functions";
169 std::string p=
"string";
170 std::string r=
"nonsense";
171 std::cout << s << std::endl;
176 "% <- front middle -> % and end -> %";
178 std::string r=
"****";
179 std::cout << s << std::endl;
option requires an argument
std::string patsubst(const std::string &s, const std::string &p, const std::string &r)
void gen_split(C &v, const std::string &s, const std::string &delimiter=" ", const bool &dropdelimiter=false)
Namespace containing all components of module commandline. ,.
Evaluates commandline by calling long_getopt. ,You may instantiate a Commandline object by passing th...
#define STRINGTEST_VERSION
struct to define options ,This struct is used to define a list of options. An example is: ...