1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 #include "AliMUONPainterEnv.h"
23 ///\class AliMUONPainterEnv
25 /// A resource file handling class.
27 /// Used to get some things persistent between two sessions of the mchview
30 ///\author Laurent Aphecetche, Subatech
33 ClassImp(AliMUONPainterEnv)
36 //_____________________________________________________________________________
37 AliMUONPainterEnv::AliMUONPainterEnv(const char* resourceFile)
38 : fEnv(new TEnv(resourceFile))
43 //_____________________________________________________________________________
44 AliMUONPainterEnv::~AliMUONPainterEnv()
49 //_____________________________________________________________________________
51 AliMUONPainterEnv::String(const char* resourceName, const char* defaultValue)
53 /// Retrieve the value associated with a given source, as a string
55 return fEnv->GetValue(resourceName,defaultValue);
58 //_____________________________________________________________________________
60 AliMUONPainterEnv::Integer(const char* resourceName, Int_t defaultValue)
62 /// Retrieve the value associated with a given source, as an integer
64 return fEnv->GetValue(resourceName,defaultValue);
67 //_____________________________________________________________________________
69 AliMUONPainterEnv::Double(const char* resourceName, Double_t defaultValue)
71 /// Retrieve the value associated with a given source, as a double
73 return fEnv->GetValue(resourceName,defaultValue);
76 //_____________________________________________________________________________
78 AliMUONPainterEnv::Save()
80 /// Save the resource file
81 fEnv->WriteFile(gSystem->ExpandPathName(Form("$HOME/%s",fEnv->GetRcName())));
84 //_____________________________________________________________________________
86 AliMUONPainterEnv::Set(const char* resourceName, Int_t value)
88 /// Set an integer resource
90 fEnv->SetValue(resourceName,Form("%d",value));
93 //_____________________________________________________________________________
95 AliMUONPainterEnv::Set(const char* resourceName, const char* value)
97 /// Set a string resource
99 fEnv->SetValue(resourceName,value);
102 //_____________________________________________________________________________
104 AliMUONPainterEnv::Set(const char* resourceName, Double_t value)
106 /// Set a double resource
108 fEnv->SetValue(resourceName,Form("%g",value));