Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TSAXParser.h
Go to the documentation of this file.
1// @(#)root/xmlparser:$Id$
2// Author: Jose Lo 12/1/2005
3
4/*************************************************************************
5 * Copyright (C) 1995-2005, 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_TSAXParser
13#define ROOT_TSAXParser
14
15#include "TXMLParser.h"
16
17
18class TList;
20struct _xmlSAXHandler;
21
22
23class TSAXParser : public TXMLParser {
24
25friend class TSAXParserCallback;
26
27private:
28 _xmlSAXHandler *fSAXHandler; ///< libxml2 SAX handler
29
30 virtual Int_t Parse();
31
32 TSAXParser(const TSAXParser&); // Not implemented
33 TSAXParser& operator=(const TSAXParser&); // Not implemented
34
35public:
36 TSAXParser();
37 virtual ~TSAXParser();
38
39 virtual Int_t ParseFile(const char *filename);
40 virtual Int_t ParseBuffer(const char *contents, Int_t len);
41
42 virtual void OnStartDocument(); //*SIGNAL*
43 virtual void OnEndDocument(); //*SIGNAL*
44 virtual void OnStartElement(const char *name, const TList *attr); //*SIGNAL*
45 virtual void OnEndElement(const char *name); //*SIGNAL*
46 virtual void OnCharacters(const char *characters); //*SIGNAL*
47 virtual void OnComment(const char *text); //*SIGNAL*
48 virtual void OnWarning(const char *text); //*SIGNAL*
49 virtual Int_t OnError(const char *text); //*SIGNAL*
50 virtual Int_t OnFatalError(const char *text); //*SIGNAL*
51 virtual void OnCdataBlock(const char *text, Int_t len); //*SIGNAL*
52
53 virtual void ConnectToHandler(const char *handlerName, void *handler);
54
55 ClassDef(TSAXParser,0); // SAX Parser
56};
57
58#endif
#define ClassDef(name, id)
Definition Rtypes.h:325
char name[80]
Definition TGX11.cxx:110
A doubly linked list.
Definition TList.h:38
TSAXParser is a subclass of TXMLParser, it is a wraper class to libxml library.
Definition TSAXParser.h:23
virtual void OnWarning(const char *text)
Emit a signal for OnWarning, where text is the warning.
virtual void OnCdataBlock(const char *text, Int_t len)
Emit a signal for OnCdataBlock.
virtual Int_t ParseBuffer(const char *contents, Int_t len)
It parse the contents, instead of a file.
virtual Int_t Parse()
This function parses the xml file, by initializing the parser and checks whether the parse context is...
virtual ~TSAXParser()
TSAXParser desctructor.
virtual Int_t OnFatalError(const char *text)
Emit a signal for OnFactalError, where text is the error and it returns the Parse Error Code,...
TSAXParser & operator=(const TSAXParser &)
TSAXParser(const TSAXParser &)
virtual Int_t ParseFile(const char *filename)
It creates the parse context of the xml file, where the xml file name is filename.
virtual void OnCharacters(const char *characters)
Emit a signal for OnCharacters, where characters are the characters outside of tags.
TSAXParser()
Create SAX parser.
virtual void OnComment(const char *text)
Emit a signal for OnComment, where text is the comment.
virtual void OnStartElement(const char *name, const TList *attr)
Emit a signal for OnStarElement, where name is the Element's name and attribute is a TList of (TObjSt...
virtual void OnEndDocument()
Emit a signal for OnEndDocument.
virtual void ConnectToHandler(const char *handlerName, void *handler)
A default TSAXParser to a user-defined Handler connection function.
virtual void OnStartDocument()
Emit a signal for OnStartDocument.
virtual void OnEndElement(const char *name)
Emit a signal for OnEndElement, where name is the Element's name.
virtual Int_t OnError(const char *text)
Emit a signal for OnError, where text is the error and it returns the Parse Error Code,...
_xmlSAXHandler * fSAXHandler
libxml2 SAX handler
Definition TSAXParser.h:28
TXMLParser is an abstract class which interfaces with Libxml2.
Definition TXMLParser.h:24
TText * text