Changeset 14613 for trunk/FACT++
- Timestamp:
- 11/13/12 17:35:11 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/Converter.cc
r12846 r14613 73 73 74 74 #include <boost/regex.hpp> 75 76 #include "Readline.h" 75 #include <boost/tokenizer.hpp> 76 77 #include "tools.h" 77 78 #include "WindowLog.h" 78 79 … … 325 326 string Converter::GetStringEol(stringstream &line) const 326 327 { 327 // Remove leading whitespaces328 while (line.peek()==' ')329 line.get();330 331 328 line >> noskipws; 332 329 333 330 const istream_iterator<char> eol; // end-of-line iterator 334 const string s(istream_iterator<char>(line), eol); 335 return s + '\0'; 331 const string text(istream_iterator<char>(line), eol); 332 333 string str = Tools::Trim(text); 334 if (str.length()>=2) 335 { 336 const char b = str[0]; 337 const char e = str[str.length()-1]; 338 339 if ((b=='\"' && e=='\"') || (b=='\'' && e=='\'')) 340 { 341 typedef boost::escaped_list_separator<char> separator; 342 const boost::tokenizer<separator> tok(str, separator("\\", " ", "\"'")); 343 344 str = *tok.begin(); 345 } 346 } 347 348 return str + '\0'; 336 349 } 337 350
Note:
See TracChangeset
for help on using the changeset viewer.