JPEGErrorManager Class Reference

Provides an error handler for the IJG JPEG Library. Specifically it uses standard Camelot practices to cope with errors generated within the library. Scope: public. More...

#include <jpgermgr.h>

List of all members.

Public Types

enum  ERROR_CLASS {
  ERR_NONE = -1, ERR_STANDARD = 0, ERR_TRACE = 1, ERR_STRUCTURE,
  ERR_FORMAT, ERR_LIMITS, ERR_UNSUPPORTED, ERR_INTERNAL
}

Public Member Functions

 JPEGErrorManager ()
 Default constructor for the JPEGErrorManager providing callbacks for error handling in the IJG JPEG Library. By default no exceptions will be thrown.
void ThrowError (StringID UserErrorMessage)
 Classes external to the IJG Library should use this entry point to throw exceptions.
ERROR_CLASS GetLastErrorClass () const
 Used internally to provide easy access to m_ErrorClass.
J_MESSAGE_CODE GetLastError () const
 Used internally for easy access.
StringID GetStringIDForError () const
 Allows class users to obtain a resource string id suitable for reporting to the user (usually via Error::SetError(...)).
const libJPEG::jpeg_error_mgr * GetErrorMgrStruct () const
libJPEG::jpeg_error_mgr * GetErrorMgrStruct ()

Static Public Member Functions

static void ErrorExit (libJPEG::j_common_ptr cinfo)
 The IJG library requires a callback to exit once an error has occurred. This is that callback. It throws an exception.
static void OutputMessage (libJPEG::j_common_ptr cinfo)
 Actual output of an error or trace message. Overrides standard implementation of sending errors to stderr.
static void EmitMessage (libJPEG::j_common_ptr cinfo, INT32 msg_level)
 Decide whether to emit a trace or warning message.
static void ResetErrorManager (libJPEG::j_common_ptr cinfo)
 Resets the the error manager prior to starting the filter proper.

Protected Attributes

libJPEG::jpeg_error_mgr m_errmgr
ERROR_CLASS m_ErrorClass
StringID m_MessageID

Static Protected Attributes

static const ERROR_CLASSm_ErrorClassTable


Detailed Description

Provides an error handler for the IJG JPEG Library. Specifically it uses standard Camelot practices to cope with errors generated within the library. Scope: public.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
08/08/96

Definition at line 122 of file jpgermgr.h.


Member Enumeration Documentation

enum JPEGErrorManager::ERROR_CLASS
 

Enumerator:
ERR_NONE 
ERR_STANDARD 
ERR_TRACE 
ERR_STRUCTURE 
ERR_FORMAT 
ERR_LIMITS 
ERR_UNSUPPORTED 
ERR_INTERNAL 

Definition at line 125 of file jpgermgr.h.

00126     {
00127         ERR_NONE        = -1,
00128         ERR_STANDARD    = 0,
00129         ERR_TRACE       = 1,
00130         ERR_STRUCTURE   ,//= _R(IDS_JPEG_ERROR_STRUCTURE),
00131         ERR_FORMAT      ,//= _R(IDS_JPEG_ERROR_FORMAT),
00132         ERR_LIMITS      ,//= _R(IDS_JPEG_ERROR_LIMITS),
00133         ERR_UNSUPPORTED ,//= _R(IDS_JPEG_ERROR_UNSUPPORTED),
00134         ERR_INTERNAL    ,//= _R(IDS_JPEG_ERROR_INTERNAL)
00135     };


Constructor & Destructor Documentation

JPEGErrorManager::JPEGErrorManager  ) 
 

Default constructor for the JPEGErrorManager providing callbacks for error handling in the IJG JPEG Library. By default no exceptions will be thrown.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
02/08/96

Definition at line 662 of file jpgermgr.cpp.


Member Function Documentation

void JPEGErrorManager::EmitMessage libJPEG::j_common_ptr  cinfo,
INT32  msg_level
[static]
 

Decide whether to emit a trace or warning message.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com> (based on IJG emit_message)
Date:
02/08/96
Notes: msg_level is one of:

-1: recoverable corrupt-data warning, may want to abort. 0: important advisory messages (always display to user). 1: first level of tracing detail. 2,3,...: successively more detailed tracing messages.

Definition at line 854 of file jpgermgr.cpp.

void JPEGErrorManager::ErrorExit libJPEG::j_common_ptr  cinfo  )  [static]
 

The IJG library requires a callback to exit once an error has occurred. This is that callback. It throws an exception.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
02/08/96

Definition at line 800 of file jpgermgr.cpp.

libJPEG::jpeg_error_mgr* JPEGErrorManager::GetErrorMgrStruct  )  [inline]
 

Definition at line 145 of file jpgermgr.h.

00145 {return &m_errmgr;};

const libJPEG::jpeg_error_mgr* JPEGErrorManager::GetErrorMgrStruct  )  const [inline]
 

Definition at line 144 of file jpgermgr.h.

00144 {return &m_errmgr;};

J_MESSAGE_CODE JPEGErrorManager::GetLastError  )  const
 

Used internally for easy access.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
02/08/96
Returns:
Retrieves the last error code

Errors: ERROR3 if invalid last error

Definition at line 698 of file jpgermgr.cpp.

JPEGErrorManager::ERROR_CLASS JPEGErrorManager::GetLastErrorClass  )  const
 

Used internally to provide easy access to m_ErrorClass.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
02/08/96
Returns:
The error class of the last error thrown via a call to ErrorExit or ThrowError

Errors: ERROR3 if class is ERR_NONE or ERR_TRACE

Definition at line 779 of file jpgermgr.cpp.

StringID JPEGErrorManager::GetStringIDForError  )  const
 

Allows class users to obtain a resource string id suitable for reporting to the user (usually via Error::SetError(...)).

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
02/08/96
Returns:
A resource StringID for the last error thrown.

Definition at line 721 of file jpgermgr.cpp.

void JPEGErrorManager::OutputMessage libJPEG::j_common_ptr  cinfo  )  [static]
 

Actual output of an error or trace message. Overrides standard implementation of sending errors to stderr.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
02/08/96

Definition at line 826 of file jpgermgr.cpp.

void JPEGErrorManager::ResetErrorManager libJPEG::j_common_ptr  cinfo  )  [static]
 

Resets the the error manager prior to starting the filter proper.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com> (based on IJG emit_message)
Date:
02/08/96

Definition at line 893 of file jpgermgr.cpp.

void JPEGErrorManager::ThrowError StringID  UserErrorMessage  ) 
 

Classes external to the IJG Library should use this entry point to throw exceptions.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
02/08/96
Parameters:
UserErrorMessage : A resource ID for a string to be used when reporting [INPUTS] this error to the user.

Definition at line 758 of file jpgermgr.cpp.


Member Data Documentation

libJPEG::jpeg_error_mgr JPEGErrorManager::m_errmgr [protected]
 

Definition at line 153 of file jpgermgr.h.

ERROR_CLASS JPEGErrorManager::m_ErrorClass [protected]
 

Definition at line 154 of file jpgermgr.h.

const ERROR_CLASS* JPEGErrorManager::m_ErrorClassTable [static, protected]
 

Definition at line 157 of file jpgermgr.h.

StringID JPEGErrorManager::m_MessageID [protected]
 

Definition at line 155 of file jpgermgr.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 03:55:35 2007 for Camelot by  doxygen 1.4.4