peiyongz    2003/03/09 08:53:27

  Modified:    c/src/xercesc/util/Platforms/FreeBSD
                        FreeBSDPlatformUtils.cpp
  Log:
  PanicHandler
  
  Revision  Changes    Path
  1.9       +7 -20     
xml-xerces/c/src/xercesc/util/Platforms/FreeBSD/FreeBSDPlatformUtils.cpp
  
  Index: FreeBSDPlatformUtils.cpp
  ===================================================================
  RCS file: 
/home/cvs/xml-xerces/c/src/xercesc/util/Platforms/FreeBSD/FreeBSDPlatformUtils.cpp,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- FreeBSDPlatformUtils.cpp  23 Feb 2003 04:36:55 -0000      1.8
  +++ FreeBSDPlatformUtils.cpp  9 Mar 2003 16:53:27 -0000       1.9
  @@ -56,6 +56,9 @@
   
   /*
    * $Log$
  + * Revision 1.9  2003/03/09 16:53:27  peiyongz
  + * PanicHandler
  + *
    * Revision 1.8  2003/02/23 04:36:55  jberry
    * Minor bug fixes to FreeBSD port
    *
  @@ -120,6 +123,7 @@
   #include    <xercesc/util/XMLString.hpp>
   #include    <xercesc/util/XMLUniDefs.hpp>
   #include    <xercesc/util/XMLUni.hpp>
  +#include    <xercesc/util/PanicHandler.hpp>
   
   #if defined(XML_USE_ICU_TRANSCODER)
       #include <xercesc/util/Transcoders/ICU/ICUTransService.hpp>
  @@ -182,7 +186,7 @@
   
       catch(...)
       {
  -        panic(XMLPlatformUtils::Panic_CantLoadMsgDomain);
  +        panic(PanicHandler::Panic_CantLoadMsgDomain);
       }
       return retVal;
   }
  @@ -212,27 +216,10 @@
   // ---------------------------------------------------------------------------
   //  XMLPlatformUtils: The panic method
   // ---------------------------------------------------------------------------
  -void XMLPlatformUtils::panic(const PanicReasons reason)
  +void XMLPlatformUtils::panic(const PanicHandler::PanicReasons reason)
   {
  -     const char* reasonStr = "Unknown reason";
  -    if (reason == Panic_NoTransService)
  -        reasonStr = "Could not load a transcoding service";
  -    else if (reason == Panic_NoDefTranscoder)
  -        reasonStr = "Could not load a local code page transcoder";
  -    else if (reason == Panic_CantFindLib)
  -        reasonStr = "Could not find the xerces-c DLL";
  -    else if (reason == Panic_UnknownMsgDomain)
  -        reasonStr = "Unknown message domain";
  -    else if (reason == Panic_CantLoadMsgDomain)
  -        reasonStr = "Cannot load message domain";
  -    else if (reason == Panic_SynchronizationErr)
  -        reasonStr = "Cannot synchronize system or mutex";
  -    else if (reason == Panic_SystemInit)
  -        reasonStr = "Cannot initialize the system or mutex";
  -
  -    fprintf(stderr, "%s\n", reasonStr);
  +    fgUserPanicHandler? fgUserPanicHandler->panic(reason) : 
fgDefaultPanicHandler->panic(reason);
   
  -    exit(-1);
   }
   
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to