Changeset 3428 in Sophya for trunk/SophyaPI/PIext/nobjmgr.cc


Ignore:
Timestamp:
Dec 9, 2007, 12:15:41 AM (18 years ago)
Author:
ansari
Message:

Correction ds NamedObjMgr::ReadAll() + ajout commande ls comme alias de listobjs , Reza 08/12/2007

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaPI/PIext/nobjmgr.cc

    r3423 r3428  
    601601  sprintf(buff,"O%d", myNObj);
    602602  cout << "NamedObjMgr::AddObj() Name changed: " << nom << " -> " << buff << endl;
    603   nom = buff;
     603  nobj = buff;
    604604}
    605605
     
    11301130
    11311131  // On lit tous les objets sequentiellement ...
    1132   string nom = servnobjm->FileName2Name(flnm); 
     1132  string nomr = servnobjm->FileName2Name(flnm); 
     1133  string nom = nomr;
     1134  string nums;
    11331135  int kn = 1;
    1134   for(int ii=0; ii<pis.NbTopLevelObjects(); ii++) {
    1135     cout << " --- DBG-ReadAll() ii=" << ii << " nom= " << nom <<endl;
    1136     PPersist* obj = pis.ReadObject();
    1137     if (!obj) continue;
    1138     AddObj(obj->DataObj(), nom, false);
    1139     kn++;
    1140     nom += (string)MuTyV(kn);
    1141   }
     1136  bool fgrdok = true;
     1137  while (fgrdok) {
     1138    try {
     1139      PPersist* obj = pis.ReadObject();
     1140      if (!obj) continue;
     1141      AddObj(obj->DataObj(), nom, false);
     1142      kn++;  nom = nomr + MuTyV(kn).Convert(nums);
     1143    }
     1144    catch (IOExc& iox) {
     1145      fgrdok = false; 
     1146    }
     1147  }
     1148  cout<<"NamedObjMgr::ReadAll(" << flnm << " ,seq) "<< kn-1 << " objects read from File" << endl;
    11421149}
    11431150catch (IOExc& iox) {
Note: See TracChangeset for help on using the changeset viewer.