- Timestamp:
- 04/08/11 14:07:50 (14 years ago)
- Location:
- trunk/FACT++/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/Converter.cc
r10323 r10326 43 43 not understood by Dim. In addition there are \b O(ptions) which are like 44 44 Words but can be omitted. They should only be used at the end of the string. 45 \b B(ool) is also special. It evaluates true/false, yes/no, on/off, 1/0. 45 Both can be encapsulated in quotationmarks '"'. \b B(ool) is also special. 46 It evaluates true/false, yes/no, on/off, 1/0. 46 47 47 48 The non-DIM like format options can be switched on and off by using the 48 strict argument in the constructor. 49 strict argument in the constructor. In general DimCommands can use these 50 options, but DimServices not. 49 51 50 52 @remark Note that all values are interpreted as signed, except the single … … 175 177 wout << " (" << val << ")"; 176 178 177 v.insert(v.end(), val.begin(), val.end() );179 v.insert(v.end(), val.begin(), val.end()+1); 178 180 } 179 181 … … 196 198 197 199 v.push_back(val); 200 v.push_back('\n'); 198 201 } 199 202 … … 274 277 line.get(); 275 278 getline(line, buf, '\"'); 279 if (line.peek()==-1) 280 line.clear(ios::eofbit); 276 281 } 277 282 else … … 400 405 //! @param ptr 401 406 //! Pointer to the binary representation. It will be incremented 402 //! according to the s ze of the template argument407 //! according to the size of the template argument 403 408 //! 404 409 //! @tparam T … … 420 425 //! 421 426 //! @param ptr 422 //! Pointer to the binary representation. 423 //! 424 void Converter::AddString(string &str, const string &ptr) const 425 { 426 str += ' ' + ptr; 427 //! Pointer to the binary representation. It will be incremented 428 //! according to the size of the template argument 429 //! 430 void Converter::AddString(string &str, const char* &ptr) const 431 { 432 const string txt(ptr); 433 str += " [" + txt + "]"; 434 ptr += txt.length()+1; 427 435 } 428 436 … … 435 443 //! 436 444 //! @param ptr 437 //! Pointer to the binary representation of the string. 438 //! 439 void Converter::AddString(vector<boost::any> &vec, const string &ptr) const 440 { 441 vec.push_back(ptr); 445 //! Pointer to the binary representation. It will be incremented 446 //! according to the size of the template argument 447 //! 448 void Converter::AddString(vector<boost::any> &vec, const char* &ptr) const 449 { 450 const string txt(ptr); 451 vec.push_back(txt); 452 ptr += txt.length()+1; 442 453 } 443 454 … … 551 562 GetBinString(data, GetString(line)); 552 563 if (*i->first.first == typeid(O)) 553 line.clear(ios::goodbit );564 line.clear(ios::goodbit|(line.rdstate()&ios::eofbit)); 554 565 break; 555 566 default: … … 564 575 break; 565 576 } 566 567 577 wout << endl; 568 578 … … 653 663 if (*i->first.first == typeid(string)) 654 664 { 655 const string str(ptr); 656 AddString(text, str); 657 ptr += str.length()+1; 665 AddString(text, ptr); 658 666 break; 659 667 } … … 672 680 case 'd': Add<double> (text, ptr); break; 673 681 case 'x': Add<long long>(text, ptr); break; 682 case 'N': AddString(text, ptr); break; 683 674 684 case 'v': 675 685 // This should never happen! -
trunk/FACT++/src/Converter.h
r10287 r10326 58 58 template<class T> 59 59 void Add(std::string &str, const char* &ptr) const; 60 void AddString(std::string &str, const std::string&ptr) const;60 void AddString(std::string &str, const char* &ptr) const; 61 61 template<class T> 62 62 void Add(std::vector<boost::any> &vec, const char* &ptr) const; 63 void AddString(std::vector<boost::any> &vec, const std::string&ptr) const;63 void AddString(std::vector<boost::any> &vec, const char* &ptr) const; 64 64 65 65
Note:
See TracChangeset
for help on using the changeset viewer.