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&) = delete;
33 TSAXParser& operator=(const TSAXParser&) = delete;
34
35public:
36 TSAXParser();
37 ~TSAXParser() override;
38
39 Int_t ParseFile(const char *filename) override;
40 Int_t ParseBuffer(const char *contents, Int_t len) override;
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 ClassDefOverride(TSAXParser,0); // SAX Parser
56};
57
58#endif
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t UChar_t len
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t attr
Option_t Option_t TPoint TPoint const char text
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 Parse()
This function parses the xml file, by initializing the parser and checks whether the parse context is...
TSAXParser & operator=(const TSAXParser &)=delete
virtual Int_t OnFatalError(const char *text)
Emit a signal for OnFactalError, where text is the error and it returns the Parse Error Code,...
virtual void OnCharacters(const char *characters)
Emit a signal for OnCharacters, where characters are the characters outside of tags.
TSAXParser(const TSAXParser &)=delete
TSAXParser()
Create SAX parser.
Int_t ParseBuffer(const char *contents, Int_t len) override
It parse the contents, instead of a file.
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.
~TSAXParser() override
TSAXParser desctructor.
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.
Int_t ParseFile(const char *filename) override
It creates the parse context of the xml file, where the xml file name is filename.
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