PoDoFo 0.9.6
|
#include <PdfError.h>
Public Member Functions | |
PdfError () | |
PdfError (const EPdfError &eCode, const char *pszFile=NULL, int line=0, const char *pszInformation=NULL) | |
PdfError (const EPdfError &eCode, const char *pszFile, int line, std::string sInformation) | |
PdfError (const PdfError &rhs) | |
const PdfError & | operator= (const PdfError &rhs) |
const PdfError & | operator= (const EPdfError &eCode) |
bool | operator== (const PdfError &rhs) |
bool | operator== (const EPdfError &eCode) |
bool | operator!= (const PdfError &rhs) |
bool | operator!= (const EPdfError &eCode) |
EPdfError | GetError () const |
const TDequeErrorInfo & | GetCallstack () const |
void | SetError (const EPdfError &eCode, const char *pszFile, int line, std::string sInformation) |
void | SetError (const EPdfError &eCode, const char *pszFile=NULL, int line=0, const char *pszInformation=NULL) |
void | SetErrorInformation (const char *pszInformation) |
void | SetErrorInformation (const wchar_t *pszInformation) |
void | AddToCallstack (const char *pszFile=NULL, int line=0, const char *pszInformation=NULL) |
void | AddToCallstack (const char *pszFile, int line, std::string sInformation) |
bool | IsError () const |
void | PrintErrorMsg () const |
const char * | what () const |
Static Public Member Functions | |
static LogMessageCallback * | SetLogMessageCallback (LogMessageCallback *fLogMessageCallback) |
static PODOFO_NOTHROW const char * | ErrorName (EPdfError eCode) |
static const char * | ErrorMessage (EPdfError eCode) |
static void | LogMessage (ELogSeverity eLogSeverity, const char *pszMsg,...) |
static void | LogMessage (ELogSeverity eLogSeverity, const wchar_t *pszMsg,...) |
static void | EnableLogging (bool bEnable) |
static bool | LoggingEnabled () |
static void | DebugMessage (const char *pszMsg,...) |
static void | EnableDebug (bool bEnable) |
static bool | DebugEnabled () |
The error handling class of the PoDoFo library. If a method encounters an error, a PdfError object is thrown as a C++ exception.
This class does not inherit from std::exception.
This class also provides meaningful error descriptions for the error codes which are values of the enum EPdfError, which are all codes PoDoFo uses (except the first and last one).
PoDoFo::PdfError::PdfError | ( | ) |
Create a PdfError object initialized to ePdfError_ErrOk.
PoDoFo::PdfError::PdfError | ( | const EPdfError & | eCode, |
const char * | pszFile = NULL , |
||
int | line = 0 , |
||
const char * | pszInformation = NULL |
||
) |
Create a PdfError object with a given error code.
eCode | the error code of this object |
pszFile | the file in which the error has occurred. Use the compiler macro FILE to initialize the field. |
line | the line in which the error has occurred. Use the compiler macro LINE to initialize the field. |
pszInformation | additional information on this error |
|
explicit |
Create a PdfError object with a given error code.
eCode | the error code of this object |
pszFile | the file in which the error has occurred. Use the compiler macro FILE to initialize the field. |
line | the line in which the error has occurred. Use the compiler macro LINE to initialize the field. |
sInformation | additional information on this error |
PoDoFo::PdfError::PdfError | ( | const PdfError & | rhs | ) |
Copy constructor
rhs | copy the contents of rhs into this object |
|
inline |
Add callstack information to an error object. Always call this function if you get an error object but do not handle the error but throw it again.
pszFile | the filename of the source file causing the error or NULL. Typically you will use the gcc macro FILE here. |
line | the line of source causing the error or 0. Typically you will use the gcc macro LINE here. |
sInformation | additional information on the error, e.g. how to fix the error. This string is intended to be shown to the user. |
|
inline |
Add callstack information to an error object. Always call this function if you get an error object but do not handle the error but throw it again.
pszFile | the filename of the source file causing the error or NULL. Typically you will use the gcc macro FILE here. |
line | the line of source causing the error or 0. Typically you will use the gcc macro LINE here. |
pszInformation | additional information on the error, e.g. how to fix the error. This string is intended to be shown to the user. |
|
static |
Is the display of debugging messages enabled or not?
|
static |
Log a message to the logging system defined for PoDoFo for debugging.
pszMsg | the message to be logged |
|
static |
Enable or disable the display of debugging messages.
bEnable | enable (true) or disable (false) |
|
static |
Enable or disable logging.
bEnable | enable (true) or disable (false) |
|
static |
Get the error message for a certain error code.
|
static |
Get the name for a certain error code.
< The encryption dictionary is invalid or misses a required key
< The password used to open the PDF file was invalid
< This font format is not supported by PoDoFO.
< This image format is not supported by PoDoFO.
< This color format cannot be converted.
|
inline |
Get access to the internal callstack of this error.
|
inline |
Return the error code of this object.
|
inline |
|
static |
Is the display of debugging messages enabled or not?
|
static |
Log a message to the logging system defined for PoDoFo.
eLogSeverity | the severity of the log message |
pszMsg | the message to be logged |
|
static |
Log a message to the logging system defined for PoDoFo.
eLogSeverity | the severity of the log message |
pszMsg | the message to be logged |
bool PoDoFo::PdfError::operator!= | ( | const EPdfError & | eCode | ) |
Overloaded comparison operator, compares this PdfError object with an error code
eCode | an error code (value of the enum EPdfError) |
bool PoDoFo::PdfError::operator!= | ( | const PdfError & | rhs | ) |
Overloaded assignment operator
eCode | a EPdfError code |
bool PoDoFo::PdfError::operator== | ( | const EPdfError & | eCode | ) |
Overloaded comparison operator, compares this PdfError object with an error code
eCode | an error code (value of the enum EPdfError) |
bool PoDoFo::PdfError::operator== | ( | const PdfError & | rhs | ) |
void PoDoFo::PdfError::PrintErrorMsg | ( | ) | const |
Print an error message to stderr. This includes callstack and extra info, if any of either was set.
|
inline |
Set the error code of this object.
eCode | the error code of this object |
pszFile | the filename of the source file causing the error or NULL. Typically you will use the gcc macro FILE here. |
line | the line of source causing the error or 0. Typically you will use the gcc macro LINE here. |
sInformation | additional information on the error. e.g. how to fix the error. This string is intended to be shown to the user. |
|
inline |
Set the error code of this object.
eCode | the error code of this object |
pszFile | the filename of the source file causing the error or NULL. Typically you will use the gcc macro FILE here. |
line | the line of source causing the error or 0. Typically you will use the gcc macro LINE here. |
pszInformation | additional information on the error, e.g. how to fix the error. This string is intended to be shown to the user. |
|
inline |
Set additional error information.
pszInformation | additional information on the error, e.g. how to fix the error. This string is intended to be shown to the user. |
|
inline |
Set additional error information.
pszInformation | additional information on the error, e.g. how to fix the error. This string is intended to be shown to the user. |
|
static |
Set a global static LogMessageCallback functor to replace stderr output in LogMessageInternal.
fLogMessageCallback | the pointer to the new callback functor object |
const char * PoDoFo::PdfError::what | ( | ) | const |
Obtain error description.