#include <Parser.h>
Public Member Functions | |
| Parser () | |
| ~Parser () | |
| void | ParseFile (const char *filename) |
| void | ParseText (const char *text) |
Static Public Member Functions | |
| const char * | GetCurrentSource () |
Private Attributes | |
| SAX2XMLReader * | fParser |
| SAX2 parser. | |
| DefaultHandler * | fHandler |
| Handler for start and end element events. | |
Static Private Attributes | |
| std::string | fSource = "" |
| XML source which is being parsed. | |
| int | fCount = 0 |
| Object count for this class. | |
Definition at line 16 of file Parser.h.
|
|
Definition at line 29 of file Parser.cxx. References fCount, fHandler, and fParser.
00029 : 00030 fParser(0), 00031 fHandler(0) 00032 { 00033 //====================================================================== 00034 // Create parser. If this is the first one created, initialize xercesc. 00035 //====================================================================== 00036 ++fCount; 00037 00038 if (fCount<=1) XMLPlatformUtils::Initialize(); 00039 00040 fParser = XMLReaderFactory::createXMLReader(); 00041 00042 fParser->setFeature(XMLUni::fgSAX2CoreValidation, true); 00043 fParser->setFeature(XMLUni::fgSAX2CoreNameSpaces, true); 00044 00045 fHandler = new xmli::SAX2DefaultHandler(); 00046 00047 fParser->setContentHandler(fHandler); 00048 } |
|
|
Definition at line 52 of file Parser.cxx. References fCount, fHandler, and fParser.
00053 {
00054 //======================================================================
00055 // Delete parser. If there are no parsers left, shutdown xercesc.
00056 //======================================================================
00057 --fCount;
00058
00059 if (fParser) { delete fParser; fParser = 0; }
00060 if (fHandler) { delete fHandler; fHandler = 0; }
00061
00062 if (fCount==0) XMLPlatformUtils::Terminate();
00063 }
|
|
|
Definition at line 18 of file Parser.cxx. References fSource. Referenced by cfg::configBuilder::Build(), xmli::SAX2Handler::EndElement(), and xmli::SAX2Handler::~SAX2Handler().
00019 {
00020 //======================================================================
00023 //======================================================================
00024 return fSource.c_str();
00025 }
|
|
|
Definition at line 84 of file Parser.cxx. References fParser, and fSource. Referenced by main(), and xmli::ReadFile().
|
|
|
Definition at line 67 of file Parser.cxx. References fParser, and fSource. Referenced by xmli::ReadString().
|
|
|
Object count for this class.
Definition at line 14 of file Parser.cxx. |
|
|
Handler for start and end element events.
|
|
|
SAX2 parser.
Definition at line 30 of file Parser.h. Referenced by ParseFile(), Parser(), ParseText(), and ~Parser(). |
|
|
XML source which is being parsed.
Definition at line 13 of file Parser.cxx. Referenced by GetCurrentSource(), ParseFile(), and ParseText(). |
1.3.5