Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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 "Rtypes.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
28namespace xmlio {
29extern const char *Root;
30extern const char *Setup;
31extern const char *ClassVersion;
32extern const char *IOVersion;
33extern const char *OnlyVersion;
34extern const char *Ptr;
35extern const char *Ref;
36extern const char *Null;
37extern const char *IdBase;
38extern const char *Size;
39extern const char *Xmlobject;
40extern const char *Xmlkey;
41extern const char *Cycle;
42extern const char *XmlBlock;
43extern const char *Zip;
44extern const char *Object;
45extern const char *ObjClass;
46extern const char *Class;
47extern const char *Member;
48extern const char *Item;
49extern const char *Name;
50extern const char *Title;
51extern const char *CreateTm;
52extern const char *ModifyTm;
53extern const char *ObjectUUID;
54extern const char *Type;
55extern const char *Value;
56extern const char *v;
57extern const char *cnt;
58extern const char *True;
59extern const char *False;
60extern const char *SInfos;
61
62extern const char *Array;
63extern const char *Bool;
64extern const char *Char;
65extern const char *Short;
66extern const char *Int;
67extern const char *Long;
68extern const char *Long64;
69extern const char *Float;
70extern const char *Double;
71extern const char *UChar;
72extern const char *UShort;
73extern const char *UInt;
74extern const char *ULong;
75extern const char *ULong64;
76extern const char *String;
77extern const char *CharStar;
78}
79
81
82class TXMLSetup {
83public:
85
86 TXMLSetup() = default;
87 TXMLSetup(const char *opt);
88 TXMLSetup(const TXMLSetup &src);
89 virtual ~TXMLSetup() = default;
90
91 TXMLSetup &operator=(const TXMLSetup &rhs);
92
94
95 void PrintSetup();
96
99 Bool_t IsUseDtd() const { return fUseDtd; }
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
112
113 static TString DefaultXmlSetup();
114 static void SetNameSpaceBase(const char *namespacebase);
115
116protected:
117 TClass *XmlDefineClass(const char *xmlClassName);
118 const char *GetElItemName(TStreamerElement *el);
119
120 Bool_t IsValidXmlSetup(const char *setupstr);
121 Bool_t ReadSetupFromStr(const char *setupstr);
122
123 Int_t AtoI(const char *sbuf, Int_t def = 0, const char *errinfo = nullptr);
124
129
130 Int_t fRefCounter{0}; //! counter , used to build id of xml references
131
132 TString fStrBuf; //! buffer, used in XmlDefineClass() function
133
135
136 ClassDef(TXMLSetup, 1) // settings to be stored in XML files
137};
138
139#endif
bool Bool_t
Definition RtypesCore.h:63
int Int_t
Definition RtypesCore.h:45
constexpr Bool_t kFALSE
Definition RtypesCore.h:101
constexpr Bool_t kTRUE
Definition RtypesCore.h:100
#define ClassDef(name, id)
Definition Rtypes.h:337
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t src
char name[80]
Definition TGX11.cxx:110
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition TClass.h:81
Basic string class.
Definition TString.h:139
virtual void SetUsedDtd(Bool_t use=kTRUE)
Definition TXMLSetup.h:104
Bool_t fUseNamespaces
Definition TXMLSetup.h:128
TClass * XmlDefineClass(const char *xmlClassName)
define class for the converted class name, where special symbols were replaced by '_'
const char * XmlClassNameSpaceRef(const TClass *cl)
produce string which used as reference in class namespace definition
EXMLLayout GetXmlLayout() const
Definition TXMLSetup.h:97
static void SetNameSpaceBase(const char *namespacebase)
set namespace base
virtual void SetUseNamespaces(Bool_t iUseNamespaces=kTRUE)
Definition TXMLSetup.h:105
Bool_t fUseDtd
Definition TXMLSetup.h:127
const char * XmlConvertClassName(const char *name)
convert class name to exclude any special symbols like ':', '<' '>' ',' and spaces
TString GetSetupAsString()
return setup values as string
Bool_t IsValidXmlSetup(const char *setupstr)
checks if string is valid setup
Bool_t ReadSetupFromStr(const char *setupstr)
get values from string
const char * GetElItemName(TStreamerElement *el)
get item name for given element
Int_t AtoI(const char *sbuf, Int_t def=0, const char *errinfo=nullptr)
converts string to integer.
Bool_t IsStoreStreamerInfos() const
Definition TXMLSetup.h:98
static TString DefaultXmlSetup()
return default value for XML setup
const char * XmlGetElementName(const TStreamerElement *el)
return converted name for TStreamerElement
Bool_t IsUseDtd() const
Definition TXMLSetup.h:99
TXMLSetup()=default
EXMLLayout fXmlLayout
Definition TXMLSetup.h:125
Int_t GetNextRefCounter()
Definition TXMLSetup.h:111
Bool_t fStoreStreamerInfos
Definition TXMLSetup.h:126
Int_t fRefCounter
Definition TXMLSetup.h:130
static TString fgNameSpaceBase
buffer, used in XmlDefineClass() function
Definition TXMLSetup.h:134
virtual ~TXMLSetup()=default
TString fStrBuf
counter , used to build id of xml references
Definition TXMLSetup.h:132
Bool_t IsUseNamespaces() const
Definition TXMLSetup.h:100
void PrintSetup()
show setup values
virtual void SetStoreStreamerInfos(Bool_t iConvert=kTRUE)
Definition TXMLSetup.h:103
@ kSpecialized
Definition TXMLSetup.h:84
@ kGeneralized
Definition TXMLSetup.h:84
TXMLSetup & operator=(const TXMLSetup &rhs)
assign operator
virtual void SetXmlLayout(EXMLLayout layout)
Definition TXMLSetup.h:102
const char * UChar
Definition TXMLSetup.cxx:89
const char * Root
Definition TXMLSetup.cxx:47
const char * Ptr
Definition TXMLSetup.cxx:52
const char * Name
Definition TXMLSetup.cxx:67
const char * SInfos
Definition TXMLSetup.cxx:78
const char * IOVersion
Definition TXMLSetup.cxx:50
const char * v
Definition TXMLSetup.cxx:74
const char * Bool
Definition TXMLSetup.cxx:81
const char * Xmlobject
Definition TXMLSetup.cxx:57
const char * Long64
Definition TXMLSetup.cxx:86
const char * ModifyTm
Definition TXMLSetup.cxx:70
const char * False
Definition TXMLSetup.cxx:77
const char * True
Definition TXMLSetup.cxx:76
const char * Int
Definition TXMLSetup.cxx:84
const char * ULong64
Definition TXMLSetup.cxx:93
const char * Member
Definition TXMLSetup.cxx:65
const char * OnlyVersion
Definition TXMLSetup.cxx:51
const char * Long
Definition TXMLSetup.cxx:85
const char * Title
Definition TXMLSetup.cxx:68
const char * Float
Definition TXMLSetup.cxx:87
const char * Value
Definition TXMLSetup.cxx:73
const char * Array
Definition TXMLSetup.cxx:80
const char * ClassVersion
Definition TXMLSetup.cxx:49
const char * String
Definition TXMLSetup.cxx:94
const char * Double
Definition TXMLSetup.cxx:88
const char * Object
Definition TXMLSetup.cxx:62
const char * Ref
Definition TXMLSetup.cxx:53
const char * cnt
Definition TXMLSetup.cxx:75
const char * IdBase
Definition TXMLSetup.cxx:55
const char * Size
Definition TXMLSetup.cxx:56
const char * XmlBlock
Definition TXMLSetup.cxx:60
const char * Cycle
Definition TXMLSetup.cxx:59
const char * Type
Definition TXMLSetup.cxx:72
const char * Null
Definition TXMLSetup.cxx:54
const char * Char
Definition TXMLSetup.cxx:82
const char * UShort
Definition TXMLSetup.cxx:90
const char * CharStar
Definition TXMLSetup.cxx:95
const char * UInt
Definition TXMLSetup.cxx:91
const char * ULong
Definition TXMLSetup.cxx:92
const char * CreateTm
Definition TXMLSetup.cxx:69
const char * Class
Definition TXMLSetup.cxx:64
const char * ObjClass
Definition TXMLSetup.cxx:63
const char * Short
Definition TXMLSetup.cxx:83
const char * Zip
Definition TXMLSetup.cxx:61
const char * Setup
Definition TXMLSetup.cxx:48
const char * ObjectUUID
Definition TXMLSetup.cxx:71
const char * Xmlkey
Definition TXMLSetup.cxx:58
const char * Item
Definition TXMLSetup.cxx:66