]> granicus.if.org Git - imagemagick/commitdiff
Code cleanup.
authordirk <dirk@git.imagemagick.org>
Sat, 3 May 2014 15:24:13 +0000 (15:24 +0000)
committerdirk <dirk@git.imagemagick.org>
Sat, 3 May 2014 15:24:13 +0000 (15:24 +0000)
Magick++/lib/Exception.cpp
Magick++/lib/Magick++/Exception.h

index 67c1afb997eb0e6d06d4b156402da3b7d5df6f6a..647fad2009707a8b2754c9f906d95054d2b8d2e2 100644 (file)
@@ -17,547 +17,534 @@ using namespace std;
 
 #include "Magick++/Exception.h"
 
-// Construct with message string
-Magick::Exception::Exception( const std::string& what_ )
+Magick::Exception::Exception(const std::string& what_)
   : std::exception(),
     _what(what_)
 {
 }
 
-// Copy constructor
-Magick::Exception::Exception( const Magick::Exception& original_ )
+Magick::Exception::Exception(const Magick::Exception& original_)
   : exception(original_),
     _what(original_._what)
 {
 }
 
-// Assignment operator
-Magick::Exception& Magick::Exception::operator= (const Magick::Exception& original_ )
+Magick::Exception::~Exception() throw()
 {
-  if(this != &original_)
-    {
-      this->_what = original_._what;
-    }
-  return *this;
 }
 
-// Return message string
-/*virtual*/ const char* Magick::Exception::what( ) const throw()
+Magick::Exception& Magick::Exception::operator=(
+  const Magick::Exception& original_)
 {
-  return _what.c_str();
+  if(this != &original_)
+    this->_what=original_._what;
+  return(*this);
 }
 
-/* Destructor */
-/*virtual*/ Magick::Exception::~Exception ( ) throw ()
+const char* Magick::Exception::what() const throw()
 {
+  return(_what.c_str());
 }
 
-//
-// Warnings
-//
-
-Magick::Warning::Warning ( const std::string& what_ )
+Magick::Error::Error(const std::string& what_)
   : Exception(what_)
 {
 }
 
-/*virtual*/ Magick::Warning::~Warning ( ) throw ()
+Magick::Error::~Error() throw()
 {
 }
 
-Magick::WarningUndefined::WarningUndefined ( const std::string& what_ )
-  : Warning(what_)
+Magick::ErrorBlob::ErrorBlob(const std::string& what_)
+  : Error(what_)
 {
 }
 
-/*virtual*/ Magick::WarningUndefined::~WarningUndefined ( ) throw ()
+Magick::ErrorBlob::~ErrorBlob() throw()
 {
 }
 
-Magick::WarningBlob::WarningBlob ( const std::string& what_ )
-  : Warning(what_)
+Magick::ErrorCache::ErrorCache(const std::string& what_)
+  : Error(what_)
 {
 }
 
-/*virtual*/ Magick::WarningBlob::~WarningBlob ( ) throw ()
+Magick::ErrorCache::~ErrorCache() throw()
 {
 }
 
-Magick::WarningCache::WarningCache ( const std::string& what_ )
-  : Warning(what_)
+Magick::ErrorCoder::ErrorCoder(const std::string& what_)
+  : Error(what_)
 {
 }
 
-/*virtual*/ Magick::WarningCache::~WarningCache ( ) throw ()
+Magick::ErrorCoder::~ErrorCoder() throw()
 {
 }
 
-Magick::WarningCoder::WarningCoder ( const std::string& what_ )
-  : Warning(what_)
+Magick::ErrorConfigure::ErrorConfigure(const std::string& what_)
+  : Error(what_)
 {
 }
 
-/*virtual*/ Magick::WarningCoder::~WarningCoder ( ) throw ()
+Magick::ErrorConfigure::~ErrorConfigure() throw()
 {
 }
 
-Magick::WarningConfigure::WarningConfigure ( const std::string& what_ )
-  : Warning(what_)
+Magick::ErrorCorruptImage::ErrorCorruptImage(const std::string& what_)
+  : Error(what_)
 {
 }
 
-/*virtual*/ Magick::WarningConfigure::~WarningConfigure ( ) throw ()
+Magick::ErrorCorruptImage::~ErrorCorruptImage() throw()
 {
 }
 
-Magick::WarningCorruptImage::WarningCorruptImage ( const std::string& what_ )
-  : Warning(what_)
+Magick::ErrorDelegate::ErrorDelegate(const std::string& what_)
+  : Error(what_)
 {
 }
 
-/*virtual*/ Magick::WarningCorruptImage::~WarningCorruptImage ( ) throw ()
+Magick::ErrorDelegate::~ErrorDelegate()throw()
 {
 }
 
-Magick::WarningDelegate::WarningDelegate ( const std::string& what_ )
-  : Warning(what_)
+Magick::ErrorDraw::ErrorDraw(const std::string& what_)
+  : Error(what_)
 {
 }
 
-/*virtual*/ Magick::WarningDelegate::~WarningDelegate ( ) throw ()
+Magick::ErrorDraw::~ErrorDraw() throw()
 {
 }
 
-Magick::WarningDraw::WarningDraw ( const std::string& what_ )
-  : Warning(what_)
+Magick::ErrorFileOpen::ErrorFileOpen(const std::string& what_)
+  : Error(what_)
 {
 }
 
-/*virtual*/ Magick::WarningDraw::~WarningDraw ( ) throw ()
+Magick::ErrorFileOpen::~ErrorFileOpen() throw()
 {
 }
 
-Magick::WarningFileOpen::WarningFileOpen ( const std::string& what_ )
-  : Warning(what_)
+Magick::ErrorImage::ErrorImage(const std::string& what_)
+  : Error(what_)
 {
 }
 
-/*virtual*/ Magick::WarningFileOpen::~WarningFileOpen ( ) throw ()
+Magick::ErrorImage::~ErrorImage() throw()
 {
 }
 
-Magick::WarningImage::WarningImage ( const std::string& what_ )
-  : Warning(what_)
+Magick::ErrorMissingDelegate::ErrorMissingDelegate(const std::string& what_)
+  : Error(what_)
 {
 }
 
-/*virtual*/ Magick::WarningImage::~WarningImage ( ) throw ()
+Magick::ErrorMissingDelegate::~ErrorMissingDelegate() throw ()
 {
 }
 
-Magick::WarningMissingDelegate::WarningMissingDelegate ( const std::string& what_ )
-  : Warning(what_)
+Magick::ErrorModule::ErrorModule(const std::string& what_)
+  : Error(what_)
 {
 }
 
-/*virtual*/ Magick::WarningMissingDelegate::~WarningMissingDelegate ( ) throw ()
+Magick::ErrorModule::~ErrorModule() throw()
 {
 }
 
-Magick::WarningModule::WarningModule ( const std::string& what_ )
-  : Warning(what_)
+Magick::ErrorMonitor::ErrorMonitor(const std::string& what_)
+  : Error(what_)
 {
 }
 
-/*virtual*/ Magick::WarningModule::~WarningModule ( ) throw ()
+Magick::ErrorMonitor::~ErrorMonitor() throw()
 {
 }
 
-Magick::WarningMonitor::WarningMonitor ( const std::string& what_ )
-  : Warning(what_)
+Magick::ErrorOption::ErrorOption(const std::string& what_)
+  : Error(what_)
 {
 }
 
-/*virtual*/ Magick::WarningMonitor::~WarningMonitor ( ) throw ()
+Magick::ErrorOption::~ErrorOption() throw()
 {
 }
 
-Magick::WarningOption::WarningOption ( const std::string& what_ )
-  : Warning(what_)
+Magick::ErrorRegistry::ErrorRegistry(const std::string& what_)
+  : Error(what_)
 {
 }
 
-/*virtual*/ Magick::WarningOption::~WarningOption ( ) throw ()
+Magick::ErrorRegistry::~ErrorRegistry() throw()
 {
 }
 
-Magick::WarningRegistry::WarningRegistry ( const std::string& what_ )
-  : Warning(what_)
+Magick::ErrorResourceLimit::ErrorResourceLimit(const std::string& what_)
+  : Error(what_)
 {
 }
 
-/*virtual*/ Magick::WarningRegistry::~WarningRegistry ( ) throw ()
+Magick::ErrorResourceLimit::~ErrorResourceLimit() throw()
 {
 }
 
-Magick::WarningResourceLimit::WarningResourceLimit ( const std::string& what_ )
-  : Warning(what_)
+Magick::ErrorStream::ErrorStream(const std::string& what_)
+  : Error(what_)
 {
 }
 
-/*virtual*/ Magick::WarningResourceLimit::~WarningResourceLimit ( ) throw ()
+Magick::ErrorStream::~ErrorStream() throw()
 {
 }
 
-Magick::WarningStream::WarningStream ( const std::string& what_ )
-  : Warning(what_)
+Magick::ErrorType::ErrorType(const std::string& what_)
+  : Error(what_)
 {
 }
 
-/*virtual*/ Magick::WarningStream::~WarningStream ( ) throw ()
+Magick::ErrorType::~ErrorType() throw()
 {
 }
 
-Magick::WarningType::WarningType ( const std::string& what_ )
-  : Warning(what_)
+Magick::ErrorUndefined::ErrorUndefined(const std::string& what_)
+  : Error(what_)
 {
 }
 
-/*virtual*/ Magick::WarningType::~WarningType ( ) throw ()
+Magick::ErrorUndefined::~ErrorUndefined() throw()
 {
 }
 
-Magick::WarningXServer::WarningXServer ( const std::string& what_ )
-  : Warning(what_)
+Magick::ErrorXServer::ErrorXServer(const std::string& what_)
+  : Error(what_)
 {
 }
 
-/*virtual*/ Magick::WarningXServer::~WarningXServer ( ) throw ()
+Magick::ErrorXServer::~ErrorXServer() throw ()
 {
 }
 
-//
-// Errors
-//
-
-Magick::Error::Error ( const std::string& what_ )
+Magick::Warning::Warning(const std::string& what_)
   : Exception(what_)
 {
 }
 
-/*virtual*/ Magick::Error::~Error ( ) throw ()
+Magick::Warning::~Warning() throw()
 {
 }
 
-Magick::ErrorUndefined::ErrorUndefined ( const std::string& what_ )
-  : Error(what_)
+Magick::WarningBlob::WarningBlob(const std::string& what_)
+  : Warning(what_)
 {
 }
 
-/*virtual*/ Magick::ErrorUndefined::~ErrorUndefined ( ) throw ()
+Magick::WarningBlob::~WarningBlob() throw()
 {
 }
 
-Magick::ErrorBlob::ErrorBlob ( const std::string& what_ )
-  : Error(what_)
+Magick::WarningCache::WarningCache(const std::string& what_)
+  : Warning(what_)
 {
 }
 
-/*virtual*/ Magick::ErrorBlob::~ErrorBlob ( ) throw ()
+Magick::WarningCache::~WarningCache() throw()
 {
 }
 
-Magick::ErrorCache::ErrorCache ( const std::string& what_ )
-  : Error(what_)
+Magick::WarningCoder::WarningCoder(const std::string& what_)
+  : Warning(what_)
 {
 }
 
-/*virtual*/ Magick::ErrorCache::~ErrorCache ( ) throw ()
+Magick::WarningCoder::~WarningCoder() throw()
 {
 }
 
-Magick::ErrorCoder::ErrorCoder ( const std::string& what_ )
-  : Error(what_)
+Magick::WarningConfigure::WarningConfigure(const std::string& what_)
+  : Warning(what_)
 {
 }
 
-/*virtual*/ Magick::ErrorCoder::~ErrorCoder ( ) throw ()
+Magick::WarningConfigure::~WarningConfigure() throw()
 {
 }
 
-Magick::ErrorConfigure::ErrorConfigure ( const std::string& what_ )
-  : Error(what_)
+Magick::WarningCorruptImage::WarningCorruptImage(const std::string& what_)
+  : Warning(what_)
 {
 }
 
-/*virtual*/ Magick::ErrorConfigure::~ErrorConfigure ( ) throw ()
+Magick::WarningCorruptImage::~WarningCorruptImage() throw()
 {
 }
 
-Magick::ErrorCorruptImage::ErrorCorruptImage ( const std::string& what_ )
-  : Error(what_)
+Magick::WarningDelegate::WarningDelegate(const std::string& what_)
+  : Warning(what_)
 {
 }
 
-/*virtual*/ Magick::ErrorCorruptImage::~ErrorCorruptImage ( ) throw ()
+Magick::WarningDelegate::~WarningDelegate() throw()
 {
 }
 
-Magick::ErrorDelegate::ErrorDelegate ( const std::string& what_ )
-  : Error(what_)
+Magick::WarningDraw::WarningDraw(const std::string& what_)
+  : Warning(what_)
 {
 }
 
-/*virtual*/ Magick::ErrorDelegate::~ErrorDelegate ( ) throw ()
+Magick::WarningDraw::~WarningDraw() throw()
 {
 }
 
-Magick::ErrorDraw::ErrorDraw ( const std::string& what_ )
-  : Error(what_)
+Magick::WarningFileOpen::WarningFileOpen(const std::string& what_)
+  : Warning(what_)
 {
 }
 
-/*virtual*/ Magick::ErrorDraw::~ErrorDraw ( ) throw ()
+Magick::WarningFileOpen::~WarningFileOpen() throw()
 {
 }
 
-Magick::ErrorFileOpen::ErrorFileOpen ( const std::string& what_ )
-  : Error(what_)
+Magick::WarningImage::WarningImage(const std::string& what_)
+  : Warning(what_)
 {
 }
 
-/*virtual*/ Magick::ErrorFileOpen::~ErrorFileOpen ( ) throw ()
+Magick::WarningImage::~WarningImage() throw()
 {
 }
 
-Magick::ErrorImage::ErrorImage ( const std::string& what_ )
-  : Error(what_)
+Magick::WarningMissingDelegate::WarningMissingDelegate(
+  const std::string& what_)
+  : Warning(what_)
 {
 }
 
-/*virtual*/ Magick::ErrorImage::~ErrorImage ( ) throw ()
+Magick::WarningMissingDelegate::~WarningMissingDelegate() throw()
 {
 }
 
-Magick::ErrorMissingDelegate::ErrorMissingDelegate ( const std::string& what_ )
-  : Error(what_)
+Magick::WarningModule::WarningModule(const std::string& what_)
+  : Warning(what_)
 {
 }
 
-/*virtual*/ Magick::ErrorMissingDelegate::~ErrorMissingDelegate ( ) throw ()
+Magick::WarningModule::~WarningModule() throw()
 {
 }
 
-Magick::ErrorModule::ErrorModule ( const std::string& what_ )
-  : Error(what_)
+Magick::WarningMonitor::WarningMonitor(const std::string& what_)
+  : Warning(what_)
 {
 }
 
-/*virtual*/ Magick::ErrorModule::~ErrorModule ( ) throw ()
+Magick::WarningMonitor::~WarningMonitor() throw()
 {
 }
 
-Magick::ErrorMonitor::ErrorMonitor ( const std::string& what_ )
-  : Error(what_)
+Magick::WarningOption::WarningOption(const std::string& what_)
+  : Warning(what_)
 {
 }
 
-/*virtual*/ Magick::ErrorMonitor::~ErrorMonitor ( ) throw ()
+Magick::WarningOption::~WarningOption() throw()
 {
 }
 
-Magick::ErrorOption::ErrorOption ( const std::string& what_ )
-  : Error(what_)
+Magick::WarningRegistry::WarningRegistry(const std::string& what_)
+  : Warning(what_)
 {
 }
 
-/*virtual*/ Magick::ErrorOption::~ErrorOption ( ) throw ()
+Magick::WarningRegistry::~WarningRegistry() throw()
 {
 }
 
-Magick::ErrorRegistry::ErrorRegistry ( const std::string& what_ )
-  : Error(what_)
+Magick::WarningResourceLimit::WarningResourceLimit(const std::string& what_)
+  : Warning(what_)
 {
 }
 
-/*virtual*/ Magick::ErrorRegistry::~ErrorRegistry ( ) throw ()
+Magick::WarningResourceLimit::~WarningResourceLimit() throw()
 {
 }
 
-Magick::ErrorResourceLimit::ErrorResourceLimit ( const std::string& what_ )
-  : Error(what_)
+Magick::WarningStream::WarningStream(const std::string& what_)
+  : Warning(what_)
 {
 }
 
-/*virtual*/ Magick::ErrorResourceLimit::~ErrorResourceLimit ( ) throw ()
+Magick::WarningStream::~WarningStream() throw()
 {
 }
 
-Magick::ErrorStream::ErrorStream ( const std::string& what_ )
-  : Error(what_)
+Magick::WarningType::WarningType(const std::string& what_)
+  : Warning(what_)
 {
 }
 
-/*virtual*/ Magick::ErrorStream::~ErrorStream ( ) throw ()
+Magick::WarningType::~WarningType() throw()
 {
 }
 
-Magick::ErrorType::ErrorType ( const std::string& what_ )
-  : Error(what_)
+Magick::WarningUndefined::WarningUndefined(const std::string& what_)
+  : Warning(what_)
 {
 }
 
-/*virtual*/ Magick::ErrorType::~ErrorType ( ) throw ()
+Magick::WarningUndefined::~WarningUndefined() throw()
 {
 }
 
-Magick::ErrorXServer::ErrorXServer ( const std::string& what_ )
-  : Error(what_)
+Magick::WarningXServer::WarningXServer(const std::string& what_)
+  : Warning(what_)
 {
 }
 
-/*virtual*/ Magick::ErrorXServer::~ErrorXServer ( ) throw ()
+Magick::WarningXServer::~WarningXServer() throw()
 {
 }
 
-// Format and throw exception
-MagickPPExport void Magick::throwExceptionExplicit( const ExceptionType severity_,
-                                                   const char* reason_,
-                                                   const char* description_)
+MagickPPExport void Magick::throwExceptionExplicit(
+  const ExceptionType severity_,const char* reason_,const char* description_)
 {
+  ExceptionInfo
+    exception;
+
   // Just return if there is no reported error
-  if ( severity_ == UndefinedException )
+  if (severity_ == UndefinedException)
     return;
 
-  ExceptionInfo exception;
-
-  GetExceptionInfo( &exception );
-  ThrowException( &exception, severity_, reason_, description_ );
-  throwException( exception );
-  (void) DestroyExceptionInfo( &exception );
+  GetPPException;
+  ThrowException(&exception,severity_,reason_, description_);
+  ThrowPPException;
 }
 
-// Throw C++ exception
-MagickPPExport void Magick::throwException( ExceptionInfo &exception_ )
+MagickPPExport void Magick::throwException(ExceptionInfo &exception_)
 {
+  ExceptionType
+    severity;
+
+  MagickBooleanType
+    relinquish;
+
   // Just return if there is no reported error
-  if ( exception_.severity == UndefinedException )
+  if (exception_.severity == UndefinedException)
     return;
 
   // Format error message ImageMagick-style
   std::string message = SetClientName(0);
-  if ( exception_.reason != 0 )
+  if (exception_.reason != (char *) NULL)
     {
-      message += std::string(": ");
-      message += std::string(exception_.reason);
+      message+=std::string(": ");
+      message+=std::string(exception_.reason);
     }
 
-  if ( exception_.description != 0 )
+  if (exception_.description != (char *) NULL)
     message += " (" + std::string(exception_.description) + ")";
 
-  ExceptionType severity = exception_.severity;
-  MagickBooleanType relinquish = exception_.relinquish;
-  DestroyExceptionInfo( &exception_ );
+  severity=exception_.severity;
+  relinquish=exception_.relinquish;
+  DestroyExceptionInfo(&exception_);
   if (relinquish)
-    GetExceptionInfo( &exception_ );
-
-  switch ( severity )
-    {
-      // Warnings
-    case ResourceLimitWarning :
-      throw WarningResourceLimit( message );
-    case TypeWarning :
-      throw WarningType( message );
-    case OptionWarning :
-      throw WarningOption( message );
-    case DelegateWarning :
-      throw WarningDelegate( message );
-    case MissingDelegateWarning :
-      throw WarningMissingDelegate( message );
-    case CorruptImageWarning :
-      throw WarningCorruptImage( message );
-    case FileOpenWarning :
-      throw WarningFileOpen( message );
-    case BlobWarning :
-      throw WarningBlob ( message );
-    case StreamWarning :
-      throw WarningStream ( message );
-    case CacheWarning :
-      throw WarningCache ( message );
-    case CoderWarning :
-      throw WarningCoder ( message );
-    case ModuleWarning :
-      throw WarningModule( message );
-    case DrawWarning :
-      throw WarningDraw( message );
-    case ImageWarning :
-      throw WarningImage( message );
-    case XServerWarning :
-      throw WarningXServer( message );
-    case MonitorWarning :
-      throw WarningMonitor( message );
-    case RegistryWarning :
-      throw WarningRegistry( message );
-    case ConfigureWarning :
-      throw WarningConfigure( message );
-      // Errors
-    case ResourceLimitError :
-    case ResourceLimitFatalError :
-      throw ErrorResourceLimit( message );
-    case TypeError :
-    case TypeFatalError :
-      throw ErrorType( message );
-    case OptionError :
-    case OptionFatalError :
-      throw ErrorOption( message );
-    case DelegateError :
-    case DelegateFatalError :
-      throw ErrorDelegate( message );
-    case MissingDelegateError :
-    case MissingDelegateFatalError :
-      throw ErrorMissingDelegate( message );
-    case CorruptImageError :
-    case CorruptImageFatalError :
-      throw ErrorCorruptImage( message );
-    case FileOpenError :
-    case FileOpenFatalError :
-      throw ErrorFileOpen( message );
-    case BlobError :
-    case BlobFatalError :
-      throw ErrorBlob ( message );
-    case StreamError :
-    case StreamFatalError :
-      throw ErrorStream ( message );
-    case CacheError :
-    case CacheFatalError :
-      throw ErrorCache ( message );
-    case CoderError :
-    case CoderFatalError :
-      throw ErrorCoder ( message );
-    case ModuleError :
-    case ModuleFatalError :
-      throw ErrorModule ( message );
-    case DrawError :
-    case DrawFatalError :
-      throw ErrorDraw ( message );
-    case ImageError :
-    case ImageFatalError :
-      throw ErrorImage ( message );
-    case XServerError :
-    case XServerFatalError :
-      throw ErrorXServer ( message );
-    case MonitorError :
-    case MonitorFatalError :
-      throw ErrorMonitor ( message );
-    case RegistryError :
-    case RegistryFatalError :
-      throw ErrorRegistry ( message );
-    case ConfigureError :
-    case ConfigureFatalError :
-      throw ErrorConfigure ( message );
-    case UndefinedException :
-    default :
-      throw ErrorUndefined( message );
+    GetExceptionInfo(&exception_);
+
+  switch (severity)
+  {
+    case BlobError:
+    case BlobFatalError:
+      throw ErrorBlob(message);
+    case BlobWarning:
+      throw WarningBlob(message);
+    case CacheError:
+    case CacheFatalError:
+      throw ErrorCache(message);
+    case CacheWarning:
+      throw WarningCache(message);
+    case CoderError:
+    case CoderFatalError:
+      throw ErrorCoder(message);
+    case CoderWarning:
+      throw WarningCoder(message);
+    case ConfigureError:
+    case ConfigureFatalError:
+      throw ErrorConfigure(message);
+    case ConfigureWarning:
+      throw WarningConfigure(message);
+    case CorruptImageError:
+    case CorruptImageFatalError:
+      throw ErrorCorruptImage(message);
+    case CorruptImageWarning:
+      throw WarningCorruptImage(message);
+    case DelegateError:
+    case DelegateFatalError:
+      throw ErrorDelegate(message);
+    case DelegateWarning:
+      throw WarningDelegate(message);
+    case DrawError:
+    case DrawFatalError:
+      throw ErrorDraw(message);
+    case DrawWarning:
+      throw WarningDraw(message);
+    case FileOpenError:
+    case FileOpenFatalError:
+      throw ErrorFileOpen(message);
+    case FileOpenWarning:
+      throw WarningFileOpen(message);
+    case ImageError:
+    case ImageFatalError:
+      throw ErrorImage(message);
+    case ImageWarning:
+      throw WarningImage(message);
+    case MissingDelegateError:
+    case MissingDelegateFatalError:
+      throw ErrorMissingDelegate(message);
+    case MissingDelegateWarning:
+      throw WarningMissingDelegate(message);
+    case ModuleError:
+    case ModuleFatalError:
+      throw ErrorModule(message);
+    case ModuleWarning:
+      throw WarningModule(message);
+    case MonitorError:
+    case MonitorFatalError:
+      throw ErrorMonitor(message);
+    case MonitorWarning:
+      throw WarningMonitor(message);
+    case OptionError:
+    case OptionFatalError:
+      throw ErrorOption(message);
+    case OptionWarning:
+      throw WarningOption(message);
+    case RegistryError:
+    case RegistryFatalError:
+      throw ErrorRegistry(message);
+    case RegistryWarning:
+      throw WarningRegistry(message);
+    case ResourceLimitError:
+    case ResourceLimitFatalError:
+      throw ErrorResourceLimit(message);
+    case ResourceLimitWarning:
+      throw WarningResourceLimit(message);
+    case StreamError:
+    case StreamFatalError:
+      throw ErrorStream(message);
+    case StreamWarning:
+      throw WarningStream(message);
+    case TypeError:
+    case TypeFatalError:
+      throw ErrorType(message);
+    case TypeWarning:
+      throw WarningType(message);
+    case UndefinedException:
+    default:
+      throw ErrorUndefined(message);
+    case XServerError:
+    case XServerFatalError:
+      throw ErrorXServer(message);
+    case XServerWarning:
+      throw WarningXServer(message);
     }
-
-}
+}
\ No newline at end of file
index 5019f2db6792a2c402fbe470529c3f2142ada265..4659673d9ddc73f8fad08ec9cd96fd2fa8c618f3 100644 (file)
 
 namespace Magick
 {
-  class MagickPPExport Exception : public std::exception
+  class MagickPPExport Exception: public std::exception
   {
   public:
-    Exception( const std::string& what_ );
-    Exception( const Exception& original_ );
-    Exception& operator= (const Exception& original_ );
-    virtual const char* what () const throw();
-    virtual ~Exception ( ) throw ();
+
+    // Construct with message string
+    Exception(const std::string& what_);
+
+    // Copy constructor
+    Exception(const Exception& original_);
+
+    // Destructor
+    virtual ~Exception() throw();
+
+    // Assignment operator
+    Exception& operator=(const Exception& original_);
+
+    // Get string identifying exception
+    virtual const char* what() const throw();
 
   private:
     std::string _what;
   };
 
   //
-  // Warnings
+  // Error exceptions
   //
 
-  class MagickPPExport Warning : public Exception
+  class MagickPPExport Error: public Exception
   {
   public:
-    explicit Warning ( const std::string& what_ );
-    ~Warning() throw ();
+    explicit Error(const std::string& what_);
+    ~Error() throw();
   };
-  
-  class MagickPPExport WarningUndefined : public Warning
+
+  class MagickPPExport ErrorBlob: public Error
   {
   public:
-    explicit WarningUndefined ( const std::string& what_ );
-    ~WarningUndefined() throw ();
+    explicit ErrorBlob(const std::string& what_);
+    ~ErrorBlob() throw();
   };
 
-  class MagickPPExport WarningBlob: public Warning
+  class MagickPPExport ErrorCache: public Error
   {
   public:
-    explicit WarningBlob ( const std::string& what_ );
-    ~WarningBlob() throw ();
+    explicit ErrorCache(const std::string& what_);
+    ~ErrorCache() throw();
   };
 
-  class MagickPPExport WarningCache: public Warning
+  class MagickPPExport ErrorCoder: public Error
   {
   public:
-    explicit WarningCache ( const std::string& what_ );
-    ~WarningCache() throw ();
+    explicit ErrorCoder(const std::string& what_);
+    ~ErrorCoder() throw();
   };
 
-  class MagickPPExport WarningCoder: public Warning
+  class MagickPPExport ErrorConfigure: public Error
   {
   public:
-    explicit WarningCoder ( const std::string& what_ );
-    ~WarningCoder() throw ();
+    explicit ErrorConfigure(const std::string& what_);
+    ~ErrorConfigure() throw();
   };
 
-  class MagickPPExport WarningConfigure: public Warning
+  class MagickPPExport ErrorCorruptImage: public Error
   {
   public:
-    explicit WarningConfigure ( const std::string& what_ );
-    ~WarningConfigure() throw ();
+    explicit ErrorCorruptImage(const std::string& what_);
+    ~ErrorCorruptImage() throw();
   };
-
-  class MagickPPExport WarningCorruptImage: public Warning
+  
+  class MagickPPExport ErrorDelegate: public Error
   {
   public:
-    explicit WarningCorruptImage ( const std::string& what_ );
-    ~WarningCorruptImage() throw ();
+    explicit ErrorDelegate(const std::string& what_);
+    ~ErrorDelegate() throw();
   };
-
-  class MagickPPExport WarningDelegate : public Warning
+  
+  class MagickPPExport ErrorDraw: public Error
   {
   public:
-    explicit WarningDelegate ( const std::string& what_ );
-    ~WarningDelegate() throw ();
+    explicit ErrorDraw(const std::string& what_);
+    ~ErrorDraw() throw();
   };
 
-  class MagickPPExport WarningDraw : public Warning
+  class MagickPPExport ErrorFileOpen: public Error
   {
   public:
-    explicit WarningDraw ( const std::string& what_ );
-    ~WarningDraw() throw ();
+    explicit ErrorFileOpen(const std::string& what_);
+    ~ErrorFileOpen() throw();
   };
 
-  class MagickPPExport WarningFileOpen: public Warning
+  class MagickPPExport ErrorImage: public Error
   {
   public:
-    explicit WarningFileOpen ( const std::string& what_ );
-    ~WarningFileOpen() throw ();
+    explicit ErrorImage(const std::string& what_);
+    ~ErrorImage() throw();
   };
 
-  class MagickPPExport WarningImage: public Warning
+  class MagickPPExport ErrorMissingDelegate: public Error
   {
   public:
-    explicit WarningImage ( const std::string& what_ );
-    ~WarningImage() throw ();
+    explicit ErrorMissingDelegate(const std::string& what_);
+    ~ErrorMissingDelegate() throw();
   };
 
-  class MagickPPExport WarningMissingDelegate : public Warning
+  class MagickPPExport ErrorModule: public Error
   {
   public:
-    explicit WarningMissingDelegate ( const std::string& what_ );
-    ~WarningMissingDelegate() throw ();
+    explicit ErrorModule(const std::string& what_);
+    ~ErrorModule() throw();
   };
 
-  class MagickPPExport WarningModule : public Warning
+  class MagickPPExport ErrorMonitor: public Error
   {
   public:
-    explicit WarningModule ( const std::string& what_ );
-    ~WarningModule() throw ();
+    explicit ErrorMonitor(const std::string& what_);
+    ~ErrorMonitor() throw();
   };
 
-  class MagickPPExport WarningMonitor : public Warning
+  class MagickPPExport ErrorOption: public Error
   {
   public:
-    explicit WarningMonitor ( const std::string& what_ );
-    ~WarningMonitor() throw ();
+    explicit ErrorOption(const std::string& what_);
+    ~ErrorOption() throw();
   };
 
-  class MagickPPExport WarningOption : public Warning
+  class MagickPPExport ErrorRegistry: public Error
   {
   public:
-    explicit WarningOption ( const std::string& what_ );
-    ~WarningOption() throw ();
+    explicit ErrorRegistry(const std::string& what_);
+    ~ErrorRegistry() throw();
   };
 
-  class MagickPPExport WarningRegistry : public Warning
+  class MagickPPExport ErrorResourceLimit: public Error
   {
   public:
-    explicit WarningRegistry ( const std::string& what_ );
-    ~WarningRegistry() throw ();
+    explicit ErrorResourceLimit(const std::string& what_);
+    ~ErrorResourceLimit() throw();
   };
 
-  class MagickPPExport WarningResourceLimit : public Warning
+  class MagickPPExport ErrorStream: public Error
   {
   public:
-    explicit WarningResourceLimit ( const std::string& what_ );
-    ~WarningResourceLimit() throw ();
+    explicit ErrorStream(const std::string& what_);
+    ~ErrorStream() throw();
   };
 
-  class MagickPPExport WarningStream : public Warning
+  class MagickPPExport ErrorType: public Error
   {
   public:
-    explicit WarningStream ( const std::string& what_ );
-    ~WarningStream() throw ();
+    explicit ErrorType(const std::string& what_);
+    ~ErrorType() throw();
   };
 
-  class MagickPPExport WarningType : public Warning
+  class MagickPPExport ErrorUndefined: public Error
   {
   public:
-    explicit WarningType ( const std::string& what_ );
-    ~WarningType() throw ();
+    explicit ErrorUndefined(const std::string& what_);
+    ~ErrorUndefined() throw();
   };
-
-  class MagickPPExport WarningXServer : public Warning
+  
+  class MagickPPExport ErrorXServer: public Error
   {
   public:
-    explicit WarningXServer ( const std::string& what_ );
-    ~WarningXServer() throw ();
+    explicit ErrorXServer(const std::string& what_);
+    ~ErrorXServer() throw();
   };
 
   //
-  // Error exceptions
+  // Warnings
   //
 
-  class MagickPPExport Error : public Exception
+  class MagickPPExport Warning: public Exception
   {
   public:
-    explicit Error ( const std::string& what_ );
-    ~Error() throw ();
+    explicit Warning(const std::string& what_);
+    ~Warning() throw();
   };
 
-  class MagickPPExport ErrorUndefined : public Error
+  class MagickPPExport WarningBlob: public Warning
   {
   public:
-    explicit ErrorUndefined ( const std::string& what_ );
-    ~ErrorUndefined() throw ();
+    explicit WarningBlob(const std::string& what_);
+    ~WarningBlob() throw();
   };
 
-  class MagickPPExport ErrorBlob: public Error
+  class MagickPPExport WarningCache: public Warning
   {
   public:
-    explicit ErrorBlob ( const std::string& what_ );
-    ~ErrorBlob() throw ();
+    explicit WarningCache(const std::string& what_);
+    ~WarningCache() throw();
   };
 
-  class MagickPPExport ErrorCache: public Error
+  class MagickPPExport WarningCoder: public Warning
   {
   public:
-    explicit ErrorCache ( const std::string& what_ );
-    ~ErrorCache() throw ();
+    explicit WarningCoder(const std::string& what_);
+    ~WarningCoder() throw();
   };
 
-  class MagickPPExport ErrorCoder: public Error
+  class MagickPPExport WarningConfigure: public Warning
   {
   public:
-    explicit ErrorCoder ( const std::string& what_ );
-    ~ErrorCoder() throw ();
+    explicit WarningConfigure(const std::string& what_);
+    ~WarningConfigure() throw();
   };
 
-  class MagickPPExport ErrorConfigure: public Error
+  class MagickPPExport WarningCorruptImage: public Warning
   {
   public:
-    explicit ErrorConfigure ( const std::string& what_ );
-    ~ErrorConfigure() throw ();
+    explicit WarningCorruptImage(const std::string& what_);
+    ~WarningCorruptImage() throw();
   };
 
-  class MagickPPExport ErrorCorruptImage: public Error
+  class MagickPPExport WarningDelegate: public Warning
   {
   public:
-    explicit ErrorCorruptImage ( const std::string& what_ );
-    ~ErrorCorruptImage() throw ();
+    explicit WarningDelegate(const std::string& what_);
+    ~WarningDelegate() throw();
   };
-  
-  class MagickPPExport ErrorDelegate : public Error
+
+  class MagickPPExport WarningDraw : public Warning
   {
   public:
-    explicit ErrorDelegate ( const std::string& what_ );
-    ~ErrorDelegate() throw ();
+    explicit WarningDraw(const std::string& what_);
+    ~WarningDraw() throw();
   };
-  
-  class MagickPPExport ErrorDraw : public Error
+
+  class MagickPPExport WarningFileOpen: public Warning
   {
   public:
-    explicit ErrorDraw ( const std::string& what_ );
-    ~ErrorDraw() throw ();
+    explicit WarningFileOpen(const std::string& what_);
+    ~WarningFileOpen() throw();
   };
 
-  class MagickPPExport ErrorFileOpen: public Error
+  class MagickPPExport WarningImage: public Warning
   {
   public:
-    explicit ErrorFileOpen ( const std::string& what_ );
-    ~ErrorFileOpen() throw ();
+    explicit WarningImage(const std::string& what_);
+    ~WarningImage() throw();
   };
 
-  class MagickPPExport ErrorImage: public Error
+  class MagickPPExport WarningMissingDelegate: public Warning
   {
   public:
-    explicit ErrorImage ( const std::string& what_ );
-    ~ErrorImage() throw ();
+    explicit WarningMissingDelegate(const std::string& what_);
+    ~WarningMissingDelegate() throw();
   };
 
-  class MagickPPExport ErrorMissingDelegate : public Error
+  class MagickPPExport WarningModule: public Warning
   {
   public:
-    explicit ErrorMissingDelegate ( const std::string& what_ );
-    ~ErrorMissingDelegate() throw ();
+    explicit WarningModule(const std::string& what_);
+    ~WarningModule() throw();
   };
 
-  class MagickPPExport ErrorModule : public Error
+  class MagickPPExport WarningMonitor: public Warning
   {
   public:
-    explicit ErrorModule ( const std::string& what_ );
-    ~ErrorModule() throw ();
+    explicit WarningMonitor(const std::string& what_);
+    ~WarningMonitor() throw();
   };
 
-  class MagickPPExport ErrorMonitor : public Error
+  class MagickPPExport WarningOption: public Warning
   {
   public:
-    explicit ErrorMonitor ( const std::string& what_ );
-    ~ErrorMonitor() throw ();
+    explicit WarningOption(const std::string& what_);
+    ~WarningOption() throw();
   };
 
-  class MagickPPExport ErrorOption : public Error
+  class MagickPPExport WarningRegistry: public Warning
   {
   public:
-    explicit ErrorOption ( const std::string& what_ );
-    ~ErrorOption() throw ();
+    explicit WarningRegistry(const std::string& what_);
+    ~WarningRegistry() throw();
   };
 
-  class MagickPPExport ErrorRegistry : public Error
+  class MagickPPExport WarningResourceLimit: public Warning
   {
   public:
-    explicit ErrorRegistry ( const std::string& what_ );
-    ~ErrorRegistry() throw ();
+    explicit WarningResourceLimit(const std::string& what_);
+    ~WarningResourceLimit() throw();
   };
 
-  class MagickPPExport ErrorResourceLimit : public Error
+  class MagickPPExport WarningStream: public Warning
   {
   public:
-    explicit ErrorResourceLimit ( const std::string& what_ );
-    ~ErrorResourceLimit() throw ();
+    explicit WarningStream(const std::string& what_);
+    ~WarningStream() throw();
   };
 
-  class MagickPPExport ErrorStream : public Error
+  class MagickPPExport WarningType: public Warning
   {
   public:
-    explicit ErrorStream ( const std::string& what_ );
-    ~ErrorStream() throw ();
+    explicit WarningType(const std::string& what_);
+    ~WarningType() throw();
   };
 
-  class MagickPPExport ErrorType : public Error
+  class MagickPPExport WarningUndefined: public Warning
   {
   public:
-    explicit ErrorType ( const std::string& what_ );
-    ~ErrorType() throw ();
+    explicit WarningUndefined(const std::string& what_);
+    ~WarningUndefined() throw();
   };
-  
-  class MagickPPExport ErrorXServer : public Error
+
+  class MagickPPExport WarningXServer: public Warning
   {
   public:
-    explicit ErrorXServer ( const std::string& what_ );
-    ~ErrorXServer() throw ();
+    explicit WarningXServer(const std::string& what_);
+    ~WarningXServer() throw();
   };
 
   //
@@ -324,12 +334,13 @@ namespace Magick
   //
 
   // Throw exception based on raw data
-  extern MagickPPExport void throwExceptionExplicit( const MagickCore::ExceptionType severity_,
-                                                   const char* reason_,
-                                                   const char* description_ = 0 );
+  extern MagickPPExport void throwExceptionExplicit(
+    const MagickCore::ExceptionType severity_,const char* reason_,
+    const char* description_=(char *) NULL);
 
   // Thow exception based on ImageMagick's ExceptionInfo
-  extern MagickPPExport void throwException( MagickCore::ExceptionInfo &exception_ );
+  extern MagickPPExport void throwException(
+    MagickCore::ExceptionInfo &exception_);
 
 } // namespace Magick