Ignore:
Timestamp:
08/18/07 12:04:44 (17 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mbase
Files:
2 edited

Legend:

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

    r8539 r8674  
    7171    if (GetEntries()<=0 && !fname.IsNull() && fname!=name)
    7272        ReadFile(fname, kEnvLocal);;
     73}
     74
     75//---------------------------------------------------------------------------
     76//
     77// Make sure that the name used for writing doesn't contain a full path
     78//
     79const char *MEnv::GetName() const
     80{
     81    const char *pos = strrchr(GetRcName(), '/');
     82    return pos>0 ? pos+1 : GetRcName();
    7383}
    7484
     
    847857//---------------------------------------------------------------------------
    848858//
     859// Add name and full path to output
     860//
     861void MEnv::PrintEnv(EEnvLevel level) const
     862{
     863    cout << "# Path: " << GetRcName() << endl;
     864    cout << "# Name: " << GetName() << endl;
     865    TEnv::PrintEnv(level);
     866}
     867
     868//---------------------------------------------------------------------------
     869//
    849870// Print resources which have never been touched (for debugging)
    850871//
  • trunk/MagicSoft/Mars/mbase/MEnv.h

    r8582 r8674  
    3838    const char *GetValue(const char *name, const char *dflt);
    3939
    40     const char *GetName() const { return GetRcName(); }
     40    const char *GetName() const { return strrchr(GetRcName(), '/')?strrchr(GetRcName(), '/')+1:GetRcName(); }
    4141
    4242    Int_t       GetColor(const char *name, Int_t dftl);
     
    6767    void        AddEnv(const TEnv &env, Bool_t overwrite=kTRUE);
    6868
     69    void        PrintEnv(EEnvLevel level = kEnvAll) const;
    6970    void        Print(Option_t *option) const { TEnv::Print(option); }
    70     void        Print() const { TEnv::PrintEnv(kEnvLocal); } //*MENU*
     71    void        Print() const { PrintEnv(kEnvLocal); } //*MENU*
    7172
    7273    void PrintUntouched() const;
Note: See TracChangeset for help on using the changeset viewer.