Crypto++ 8.7
Free C++ class library of cryptographic schemes
Public Types | Public Member Functions | List of all members
Exception Class Reference

Base class for all exceptions thrown by the library. More...

#include <cryptlib.h>

+ Inheritance diagram for Exception:

Public Types

enum  ErrorType {
  NOT_IMPLEMENTED , INVALID_ARGUMENT , CANNOT_FLUSH , DATA_INTEGRITY_CHECK_FAILED ,
  INVALID_DATA_FORMAT , IO_ERROR , OTHER_ERROR
}
 Error types or categories. More...
 

Public Member Functions

 Exception (ErrorType errorType, const std::string &s)
 Construct a new Exception. More...
 
const char * what () const throw ()
 Retrieves a C-string describing the exception. More...
 
const std::string & GetWhat () const
 Retrieves a string describing the exception. More...
 
void SetWhat (const std::string &s)
 Sets the error string for the exception. More...
 
ErrorType GetErrorType () const
 Retrieves the error type for the exception. More...
 
void SetErrorType (ErrorType errorType)
 Sets the error type for the exceptions. More...
 

Detailed Description

Base class for all exceptions thrown by the library.

All library exceptions directly or indirectly inherit from the Exception class. The Exception class itself inherits from std::exception. The library does not use std::runtime_error derived classes.

Definition at line 158 of file cryptlib.h.

Member Enumeration Documentation

◆ ErrorType

Error types or categories.

Enumerator
NOT_IMPLEMENTED 

A method was called which was not implemented.

INVALID_ARGUMENT 

An invalid argument was detected.

CANNOT_FLUSH 

BufferedTransformation received a Flush(true) signal but can't flush buffers.

DATA_INTEGRITY_CHECK_FAILED 

Data integerity check, such as CRC or MAC, failed.

INVALID_DATA_FORMAT 

Input data was received that did not conform to expected format.

IO_ERROR 

Error reading from input device or writing to output device.

OTHER_ERROR 

Some other error occurred not belonging to other categories.

Definition at line 163 of file cryptlib.h.

Constructor & Destructor Documentation

◆ ~Exception()

virtual Exception::~Exception ( )
throw (
)
inlinevirtual

Definition at line 180 of file cryptlib.h.

◆ Exception()

Exception::Exception ( ErrorType  errorType,
const std::string &  s 
)
inlineexplicit

Construct a new Exception.

Definition at line 183 of file cryptlib.h.

Member Function Documentation

◆ what()

const char * Exception::what ( ) const
throw (
)
inline

Retrieves a C-string describing the exception.

Definition at line 186 of file cryptlib.h.

◆ GetWhat()

const std::string & Exception::GetWhat ( ) const
inline

Retrieves a string describing the exception.

Definition at line 188 of file cryptlib.h.

◆ SetWhat()

void Exception::SetWhat ( const std::string &  s)
inline

Sets the error string for the exception.

Definition at line 190 of file cryptlib.h.

◆ GetErrorType()

ErrorType Exception::GetErrorType ( ) const
inline

Retrieves the error type for the exception.

Definition at line 192 of file cryptlib.h.

◆ SetErrorType()

void Exception::SetErrorType ( ErrorType  errorType)
inline

Sets the error type for the exceptions.

Definition at line 194 of file cryptlib.h.


The documentation for this class was generated from the following file: