20 gSystem.Load(
"libTable");
23 d.
Mkdir(
"v1/v1_1/v1_1_1");
24 cout <<
"Short list:" << endl;
26 cout <<
"Wide list:" << endl;
29 d.
Mkdir(
"/v1/v1_2/v1_2_1");
32 d.
Mkdir(
"v1/v1_3/v1_2_2");
35 TDataSet *just = d(
"v1/v1/v1_v1_2_2");
38 cout <<
"Error: Mkdir return a wrong addrees";
40 cout <<
"Ok! return value of TDataSetIter::Mkdir method has been tested";
46 d.
Mkdir(
"v1/v21/v3211");
48 cout << endl <<
"------------ 1 ------------ " << endl;
50 d.
Mkdir(
"v1/v21/v3212/v4");
51 cout <<
"the current path: " << d(
"v1/v21/v3212/v4")->Path() << endl;
55 cout <<
"list \"v3212\" the relative path " << endl;
56 d.Pwd(
"v1/v21/v3212");
57 d(
"v1/v21/v3212")->ls();
61 cout <<
"--------------------" <<
" Testing TDataSetIter::Du() method: " <<
62 "--------------------" << endl;
64 cout <<
"---------------------" << endl;
65 cout <<
"Total: " << total <<
" datasets were listed" << endl;
66 cout <<
"-----------------" <<
" End of Testing TDataSetIter::Du() method: " <<
67 "----------------" << endl;
69 cout <<
"We'll try some \"wrong\" path now" << endl;
73 cout << endl <<
"-------- 2 test \"FindObject\" ------------ " << endl;
75 const Char_t *v3212 =
"v3212";
78 const Char_t *t = found->
Path();
79 cout <<
"Object: " << v3212 <<
" found. It\'s path is " << t << endl;
82 cout <<
"Object: " << v3212 <<
" has not been found." << endl;
83 cout <<
"Try FindByName" << endl;
86 cout <<
"The wrong implementation of TDataSetIter::FindObject method has been discovered" << endl;
92 cout << endl <<
"-------- 2.2 test \"FindByName\" ------------ " << endl;
93 cout << endl <<
"-------- 2.2 test \"FindByName\" ------------ " << endl;
95 const Char_t *vS3213 =
"/v32/13";
96 cout <<
" === Error message expected " << endl;
100 cout << endl <<
"-------- 2.3 test \"FindByName\" ------------ " << endl;
101 cout << endl <<
"-------- 2.3 test \"FindByName\" ------------ " << endl;
103 const Char_t *V3212 =
"V3212";
106 const Char_t *t2 = found->
Path();
107 cout <<
"Object: " << V3212 <<
" found. It\'s path is " << t2 << endl;
110 cout <<
"Object: " << V3212 <<
" has not been found." << endl;
114 cout << endl <<
"-------- 2.4 test \"FindByName\" ------------ " << endl;
115 cout << endl <<
"-------- 2.4 test \"FindByName\" ------------ " << endl;
117 cout <<
" === Error message expected " << endl;
118 found = d.
FindByName(V3212,
"v1/v21/v3212/v4",
"-I");
120 cout <<
" Object not found" << endl;
122 cout <<
"recreating directories" << endl;
124 d.
Rmdir(
"v1/v1_1/v1_1_1");
126 cout << endl <<
"------------ 3 ------------ " << endl;
127 d.
Mkdir(
"v1/v1_1/v1_1_1");
129 cout << endl <<
"------------ 4 ------------ " << endl;
130 d.
Rmdir(
"v1/v1_1/v1_1_1");
132 cout << endl <<
"------------ 5 ------------ " << endl;
133 d.
Mkdir(
"v1/v1_1/v1_1_1");
135 cout << endl <<
"------------ 6 ------------ " << endl;
136 cout <<
"Let's check the operator []" << endl;
137 if (d[
"v1/v1_1/v1_1_1"])
138 cout <<
" ** Error **: the path to d[\"" << d(
"v1/v1_1/v1_1_1")->Path() <<
"\"]=" << d[
"v1/v1_1/v1_1_1"] << endl;
140 cout <<
" Ok! the path to d[\"" << d(
"v1/v1_1/v1_1_1")->Path() <<
"\"]=" << d[
"v1/v1_1/v1_1_1"] <<
";" << endl;
141 cout << endl <<
"------------ 7 ------------ " << endl;
142 cout <<
" Check loop with \"TDataSet *operator *() const\"" << endl;
147 cout <<
"\tCurrent ds <" << ds->GetName() <<
">;";
149 cout <<
"\tnext ds will be <" << (*d)->GetName();
152 cout <<
"\tthere will be no new ds" << endl;
156 cout <<
" end of loop " << endl << endl ;
158 cout << endl <<
"------------ 8 ------------ " << endl;
161 cout << endl <<
"------------ 9 ------------ " << endl;
167 cout <<
"Error the directory should be undefined nowadays " << endl;
169 else cout <<
"Ok! The last dataset has NO active directory anymore" << endl;
172 cout << endl <<
"------------ 9 ------------ " << endl;
virtual Int_t Du() const
summarize dataset usage by Herb Ward proposal
virtual TDataSet * Mkdir(const Char_t *dirname)
to be documented
virtual TDataSet * Ls(const Char_t *dirname="", Option_t *opt="") const
virtual TObject * FindObject(const Char_t *name) const
virtual void ls(Option_t *option="") const
virtual TDataSet * FindByName(const Char_t *name, const Char_t *path="", Option_t *opt="")
to be documented
virtual TDataSet * Rmdir(TDataSet *dataset, Option_t *option="")
virtual TString Path() const
return the full path of this data set