Changeset 3423 in Sophya


Ignore:
Timestamp:
Dec 8, 2007, 11:21:02 PM (18 years ago)
Author:
ansari
Message:

ajout possibilite lecture ppf sequentielle (sans nametag) avec openppf et amelioration texte de help piapp, Reza 08/12/2007

Location:
trunk/SophyaPI/PIext
Files:
3 edited

Legend:

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

    r3279 r3423  
    129129
    130130else if (kw == "openppf" ) {
    131   if (tokens.size()<1) {cout<<"Usage: openppf file [objname1 objname2 ...]"<<endl; return(0); }
    132   else if (tokens.size()==1) mObjMgr->ReadAll(tokens[0]); 
    133   else mObjMgr->ReadObj(tokens);
     131  if (tokens.size()<1) {
     132    cout<<"Usage: openppf [-s] file [objname1 objname2 ...]"<<endl;
     133    return(0);
     134  }
     135  else if (tokens.size()==1)   // read all objects at nametags
     136    mObjMgr->ReadAll(tokens[0],true); 
     137  else {
     138    if (tokens[0] == "-s")  // Read all objects sequentially
     139      mObjMgr->ReadAll(tokens[1],false); 
     140    else mObjMgr->ReadObj(tokens);   // read specified objects
     141  }
    134142}
    135143else if ((kw == "saveobjs") || (kw == "saveppf"))  {
     
    925933
    926934kw = "openppf";
    927 usage = "Reads all or some objects from a PPF file \n Usage: openppf filename [objname1 objname2 ...]";
    928 usage += "\n  Related commands: saveall "; 
     935usage = "Reads all or some objects from a PPF file";
     936usage += "\n  Usage: (1) openppf filename ";
     937usage += "\n     Or  (2) openppf -s filename (2)";
     938usage += "\n     Or  (3) openppf filename objname1 [ objname2 ...]";
     939usage += "\n  The first form reads all objects at NameTags,";
     940usage += "\n    or all objects if the file has no NameTags.";     
     941usage += "\n  The third reads only the objects with the specified nametags";
     942usage += "\n  Related commands: saveppf saveall savelist"; 
    929943mpiac->RegisterCommand(kw, usage, this, "FileIO");
    930944kw = "saveppf";
     
    10071021kw = "listobjs";
    10081022usage = "Prints the list of objects (Alias: ls)";
    1009  usage += "\n Usage: listobjs [patt=*] \n patt : /*/x?y* ... ";
     1023usage += "\n Usage: listobjs [patt=*]  ";
     1024usage += "\n    Or  listobjs patt VarName ";
     1025 usage += "\n   Obj. name pattern patt in the form abc?x* or /*/x?y ... ";
    10101026mpiac->RegisterCommand(kw, usage, this, "Object Management");
    10111027kw = "rename";
  • trunk/SophyaPI/PIext/nobjmgr.cc

    r3376 r3423  
    10901090}
    10911091/* --Methode-- */
    1092 void NamedObjMgr::ReadAll(string const & flnm)
     1092void NamedObjMgr::ReadAll(string const & flnm, bool atnametags)
     1093  // Lit tous les objets d'un fichier PPF
     1094  // si atnametags == true -> objets avec nametags seulement
     1095  //    sinon, tous les objets sequentiellement
    10931096{
    10941097#ifdef SANS_EVOLPLANCK
     
    11151118try {
    11161119  PInPersist pis(flnm);
    1117   if (pis.NbNameTags() >= 1)  {
     1120  if (atnametags && (pis.NbNameTags() >= 1))  {
    11181121    if (pis.NbNameTags() < pis.NbTopLevelObjects()) {
    11191122      cout << "NamedObjMgr::ReadAll()/Warning File " << flnm << " NbNameTags="
     
    11261129  }
    11271130
     1131  // On lit tous les objets sequentiellement ...
    11281132  string nom = servnobjm->FileName2Name(flnm); 
    11291133  int kn = 1;
    11301134  for(int ii=0; ii<pis.NbTopLevelObjects(); ii++) {
     1135    cout << " --- DBG-ReadAll() ii=" << ii << " nom= " << nom <<endl;
    11311136    PPersist* obj = pis.ReadObject();
    11321137    if (!obj) continue;
  • trunk/SophyaPI/PIext/nobjmgr.h

    r3366 r3423  
    7171  virtual void          ReadObj(string const & nomppf, string & nobj);
    7272  virtual void          ReadObj(vector<string> & flnm_objname);
    73   virtual void          ReadAll(string const & nomppf);
     73  virtual void          ReadAll(string const & nomppf, bool atnametags=true);
    7474  virtual void          SaveObj(string & nom, POutPersist& s, bool keeppath=false);
    7575  virtual void          SaveObjects(string & patt, string const& nomppf);
Note: See TracChangeset for help on using the changeset viewer.