Logo ROOT   6.10/09
Reference Guide
TXMLSetup.h
Go to the documentation of this file.
1 // @(#)root/xml:$Id$
2 // Author: Sergey Linev 10.05.2004
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TXMLSetup
13 #define ROOT_TXMLSetup
14 
15 #include "TObject.h"
16 #include "TString.h"
17 
18 #ifdef Bool
19 #undef Bool
20 #endif
21 #ifdef True
22 #undef True
23 #endif
24 #ifdef False
25 #undef False
26 #endif
27 
28 
29 namespace xmlio {
30  extern const char* Root;
31  extern const char* Setup;
32  extern const char* ClassVersion;
33  extern const char* IOVersion;
34  extern const char* OnlyVersion;
35  extern const char* Ptr;
36  extern const char* Ref;
37  extern const char* Null;
38  extern const char* IdBase;
39  extern const char* Size;
40  extern const char* Xmlobject;
41  extern const char* Xmlkey;
42  extern const char* Cycle;
43  extern const char* XmlBlock;
44  extern const char* Zip;
45  extern const char* Object;
46  extern const char* ObjClass;
47  extern const char* Class;
48  extern const char* Member;
49  extern const char* Item;
50  extern const char* Name;
51  extern const char* Title;
52  extern const char* CreateTm;
53  extern const char* ModifyTm;
54  extern const char* ObjectUUID;
55  extern const char* Type;
56  extern const char* Value;
57  extern const char* v;
58  extern const char* cnt;
59  extern const char* True;
60  extern const char* False;
61  extern const char* SInfos;
62 
63  extern const char* Array;
64  extern const char* Bool;
65  extern const char* Char;
66  extern const char* Short;
67  extern const char* Int;
68  extern const char* Long;
69  extern const char* Long64;
70  extern const char* Float;
71  extern const char* Double;
72  extern const char* UChar;
73  extern const char* UShort;
74  extern const char* UInt;
75  extern const char* ULong;
76  extern const char* ULong64;
77  extern const char* String;
78  extern const char* CharStar;
79 }
80 
81 class TStreamerElement;
82 
83 class TXMLSetup {
84  public:
85  enum EXMLLayout { kSpecialized = 2,
86  kGeneralized = 3 };
87 
88  TXMLSetup();
89  TXMLSetup(const char* opt);
90  TXMLSetup(const TXMLSetup& src);
91  virtual ~TXMLSetup();
92 
93  TString GetSetupAsString();
94 
95  void PrintSetup();
96 
97  EXMLLayout GetXmlLayout() const { return fXmlLayout; }
98  Bool_t IsStoreStreamerInfos() const { return fStoreStreamerInfos; }
99  Bool_t IsUseDtd() const { return fUseDtd; }
100  Bool_t IsUseNamespaces() const { return fUseNamespaces; }
101 
102  virtual void SetXmlLayout(EXMLLayout layout) { fXmlLayout = layout; }
103  virtual void SetStoreStreamerInfos(Bool_t iConvert = kTRUE) { fStoreStreamerInfos = iConvert; }
104  virtual void SetUsedDtd(Bool_t use = kTRUE) { fUseDtd = use; }
105  virtual void SetUseNamespaces(Bool_t iUseNamespaces = kTRUE) { fUseNamespaces = iUseNamespaces; }
106 
107  const char* XmlConvertClassName(const char* name);
108  const char* XmlClassNameSpaceRef(const TClass* cl);
109  const char* XmlGetElementName(const TStreamerElement* el);
110 
111  Int_t GetNextRefCounter() { return fRefCounter++; }
112 
113  static TString DefaultXmlSetup();
114  static void SetNameSpaceBase(const char* namespacebase);
115 
116  protected:
117 
118  TClass* XmlDefineClass(const char* xmlClassName);
119  const char* GetElItemName(TStreamerElement* el);
120 
121  Bool_t IsValidXmlSetup(const char* setupstr);
122  Bool_t ReadSetupFromStr(const char* setupstr);
123 
124  Int_t AtoI(const char* sbuf, Int_t def = 0, const char* errinfo = 0);
125 
130 
131  Int_t fRefCounter; //! counter , used to build id of xml references
132 
133  TString fStrBuf; //! buffer, used in XmlDefineClass() function
134 
136 
137  ClassDef(TXMLSetup,1) //settings to be stored in XML files
138 };
139 
140 #endif
const char * ULong
Definition: TXMLSetup.cxx:92
Int_t fRefCounter
Definition: TXMLSetup.h:131
const char * Object
Definition: TXMLSetup.cxx:62
const char * Long64
Definition: TXMLSetup.cxx:86
const char * XmlBlock
Definition: TXMLSetup.cxx:60
const char * UInt
Definition: TXMLSetup.cxx:91
const char * Ref
Definition: TXMLSetup.cxx:53
const char * ObjClass
Definition: TXMLSetup.cxx:63
const char * ModifyTm
Definition: TXMLSetup.cxx:70
const char * Double
Definition: TXMLSetup.cxx:88
const char * Title
Definition: TXMLSetup.cxx:68
const char * Size
Definition: TXMLSetup.cxx:56
EXMLLayout GetXmlLayout() const
Definition: TXMLSetup.h:97
const char * v
Definition: TXMLSetup.cxx:74
const char * ULong64
Definition: TXMLSetup.cxx:93
Basic string class.
Definition: TString.h:129
const char * Setup
Definition: TXMLSetup.cxx:48
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
const char * Item
Definition: TXMLSetup.cxx:66
const char * Class
Definition: TXMLSetup.cxx:64
const char * False
Definition: TXMLSetup.cxx:77
const char * Type
Definition: TXMLSetup.cxx:72
const char * Name
Definition: TXMLSetup.cxx:67
const char * String
Definition: TXMLSetup.cxx:94
const char * Float
Definition: TXMLSetup.cxx:87
#define ClassDef(name, id)
Definition: Rtypes.h:297
const char * UChar
Definition: TXMLSetup.cxx:89
const char * Char
Definition: TXMLSetup.cxx:82
const char * Cycle
Definition: TXMLSetup.cxx:59
const char * Xmlkey
Definition: TXMLSetup.cxx:58
virtual void SetUsedDtd(Bool_t use=kTRUE)
Definition: TXMLSetup.h:104
TString fStrBuf
counter , used to build id of xml references
Definition: TXMLSetup.h:133
const char * CreateTm
Definition: TXMLSetup.cxx:69
const char * Array
Definition: TXMLSetup.cxx:80
The ROOT global object gROOT contains a list of all defined classes.
Definition: TClass.h:71
Int_t GetNextRefCounter()
Definition: TXMLSetup.h:111
Bool_t fStoreStreamerInfos
Definition: TXMLSetup.h:127
Bool_t IsUseNamespaces() const
Definition: TXMLSetup.h:100
const char * Ptr
Definition: TXMLSetup.cxx:52
const char * Root
Definition: TXMLSetup.cxx:47
const char * IOVersion
Definition: TXMLSetup.cxx:50
const char * ObjectUUID
Definition: TXMLSetup.cxx:71
virtual void SetStoreStreamerInfos(Bool_t iConvert=kTRUE)
Definition: TXMLSetup.h:103
const char * Null
Definition: TXMLSetup.cxx:54
Bool_t fUseDtd
Definition: TXMLSetup.h:128
const char * CharStar
Definition: TXMLSetup.cxx:95
static TString fgNameSpaceBase
buffer, used in XmlDefineClass() function
Definition: TXMLSetup.h:135
const char * Member
Definition: TXMLSetup.cxx:65
virtual void SetUseNamespaces(Bool_t iUseNamespaces=kTRUE)
Definition: TXMLSetup.h:105
const char * Int
Definition: TXMLSetup.cxx:84
Bool_t IsStoreStreamerInfos() const
Definition: TXMLSetup.h:98
EXMLLayout fXmlLayout
Definition: TXMLSetup.h:126
const char * Short
Definition: TXMLSetup.cxx:83
const char * OnlyVersion
Definition: TXMLSetup.cxx:51
Bool_t IsUseDtd() const
Definition: TXMLSetup.h:99
const char * ClassVersion
Definition: TXMLSetup.cxx:49
const char * True
Definition: TXMLSetup.cxx:76
const Bool_t kTRUE
Definition: RtypesCore.h:91
const char * UShort
Definition: TXMLSetup.cxx:90
virtual void SetXmlLayout(EXMLLayout layout)
Definition: TXMLSetup.h:102
const char * SInfos
Definition: TXMLSetup.cxx:78
const char * IdBase
Definition: TXMLSetup.cxx:55
const char * Zip
Definition: TXMLSetup.cxx:61
const char * cnt
Definition: TXMLSetup.cxx:75
const char * Xmlobject
Definition: TXMLSetup.cxx:57
const char * Long
Definition: TXMLSetup.cxx:85
const char * Value
Definition: TXMLSetup.cxx:73
const char * Bool
Definition: TXMLSetup.cxx:81
Bool_t fUseNamespaces
Definition: TXMLSetup.h:129