Ignore:
Timestamp:
10/22/04 15:59:02 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mbase
Files:
5 edited

Legend:

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

    r5299 r5307  
    202202// --------------------------------------------------------------------------
    203203//
     204// As the filter string may contain a + character, we have to replace
     205// this filter by a new filter contaning a \+ at all locations where a +
     206// was in the original filter.
     207//
     208// We replace:
     209//   .  by  \\.
     210//   +  by  \\+
     211//   *  by  [^\\/:]*
     212//   ?  by  .
     213//
     214// And surround the filter by ^ and $.
     215//
     216// For more details you can have a look at the template:
     217//  TRegexp::MakeWildcard
     218//
     219const TRegexp MDirIter::MakeRegexp(TString n) const
     220{
     221    n.Prepend("^");
     222    n.ReplaceAll(".", "\\.");
     223    n.ReplaceAll("+", "\\+");
     224    n.ReplaceAll("*", "[^\\/:]*");
     225    n.ReplaceAll("?", ".");
     226    n.Append("$");
     227
     228    return TRegexp(n, kFALSE);
     229}
     230
     231// --------------------------------------------------------------------------
     232//
    204233// Check whether the given name n matches the filter f.
    205234// Filters are of the form TRegexp(f, kTRUE)
     
    207236Bool_t MDirIter::MatchFilter(const TString &n, const TString &f) const
    208237{
    209     // As the filter string may contain a + character, we have to replace
    210     // this filter by a new filter contaning a \+ at all locations where a +
    211     // was in the original filter.
    212     TString nf(f);
    213     nf.ReplaceAll("+","\\+");
    214 
    215     return f.IsNull() || !n(TRegexp(nf, kTRUE)).IsNull();
     238
     239    return f.IsNull() || !n(MakeRegexp(f)).IsNull();
    216240}
    217241
  • trunk/MagicSoft/Mars/mbase/MDirIter.h

    r5144 r5307  
    2323    TString ConcatFileName(const char *dir, const char *name) const;
    2424    void    PrintEntry(const TObject &o) const;
     25    const   TRegexp MakeRegexp(TString n) const;
    2526
    2627public:
  • trunk/MagicSoft/Mars/mbase/MRunIter.cc

    r5141 r5307  
    5353
    5454    // R. DeLosReyes and T. Bretz
    55     // Changes to read the DAQ numbering format. Changes takes place 
     55    // Changes to read the DAQ numbering format. Changes takes place
    5656    // between runs 35487 and 00035488 (2004_08_30)
     57    const char *fmt = run>35487 ? "*_%08d_*_%s" : "*_%05d_*_%s";
    5758
    58       MDirIter Next;
    59       if(run<=35487)
    60         Next.AddDirectory(p, Form("*_%05d_*_%s", run,fIsRawFile?"*.raw":"*.root"), -1);
    61       else
    62         Next.AddDirectory(p, Form("*_%08d_*_%s", run,fIsRawFile?"*.raw":"*.root"), -1);
     59    MDirIter Next;
     60    Next.AddDirectory(p, Form(fmt, run,fIsRawFile?"*.raw":"*.root"), -1);
    6361
    6462    const TString name(Next());
  • trunk/MagicSoft/Mars/mbase/MStatusDisplay.cc

    r4766 r5307  
    14831483    if (TestBit(kExitLoopOnExit) || TestBit(kExitLoopOnClose))
    14841484    {
    1485         gLog << dbg << "CloseWindow() calling ExitLoop." << endl;
     1485        //gLog << dbg << "CloseWindow() calling ExitLoop." << endl;
    14861486        gSystem->ExitLoop();
    14871487    }
     
    14911491        //gLog << dbg << "delete " << fName << ";" << endl;
    14921492        delete this;
    1493     }
    1494     fStatus = kFileExit;
    1495     //gLog << dbg << fName << ".fStatus=kFileExit;" << endl;
     1493        // DO NOT EXECUTE ANY COMMAND AFTER this!
     1494    }
     1495    else
     1496    {
     1497        fStatus = kFileExit;
     1498        //gLog << dbg << fName << ".fStatus=kFileExit;" << endl;
     1499    }
    14961500}
    14971501
  • trunk/MagicSoft/Mars/mbase/MTaskEnv.cc

    r4732 r5307  
    215215{
    216216    if (!IsEnvDefined(env, prefix, print))
    217         return kFALSE;
     217        return fTask ? fTask->ReadEnv(env, prefix, print) : kFALSE;
    218218
    219219    TString task = GetEnvValue(env, prefix, "");
Note: See TracChangeset for help on using the changeset viewer.