Hello, I'm trying to get the tokenizer to work using the tokenizer boost class. I found this tutorial in the documentation on speeding up:
http://www.boost.org/doc/libs/1 _36 _0 / libs / tokenizer / escaped _list _separator.htm
the problem is that I cannot get an argument for the escape-_list _ separator ("," "," ");
but if I modify the boost / tokenizer.hpp file, it works. but this is not an ideal solution, I wondered if there is something that I do not see in order to get different arguments in escape-_list_separator.
I want it to be split into spaces with the "and" character for escaping and without an escape character inside the specified string.
this is used for the argument analysis system in the game console.
include <iostream>
include <boost/tokenizer.hpp>
include <string>
int main()
{
using namespace std;
using namespace boost;
string s = "exec script1 \"script argument number one\"";
string separator1("");//dont let quoted arguments escape themselves
string separator2(" ");//split on spaces
string separator3("\"\'");//let it have quoted arguments
tokenizer<escaped_list_separator<char>(separator1,separator2,separator3)> tok(s);
for(tokenizer<escaped_list_separator<char>(separator1,separator2,separator3)>::iterator beg=tok.begin(); beg!=tok.end();++beg)
{
cout << *beg << "\n";
}
}
the error from visual studio 2005 is error C2974: 'boost :: tokenizer': invalid template argument for 'TokenizerFunc', type expectedEDIT: This question was called by Ferruchio and explained to everyone who thanked everyone.
source
share