Changeset 19720 for trunk/Mars


Ignore:
Timestamp:
10/05/19 16:54:54 (5 years ago)
Author:
tbretz
Message:
Added a constructor which allows to instantiate MDIrIter with just one argument
Location:
trunk/Mars/mbase
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Mars/mbase/MDirIter.cc

    r19626 r19720  
    139139
    140140    // Create an iterator to iterate over all entries in the directory
    141     MDirIter NextD(dir);
     141    MDirIter NextD;
     142    NextD.AddDirectory(dir);
    142143
    143144    TString c;
     
    159160// Add a single file to the iterator
    160161//
    161 Int_t MDirIter::AddFile(const char *name)
     162Int_t MDirIter::AddFile(const char *name, Int_t rec)
    162163{
    163164    return AddDirectory(gSystem->DirName(name), gSystem->BaseName(name));
  • trunk/Mars/mbase/MDirIter.h

    r14853 r19720  
    3838            AddDirectory(o->GetName(), o->GetTitle());
    3939    }
    40     MDirIter(const char *dir, const char *filter="", Int_t rec=0) : fNext(&fList), fDirPtr(NULL)
     40    MDirIter(const char *dir, const char *filter, Int_t rec=0) : fNext(&fList), fDirPtr(NULL)
    4141    {
    4242        fList.SetOwner();
    4343        AddDirectory(dir, filter, rec);
     44    }
     45    MDirIter(const char *dir, Int_t rec=0) : fNext(&fList), fDirPtr(NULL)
     46    {
     47        fList.SetOwner();
     48        AddFile(dir, rec);
    4449    }
    4550    ~MDirIter()
     
    5257
    5358    Int_t AddDirectory(const char *dir, const char *filter="", Int_t recursive=0);
    54     Int_t AddFile(const char *name);
     59    Int_t AddFile(const char *name, Int_t rec=0);
    5560    void  Add(const MDirIter &iter);
    5661    void  Reset();
Note: See TracChangeset for help on using the changeset viewer.