Logo ROOT   6.08/07
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 #ifndef ROOT_TObject
16 #include "TObject.h"
17 #endif
18 #ifndef ROOT_TString
19 #include "TString.h"
20 #endif
21 
22 #ifdef Bool
23 #undef Bool
24 #endif
25 #ifdef True
26 #undef True
27 #endif
28 #ifdef False
29 #undef False
30 #endif
31 
32 
33 namespace xmlio {
34  extern const char* Root;
35  extern const char* Setup;
36  extern const char* ClassVersion;
37  extern const char* IOVersion;
38  extern const char* OnlyVersion;
39  extern const char* Ptr;
40  extern const char* Ref;
41  extern const char* Null;
42  extern const char* IdBase;
43  extern const char* Size;
44  extern const char* Xmlobject;
45  extern const char* Xmlkey;
46  extern const char* Cycle;
47  extern const char* XmlBlock;
48  extern const char* Zip;
49  extern const char* Object;
50  extern const char* ObjClass;
51  extern const char* Class;
52  extern const char* Member;
53  extern const char* Item;
54  extern const char* Name;
55  extern const char* Title;
56  extern const char* CreateTm;
57  extern const char* ModifyTm;
58  extern const char* ObjectUUID;
59  extern const char* Type;
60  extern const char* Value;
61  extern const char* v;
62  extern const char* cnt;
63  extern const char* True;
64  extern const char* False;
65  extern const char* SInfos;
66 
67  extern const char* Array;
68  extern const char* Bool;
69  extern const char* Char;
70  extern const char* Short;
71  extern const char* Int;
72  extern const char* Long;
73  extern const char* Long64;
74  extern const char* Float;
75  extern const char* Double;
76  extern const char* UChar;
77  extern const char* UShort;
78  extern const char* UInt;
79  extern const char* ULong;
80  extern const char* ULong64;
81  extern const char* String;
82  extern const char* CharStar;
83 }
84 
85 class TStreamerElement;
86 
87 class TXMLSetup {
88  public:
89  enum EXMLLayout { kSpecialized = 2,
90  kGeneralized = 3 };
91 
92  TXMLSetup();
93  TXMLSetup(const char* opt);
94  TXMLSetup(const TXMLSetup& src);
95  virtual ~TXMLSetup();
96 
97  TString GetSetupAsString();
98 
99  void PrintSetup();
100 
101  EXMLLayout GetXmlLayout() const { return fXmlLayout; }
102  Bool_t IsStoreStreamerInfos() const { return fStoreStreamerInfos; }
103  Bool_t IsUseDtd() const { return fUseDtd; }
104  Bool_t IsUseNamespaces() const { return fUseNamespaces; }
105 
106  virtual void SetXmlLayout(EXMLLayout layout) { fXmlLayout = layout; }
107  virtual void SetStoreStreamerInfos(Bool_t iConvert = kTRUE) { fStoreStreamerInfos = iConvert; }
108  virtual void SetUsedDtd(Bool_t use = kTRUE) { fUseDtd = use; }
109  virtual void SetUseNamespaces(Bool_t iUseNamespaces = kTRUE) { fUseNamespaces = iUseNamespaces; }
110 
111  const char* XmlConvertClassName(const char* name);
112  const char* XmlClassNameSpaceRef(const TClass* cl);
113  const char* XmlGetElementName(const TStreamerElement* el);
114 
115  Int_t GetNextRefCounter() { return fRefCounter++; }
116 
117  static TString DefaultXmlSetup();
118  static void SetNameSpaceBase(const char* namespacebase);
119 
120  protected:
121 
122  TClass* XmlDefineClass(const char* xmlClassName);
123  const char* GetElItemName(TStreamerElement* el);
124 
125  Bool_t IsValidXmlSetup(const char* setupstr);
126  Bool_t ReadSetupFromStr(const char* setupstr);
127 
128  Int_t AtoI(const char* sbuf, Int_t def = 0, const char* errinfo = 0);
129 
134 
135  Int_t fRefCounter; //! counter , used to build id of xml references
136 
137  TString fStrBuf; //! buffer, used in XmlDefineClass() function
138 
140 
141  ClassDef(TXMLSetup,1) //settings to be stored in XML files
142 };
143 
144 #endif
const char * ULong
Definition: TXMLSetup.cxx:92
Int_t fRefCounter
Definition: TXMLSetup.h:135
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:101
const char * v
Definition: TXMLSetup.cxx:74
const char * ULong64
Definition: TXMLSetup.cxx:93
Basic string class.
Definition: TString.h:137
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:254
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:108
TString fStrBuf
counter , used to build id of xml references
Definition: TXMLSetup.h:137
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:81
Int_t GetNextRefCounter()
Definition: TXMLSetup.h:115
Bool_t fStoreStreamerInfos
Definition: TXMLSetup.h:131
Bool_t IsUseNamespaces() const
Definition: TXMLSetup.h:104
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:107
const char * Null
Definition: TXMLSetup.cxx:54
Bool_t fUseDtd
Definition: TXMLSetup.h:132
const char * CharStar
Definition: TXMLSetup.cxx:95
static TString fgNameSpaceBase
buffer, used in XmlDefineClass() function
Definition: TXMLSetup.h:139
const char * Member
Definition: TXMLSetup.cxx:65
virtual void SetUseNamespaces(Bool_t iUseNamespaces=kTRUE)
Definition: TXMLSetup.h:109
const char * Int
Definition: TXMLSetup.cxx:84
Bool_t IsStoreStreamerInfos() const
Definition: TXMLSetup.h:102
EXMLLayout fXmlLayout
Definition: TXMLSetup.h:130
const char * Short
Definition: TXMLSetup.cxx:83
const char * OnlyVersion
Definition: TXMLSetup.cxx:51
const Bool_t kTRUE
Definition: Rtypes.h:91
Bool_t IsUseDtd() const
Definition: TXMLSetup.h:103
const char * ClassVersion
Definition: TXMLSetup.cxx:49
const char * True
Definition: TXMLSetup.cxx:76
const char * UShort
Definition: TXMLSetup.cxx:90
virtual void SetXmlLayout(EXMLLayout layout)
Definition: TXMLSetup.h:106
const char * SInfos
Definition: TXMLSetup.cxx:78
const char * IdBase
Definition: TXMLSetup.cxx:55
const char * Zip
Definition: TXMLSetup.cxx:61
char name[80]
Definition: TGX11.cxx:109
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:133