Rev | Line | |
---|
[583] | 1 | #include <stdio.h>
|
---|
| 2 | #include <stdlib.h>
|
---|
| 3 | #include <typeinfo>
|
---|
| 4 | #include <iostream.h>
|
---|
| 5 | #include <string>
|
---|
| 6 |
|
---|
| 7 | #include "ppersist.h"
|
---|
| 8 | #include "anydataobj.h"
|
---|
| 9 | #include "sambainit.h"
|
---|
| 10 |
|
---|
| 11 | int main(int narg, char* arg[])
|
---|
| 12 | {
|
---|
| 13 | SambaInitiator smbinit;
|
---|
| 14 |
|
---|
| 15 | if (narg < 2) {
|
---|
| 16 | cerr << " Usage: scanppf filename \n " << endl;
|
---|
| 17 | exit(0);
|
---|
| 18 | }
|
---|
| 19 |
|
---|
| 20 | try {
|
---|
| 21 | string flnm = arg[1];
|
---|
| 22 | PPersist* op = NULL;
|
---|
| 23 | cout << " Opening PPF file " << flnm << endl;
|
---|
| 24 | PInPersist s(flnm);
|
---|
| 25 | int nt = s.NbTags();
|
---|
| 26 | cout << " Number of tags in file = " << nt << endl;
|
---|
| 27 | if (nt < 1) {
|
---|
| 28 | op = s.ReadObject();
|
---|
| 29 | cout << " Object Type " << typeid(*op).name() << endl;
|
---|
| 30 | if (op) delete op;
|
---|
| 31 | }
|
---|
| 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;
|
---|
| 38 | }
|
---|
| 39 | }
|
---|
| 40 | catch (PThrowable pex) {
|
---|
| 41 | cerr << " scanppf/Error - Exception catched " << pex.Msg() << endl;
|
---|
| 42 | }
|
---|
| 43 |
|
---|
| 44 | cout << " ----------- End of scanppf ------------- " << endl;
|
---|
| 45 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.