Hauptseite | Liste aller Namensbereiche | Klassenhierarchie | Übersicht | Auflistung der Dateien | Elemente eines Namensbereiches | Datenstruktur-Elemente | Datei-Elemente

UnitSax2ContentHandler.hpp

gehe zur Dokumentation dieser Datei
00001 #ifndef PSFA_UNIT_SAX2_CONTENT_HANDLER_HPP
00002 #define PSFA_UNIT_SAX2_CONTENT_HANDLER_HPP
00003 // Copyright (C) 2004 Bernhard Assmann <bernie@tuxomania.net>
00004 //  
00005 // This program is free software; you can redistribute it and/or modify
00006 // it under the terms of the GNU General Public License as published by
00007 // the Free Software Foundation; either version 2 of the License, or
00008 // (at your option) any later version.
00009 //  
00010 // This program is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 // GNU General Public License for more details.
00014 //  
00015 // You should have received a copy of the GNU General Public License
00016 // along with this program; if not, write to the Free Software
00017 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00018 //  
00019 
00020 #include <xercesc/sax2/Attributes.hpp>
00021 #include <xercesc/sax2/ContentHandler.hpp>
00022 
00023 #include <string>
00024 #include <vector>
00025 
00026 #include "psfa/IndexData.hpp"
00027 
00028 namespace psfa 
00029 {
00030 
00037   class UnitSax2ContentHandler : public xercesc::ContentHandler
00038   {
00039   public:
00046     UnitSax2ContentHandler( const std::string pool,
00047              std::vector< IndexData_SP >& dataList );
00048     
00049     ~UnitSax2ContentHandler();
00050     
00051     virtual void 
00052     characters( const XMLCh* const chars,
00053       const unsigned int length );
00054     
00055     virtual void 
00056     endDocument();
00057     
00058     virtual void 
00059     endElement( const XMLCh* const uri,
00060       const XMLCh* const localname,
00061       const XMLCh* const qname );
00062         
00063     virtual void 
00064     ignorableWhitespace( const XMLCh* const chars,
00065           const unsigned int length );
00066     
00067     virtual void 
00068     processingInstruction( const XMLCh* const target,
00069             const XMLCh* const data );
00070     
00071     virtual void 
00072     setDocumentLocator (const xercesc::Locator* locator );
00073     
00074     virtual void 
00075     startDocument();
00076     
00077     virtual void 
00078     startElement( const XMLCh* const uri,
00079         const XMLCh* const localname,
00080         const XMLCh* const qname,
00081         const xercesc::Attributes& attrs );
00082     
00083     virtual void 
00084     startPrefixMapping( const XMLCh* const prefix,
00085          const XMLCh* const uri );
00086     
00087     virtual void
00088     endPrefixMapping( const XMLCh* const prefix );
00089     
00090     
00091     virtual void 
00092     skippedEntity( const XMLCh* const name );
00093     
00094     void
00095     setFileName( const std::string name );
00096     
00097     
00098   private:
00099 
00104     enum Mode { start,     
00106       unit,    
00107       index    
00108     };
00109 
00110     Mode mode_;         
00112     const xercesc::Locator* locator_; 
00114     std::string pool_;     
00116     std::string aktFile_;  
00118     std::string aktUnit_;  
00120     std::string aktKontext_;  
00122     std::vector< IndexData_SP >& dataList_; 
00125     std::vector<std::string> tagNames_;   
00127     std::vector<std::string> kontextNames_; 
00129     std::string unitTag_;  
00132     IndexData_SP indexData_;  
00133   };
00134 }
00135 #endif

Erzeugt am Mon Jul 12 11:45:04 2004 für PSFA von doxygen 1.3.4