Changeset 2645 in Sophya
- Timestamp:
- Feb 7, 2005, 3:23:45 PM (21 years ago)
- Location:
- trunk/SophyaPI/PIext
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PIext/basexecut.cc
r2638 r2645 364 364 } 365 365 else if (kw == "openppf" ) { 366 if (tokens.size() < 1) { cout << "Usage: openppf file " << endl; return(0); } 367 mObjMgr->ReadAll(tokens[0]); 366 if (tokens.size()<1) {cout<<"Usage: openppf file [objname1 objname2 ...]"<<endl; return(0); } 367 else if (tokens.size()==1) mObjMgr->ReadAll(tokens[0]); 368 else mObjMgr->ReadObj(tokens); 368 369 } 369 370 else if ((kw == "saveobjs") || (kw == "saveppf")) { … … 1460 1461 mpiac->RegisterCommand(kw, usage, this, "FileIO"); 1461 1462 kw = "openppf"; 1462 usage = "Reads all o bjects from a PPF file \n Usage: openppf filename";1463 usage = "Reads all or some objects from a PPF file \n Usage: openppf filename [objname1 objname2 ...]"; 1463 1464 usage += "\n Related commands: saveall openfits"; 1464 1465 mpiac->RegisterCommand(kw, usage, this, "FileIO"); -
trunk/SophyaPI/PIext/nobjmgr.cc
r2615 r2645 926 926 AddObj_P(ppobj->DataObj(), nobj, true); 927 927 cout << "NamedObjMgr::ReadObj(...) object " << nobj << " read from file " << endl; 928 return; 929 } 930 /* --Methode-- */ 931 void NamedObjMgr::ReadObj(vector<string> & flnm_objname) 932 // flnm_objname[0] = nom du fichier .ppf 933 // flnm_objname[1...] = nom des tags des objects a lire 934 { 935 if(flnm_objname.size()<2) return; 936 ZSync(*myMutex); 937 int nread=0; 938 try { 939 PInPersist pis(flnm_objname[0]); 940 for(int i=1;i<flnm_objname.size();i++) { 941 bool ok = pis.GotoNameTag(flnm_objname[i]); 942 if(!ok) { 943 cout<<"NamedObjMgr::ReadObj(...) Unknown object: "<<flnm_objname[i]<<endl; 944 continue; 945 } 946 PPersist *ppobj = pis.ReadObject();; 947 if(ppobj==NULL) { 948 cout<<"NamedObjMgr::ReadObj(...) impossible to read "<<flnm_objname[i]<<endl; 949 continue; 950 } 951 AddObj_P(ppobj->DataObj(),flnm_objname[i],true); 952 nread++; 953 cout<<"NamedObjMgr::ReadObj(...) object "<<flnm_objname[i]<<" read from file "<<endl; 954 } 955 } catch (IOExc iox) { 956 cerr<<"NamedObjMgr::ReadObj()/Error Exception - Msg= "<<iox.Msg()<<endl; 957 } 958 cout<<nread<<" objects have been read"<<endl; 928 959 return; 929 960 } -
trunk/SophyaPI/PIext/nobjmgr.h
r2491 r2645 70 70 virtual void ReadObj(PInPersist& s, int num=-1); 71 71 virtual void ReadObj(string const & nomppf, string & nobj); 72 virtual void ReadObj(vector<string> & flnm_objname); 72 73 virtual void ReadAll(string const & nomppf); 73 74 virtual void ReadFits(string const & flnm, string & nobj);
Note:
See TracChangeset
for help on using the changeset viewer.