Opened 15 years ago
#1798 new Bugs
met an error using boost::tokenizer in multi-times in vs2005, unicode
Reported by: | Owned by: | jsiek | |
---|---|---|---|
Milestone: | Component: | tokenizer | |
Version: | Boost 1.34.1 | Severity: | Problem |
Keywords: | boost::tokenizer | Cc: |
Description
test function:
const CHAR* tnotifymsg = “HTTP/1.1 Host: 176.177.193.111 Content-Length: 110 Date : ......
<?xml version="1.0"?> <Encodeing>
<Body cls="auto" obj="10001">
<ID>19</ID>
</ Encodeing >”;
CHAR* pSeparator = " ,;\n\r";
int nErrorcode = 0;
boost::char_separator<CHAR> sep(pSeparator); std::string strNotifymsg = tnotifymsg; boost::tokenizer<boost::char_separator<CHAR>> tokens(strNotifymsg, sep);
boost::tokenizer<boost::char_separator<CHAR>>::iterator itBegin = tokens.begin();
boost::tokenizer<boost::char_separator<CHAR>>::iterator itEnd = tokens.end();
boost::tokenizer<boost::char_separator<CHAR>>::iterator beg = itBegin;
error code if "HTTP/1.1" at the beginning of notify message if(_stricmp((*beg).c_str(), "HTTP/1.1") == 0) {
using boost::lexical_cast; ++beg; nErrorcode = lexical_cast<int>(*beg);
return nErrorcode;
} else{
else the right message for parser for(; !bFinishFlag; ++beg) {
;
}
}