TString question

Pasha Murat (murat@cdfsga.fnal.gov)
Fri, 29 May 1998 11:32:02 -0500 (CDT)


Hi Nick,

you are perfectly right: if you look at the definition of TString class
you'll see that it has nothing except char* in it, so there is no reason
to use TString*, which is char**
Regards, Pasha.

--------------------------------------------------------------------------------
Nick van Eijndhoven writes:
> Dear ROOTers,
> I have a class derived from TObject and with ClassDef() and
> ClassImp() to have the automatic ROOT I/O generated.
> However, in the private area of that class I need to store
> a char* data member.
> This gives problems in the automatic streamer generation, so
> I replaced the char* by TString* and in some member function
> I initialise via
>
> s=new TString("test");
>
> However, when compiling my class it turns out that there is
> in the dictionary NO 'binary >>' defined which can handle a
> TString* object on the right hand side.
> This results in a compilation error (using msvc++ on win95
> with ROOT 2.00/07) and so I can't create my DLL.
>
> So I guess replacing TString* by TString in the private area
> in my class will do the job.
> Now my question is : Does there exist some TString member function
> with which I can put some chararcter string into the object ?
> (i.e. the reverse of TString::Data())
> What I need is :
>
> private : // the private area of my class
> TString s;
>
> and then in the code of my member function :
>
> s.Enter("test"); // To enter the string "test" into s
>
> So far I could not find such a funtionality in the docs, so
> as usual any good advice is very welcome.
>
> --
>
> Cheers,
>
> _/_/ _/ _/ _/_/_/_/ _/ _/
> _/ _/ _/ _/ _/ _/ _/
> _/ _/ _/ _/ _/ _/_/
> _/ _/_/ _/ _/ _/ _/
> _/ _/ _/ _/_/_/_/ _/ _/
>
>
> *----------------------------------------------------------------------*
> Dr. Nick van Eijndhoven Department of Subatomic Physics
> email : nick@phys.uu.nl Utrecht University / NIKHEF
> tel. +31-30-2532331 (direct) P.O. Box 80.000
> tel. +31-30-2531492 (secr.) NL-3508 TA Utrecht
> fax. +31-30-2518689 The Netherlands
> WWW : http://www.phys.uu.nl/~nick Office : Ornstein lab. 172
> ----------------------------------------------------------------------
> tel. +41-22-7679751 (direct) CERN PPE Division / ALICE exp.
> tel. +41-22-7675857 (secr.) CH-1211 Geneva 23
> fax. +41-22-7679480 Switzerland
> CERN beep : 13+7294 Office : B 160 1-012
> *----------------------------------------------------------------------*