26 gSystem.Load(
"libStar");
29 d.
Mkdir(
"v1/v1_1/v1_1_1");
30 cout <<
"Short list:" << endl;
32 cout <<
"Wide list:" << endl;
35 d.
Mkdir(
"/v1/v1_2/v1_2_1");
38 d.
Mkdir(
"v1/v1_3/v1_2_2");
41 TDataSet *just = d(
"v1/v1/v1_v1_2_2");
44 cout <<
"Error: Mkdir return a wrong addrees";
46 cout <<
"Ok! return value of TDataSetIter::Mkdir method has been tested";
52 d.
Mkdir(
"v1/v21/v3211");
54 cout << endl <<
"------------ 1 ------------ " << endl;
56 d.
Mkdir(
"v1/v21/v3212/v4");
57 cout <<
"the current path: " << d(
"v1/v21/v3212/v4")->Path() << endl;
61 cout <<
"list \"v3212\" the relative path " << endl;
62 d.Pwd(
"v1/v21/v3212");
63 d(
"v1/v21/v3212")->ls();
67 cout <<
"--------------------" <<
" Testing TDataSetIter::Du() method: " <<
68 "--------------------" << endl;
70 cout <<
"---------------------" << endl;
71 cout <<
"Total: " << total <<
" datasets were listed" << endl;
72 cout <<
"-----------------" <<
" End of Testing TDataSetIter::Du() method: " <<
73 "----------------" << endl;
75 cout <<
"We'll try some \"wrong\" path now" << endl;
79 cout << endl <<
"-------- 2 test \"FindObject\" ------------ " << endl;
81 const Char_t *v3212 =
"v3212";
84 const Char_t *t = found->
Path();
85 cout <<
"Object: " << v3212 <<
" found. It\'s path is " << t << endl;
88 cout <<
"Object: " << v3212 <<
" has not been found." << endl;
89 cout <<
"Try FindByName" << endl;
92 cout <<
"The wrong implementation of TDataSetIter::FindObject method has been discovered" << endl;
98 cout << endl <<
"-------- 2.2 test \"FindByName\" ------------ " << endl;
99 cout << endl <<
"-------- 2.2 test \"FindByName\" ------------ " << endl;
101 const Char_t *vS3213 =
"/v32/13";
102 cout <<
" === Error message expected " << endl;
106 cout << endl <<
"-------- 2.3 test \"FindByName\" ------------ " << endl;
107 cout << endl <<
"-------- 2.3 test \"FindByName\" ------------ " << endl;
109 const Char_t *V3212 =
"V3212";
112 const Char_t *t2 = found->
Path();
113 cout <<
"Object: " << V3212 <<
" found. It\'s path is " << t2 << endl;
116 cout <<
"Object: " << V3212 <<
" has not been found." << endl;
120 cout << endl <<
"-------- 2.4 test \"FindByName\" ------------ " << endl;
121 cout << endl <<
"-------- 2.4 test \"FindByName\" ------------ " << endl;
123 cout <<
" === Error message expected " << endl;
124 found = d.
FindByName(V3212,
"v1/v21/v3212/v4",
"-I");
126 cout <<
" Object not found" << endl;
128 cout <<
"recreating directories" << endl;
130 d.
Rmdir(
"v1/v1_1/v1_1_1");
132 cout << endl <<
"------------ 3 ------------ " << endl;
133 d.
Mkdir(
"v1/v1_1/v1_1_1");
135 cout << endl <<
"------------ 4 ------------ " << endl;
136 d.
Rmdir(
"v1/v1_1/v1_1_1");
138 cout << endl <<
"------------ 5 ------------ " << endl;
139 d.
Mkdir(
"v1/v1_1/v1_1_1");
141 cout << endl <<
"------------ 6 ------------ " << endl;
142 cout <<
"Let's check the operator []" << endl;
143 if (d[
"v1/v1_1/v1_1_1"])
144 cout <<
" ** Error **: the path to d[\"" << d(
"v1/v1_1/v1_1_1")->Path() <<
"\"]=" << d[
"v1/v1_1/v1_1_1"] << endl;
146 cout <<
" Ok! the path to d[\"" << d(
"v1/v1_1/v1_1_1")->Path() <<
"\"]=" << d[
"v1/v1_1/v1_1_1"] <<
";" << endl;
147 cout << endl <<
"------------ 7 ------------ " << endl;
148 cout <<
" Check loop with \"TDataSet *operator *() const\"" << endl;
153 cout <<
"\tCurrent ds <" << ds->GetName() <<
">;";
155 cout <<
"\tnext ds will be <" << (*d)->GetName();
158 cout <<
"\tthere will be no new ds" << endl;
162 cout <<
" end of loop " << endl << endl ;
164 cout << endl <<
"------------ 8 ------------ " << endl;
167 cout << endl <<
"------------ 9 ------------ " << endl;
173 cout <<
"Error the directory should be undefined nowadays " << endl;
175 else cout <<
"Ok! The last dataset has NO active directory anymore" << endl;
178 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