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

ConfigSax2ContentHandler.cpp

gehe zur Dokumentation dieser Datei
00001 // Copyright (C) 2004 Bernhard Assmann <bernie@tuxomania.net>
00002 //  
00003 // This program is free software; you can redistribute it and/or modify
00004 // it under the terms of the GNU General Public License as published by
00005 // the Free Software Foundation; either version 2 of the License, or
00006 // (at your option) any later version.
00007 //  
00008 // This program is distributed in the hope that it will be useful,
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00011 // GNU General Public License for more details.
00012 //  
00013 // You should have received a copy of the GNU General Public License
00014 // along with this program; if not, write to the Free Software
00015 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00016 //  
00017 
00018 #include <xercesc/util/XMLString.hpp>
00019 #include <xercesc/sax/Locator.hpp>
00020 
00021 #include <map>
00022 #include <string>
00023 
00024 #include "psfa/ConfigSax2ContentHandler.hpp"
00025 #include "psfa/Helper.hpp"
00026 
00027 
00028 
00029 psfa::ConfigSax2ContentHandler::ConfigSax2ContentHandler(std::map<
00030                       std::string,
00031                       std::string >& data )
00032   : mode_(start),
00033     data_(data),
00034     pool_(""),
00035     key_("")
00036 {
00037   
00038 }
00039 
00040 
00041 
00042 void 
00043 psfa::ConfigSax2ContentHandler::characters( const XMLCh* const chars,
00044                    const unsigned int length ) 
00045 {
00046   using psfahelper::stripWhiteSpace;
00047   
00048   std::string tmp( chars, chars + length );
00049   tmp = stripWhiteSpace(tmp);
00050   if( tmp == "" ) {
00051     return;
00052   }
00053   switch( mode_ ) {
00054   case poolName:
00055     pool_ = tmp;
00056     break;
00057   case key:
00058     key_ = pool_ + "_" + tmp;
00059     break;
00060   case value:
00061     {
00062       typedef std::map< std::string, std::string > cMap;
00063       cMap::value_type i( key_, tmp );
00064       data_.insert( i );
00065     }
00066     break;
00067   default:
00068     break;
00069   }
00070   return;
00071 }
00072 
00073 
00074 
00075 void 
00076 psfa::ConfigSax2ContentHandler::endDocument() 
00077 {
00078 
00079 }
00080 
00081 
00082 
00083 void 
00084 psfa::ConfigSax2ContentHandler::endElement( const XMLCh* const,
00085                    const XMLCh* const,
00086                    const XMLCh* const ) 
00087 {
00088 
00089 }
00090 
00091 
00092 
00093 void 
00094 psfa::ConfigSax2ContentHandler::ignorableWhitespace( const XMLCh* const,
00095                        const unsigned int )
00096 {
00097 
00098 }
00099 
00100 
00101     
00102 void 
00103 psfa::ConfigSax2ContentHandler::processingInstruction( const XMLCh* const,
00104                          const XMLCh* const ) 
00105 {
00106     
00107 }
00108 
00109 
00110 
00111 void 
00112 psfa::ConfigSax2ContentHandler::setDocumentLocator ( const xercesc::Locator* ) 
00113 {
00114 
00115 }
00116 
00117 
00118     
00119 void 
00120 psfa::ConfigSax2ContentHandler::startDocument() 
00121 {
00122     
00123 }
00124 
00125 
00126     
00127 void 
00128 psfa::ConfigSax2ContentHandler::startElement( const XMLCh* const,
00129                      const XMLCh* const,
00130                      const XMLCh* const qname,
00131                      const xercesc::Attributes& ) 
00132 {
00133   using psfahelper::getXMLChLength;
00134   using std::string;
00135   
00136   const string::size_type s = getXMLChLength( qname );
00137   const string tag( qname, qname + s );
00138 
00139   if( tag == "name" ) {
00140     mode_ = poolName;
00141   }
00142   else if ( tag == "key" ) {
00143     mode_ = key;
00144   }
00145   else if ( tag == "value" ) {
00146     mode_ = value;
00147   }
00148   return;
00149 }
00150 
00151 
00152     
00153 void 
00154 psfa::ConfigSax2ContentHandler::startPrefixMapping( const XMLCh* const,
00155                       const XMLCh* const ) 
00156 {
00157     
00158 }
00159 
00160     
00161 
00162 void
00163 psfa::ConfigSax2ContentHandler::endPrefixMapping( const XMLCh* const ) 
00164 {
00165     
00166     
00167 }
00168 
00169    
00170     
00171 void 
00172 psfa::ConfigSax2ContentHandler::skippedEntity( const XMLCh* const ) 
00173 {
00174     
00175 }

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