Logo ROOT   6.08/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 #ifndef ROOT_TXMLParser
16 #include "TXMLParser.h"
17 #endif
18 
19 
20 class TList;
21 class TSAXParserCallback;
22 struct _xmlSAXHandler;
23 
24 
25 class TSAXParser : public TXMLParser {
26 
27 friend class TSAXParserCallback;
28 
29 private:
30  _xmlSAXHandler *fSAXHandler; ///< libxml2 SAX handler
31 
32  virtual Int_t Parse();
33 
34  TSAXParser(const TSAXParser&); // Not implemented
35  TSAXParser& operator=(const TSAXParser&); // Not implemented
36 
37 public:
38  TSAXParser();
39  virtual ~TSAXParser();
40 
41  virtual Int_t ParseFile(const char *filename);
42  virtual Int_t ParseBuffer(const char *contents, Int_t len);
43 
44  virtual void OnStartDocument(); //*SIGNAL*
45  virtual void OnEndDocument(); //*SIGNAL*
46  virtual void OnStartElement(const char *name, const TList *attr); //*SIGNAL*
47  virtual void OnEndElement(const char *name); //*SIGNAL*
48  virtual void OnCharacters(const char *characters); //*SIGNAL*
49  virtual void OnComment(const char *text); //*SIGNAL*
50  virtual void OnWarning(const char *text); //*SIGNAL*
51  virtual Int_t OnError(const char *text); //*SIGNAL*
52  virtual Int_t OnFatalError(const char *text); //*SIGNAL*
53  virtual void OnCdataBlock(const char *text, Int_t len); //*SIGNAL*
54 
55  virtual void ConnectToHandler(const char *handlerName, void *handler);
56 
57  ClassDef(TSAXParser,0); // SAX Parser
58 };
59 
60 #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:30
TSAXParser is a subclass of TXMLParser, it is a wraper class to libxml library.
Definition: TSAXParser.h:25
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:254
virtual ~TSAXParser()
TSAXParser desctructor.
Definition: TSAXParser.cxx:97
friend class TSAXParserCallback
Definition: TSAXParser.h:27
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:47
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:30
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