Re: [ROOT] Human readable/writeable I/O?

From: Rene Brun (Rene.Brun@cern.ch)
Date: Wed Jan 23 2002 - 09:00:03 MET


Hi Brett,

As already indicated by Valery, implementing MyClass::SavePrimitive
is the solution to your problem if you want a readable version of the file.
SavePrimitive is implemented for most ROOT classes that appear in a canvas:
all graphics primitives, TGraph, TH1, TCanvas, TPad, etc.
In SavePrimitive, you generate the C++ code to rebuild the objects with
their attributes. This code can be edited and reexecuted by CINT again.
I strongly encourage people to implement the SavePrimitive function
for their classes.

I am also considering the generation of ascii files via the TStreamerInfo
class. XML is a likely choice. I agree with you that XML is NOT an input
format. I have seen that most attempts to use XML as an input format have
failed so far. But XML is a good candidate for an interchange format
between different applications when the volume of data to be exchanged is small.
The problem is not writing the XML file, but the choice of a good DTD.

Rene Brun

Brett Viren wrote:
> 
> Hi,
> 
> I have a container class: a heterogeneous map from string keys to
> values of type char, int, double, string and itself (that is, it can
> be used to form a hierarchical tree).  Currently it can be be
> read/written via ROOT streamers.  It is typically used to hold
> configuration data.
> 
> I am looking for a way to write it out as plain text in a form that
> can be edited in a text editor and subsequently read back in.
> 
> Does anyone have any ideas?  (Please, no XML).
> 
> Thanks,
> -Brett.



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:39 MET