Logo ROOT   6.12/07
Reference Guide
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 
18 class TList;
19 class TSAXParserCallback;
20 struct _xmlSAXHandler;
21 
22 
23 class TSAXParser : public TXMLParser {
24 
25 friend class TSAXParserCallback;
26 
27 private:
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 
35 public:
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
virtual void OnComment(const char *text)
Emit a signal for OnComment, where text is the comment.
Definition: TSAXParser.cxx:155
virtual Int_t ParseBuffer(const char *contents, Int_t len)
It parse the contents, instead of a file.
Definition: TSAXParser.cxx:253
_xmlSAXHandler * fSAXHandler
libxml2 SAX handler
Definition: TSAXParser.h:28
TSAXParser is a subclass of TXMLParser, it is a wraper class to libxml library.
Definition: TSAXParser.h:23
virtual void OnStartDocument()
Emit a signal for OnStartDocument.
Definition: TSAXParser.cxx:107
int Int_t
Definition: RtypesCore.h:41
virtual void OnWarning(const char *text)
Emit a signal for OnWarning, where text is the warning.
Definition: TSAXParser.cxx:163
virtual Int_t OnError(const char *text)
Emit a signal for OnError, where text is the error and it returns the Parse Error Code...
Definition: TSAXParser.cxx:172
#define ClassDef(name, id)
Definition: Rtypes.h:320
virtual ~TSAXParser()
TSAXParser desctructor.
Definition: TSAXParser.cxx:97
friend class TSAXParserCallback
Definition: TSAXParser.h:25
virtual void OnEndElement(const char *name)
Emit a signal for OnEndElement, where name is the Element&#39;s name.
Definition: TSAXParser.cxx:138
A doubly linked list.
Definition: TList.h:44
TSAXParser & operator=(const TSAXParser &)
virtual Int_t Parse()
This function parses the xml file, by initializing the parser and checks whether the parse context is...
Definition: TSAXParser.cxx:206
virtual void OnEndDocument()
Emit a signal for OnEndDocument.
Definition: TSAXParser.cxx:115
TXMLParser is an abstract class which interfaces with Libxml2.
Definition: TXMLParser.h:24
TSAXParser()
Create SAX parser.
Definition: TSAXParser.cxx:67
virtual void OnCdataBlock(const char *text, Int_t len)
Emit a signal for OnCdataBlock.
Definition: TSAXParser.cxx:191
TText * text
virtual void ConnectToHandler(const char *handlerName, void *handler)
A default TSAXParser to a user-defined Handler connection function.
Definition: TSAXParser.cxx:441
virtual void OnCharacters(const char *characters)
Emit a signal for OnCharacters, where characters are the characters outside of tags.
Definition: TSAXParser.cxx:147
virtual Int_t OnFatalError(const char *text)
Emit a signal for OnFactalError, where text is the error and it returns the Parse Error Code...
Definition: TSAXParser.cxx:182
virtual void OnStartElement(const char *name, const TList *attr)
Emit a signal for OnStarElement, where name is the Element&#39;s name and attribute is a TList of (TObjSt...
Definition: TSAXParser.cxx:126
char name[80]
Definition: TGX11.cxx:109
virtual Int_t ParseFile(const char *filename)
It creates the parse context of the xml file, where the xml file name is filename.
Definition: TSAXParser.cxx:236