2 #define ROOTHISTCNV_ROOTDIRFCN_CPP
10 #include "TDirectory.h"
14 namespace RootHistCnv {
24 while ( (p = full.find(
"/",i)) != -1) {
26 if (! gDirectory->GetKey(sdir.c_str()) ) {
29 gDirectory->cd(sdir.c_str());
33 gDirectory->cd( full.substr(i,full.length()-
i).c_str() );
54 if ( (p=full.find(
":",0)) != -1 ) {
55 fil = full.substr(0,p);
58 gDirectory->cd(fil.c_str());
61 while ( (p = full.find(
"/",i)) != -1) {
62 s = full.substr(i,p-i);
66 lpath.
push_back( full.substr(i,full.length()-
i) );
68 if ( full.substr(0,1) ==
"/") {
73 for(litr=lpath.
begin(); litr!=lpath.
end(); ++litr) {
75 if (! gDirectory->GetKey(litr->c_str()) ) {
76 gDirectory->mkdir(litr->c_str());
78 gDirectory->cd(litr->c_str());
100 if (dir.substr(0,1) !=
"/") {
104 if (dir.substr(dir.length()-1,1) !=
"/") {
108 long ll = full.find(dir);
113 full.erase(0,dir.length()-1);