test driver for stringtokens
This commit is contained in:
parent
db27f7c016
commit
7079534ab3
1 changed files with 14 additions and 2 deletions
|
@ -1264,7 +1264,19 @@ int main(int argc, char **argv)
|
|||
{
|
||||
thisprog = *argv++;argc--;
|
||||
|
||||
#if 0
|
||||
#if 1
|
||||
if (argc <=0 ) {
|
||||
cerr << "Usage: smallut <stringtosplit>" << endl;
|
||||
exit(1);
|
||||
}
|
||||
string s = *argv++;argc--;
|
||||
vector<string> vs;
|
||||
stringToTokens(s, vs, "/");
|
||||
for (vector<string>::const_iterator it = vs.begin(); it != vs.end(); it++)
|
||||
cerr << "[" << *it << "] ";
|
||||
cerr << endl;
|
||||
exit(0);
|
||||
#elif 0
|
||||
if (argc <=0 ) {
|
||||
cerr << "Usage: smallut <stringtosplit>" << endl;
|
||||
exit(1);
|
||||
|
@ -1369,7 +1381,7 @@ int main(int argc, char **argv)
|
|||
string out;
|
||||
stringsToCSV(tokens, out);
|
||||
cout << "CSV line: [" << out << "]" << endl;
|
||||
#elif 1
|
||||
#elif 0
|
||||
string sshort("ABC");
|
||||
string slong("ABCD");
|
||||
string sshortsmaller("ABB");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue