Log of /trunk/io/xml/src/TXMLSetup.cxx
Parent Directory
Revision
44507 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Jun 4 12:30:41 2012 UTC (2 years, 7 months ago) by
axel
File length: 9455 byte(s)
Diff to
previous 35763
Remove
using namespace std;
from Riostream.h, which has huge consequences for all of ROOT.
Riostream.h is now a simple wrapper for fstream, iostream, iomanip for backward compatibility; Riosfwd.h simply wraps iosfwd.
Because of templates and their inline functions, Riostream.h needed to be included in headers, too (e.g. TParameter.h), which violated the assumption that Riostream.h is not exposing its using namespace std to headers.
ROOT now requires R__ANSISTREAM, R__SSTREAM, which does not change the set of supported compilers.
Without "using namespace std", several identifiers are now prefixed by std::; e.g. roofit/* source files now have a using namespace std to keep their coding style.
TFile::MakeProject() now generates "using namespace std" to convert the CINT-style class names into C++ ones.
Revision
22419 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Mar 3 00:25:01 2008 UTC (6 years, 10 months ago) by
rdm
Original Path:
trunk/xml/src/TXMLSetup.cxx
File length: 9448 byte(s)
Diff to
previous 20882
From Andrew Savchenko:
ROOT can not be compiled with gcc-4.3.
Some ROOT source files doesn't contain required #include directives,
for example, they use strlen(), but #include <string.h> is missed or
malloc() is used and #include <stdlib.h> is missed.
Earlier versions of gcc allowed some headers to be included implicitly,
but issued a warning (-Wimplicit-function-declaration). Newer one,
gcc-4.3 denies such silly behaviour: all required headers must be explicitly
included.
Attached patch fixes this. Also it fixes another issue, which disallows
ROOT to compile under gcc-4.3: C functions don't belong to namespace std,
so expressions like std::memcpy() are no longer valid and plain memcpy()
should be used instead.
Revision
13871 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Jan 20 01:12:13 2006 UTC (9 years ago) by
pcanal
Original Path:
trunk/xml/src/TXMLSetup.cxx
File length: 9490 byte(s)
Diff to
previous 13349
From Sergei Linev:
1. Better support of TClonesArray.
Now TBufferXML all set bit, that member-wise streaming is not supported.
Therefore, objects in TClonesArray are stored in XML file in "normal" form
and you can see correctly them in xml.
2. Object conversion to/from XML
Some times ago I get a request to convert object directly to XML form without
file I/O. I implement four static methods in TBufferXML:
static TString ConvertToXML(TObject* obj, Bool_t GenericLayout = kFALSE, Bool_t UseNamespaces = kFALSE);
static TString ConvertToXML(void* obj, TClass* cl, Bool_t GenericLayout = kFALSE, Bool_t UseNamespaces = kFALSE);
static TObject* ConvertFromXML(const char* str, Bool_t GenericLayout = kFALSE, Bool_t UseNamespaces = kFALSE);
static void* ConvertFromXMLAny(const char* str, TClass** cl = 0, Bool_t GenericLayout = kFALSE, Bool_t UseNamespaces = kFALSE);
They convert object to/from string with XML nodes. Simplest code is look like:
TH1* h = new TH1I("name","title", 1000, 0, 1000);
TString s = TBufferXML::ConvertToXML(h);
cout << s << endl;
TObject* obj = TBufferXML::ConvertFromXML(s);
if (obj) obj->Draw();
3. More information stored in XML file.
I now store file creation/modification time, file UUID, file title, key title and creation time.
I also put TXMLFile version into file itself to support old format of XML file for case of TClonesArray.
4. Preparation for custom streamers support
I already put implementation of methods
virtual void ClassBegin(const TClass*, Version_t = -1);
virtual void ClassEnd(const TClass*);
virtual void ClassMember(const char* name, const char* typeName = 0, Int_t arrsize1 = -1, Int_t arrsize2 = -1);
into TBufferXML class to enable support for custom streamers.
They work the same way as I did for TBufferSQL2 class,
but to enable them, I need declaration of that functions in TBuffer class.
For TBuffer these functions does not required any implementation.
Revision
13349 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Nov 24 16:57:23 2005 UTC (9 years, 2 months ago) by
pcanal
Original Path:
trunk/xml/src/TXMLSetup.cxx
File length: 9294 byte(s)
Diff to
previous 13291
From Sergei Linev:
I introduce new function TSQLFile::MakeSelectQuery.
It produces SQL query, which can be used outside ROOT to get all objects data (including data from parent classes)
with single SELECT statement. As result, one table with all data is produced.
Revision
9341 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Jun 29 14:45:38 2004 UTC (10 years, 6 months ago) by
brun
Original Path:
trunk/xml/src/TXMLSetup.cxx
File length: 8551 byte(s)
Diff to
previous 9315
From Sergey Linev:
I slightly modify xml package. I remove non used class TXMLDtdGenerator. I
plan to move it's code in TXMLPlayer class later, when all code generation
will be done. Do not forget to delete TXMLDtdGenerator.* files from
root/xml/inc, root/xml/src and root/include directory.
I fix problem for the case, when class inherits from STL class.
I also add some comments to new TXMLPlayer class.
Revision
8929 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri May 14 14:30:46 2004 UTC (10 years, 8 months ago) by
brun
Original Path:
trunk/xml/src/TXMLSetup.cxx
File length: 8110 byte(s)
Diff to
previous 8884
From Sergey Linev
1. TXMLFile can be opened with "create", "recreate", "open", "new", "update"
options. Special string like "2xoo" can be specified to "recreate" xml file with
specific xml options (explained in TXMLSetup class).
Close() and ReOpen() methods are implemented.
2. Correct writing and reading of TStreamerInfo classes to xml file.
Before they were skiped them when reading.
This can be optional (default on) (first cross in "2xoo")
3. Any data, which are stored directly to TBuffer like TBuffer::WriteBuf,
will be stored as binary block of data and restored when reading from file
4. According to compression level of TFile:
==0: no any repetition counters in arrays;
>0: repetition counter in array, in future also for TClonesArray fields
>5: file created without space indentation and new lines
Binary data compressed by zip with the same compression level
5. Namespaces are introduced (optional - default off).
If on, any data member get prefix according to class name.
To test, create file option should be "2xox" (last cross set namespaces on).
Object will look like:
<TAttLine xmlns:TAttLine="http://root.cern.ch/root/htmldoc/TAttLine.html" version="1">
<TAttLine:fLineColor v="1"/>
<TAttLine:fLineStyle v="1"/>
<TAttLine:fLineWidth v="1"/>
</TAttLine>
Important for DTD (in future) and just for convenient viewing of xml file.
6. Generic layout of XML file is introduced again.
still have some problems how it looks (because reading is ok), which
should be solved later.
In list of options it is first number 3 "3xoo".
Number 2 is default for class specific layout.
I keep several numbers for some variants, which may come later.
7. gXML global pointer is removed. Now each instance of TXMLFile creates own
copy of TXMLEngine object.
8. TXMLBuffer parent always set to correpondent TXMLFile. Important for TRef
classes.
9. Comments for TXMLFile, TXMLBuffer, TXMLKey are created. Other in progress
10. Small changes according to recent changes in TDirectory and in TKey
classes for not TObject classes.
Revision
8860 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Added
Mon May 10 21:29:26 2004 UTC (10 years, 8 months ago) by
brun
Original Path:
trunk/xml/src/TXMLSetup.cxx
File length: 6610 byte(s)
Introduce new package xml.
Originally proposed by Hans Essel from GSI.
Main implementation by Sergey Linev from GSI.
Adaptation to ROOT framework by Rene Brun.
"xml" is an optional package that can be used to write file.xml
instead of file.root. XML files do not have any advantages
compared to the normal ROOT files, except that the information
in these files can be edited via a normal editor.
The main motivation for this new format is to facilitate the
communication with other non ROOT applications. Currently
writing and reading XML files is limited to ROOT applications.
It is our intention to develop a simple reader independent
of the ROOT libraries that could be used as an example for
real applications.
The XML format should be used only for small data volumes,
typically histogram files, pictures, geometries, calibrations.
The XML file is built in memory before being dumped to disk.
Like for normal ROOT files, XML files use the same I/O mechanism
exploiting the ROOT/CINT dictionary. Any class having a dictionary
can be saved in XML format.
This first implementation does not support subdirectories
or Trees.
The shared library libRXML.so may be loaded dynamically
via gSystem->Load("libRXML"). This library is automatically
loaded by the plugin manager as soon as a XML file is created
via, eg
TFile::Open("file.xml","recreate");
TFile::Open returns a TXMLFile object. When a XML file is open in write mode,
one can use the normal TObject::Write to write an object in the file.
Alternatively one can use the new functions TDirectory::WriteObject and
TDirectory::WriteObjectAny to write a TObject* or any class not deriving
from TObject.
example of a session saving a histogram to a XML file
=====================================================
TFile *f = TFile::Open("Example.xml","recreate");
TH1F *h = new TH1F("h","test",1000,-2,2);
h->FillRandom("gaus");
h->Write();
delete f;
example of a session reading the histogram from the file
========================================================
TFile *f = TFile::Open("Example.xml");
TH1F *h = (TH1F*)f->Get("h");
h->Draw();
A new option in the canvas "File" menu is available to save
a TCanvas as a XML file. One can also do
canvas->Print("Example.xml");
Configuring ROOT with the option "xml"
======================================
The XML package uses the public XML parser and toolkit
from Gnome. You should download the latest version 2-6.9
from http://www.xmlsoft.org/downloads.html.
On Unix systems dowload "libxml2-2.6.9.tar.gz" and create
XMLDIR pointing to the directory libxml2-2.6.9. in the XMLDIR
directory, run the normal
./configure
make
On Windows, from the same web site download
libxml2-2.6.9.win32.zip
iconv-1.9.1.win32.zip
unzip the two files, then copy the file iconv.h from the iconv/include file
to $XMLDIR/include. Also copy iconv.dll, iconv.lib and iconv_a.lib
from the iconv/lib directory to $XMLDIR/lib.
You are now ready to configure ROOT with the XML option. do:
./configure -enable-xml -enable-xxxxx, etc
documentation
=============
The "xml" package is currently under development. A more complete
documentation will be provided shortly in the classes reference guide.
See classes TXMLFile, TXMLKey, TXMLBuffer, TXMLEngine, TXMLSetup
and TXMLDtdGenerator.
An example of XML file corresponding to the small example below
can be found at http://root.cern.ch/root/Example.xml.
This form allows you to request diffs between any two revisions of this file.
For each of the two "sides" of the diff,
enter a numeric revision.