[Boost-bugs] [Boost C++ Libraries] #1798: met an error using boost::tokenizer in multi-times in vs2005, unicode

Subject: [Boost-bugs] [Boost C++ Libraries] #1798: met an error using boost::tokenizer in multi-times in vs2005, unicode
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2008-04-09 08:12:29


#1798: met an error using boost::tokenizer in multi-times in vs2005, unicode
----------------------------------------+-----------------------------------
 Reporter: wingo <wangtonggu_at_[hidden]> | Owner: jsiek
     Type: Bugs | Status: new
Milestone: | Component: tokenizer
  Version: Boost 1.34.1 | Severity: Problem
 Keywords: boost::tokenizer |
----------------------------------------+-----------------------------------
 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)
                 {
                         ;
 }
         }

--
Ticket URL: <http://svn.boost.org/trac/boost/ticket/1798>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.


This archive was generated by hypermail 2.1.7 : 2017-02-16 18:49:57 UTC