Ignore:
Timestamp:
08/24/04 14:51:17 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mbase
Files:
7 edited

Legend:

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

    r4452 r4722  
    231231// --------------------------------------------------------------------------
    232232//
     233// Returns GetIntAndRemove. If HasOption returns kFALSE def is returned.
     234//
     235Int_t MArgs::GetIntAndRemove(const TString name, Int_t def)
     236{
     237    if (!HasOption(name))
     238        return def;
     239    return GetIntAndRemove(name);
     240}
     241
     242// --------------------------------------------------------------------------
     243//
     244// Returns GetFloatAndRemove. If HasOption returns kFALSE def is returned.
     245//
     246Double_t MArgs::GetFloatAndRemove(const TString name, Double_t def)
     247{
     248    if (!HasOption(name))
     249        return def;
     250    return GetFloatAndRemove(name);
     251}
     252
     253// --------------------------------------------------------------------------
     254//
     255// Returns GetStringAndRemove. If HasOption returns kFALSE def is returned.
     256//
     257TString MArgs::GetStringAndRemove(const TString name, const TString def)
     258{
     259    if (!HasOption(name))
     260        return def;
     261    return GetStringAndRemove(name);
     262}
     263
     264// --------------------------------------------------------------------------
     265//
    233266// Return the TString corresponding to the i-th argument.
    234267// This is ment for enumerations like
  • trunk/MagicSoft/Mars/mbase/MArgs.h

    r3183 r4722  
    4343    TString  GetStringAndRemove(const TString name);
    4444
     45    Int_t    GetIntAndRemove(const TString name, Int_t def);
     46    Double_t GetFloatAndRemove(const TString name, Double_t def);
     47    TString  GetStringAndRemove(const TString name, const TString def);
     48
    4549    Bool_t   Has(const TString name) const;
    4650    Bool_t   HasOnly(const TString name) const;
  • trunk/MagicSoft/Mars/mbase/MDirIter.cc

    r4215 r4722  
    151151// --------------------------------------------------------------------------
    152152//
     153// Adds all entries from iter to this object
     154//
     155void MDirIter::Add(const MDirIter &iter)
     156{
     157    TIter Next(&iter.fList);
     158    TObject *o=0;
     159    while ((o=Next()))
     160        fList.Add(o->Clone());
     161}
     162
     163// --------------------------------------------------------------------------
     164//
    153165//  Return the pointer to the current directory. If the pointer is NULL
    154166//  a new directory is opened. If no new directory can be opened NULL is
  • trunk/MagicSoft/Mars/mbase/MDirIter.h

    r4219 r4722  
    4949
    5050    Int_t AddDirectory(const char *dir, const char *filter="", Int_t recursive=0);
     51    void  Add(const MDirIter &iter);
    5152    void  Reset();
    5253
  • trunk/MagicSoft/Mars/mbase/MEvtLoop.cc

    r4601 r4722  
    964964Bool_t MEvtLoop::ReadEnv(const char *config)
    965965{
    966     return config ? ReadEnv(TEnv(config)) : kTRUE;
     966    if (!config)
     967        return kTRUE;
     968
     969    const Bool_t fileexist = !gSystem->AccessPathName(config, kFileExists);
     970    if (!fileexist)
     971    {
     972        *fLog << warn << "WARNING - resource file '" << config << "' not found... no resources applied." << endl;
     973        return kFALSE;
     974    }
     975
     976    return ReadEnv(TEnv(config));
    967977}
    968978
  • trunk/MagicSoft/Mars/mbase/MLog.cc

    r4601 r4722  
    512512// --------------------------------------------------------------------------
    513513//
     514// Print usage information setup in Setup()
     515//
     516void MLog::Usage()
     517{
     518    //                 1         2         3         4         5         6         7         8
     519    //        12345678901234567890123456789012345678901234567890123456789012345678901234567890
     520    *this << "   -v#                       Verbosity level # [default=2]" << endl;
     521    *this << "   -a, --no-colors           Do not use Ansii color codes" << endl;
     522    *this << "   --debug[=n]               Enable root debugging [default: gDebug=1]" << endl;
     523}
     524
     525// --------------------------------------------------------------------------
     526//
    514527// Setup MLog and global debug output from command line arguments.
    515528//
  • trunk/MagicSoft/Mars/mbase/MLog.h

    r4452 r4722  
    185185
    186186    void Setup(MArgs &arg);
     187    void Usage();
    187188
    188189    void ReadEnv(const TEnv &env, TString prefix="", Bool_t print=kFALSE);
Note: See TracChangeset for help on using the changeset viewer.