73{
74 TList* keylist = curdir->GetListOfKeys();
75
76 TIter nextkey(keylist);
77 TKey* key = 0;
78 while ((key = (TKey*)nextkey())) {
79 TObject* obj = curdir->FindObjectAny(key->GetName());
80 if (obj->IsA()->InheritsFrom("TH1")) {
81 TH1* h1 = (TH1*) obj;
82
83 msg->
add(h1, h1->GetName());
84 numobjs++;
85 } else if (obj->IsA()->InheritsFrom(TDirectory::Class())) {
86
87 TDirectory* tdir = (TDirectory*) obj;
88
89 TText subdir(0, 0, tdir->GetName());
90 msg->
add(&subdir,
"SUBDIR:" +
string(obj->GetName())) ;
91 numobjs++;
92 tdir->cd();
93 StreamHistograms(tdir, msg, numobjs);
94 TText command(0, 0, "COMMAND:EXIT");
95 msg->
add(&command,
"SUBDIR:EXIT");
96 numobjs++;
97 curdir->cd();
98 }
99 }
100 return 0;
101}
virtual void add(const TObject *, const std::string &name)
Add an object to be streamed.