Changeset 582 in Sophya


Ignore:
Timestamp:
Nov 16, 1999, 5:57:39 PM (26 years ago)
Author:
ansari
Message:

Corr. bug et ajout Methodes PInPersist::GetTagName - Reza 16/11/99

Location:
trunk/SophyaLib/BaseTools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaLib/BaseTools/ppersist.cc

    r576 r582  
    328328PInPersist::GotoTagNum(int itag)
    329329{
    330   if (itag<0 || itag >= tags.size()) return false;
     330  if (itag<0 || itag >= (int)tags.size()) return false;
    331331  map<string, int_8>::iterator i = tags.begin();
    332332  for (int j=0; j<itag; j++) i++;
     
    335335}
    336336
     337string
     338PInPersist::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
     346static vector<string> * ret_tag_names = NULL;
     347vector<string> const &
     348PInPersist::GetTagNames()
     349{
     350if (ret_tag_names) delete ret_tag_names;
     351ret_tag_names = new vector<string> ;
     352map<string, int_8>::iterator i;
     353for(i=tags.begin(); i!=tags.end(); i++) ret_tag_names->push_back((*i).first);
     354return(*ret_tag_names); 
     355}
    337356
    338357//++
     
    682701  int_2 len;
    683702  GetRawI2(len);
    684   char * buff = new char(len+1);
     703  char * buff = new char[len+1];
    685704  GetRawBytes(buff, len);
    686705  buff[len] = '\0';
  • trunk/SophyaLib/BaseTools/ppersist.h

    r576 r582  
    114114    int    NbTags();
    115115    bool   GotoTagNum(int itag);  // 0..NbTags-1
     116    string GetTagName(int itag);  // 0..NbTags-1
     117    vector<string> const &  GetTagNames(); 
    116118
    117119    void   GetByte (char& c);
Note: See TracChangeset for help on using the changeset viewer.