60 fExpectedBaseClass(nullptr), fCompressLevel(0), fIOVersion(3)
121 TClass *clActual =
nullptr;
122 void *ptr = (
void *)obj;
132 return ConvertToXML(ptr, clActual, GenericLayout, UseNamespaces);
183 return (
TObject *)(((
char *)obj) + delta);
204 void *obj = buf.
XmlReadAny(xmlnode,
nullptr, cl);
218 TClass *objClass =
nullptr;
221 if (!res || !objClass)
224 if (objClass == expectedClass)
229 ::Error(
"TBufferXML::ConvertFromXMLChecked",
"expected class %s is not base for read class %s",
235 return (
char *)res - offset;
285 class TXMLStackObj :
public TObject {
288 :
TObject(), fNode(node), fInfo(
nullptr), fElem(
nullptr), fElemNumber(0), fCompressedClassNode(
kFALSE),
289 fClassNs(
nullptr), fIsStreamerInfo(
kFALSE), fIsElemOwner(
kFALSE)
293 virtual ~TXMLStackObj()
299 Bool_t IsStreamerInfo()
const {
return fIsStreamerInfo; }
305 Bool_t fCompressedClassNode;
321 TXMLStackObj *stack =
new TXMLStackObj(current);
343 TXMLStackObj *stack =
Stack();
344 return stack ? stack->fNode :
nullptr;
352 TXMLStackObj *stack =
Stack();
412 if (!node || (
Length() == 0))
415 const char *src =
Buffer();
418 char *fZipBuffer = 0;
424 if ((
Length() > 512) && (compressionLevel > 0)) {
425 int zipBufferSize =
Length();
426 fZipBuffer =
new char[zipBufferSize + 9];
428 int compressedSize = 0;
429 R__zipMultipleAlgorithm(compressionLevel, &dataSize,
Buffer(), &zipBufferSize, fZipBuffer, &compressedSize,
430 compressionAlgorithm);
431 if (compressedSize > 0) {
433 srcSize = compressedSize;
436 fZipBuffer =
nullptr;
446 while (srcCnt++ < srcSize) {
447 tgt += sprintf(tgt,
" %02x", (
unsigned char)*src);
449 if (block++ == 100) {
478 char *fUnzipBuffer =
nullptr;
481 Info(
"XmlReadBlock",
"Block size = %d, Length = %d, Compressed = %d", blockSize,
Length(), blockCompressed);
487 Int_t readSize = blockSize;
491 if (blockCompressed) {
493 fUnzipBuffer =
new char[zipSize];
499 char *ptr = (
char *)content.
Data();
502 Info(
"XmlReadBlock",
"Content %s", ptr);
504 for (
int i = 0; i < readSize; i++) {
505 while ((*ptr < 48) || ((*ptr > 57) && (*ptr < 97)) || (*ptr > 102))
508 int b_hi = (*ptr > 57) ? *ptr - 87 : *ptr - 48;
510 int b_lo = (*ptr > 57) ? *ptr - 87 : *ptr - 48;
513 *tgt = b_hi * 16 + b_lo;
517 Info(
"XmlReadBlock",
" Buf[%d] = %d", i, b_hi * 16 + b_lo);
522 int srcsize(0), tgtsize(0), unzipRes(0);
526 R__unzip(&readSize, (
unsigned char *)fUnzipBuffer, &blockSize, (
unsigned char *)
Buffer(), &unzipRes);
528 if (status != 0 || unzipRes != blockSize)
529 Error(
"XmlReadBlock",
"Decompression error %d", unzipRes);
531 Info(
"XmlReadBlock",
"Unzip ok");
533 delete[] fUnzipBuffer;
567 if (refvalue.
Length() > 0) {
607 Error(
"ExtractPointer",
"not found ptr %s result %p %s", ptrid, ptr, (cl ? cl->
GetName() :
"null"));
626 Error(
"ExtractReference",
"Reference tag %s not started from %s", refid,
xmlio::IdBase);
635 Info(
"ExtractReference",
"Find reference %s for object %p class %s", refid, ptr, (cl ? cl->
GetName() :
"null"));
669 if (!node || !name || !value)
673 if ((!cont || (strcmp(cont, value) != 0))) {
675 Error(
"VerifyAttr",
"%s : attr %s = %s, expected: %s", errinfo, name, cont, value);
742 TXMLStackObj *curr =
PushStack(elemnode);
794 ((
TClass *)cl)->Streamer((
void *)obj, *
this);
799 Info(
"XmlWriteObject",
"Done write for class: %s", cl ? cl->
GetName() :
"null");
823 TClass *objClass =
nullptr;
838 Error(
"XmlReadObject",
"Cannot find class %s", clname.
Data());
844 Info(
"XmlReadObject",
"Reading object of class %s", clname.
Data());
847 obj = objClass->
New();
853 objClass->
Streamer((
void *)obj, *
this);
860 Info(
"XmlReadObject",
"Reading object of class %s done", clname.
Data());
895 Info(
"IncrementLevel",
"Class: %s", clname.
Data());
900 TXMLStackObj *stack =
Stack();
905 if (compressClassNode) {
927 if (!compressClassNode) {
939 stack->fCompressedClassNode = compressClassNode;
940 stack->fInfo = sinfo;
941 stack->fIsStreamerInfo =
kTRUE;
957 TXMLStackObj *stack =
Stack();
959 if (!stack->IsStreamerInfo()) {
964 if (stack->fCompressedClassNode) {
965 stack->fInfo =
nullptr;
966 stack->fIsStreamerInfo =
kFALSE;
967 stack->fCompressedClassNode =
kFALSE;
998 TXMLStackObj *stack =
Stack();
1000 Error(
"SetStreamerElementNumber",
"stack is empty");
1004 if (!stack->IsStreamerInfo()) {
1013 Error(
"SetStreamerElementNumber",
"Lost of stack");
1018 Error(
"SetStreamerElementNumber",
"Problem in Inc/Dec level");
1024 if (!stack->IsStreamerInfo()) {
1025 Error(
"SetStreamerElementNumber",
"Problem in Inc/Dec level");
1031 Info(
"SetStreamerElementNumber",
" Next element %s", elem->
GetName());
1044 Info(
"SetStreamerElementNumber",
" Expects base class %s with standard streamer",
1055 stack->fElemNumber = number;
1056 stack->fIsElemOwner = (number < 0);
1126 if (!name || (strlen(name) == 0)) {
1127 Error(
"ClassMember",
"Invalid member name");
1134 Int_t typ_id(-1), comp_type(-1);
1136 if (strcmp(typeName,
"raw:data") == 0)
1147 if (strcmp(name, typeName) == 0) {
1155 if (tname[tname.
Length() - 1] ==
'*') {
1161 Error(
"ClassMember",
"Invalid class specifier %s", typeName);
1186 }
else if ((typ_id > 0) && (typ_id < 20)) {
1203 Error(
"ClassMember",
"Invalid combination name = %s type = %s", name, typeName);
1230 if (!elem || !elemnode)
1238 XMLNodePointer_t nodecharstar(
nullptr), nodeuchar(
nullptr), nodeint(
nullptr), nodestring(
nullptr);
1257 nodecharstar = node;
1284 XMLNodePointer_t vnode =
nullptr, idnode =
nullptr, bitsnode =
nullptr, prnode =
nullptr;
1309 if (!vnode || !idnode || !bitsnode)
1313 fXML->
NewAttr(elemnode,
nullptr,
"fUniqueID", str);
1317 sscanf(str.
Data(),
"%u", &bits);
1320 snprintf(sbuf,
sizeof(sbuf),
"%x", bits);
1325 fXML->
NewAttr(elemnode,
nullptr,
"fProcessID", str);
1343 if (!elem || !elemnode)
1357 snprintf(sbuf,
sizeof(sbuf),
"%d", len);
1394 sscanf(bitsstr.
Data(),
"%x", &bits);
1396 snprintf(sbuf,
sizeof(sbuf),
"%u", bits);
1401 if (prstr.
Length() > 0) {
1422 const char *clname =
nullptr;
1428 Info(
"ReadClass",
"Try to read class %s", clname ? clname :
"---");
1430 return clname ?
gROOT->GetClass(clname) :
nullptr;
1439 Info(
"WriteClass",
"Try to write class %s", cl->
GetName());
1465 Error(
"ReadVersion",
"No correspondent tags to read version");
1470 Info(
"ReadVersion",
"Version = %d", res);
1537 Info(
"WriteObject",
"Class %s", (actualClass ? actualClass->
GetName() :
" null"));
1544 template <
typename T>
1548 while (indx < arrsize) {
1555 arr[indx++] = arr[curr];
1563 template <
typename T>
1580 ShiftStack(is_static ?
"readstatarr" :
"readarr");
1797 template <
typename T>
1828 Int_t size = strlen(buf);
1831 memcpy(c, buf, size);
1941 const TClass *onFileClass)
1945 (*streamer)(*
this, start, 0);
1949 int objectSize = cl->
Size();
1950 char *obj = (
char *)start;
1951 char *end = obj + n * objectSize;
1953 for (; obj < end; obj += objectSize)
1954 ((
TClass *)cl)->Streamer(obj, *
this, onFileClass);
1965 const TClass *onFileClass)
1979 for (
Int_t j = 0; j <
n; j++) {
1981 start[j] = cl->
New();
1985 (*streamer)(*
this, (
void *)start, oldStyle ? n : 0);
1991 for (
Int_t j = 0; j <
n; j++) {
1994 start[j] = ((
TClass *)cl)->New();
1995 ((
TClass *)cl)->Streamer(start[j], *
this);
1999 void *old = start[j];
2025 for (
Int_t j = 0; j <
n; j++) {
2027 start[j] = ((
TClass *)cl)->New();
2028 ((
TClass *)cl)->Streamer(start[j], *
this, onFileClass);
2033 template <
typename T>
2038 while (indx < arrsize) {
2040 Int_t curr = indx++;
2041 while ((indx < arrsize) && (arr[indx] == arr[curr]))
2043 if (indx - curr > 1)
2047 for (
Int_t indx = 0; indx < arrsize; indx++)
2056 template <
typename T>
2176 template <
typename T>
2203 Bool_t usedefault = (n == 0);
2206 for (
int i = 0; i <
n; i++) {
2328 (*streamer)(*
this, start, 0);
2332 char *obj = (
char *)start;
2335 int size = cl->
Size();
2337 for (
Int_t j = 0; j <
n; j++, obj += size) {
2338 ((
TClass *)cl)->Streamer(obj, *
this);
2365 (*streamer)(*
this, (
void *)start, oldStyle ? n : 0);
2375 for (
Int_t j = 0; j <
n; j++) {
2377 if (!strInfo && !start[j] && !oldStyle) {
2387 ((
TClass *)cl)->Streamer(start[j], *
this);
2395 for (
Int_t j = 0; j <
n; j++) {
2397 start[j] = ((
TClass *)cl)->New();
2398 ((
TClass *)cl)->Streamer(start[j], *
this);
2412 ((
TObject *)obj)->TObject::Streamer(*
this);
2415 ((
TNamed *)obj)->TNamed::Streamer(*
this);
2422 Info(
"StreamObject",
"Class: %s", (cl ? cl->
GetName() :
"none"));
2576 char *
data =
new char[nbig];
2597 Error(
"ReadStdString",
"The std::string address is nullptr but should not");
2612 obj->resize(nbig,
'\0');
2615 obj->resize(nwh,
'\0');
2638 s =
new char[nch + 1];
2808 Int_t nbig = obj->length();
2845 snprintf(buf,
sizeof(buf),
"%d", value);
2855 snprintf(buf,
sizeof(buf),
"%hd", value);
2865 snprintf(buf,
sizeof(buf),
"%d", value);
2875 snprintf(buf,
sizeof(buf),
"%ld", value);
2884 std::string buf = std::to_string(value);
2922 snprintf(buf,
sizeof(buf),
"%u", value);
2932 snprintf(buf,
sizeof(buf),
"%hu", value);
2942 snprintf(buf,
sizeof(buf),
"%u", value);
2952 snprintf(buf,
sizeof(buf),
"%lu", value);
2961 std::string buf = std::to_string(value);
2992 sscanf(res,
"%d", &n);
3005 sscanf(res,
"%hd", &value);
3017 sscanf(res,
"%d", &value);
3029 sscanf(res,
"%ld", &value);
3053 sscanf(res,
"%f", &value);
3065 sscanf(res,
"%lf", &value);
3090 sscanf(res,
"%ud", &n);
3103 sscanf(res,
"%hud", &value);
3115 sscanf(res,
"%u", &value);
3127 sscanf(res,
"%lu", &value);
3182 return Stack()->fInfo;
Int_t fCompressLevel
! Compression level and algorithm
Describe Streamer information for one class version.
XMLNodePointer_t CreateItemNode(const char *name)
Create item node of specified name.
virtual const char * GetName() const
Returns name of object.
virtual ~TBufferXML()
Destroy xml buffer.
Bool_t VerifyStackNode(const char *name, const char *errinfo=nullptr)
Check, if stack node has specified name.
void XmlReadBlock(XMLNodePointer_t node)
Read binary block of data from xml.
static Bool_t CanDelete()
static function returning true if ReadBuffer can delete object
TXMLStackObj * PushStack(XMLNodePointer_t current, Bool_t simple=kFALSE)
Add new level to xml stack.
virtual Int_t ReadStaticArray(Bool_t *b)
Read array of Bool_t from buffer.
void Add(ULong64_t hash, Long64_t key, Long64_t value)
Add an (key,value) pair to the table. The key should be unique.
static const char * ConvertFloat(Float_t v, char *buf, unsigned len, Bool_t not_optimize=kFALSE)
convert float to string with configured format
Int_t GetCompressionSettings() const
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
virtual void WriteLong64(Long64_t l)
Writes Long64_t value to buffer.
void SetCompressionAlgorithm(Int_t algorithm=0)
See comments for function SetCompressionSettings.
void WorkWithElement(TStreamerElement *elem, Int_t comp_type)
This function is a part of SetStreamerElementNumber method.
Bool_t ProcessPointer(const void *ptr, XMLNodePointer_t node)
Add "ptr" attribute to node, if ptr is null or if ptr is pointer on object, which is already saved in...
void XmlWriteBlock(XMLNodePointer_t node)
Write binary data block from buffer to xml.
void FreeAttr(XMLNodePointer_t xmlnode, const char *name)
remove attribute from xmlnode
virtual void ReadLong(Long_t &l)
Reads Long_t value from buffer.
virtual void WriteFastArray(const Bool_t *b, Int_t n)
Write array of Bool_t to buffer.
virtual Int_t ReadArray(Bool_t *&b)
Read array of Bool_t from buffer.
TString fValueBuf
! Current value buffer
virtual TClass * GetClass() const =0
virtual void WriteLong(Long_t l)
Writes Long_t value to buffer.
R__ALWAYS_INLINE void XmlWriteArray(const T *arr, Int_t arrsize)
Write array, including it size Content may be compressed.
void SetCompressionSettings(Int_t settings=1)
Used to specify the compression level and algorithm.
void SetCompressionLevel(Int_t level=1)
See comments for function SetCompressionSettings.
TObject * GetParent() const
Return pointer to parent of this buffer.
EXMLLayout GetXmlLayout() const
TXMLStackObj * Stack(UInt_t depth=0)
virtual TClass * GetClassPointer() const
Returns a pointer to the TClass of this element.
virtual void WriteULong64(ULong64_t l)
Writes ULong64_t value to buffer.
virtual void ReadFastArray(Bool_t *b, Int_t n)
Read array of Bool_t from buffer.
static void * ConvertFromXMLChecked(const char *xml, const TClass *expectedClass, Bool_t GenericLayout=kFALSE, Bool_t UseNamespaces=kFALSE)
Convert from XML and check if object derived from specified class When possible, cast to given class...
Version_t fVersionBuf
! Current version buffer
virtual void WriteCharStar(char *s)
Write a char* string.
virtual void WriteChar(Char_t c)
Writes Char_t value to buffer.
virtual void InitMap()
Create the fMap container and initialize them with the null object.
XMLNodePointer_t XmlWriteAny(const void *obj, const TClass *cl)
Convert object of any class to xml structures Return pointer on top xml element.
virtual void SetArrayDim(Int_t dim)
Set number of array dimensions.
virtual void WriteFastArrayString(const Char_t *c, Int_t n)
Write array of n characters into the I/O buffer.
void CreateElemNode(const TStreamerElement *elem)
Create xml node correspondent to TStreamerElement object.
virtual void WriteTString(const TString &s)
Writes a TString.
virtual Version_t ReadVersion(UInt_t *start=nullptr, UInt_t *bcnt=nullptr, const TClass *cl=nullptr)
Read version value from buffer.
Bool_t VerifyNode(XMLNodePointer_t node, const char *name, const char *errinfo=nullptr)
Check if node has specified name.
R__ALWAYS_INLINE void XmlReadArrayContent(T *arr, Int_t arrsize)
Template method to read array content.
virtual void SetMaxIndex(Int_t dim, Int_t max)
set maximum index for array with dimension dim
void UnlinkFreeNode(XMLNodePointer_t xmlnode)
combined operation. Unlink node and free used memory
XMLNodePointer_t XmlWriteValue(const char *value, const char *name)
Create xml node with specified name and adds it to stack node.
XMLAttrPointer_t NewIntAttr(XMLNodePointer_t xmlnode, const char *name, Int_t value)
create node attribute with integer value
virtual void WriteULong(ULong_t l)
Writes ULong_t value to buffer.
XMLNodePointer_t XmlWriteObject(const void *obj, const TClass *objClass, Bool_t cacheReuse)
Write object to buffer If object was written before, only pointer will be stored Return pointer to to...
const char * GetNodeContent(XMLNodePointer_t xmlnode)
get contents (if any) of xmlnode
virtual void WriteStdString(const std::string *s)
Writes a std::string.
Bool_t VerifyItemNode(const char *name, const char *errinfo=nullptr)
Checks, if stack node is item and has specified name.
TXMLEngine * fXML
! instance of TXMLEngine for working with XML structures
virtual void ReadCharP(Char_t *c)
Reads array of characters from buffer.
TXMLFile * XmlFile()
Returns pointer to TXMLFile object.
Int_t GetBaseClassOffset(const TClass *toBase, void *address=0, bool isDerivedObject=true)
virtual void WriteInt(Int_t i)
Writes Int_t value to buffer.
Bool_t VerifyAttr(XMLNodePointer_t node, const char *name, const char *value, const char *errinfo=nullptr)
Checks, that attribute of specified name exists and has specified value.
virtual void WriteShort(Short_t s)
Writes Short_t value to buffer.
virtual void DecrementLevel(TVirtualStreamerInfo *)
Function is called from TStreamerInfo WriteBuffer and ReadBuffer functions and decrease level in xml ...
virtual void WriteUChar(UChar_t c)
Writes UChar_t value to buffer.
virtual void ReadCharStar(char *&s)
Read a char* string.
The TNamed class is the base class for all named ROOT classes.
void BeforeIOoperation()
Function is called before any IO operation of TBuffer Now is used to store version value if no proper...
virtual void ReadShort(Short_t &s)
Reads Short_t value from buffer.
Int_t AtoI(const char *sbuf, Int_t def=0, const char *errinfo=0)
converts string to integer.
virtual void WriteUShort(UShort_t s)
Writes UShort_t value to buffer.
virtual void ClassMember(const char *name, const char *typeName=nullptr, Int_t arrsize1=-1, Int_t arrsize2=-1)
Method indicates name and typename of class member, which should be now streamed in custom streamer...
virtual void WriteUInt(UInt_t i)
Writes UInt_t value to buffer.
XMLNsPointer_t NewNS(XMLNodePointer_t xmlnode, const char *reference, const char *name=0)
create namespace attribute for xmlnode.
int R__unzip_header(Int_t *nin, UChar_t *bufin, Int_t *lout)
void SetIOVersion(Int_t v)
virtual void ReadStdString(std::string *s)
Reads a std::string.
virtual void StreamObject(void *obj, const TClass *cl, const TClass *onFileClass=nullptr)
Stream object to/from buffer.
R__ALWAYS_INLINE void XmlWriteArrayContent(const T *arr, Int_t arrsize)
virtual void WriteCharP(const Char_t *c)
Writes array of characters to buffer.
TObject()
TObject constructor.
virtual void ReadULong64(ULong64_t &l)
Reads ULong64_t value from buffer.
virtual TClass * ReadClass(const TClass *cl=nullptr, UInt_t *objTag=nullptr)
Function to read class from buffer, used in old-style streamers.
virtual void ReadBool(Bool_t &b)
Reads Bool_t value from buffer.
const char * GetNodeName(XMLNodePointer_t xmlnode)
returns name of xmlnode
XMLNodePointer_t StackNode()
Return pointer on current xml node.
void Expand(Int_t newsize, Bool_t copy=kTRUE)
Expand (or shrink) the I/O buffer to newsize bytes.
ECompressionAlgorithm
The global settings depend on a global variable named R__ZipMode which can be modified by a global fu...
virtual void ReadUChar(UChar_t &c)
Reads UChar_t value from buffer.
Bool_t VerifyStackAttr(const char *name, const char *value, const char *errinfo=nullptr)
Checks stack attribute.
Int_t fIOVersion
! Indicates format of ROOT xml file
virtual void ReadUInt(UInt_t &i)
Reads UInt_t value from buffer.
const char * XmlGetElementName(const TStreamerElement *el)
return converted name for TStreamerElement
TClass * fExpectedBaseClass
! Pointer to class, which should be stored as parent of current
virtual void * ReadObjectAny(const TClass *clCast)
Read object from buffer. Only used from TBuffer.
void ShiftToNext(XMLNodePointer_t &xmlnode, Bool_t realnode=kTRUE)
shifts specified node to next if realnode==kTRUE, any special nodes in between will be skipped ...
TClass * GetClass() const
void SetXML(TXMLEngine *xml)
virtual void IncrementLevel(TVirtualStreamerInfo *)
Function is called from TStreamerInfo WriteBuffer and ReadBuffer functions and indent new level in xm...
virtual void MapObject(const TObject *obj, UInt_t offset=1)
Add object to the fMap container.
Basic data type descriptor (datatype information is obtained from CINT).
virtual Int_t WriteObjectAny(const void *obj, const TClass *ptrClass, Bool_t cacheReuse=kTRUE)
Write object to I/O buffer.
void * XmlReadObject(void *obj, TClass **cl=nullptr)
Read object from the buffer.
void WorkWithClass(TStreamerInfo *info, const TClass *cl=nullptr)
Prepares buffer to stream data of specified class.
TBufferXML()
Default constructor.
void Destructor(void *obj, Bool_t dtorOnly=kFALSE)
Explicitly call destructor for object.
virtual TVirtualStreamerInfo * GetInfo()
Return current streamer info element.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Int_t Size() const
Return size of object of this class.
virtual void ClassEnd(const TClass *)
Should be called at the end of custom streamer See TBufferXML::ClassBegin for more details...
virtual void GetMappedObject(UInt_t tag, void *&ptr, TClass *&ClassPtr) const
Retrieve the object stored in the buffer's object map at 'tag' Set ptr and ClassPtr respectively to t...
The ROOT global object gROOT contains a list of all defined classes.
static TString ConvertToXML(const TObject *obj, Bool_t GenericLayout=kFALSE, Bool_t UseNamespaces=kFALSE)
Converts object, inherited from TObject class, to XML string GenericLayout defines layout choice for ...
Int_t GetNextRefCounter()
Bool_t fCanUseCompact
! Flag indicate that basic type (like Int_t) can be placed in the same tag
Bool_t VerifyElemNode(const TStreamerElement *elem)
Checks if stack node correspond to TStreamerElement object.
Long_t Property() const
Set TObject::fBits and fStreamerType to cache information about the class.
void ExtractReference(XMLNodePointer_t node, const void *ptr, const TClass *cl)
Analyze if node has "ref" attribute and register it to object map.
void PerformPreProcessing(const TStreamerElement *elem, XMLNodePointer_t elemnode)
Function is unpack TObject and TString structures to be able read them from custom streamers of this ...
void Streamer(void *obj, TBuffer &b, const TClass *onfile_class=0) const
Bool_t IsUseNamespaces() const
void SkipEmpty(XMLNodePointer_t &xmlnode)
Skip all current empty nodes and locate on first "true" node.
static const char * ConvertDouble(Double_t v, char *buf, unsigned len, Bool_t not_optimize=kFALSE)
convert float to string with configured format
const char * XmlConvertClassName(const char *name)
convert class name to exclude any special symbols like ':', '<' '>' ',' and spaces ...
virtual void WriteFloat(Float_t f)
Writes Float_t value to buffer.
void CheckVersionBuf()
Checks buffer, filled by WriteVersion if next data is arriving, version should be stored in buffer...
Bool_t HasAttr(XMLNodePointer_t xmlnode, const char *name)
checks if node has attribute of specified name
static TObject * ConvertFromXML(const char *str, Bool_t GenericLayout=kFALSE, Bool_t UseNamespaces=kFALSE)
Read object from XML, produced by ConvertToXML() method.
virtual UInt_t WriteVersion(const TClass *cl, Bool_t useBcnt=kFALSE)
Copies class version to buffer, but not writes it to xml Version will be written with next I/O operat...
Version_t GetClassVersion() const
XMLAttrPointer_t NewAttr(XMLNodePointer_t xmlnode, XMLNsPointer_t, const char *name, const char *value)
creates new attribute for xmlnode, namespaces are not supported for attributes
Base class for text-based streamers like TBufferJSON or TBufferXML Special actions list will use meth...
virtual void ReadDouble(Double_t &d)
Reads Double_t value from buffer.
virtual void WriteArray(const Bool_t *b, Int_t n)
Write array of Bool_t to buffer.
Bool_t ExtractPointer(XMLNodePointer_t node, void *&ptr, TClass *&cl)
Searches for "ptr" attribute and returns pointer to object and class, if "ptr" attribute reference to...
const char * GetAttr(XMLNodePointer_t xmlnode, const char *name)
returns value of attribute for xmlnode
void SaveSingleNode(XMLNodePointer_t xmlnode, TString *res, Int_t layout=1)
convert single xmlnode (and its child node) to string if layout<=0, no any spaces or newlines will be...
virtual void ReadInt(Int_t &i)
Reads Int_t value from buffer.
virtual void ReadUShort(UShort_t &s)
Reads UShort_t value from buffer.
unsigned long long ULong64_t
Int_t IndexOf(const TObject *obj) const
virtual void ReadULong(ULong_t &l)
Reads ULong_t value from buffer.
TExMap * fMap
Map containing object,offset pairs for reading/writing.
static constexpr double s
Int_t GetCompressionLevel() const
const char * XmlClassNameSpaceRef(const TClass *cl)
produce string which used as reference in class namespace definition
virtual void ReadTString(TString &s)
Reads a TString.
virtual void WriteDouble(Double_t d)
Writes Double_t value to buffer.
static TClass * GetClass(const char *name, Bool_t load=kTRUE, Bool_t silent=kFALSE)
Static method returning pointer to TClass of the specified class name.
void FreeNode(XMLNodePointer_t xmlnode)
release all memory, allocated from this node and destroys node itself
void R__unzip(Int_t *nin, UChar_t *bufin, Int_t *lout, char *bufout, Int_t *nout)
virtual void WriteBool(Bool_t b)
Writes Bool_t value to buffer.
Mother of all ROOT objects.
TObjArray * GetElements() const
XMLNodePointer_t XmlWriteBasic(Char_t value)
Converts Char_t to string and add xml node to buffer.
R__ALWAYS_INLINE void XmlReadFastArray(T *arr, Int_t n)
Template method to read content of array, which not include size of array Also treated situation...
Bool_t IsTObject() const
Return kTRUE is the class inherits from TObject.
Class for serializing/deserializing object to/from xml.
virtual void ReadLong64(Long64_t &l)
Reads Long64_t value from buffer.
XMLNodePointer_t GetChild(XMLNodePointer_t xmlnode, Bool_t realnode=kTRUE)
returns first child of xmlnode
virtual void SetUseNamespaces(Bool_t iUseNamespaces=kTRUE)
Int_t fErrorFlag
! Error flag
Int_t GetIOVersion() const
Int_t GetCompressionAlgorithm() const
XMLNodePointer_t NewChild(XMLNodePointer_t parent, XMLNsPointer_t ns, const char *name, const char *content=0)
create new child element for parent node
static R__ALWAYS_INLINE ULong_t Void_Hash(const void *ptr)
Return hash value for provided object.
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
virtual void SkipObjectAny()
Skip any kind of object from buffer Actually skip only one node on current level of xml structure...
Int_t GetIntAttr(XMLNodePointer_t node, const char *name)
returns value of attribute as integer
virtual void WriteClass(const TClass *cl)
Function to write class into buffer, used in old-style streamers.
Int_t Atoi() const
Return integer value of string.
virtual void SetStreamerElementNumber(TStreamerElement *elem, Int_t comp_type)
Function is called from TStreamerInfo WriteBuffer and ReadBuffer functions and add/verify next elemen...
void SetBaseVersion(Int_t v)
TClass * XmlDefineClass(const char *xmlClassName)
define class for the converted class name, where special symbols were replaced by '_' ...
Undefined compression algorithm (must be kept the last of the list in case a new algorithm is added)...
void PerformPostProcessing()
Function is converts TObject and TString structures to more compact representation.
virtual void ReadChar(Char_t &c)
Reads Char_t value from buffer.
virtual void ClassBegin(const TClass *, Version_t=-1)
Should be called at the beginning of custom class streamer.
XMLNodePointer_t ReadSingleNode(const char *src)
read single xmlnode from provided string
virtual void ForceWriteInfo(TVirtualStreamerInfo *info, Bool_t force)
force writing the TStreamerInfo to the file
Abstract Interface class describing Streamer information for one class.
const char * ClassVersion
virtual void ReadFastArrayString(Char_t *c, Int_t n)
Read array of n characters from the I/O buffer.
virtual void SetXmlLayout(EXMLLayout layout)
void ShiftStack(const char *info=nullptr)
Shift stack node to next.
static constexpr double ns
virtual void ReadFloat(Float_t &f)
Reads Float_t value from buffer.
Long64_t GetObjectTag(const void *obj)
Returns tag for specified object from objects map (if exists) Returns 0 if object not included into o...
TXMLStackObj * PopStack()
Remove one level from xml stack.
void XmlReadBasic(Char_t &value)
Reads string from current xml node and convert it to Char_t value.
virtual void SetOnFileClass(const TClass *cl)
std::deque< TXMLStackObj * > fStack
! Stack of processed objects
static void * ConvertFromXMLAny(const char *str, TClass **cl=nullptr, Bool_t GenericLayout=kFALSE, Bool_t UseNamespaces=kFALSE)
Read object of any class from XML, produced by ConvertToXML() method.
R__ALWAYS_INLINE Int_t XmlReadArray(T *&arr, bool is_static=false)
Template method to read array with size attribute If necessary, array is created. ...
R__ALWAYS_INLINE void XmlWriteFastArray(const T *arr, Int_t n)
Write array without size attribute Also treat situation, when instead of one single array chain of se...
void Resize(Ssiz_t n)
Resize the string. Truncate or add blanks as necessary.
virtual void WriteObjectClass(const void *actualObjStart, const TClass *actualClass, Bool_t cacheReuse)
Write object to buffer. Only used from TBuffer.
const char * XmlReadValue(const char *name)
read string value from current stack node
void * XmlReadAny(XMLNodePointer_t node, void *obj, TClass **cl)
Recreate object from xml structure.
void * New(ENewType defConstructor=kClassNew, Bool_t quiet=kFALSE) const
Return a pointer to a newly allocated object of this class.
const char * Data() const