Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/TXMLSetup.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // @(#)root/xml:$Id$
0002 // Author: Sergey Linev  10.05.2004
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 #ifndef ROOT_TXMLSetup
0013 #define ROOT_TXMLSetup
0014 
0015 #include "Rtypes.h"
0016 #include "TString.h"
0017 
0018 #ifdef Bool
0019 #undef Bool
0020 #endif
0021 #ifdef True
0022 #undef True
0023 #endif
0024 #ifdef False
0025 #undef False
0026 #endif
0027 
0028 namespace xmlio {
0029 extern const char *Root;
0030 extern const char *Setup;
0031 extern const char *ClassVersion;
0032 extern const char *IOVersion;
0033 extern const char *OnlyVersion;
0034 extern const char *Ptr;
0035 extern const char *Ref;
0036 extern const char *Null;
0037 extern const char *IdBase;
0038 extern const char *Size;
0039 extern const char *Xmlobject;
0040 extern const char *Xmlkey;
0041 extern const char *Cycle;
0042 extern const char *XmlBlock;
0043 extern const char *Zip;
0044 extern const char *Object;
0045 extern const char *ObjClass;
0046 extern const char *Class;
0047 extern const char *Member;
0048 extern const char *Item;
0049 extern const char *Name;
0050 extern const char *Title;
0051 extern const char *CreateTm;
0052 extern const char *ModifyTm;
0053 extern const char *ObjectUUID;
0054 extern const char *Type;
0055 extern const char *Value;
0056 extern const char *v;
0057 extern const char *cnt;
0058 extern const char *True;
0059 extern const char *False;
0060 extern const char *SInfos;
0061 
0062 extern const char *Array;
0063 extern const char *Bool;
0064 extern const char *Char;
0065 extern const char *Short;
0066 extern const char *Int;
0067 extern const char *Long;
0068 extern const char *Long64;
0069 extern const char *Float;
0070 extern const char *Double;
0071 extern const char *UChar;
0072 extern const char *UShort;
0073 extern const char *UInt;
0074 extern const char *ULong;
0075 extern const char *ULong64;
0076 extern const char *String;
0077 extern const char *CharStar;
0078 }
0079 
0080 class TStreamerElement;
0081 
0082 class TXMLSetup {
0083 public:
0084    enum EXMLLayout { kSpecialized = 2, kGeneralized = 3 };
0085 
0086    TXMLSetup() = default;
0087    TXMLSetup(const char *opt);
0088    TXMLSetup(const TXMLSetup &src);
0089    virtual ~TXMLSetup() = default;
0090 
0091    TXMLSetup &operator=(const TXMLSetup &rhs);
0092 
0093    TString GetSetupAsString();
0094 
0095    void PrintSetup();
0096 
0097    EXMLLayout GetXmlLayout() const { return fXmlLayout; }
0098    Bool_t IsStoreStreamerInfos() const { return fStoreStreamerInfos; }
0099    Bool_t IsUseDtd() const { return fUseDtd; }
0100    Bool_t IsUseNamespaces() const { return fUseNamespaces; }
0101 
0102    virtual void SetXmlLayout(EXMLLayout layout) { fXmlLayout = layout; }
0103    virtual void SetStoreStreamerInfos(Bool_t iConvert = kTRUE) { fStoreStreamerInfos = iConvert; }
0104    virtual void SetUsedDtd(Bool_t use = kTRUE) { fUseDtd = use; }
0105    virtual void SetUseNamespaces(Bool_t iUseNamespaces = kTRUE) { fUseNamespaces = iUseNamespaces; }
0106 
0107    const char *XmlConvertClassName(const char *name);
0108    const char *XmlClassNameSpaceRef(const TClass *cl);
0109    const char *XmlGetElementName(const TStreamerElement *el);
0110 
0111    Int_t GetNextRefCounter() { return fRefCounter++; }
0112 
0113    static TString DefaultXmlSetup();
0114    static void SetNameSpaceBase(const char *namespacebase);
0115 
0116 protected:
0117    TClass *XmlDefineClass(const char *xmlClassName);
0118    const char *GetElItemName(TStreamerElement *el);
0119 
0120    Bool_t IsValidXmlSetup(const char *setupstr);
0121    Bool_t ReadSetupFromStr(const char *setupstr);
0122 
0123    Int_t AtoI(const char *sbuf, Int_t def = 0, const char *errinfo = nullptr);
0124 
0125    EXMLLayout fXmlLayout{kSpecialized};
0126    Bool_t fStoreStreamerInfos{kTRUE};
0127    Bool_t fUseDtd{kFALSE};
0128    Bool_t fUseNamespaces{kFALSE};
0129 
0130    Int_t fRefCounter{0}; //!  counter , used to build id of xml references
0131 
0132    TString fStrBuf; //!  buffer, used in XmlDefineClass() function
0133 
0134    static TString fgNameSpaceBase;
0135 
0136    ClassDef(TXMLSetup, 1) // settings to be stored in XML files
0137 };
0138 
0139 #endif