Ignore:
Timestamp:
05/26/04 15:07:29 (20 years ago)
Author:
merck
Message:
MMerck: Changed MatchFilter to replace al '+' by '/+' in the filter. This allows to have a + in the filename or filter part of a selector to select files like those for the source 1ES1426+428. However this change affects the MatchFilter method in such a way that you can't use anymore a filter using a + in a regular expression.
File:
1 edited

Legend:

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

    r2377 r4193  
    195195Bool_t MDirIter::MatchFilter(const TString &n, const TString &f) const
    196196{
    197     return f.IsNull() || !n(TRegexp(f, kTRUE)).IsNull();
     197    // As the filter string may contain a + character, we have to replace
     198    // this filter by a new filter contaning a \+ at all locations where a +
     199    // was in the original filter.
     200    TString nf(f);
     201    nf.ReplaceAll("+","\\+");
     202
     203    return f.IsNull() || !n(TRegexp(nf, kTRUE)).IsNull();
    198204}
    199205
     
    238244    // Check global filter
    239245    if (!MatchFilter(n, fFilter))
    240         return kFALSE;
     246         return kFALSE;
    241247
    242248    // Check for file or directory
     
    247253    // Check for rread perissions
    248254    return !gSystem->AccessPathName(fqp, kReadPermission);
     255
    249256}
    250257
Note: See TracChangeset for help on using the changeset viewer.