- Timestamp:
- Nov 16, 1999, 5:57:39 PM (26 years ago)
- Location:
- trunk/SophyaLib/BaseTools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/BaseTools/ppersist.cc
r576 r582 328 328 PInPersist::GotoTagNum(int itag) 329 329 { 330 if (itag<0 || itag >= tags.size()) return false;330 if (itag<0 || itag >= (int)tags.size()) return false; 331 331 map<string, int_8>::iterator i = tags.begin(); 332 332 for (int j=0; j<itag; j++) i++; … … 335 335 } 336 336 337 string 338 PInPersist::GetTagName(int itag) 339 { 340 if (itag<0 || itag >= (int)tags.size()) return ""; 341 map<string, int_8>::iterator i = tags.begin(); 342 for (int j=0; j<itag; j++) i++; 343 return((*i).first); 344 } 345 346 static vector<string> * ret_tag_names = NULL; 347 vector<string> const & 348 PInPersist::GetTagNames() 349 { 350 if (ret_tag_names) delete ret_tag_names; 351 ret_tag_names = new vector<string> ; 352 map<string, int_8>::iterator i; 353 for(i=tags.begin(); i!=tags.end(); i++) ret_tag_names->push_back((*i).first); 354 return(*ret_tag_names); 355 } 337 356 338 357 //++ … … 682 701 int_2 len; 683 702 GetRawI2(len); 684 char * buff = new char (len+1);703 char * buff = new char[len+1]; 685 704 GetRawBytes(buff, len); 686 705 buff[len] = '\0'; -
trunk/SophyaLib/BaseTools/ppersist.h
r576 r582 114 114 int NbTags(); 115 115 bool GotoTagNum(int itag); // 0..NbTags-1 116 string GetTagName(int itag); // 0..NbTags-1 117 vector<string> const & GetTagNames(); 116 118 117 119 void GetByte (char& c);
Note:
See TracChangeset
for help on using the changeset viewer.