Ignore:
Timestamp:
03/31/03 10:37:56 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mfileio/MRead.cc

    r1668 r1880  
    3939ClassImp(MRead);
    4040
     41// --------------------------------------------------------------------------
     42//
     43// Read the setup from a TEnv:
     44//   File0, File1, File2, ..., File10, ..., File100, ...
     45//
     46// Searching stops if the first key isn't found in the TEnv
     47//
     48// Enclosing quotation marks (") are removed
     49//
     50// Number of entries at the moment not supported
     51//
     52Bool_t MRead::ReadEnv(const TEnv &env, TString prefix, Bool_t print)
     53{
     54    //
     55    // Don't allow 'global' setup of files
     56    //
     57    if (prefix.IsNull())
     58        return kFALSE;
     59
     60    //
     61    // Search (beginning with 0) all keys
     62    //
     63    for (int i=0;; i++)
     64    {
     65        TString idx = "File";
     66        idx += i;
     67
     68        // Output if print set to kTRUE
     69        IsEnvDefined(env, prefix, idx, print);
     70
     71        // Try to get the file name
     72        TString name = GetEnvValue(env, prefix, idx, "");
     73        if (name.IsNull())
     74            return kTRUE;
     75
     76        if (name.BeginsWith("\"") && name.EndsWith("\""))
     77        {
     78            name.Remove(name.Last('\"'), 1);
     79            name.Remove(name.First('\"'), 1);
     80        }
     81
     82        AddFile(name);
     83    }
     84
     85    return kTRUE;
     86}
Note: See TracChangeset for help on using the changeset viewer.