1 #define ROOTHISTCNV_ROOTDIRFCN_CPP
9 #include "TDirectory.h"
13 namespace RootHistCnv {
23 while ( (p = full.find(
"/",i)) != -1) {
25 if (! gDirectory->GetKey(sdir.c_str()) ) {
28 gDirectory->cd(sdir.c_str());
32 gDirectory->cd( full.substr(i,full.length()-
i).c_str() );
53 if ( (p=full.find(
":",0)) != -1 ) {
54 fil = full.substr(0,p);
57 gDirectory->cd(fil.c_str());
60 while ( (p = full.find(
"/",i)) != -1) {
61 s = full.substr(i,p-i);
65 lpath.
push_back( full.substr(i,full.length()-
i) );
67 if ( full.substr(0,1) ==
"/") {
72 for(litr=lpath.
begin(); litr!=lpath.
end(); ++litr) {
74 if (! gDirectory->GetKey(litr->c_str()) ) {
75 gDirectory->mkdir(litr->c_str());
77 gDirectory->cd(litr->c_str());
99 if (dir.substr(0,1) !=
"/") {
103 if (dir.substr(dir.length()-1,1) !=
"/") {
107 long ll = full.find(dir);
112 full.erase(0,dir.length()-1);