Ignore:
Timestamp:
09/28/04 18:30:48 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mbase
Files:
2 edited

Legend:

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

    r4966 r5144  
    350350    }
    351351}
     352
     353// --------------------------------------------------------------------------
     354//
     355// Loop over all contents (files). Sort the files alphabetically.
     356// Delete the contents of this DirIter and add all sorted files
     357// to this DirIter.
     358//
     359void MDirIter::Sort()
     360{
     361    MDirIter Next(*this);
     362
     363    TList l;
     364    l.SetOwner();
     365
     366    TString name;
     367    while (!(name=Next()).IsNull())
     368        l.Add(new TNamed(name.Data(), ""));
     369
     370    l.Sort();
     371
     372    fList.Delete();
     373    Close();
     374    fFilter = "";
     375
     376    TIter NextN(&l);
     377    TObject *o=0;
     378    while ((o=NextN()))
     379           AddDirectory(o->GetName());
     380}
  • trunk/MagicSoft/Mars/mbase/MDirIter.h

    r4966 r5144  
    4848    }
    4949
     50    void Sort();
     51
    5052    Int_t AddDirectory(const char *dir, const char *filter="", Int_t recursive=0);
    5153    void  Add(const MDirIter &iter);
Note: See TracChangeset for help on using the changeset viewer.