XmlOdb.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef INCLUDE_XmlOdb_H
00011 #define INCLUDE_XmlOdb_H
00012
00013 #include <stdlib.h>
00014 #include "TXMLNode.h"
00015 #include "TXMLAttr.h"
00016 #include "TDOMParser.h"
00017 #include "rootana_stdint.h"
00018
00019 #include "VirtualOdb.h"
00020
00021
00022
00023 struct XmlOdb : VirtualOdb
00024 {
00025 TDOMParser* fParser;
00026 TXMLNode* fOdb;
00027
00028
00029 XmlOdb(const char*buf,int bufLength);
00030
00031
00032 XmlOdb(const char* filename);
00033
00034
00035 virtual ~XmlOdb();
00036
00037
00038 TXMLNode* FindNode(TXMLNode*node,const char*name);
00039
00040
00041 void DumpTree(TXMLNode*node = NULL, int level = 0);
00042
00043
00044 void DumpDirTree(TXMLNode*node = NULL, int level = 0);
00045
00046
00047 const char* GetAttrValue(TXMLNode*node,const char*attrName);
00048
00049
00050 TXMLNode* FindPath(TXMLNode*node,const char* path);
00051
00052
00053 TXMLNode* FindArrayPath(TXMLNode*node,const char* path,const char* type,int index);
00054
00055 int odbReadAny( const char*name, int index, int tid,void* buf, int bufsize=0);
00056 int odbReadInt( const char*name, int index, int defaultValue);
00057 uint32_t odbReadUint32(const char*name, int index, uint32_t defaultValue);
00058 bool odbReadBool( const char*name, int index, bool defaultValue);
00059 double odbReadDouble(const char*name, int index, double defaultValue);
00060 float odbReadFloat(const char*name, int index, float defaultValue);
00061 const char* odbReadString(const char*name, int index, const char* defaultValue);
00062 int odbReadArraySize(const char*name);
00063 };
00064
00065 #endif
00066