"Fossies" - the Fresh Open Source Software Archive

Member "OpenSP-1.5.2/lib/DtdDeclEventHandler.cxx" (21 Jul 2005, 1048 Bytes) of package /linux/misc/old/OpenSP-1.5.2.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "DtdDeclEventHandler.cxx" see the Fossies "Dox" file reference documentation.

    1 // Copyright (c) 1999 Matthias Clasen
    2 // See the file COPYING for copying permission.
    3 
    4 #include "splib.h"
    5 #include "DtdDeclEventHandler.h"
    6 #include "macros.h"
    7 
    8 #ifdef SP_NAMESPACE
    9 namespace SP_NAMESPACE {
   10 #endif
   11   
   12 DtdDeclEventHandler::DtdDeclEventHandler(const StringC &pubid)
   13 : pubid_(pubid), match_(0)
   14 {
   15 }
   16 
   17 void DtdDeclEventHandler::message(MessageEvent *event)
   18 {
   19   switch (event->message().type->severity()) {
   20   case MessageType::quantityError:
   21   case MessageType::error:
   22   case MessageType::idrefError:
   23     delete event;
   24     cancel();
   25     break;
   26   case MessageType::info:
   27   case MessageType::warning:
   28     delete event;
   29     break;
   30   }
   31 }
   32 
   33 void DtdDeclEventHandler::startDtd(StartDtdEvent *event)
   34 {
   35   const Entity *entity = event->entity().pointer();
   36   if (entity) {
   37     const StringC *pubid = 
   38       entity->asExternalEntity()->externalId().publicIdString();
   39     if (pubid && pubid_ == *pubid) 
   40       match_ = 1;
   41   }
   42   delete event;
   43   cancel();
   44 }
   45 
   46 Boolean DtdDeclEventHandler::match() const
   47 {
   48   return match_;
   49 }
   50 
   51 #ifdef SP_NAMESPACE
   52 }
   53 #endif
   54 
   55 
   56