On Wed, 5 Apr 2000, Fons Rademakers wrote: > I've now made most functions in the class virtual. > However, most should work without having to derive a special class. > You just should be able to use TEnv like it is: > > TEnv *e = new TEnv("/my/path/.myenvrc"); yes you are right as long as local file is supposed to be used. As I said I wanted to duplicate ROOT's mechanism of reading: 1) Project system default file (${PROJECT}/system.myenvrc) analogous to kEnvGlobal 2) User default (${HOME}/.myenvrc) is it exists analogous to kEnvUser should user wish to save something it goes to ${HOME}/.myenvrc file. just using 'TEnv' as you recommended doesn't help (or am I wrong here) > e->Print(); > e->SetValue("bla", "-1") > e->SaveLevel(kEnvLocal) > > I don't see any problem with using -1 as value. It works for me. Sorry, I wasn't specific enough - I don't have trouble saving values. I have problem with reading values: root [0] TEnv* e = new TEnv(".evdrc"); root [1] e->Print() TCotDisplay.TrackColor: 1 [User] TCotDisplay.WindowWidth: 536 [User] TCotDisplay.WindowHeight: 649 [User] TCotDisplay.WindowXPosition: 26 [User] TCotDisplay.WindowYPosition: 25 [User] TCotDisplay.ViewPadColor: 0 [User] TLegoDisplay.WindowWidth: 536 [User] TLegoDisplay.WindowHeight: 649 [User] TLegoDisplay.WindowXPosition: 973 [User] TLegoDisplay.WindowYPosition: 193 [User] TLegoDisplay.ViewPadColor: 1 [User] TLegoDisplay.Phi: -417 [User] TLegoDisplay.Theta: 38 [User] TLegoDisplay.Psi: 0 [User] root [2] Int_t phi = e->GetValue("TLegoDisplay.Phi",0); root [3] cout << phi << endl; 0 root [4] e->SetValue("TLegoDisplay.Phi","417"); root [5] e->Save() root [6] phi = e->GetValue("TLegoDisplay.Phi",0); root [7] cout << phi << endl; 417 as you see positive value of phi has been read out in contrast to negative show me where I'm wrong here > > Cheers, Fons. > > > > Dmitri Litvintsev wrote: > > > > Dear Rooters, > > > > I've been developing ROOT application and want read/save > > application specific resources from/to a file which is not > > located in $(ROOTSYS) and called differently. > > > > e.g. > > > > default file for all users to fetch at start up: > > ${OUR_PROJECT}/${MY_APPLICATION}/.myenvrc > > > > if user modified and saved some applicaion specific resources > > it should go to his ${HOME}/.myenvrc > > > > I see that there is a class TEnv which probably does this for the > > ROOT. > > > > I thought of using TEnv class. > > > > And overide a couple of relevant methods. The trouble is > > that: > > Save() > > SaveLevel() > > SetValue() > > > > are not virtual. May I ask to make all methods of this class > > virtual? > > > > regards, > > Dmitri Litvintsev > > > > /----------------------------------------------------------\ > > | Tel: (630) 840 5005 | > > | FAX: (630) 840 2968 | > > | office: 169-E CDF Trailers | > > | E-mail: litvinse@fnal.gov | > > \----------------------------------------------------------/ > > -- > Org: CERN, European Laboratory for Particle Physics. > Mail: 1211 Geneve 23, Switzerland > E-Mail: Fons.Rademakers@cern.ch Phone: +41 22 7679248 > WWW: http://root.cern.ch/~rdm/ Fax: +41 22 7677910 >
This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:22 MET