AliXMLParser (Harsh)
[u/mrichter/AliRoot.git] / ANALYSIS / AliXMLParser.h
CommitLineData
b5d4146b 1/*
2Author : Harsh Arora (harsh.arora@cern.ch)
3
4
5AliXMLParser
6---------
7
8AliXMLParser is a tool to parse XML file and store it in trees
9
10*/
11
12#ifndef ALIXMLPARSER_H
13#define ALIXMLPARSER_H
14
15#ifndef ROOT_TList
16#include <TList.h>
17#endif
18
19#ifndef ROOT_TSAXParser
20#include <TSAXParser.h>
21#endif
22
23#ifndef ROOT_TXMLAttr
24#include <TXMLAttr.h>
25#endif
26
27#ifndef ROOT_TString
28#include <TString.h>
29#endif
30
31class AliXMLParser {
32public:
33 AliXMLParser();
34 AliXMLParser(const AliXMLParser& obj);
35 virtual ~AliXMLParser();
36 TList* GetTreesFromXML(TString file);
37 TList* GetTreesFromURL(TString host);
38
39// -------------- Slot Functions -----------
40 void OnStartDocument();
41 void OnEndDocument();
42 void OnStartElement(const char*, const TList*);
43 void OnEndElement(const char*);
44 void OnCharacters(const char*);
45 void OnComment(const char*);
46 void OnWarning(const char*);
47 void OnError(const char*);
48 void OnFatalError(const char*);
49 void OnCdataBlock(const char*, Int_t);
50// -----------------------------------------
51
52private:
53
54 int GetEntryIndex(TString entry_name); //Reverse search for index of entry by name
55 TList* fTreeList; //List of Trees made from tables
56 TString fTableTag; //Identifier for new table
57 Bool_t fInsideTree; //True if table_tag is identified
58 Int_t fNumTokens; //Number of Attributes
59 TList* fEntries; //List of Entries in a table
60 TList* fVal; //Corresponding values of Entries in a Table
61 Int_t fNumTrees; //Number of Trees
62 Bool_t fError; //True if error in XML is encountered
63
64 ClassDef(AliXMLParser,0);
65
66 AliXMLParser& operator=(const AliXMLParser& other);
67};
68
69#endif