Changeset 589 in Sophya for trunk/SophyaProg/Tests


Ignore:
Timestamp:
Nov 17, 1999, 4:58:23 PM (26 years ago)
Author:
ansari
Message:

ajoute possibilite lecture sequentielle meme si tags

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaProg/Tests/scanppf.cc

    r583 r589  
    1414
    1515if (narg < 2) {
    16   cerr << " Usage: scanppf filename \n " <<  endl;
     16  cerr << " Usage: scanppf filename [s]\n " <<  endl;
    1717  exit(0);
    1818  }
     
    2020try {
    2121  string flnm = arg[1];
     22  bool seq=false;
     23  if (narg > 2) seq=true;
    2224  PPersist* op = NULL;
    2325  cout << " Opening PPF file " << flnm << endl;
     
    3032    if (op) delete op;
    3133  }
    32   else for(int i=0; i<nt; i++) {
    33     cout << ">>> TagNum= " << i << " TagName= " << s.GetTagName(i) << endl;
    34     s.GotoTagNum(i);
    35     op = s.ReadObject();
    36     cout << " Object Type " << typeid(*op).name() << endl;
    37     if (op) delete op;
     34  else if (!seq) {
     35    for(int i=0; i<nt; i++) {
     36      cout << ">>> TagNum= " << i << " TagName= " << s.GetTagName(i) << endl;
     37      s.GotoTagNum(i);
     38      op = s.ReadObject();
     39      cout << " Object Type " << typeid(*op).name() << endl;
     40      if (op) delete op;
     41    }
     42  } else {
     43    while (1) {
     44      op = s.ReadObject();
     45      cout << " Object Type " << typeid(*op).name() << endl;
     46      if (op) delete op;
     47    }
    3848  }
    3949}
Note: See TracChangeset for help on using the changeset viewer.