1 #define ROOTHISTCNV_ROOTDIRFCN_CPP 6 #include "TDirectory.h" 19 gDirectory->cd(
"/" );
20 while ( ( p = full.
find(
"/", i ) ) != -1 ) {
21 auto sdir = full.
substr( i, p - i );
22 if ( !gDirectory->GetKey( sdir.c_str() ) ) {
return false; }
23 gDirectory->cd( sdir.c_str() );
26 gDirectory->cd( full.
substr( i ).c_str() );
35 TDirectory* gDir = gDirectory;
38 auto p = full.
find(
":", 0 );
39 if ( p != std::string::npos ) {
40 auto fil = full.
substr( 0, p );
43 gDirectory->cd( fil.c_str() );
47 while ( ( p = full.
find(
"/", i ) ) != std::string::npos ) {
53 if ( full.
compare( 0, 1,
"/" ) == 0 ) gDirectory->cd(
"/" );
55 for (
const auto& lp : lpath ) {
56 if ( !gDirectory->GetKey( lp.c_str() ) ) { gDirectory->mkdir( lp.c_str() ); }
57 gDirectory->cd( lp.c_str() );
78 if ( dir.
compare( 0, 1,
"/" ) != 0 ) { dir.
insert( 0,
"/" ); }
80 if ( dir.
compare( dir.
length() - 1, 1,
"/" ) != 0 ) { dir +=
"/"; }
82 long ll = full.
find( dir );
83 if ( ll != 0 ) {
return false; }
bool RootTrimLeadingDir(std::string &full, std::string dir)
bool RootMkdir(const std::string &full)
bool RootCd(const std::string &full)