Ignore:
Timestamp:
12/02/08 11:23:24 (16 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mbase
Files:
2 edited

Legend:

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

    r9025 r9186  
    10901090// --------------------------------------------------------------------------
    10911091//
     1092// This is a wrapper which checks the resource file for an id containing
     1093// a %d with different numbers of leading zeros (1 to 8).
     1094//
     1095// If athe entries in the resource file are not unambiguous a warning
     1096// is printed.
     1097//
     1098TString MParContainer::GetEnvValue3(const TEnv &env, const TString &prefix, TString id, UInt_t num) const
     1099{
     1100    id.ReplaceAll("%d", "%%0%dd");
     1101
     1102    TString rc;
     1103    for (int i=1; i<9; i++)
     1104    {
     1105        const TString form = Form(id.Data(), i);
     1106        const TString res  = Form(form.Data(), num);
     1107
     1108        const TString str  = GetEnvValue2(env, prefix, res, "");
     1109
     1110        if (str.IsNull())
     1111            continue;
     1112
     1113        if (rc.IsNull())
     1114            rc = str;
     1115        else
     1116            *fLog << warn << "Entry " << res << " ambigous (was also found with less leading zeros)... ignored." << endl;
     1117    }
     1118
     1119    return rc;
     1120}
     1121
     1122// --------------------------------------------------------------------------
     1123//
    10921124// If object to remove is fDisplay set fDisplay to NULL.
    10931125// If object to remove is fLog     set fLog     to NULL.
  • trunk/MagicSoft/Mars/mbase/MParContainer.h

    r9035 r9186  
    149149    const char *GetEnvValue2(const TEnv &env, const TString &prefix, const TString &postfix, const char *dflt, Bool_t print=kFALSE) const;
    150150
     151    TString     GetEnvValue3(const TEnv &env, const TString &prefix, TString id, UInt_t num) const;
     152
    151153    MParContainer *GetNewObject(const char *name, const char *base) const;
    152154    MParContainer *GetNewObject(const char *name, TClass *base=MParContainer::Class()) const;
Note: See TracChangeset for help on using the changeset viewer.