1 #define ROOTHISTCNV_ROOTDIRFCN_CPP 6 #include "TDirectory.h" 20 gDirectory->cd(
"/" );
21 while ( ( p = full.
find(
"/", i ) ) != -1 ) {
22 auto sdir = full.
substr( i, p - i );
23 if ( !gDirectory->GetKey( sdir.c_str() ) ) {
26 gDirectory->cd( sdir.c_str() );
29 gDirectory->cd( full.
substr( i ).c_str() );
38 TDirectory* gDir = gDirectory;
41 auto p = full.
find(
":", 0 );
42 if ( p != std::string::npos ) {
43 auto fil = full.
substr( 0, p );
46 gDirectory->cd( fil.c_str() );
50 while ( ( p = full.
find(
"/", i ) ) != std::string::npos ) {
56 if ( full.
compare( 0, 1,
"/" ) == 0 ) gDirectory->cd(
"/" );
58 for (
const auto& lp : lpath ) {
59 if ( !gDirectory->GetKey( lp.c_str() ) ) {
60 gDirectory->mkdir( lp.c_str() );
62 gDirectory->cd( lp.c_str() );
83 if ( dir.
compare( 0, 1,
"/" ) != 0 ) {
91 long ll = full.
find( dir );
bool RootTrimLeadingDir(std::string &full, std::string dir)
bool RootMkdir(const std::string &full)
bool RootCd(const std::string &full)