libCZI
Reading and Writing CZI documents made easy
libCZI::LibCZIIOException Class Reference

#include <libCZI_exceptions.h>

Inheritance diagram for libCZI::LibCZIIOException:
libCZI::LibCZIException

Public Member Functions

 LibCZIIOException (const char *szErrMsg, std::uint64_t offset, std::uint64_t size)
 
std::uint64_t GetOffset () const
 
std::uint64_t GetSize () const
 
- Public Member Functions inherited from libCZI::LibCZIException
 LibCZIException (const char *szErrMsg)
 

Detailed Description

Exception for signaling an I/O error. If the problem originates from the (external) stream-object, then the original exception is enclosed here as a nested exception. In order to access the nested exception, use something like this:

try
{
spReader->Open(stream);
}
catch (LibCZIIOException& excp)
{
try
{
excp.rethrow_nested();
}
catch (std::ios_base::failure& innerExcp) // assuming that is the exception you
{ // expect to be thrown from the stream-object
....
}
}
LibCZIIOException(const char *szErrMsg, std::uint64_t offset, std::uint64_t size)
Definition: libCZI_exceptions.h:120

Constructor & Destructor Documentation

◆ LibCZIIOException()

libCZI::LibCZIIOException::LibCZIIOException ( const char *  szErrMsg,
std::uint64_t  offset,
std::uint64_t  size 
)
inline

Constructor for the LibCZIIOException. This type is used to signal an I/O-error from the underlying stream.

Parameters
szErrMsgMessage describing the error.
offsetThe offset (into the stream) at which the I/O-error occurred.
sizeThe size of data we have attempted to read (when the I/O-error occurred).

Member Function Documentation

◆ GetOffset()

std::uint64_t libCZI::LibCZIIOException::GetOffset ( ) const
inline

Gets the offset (in bytes) into the stream at which the I/O-error occurred.

Returns
The offset (in bytes).

◆ GetSize()

std::uint64_t libCZI::LibCZIIOException::GetSize ( ) const
inline

Gets the size of data (in bytes) we attempted to read when the I/O-error occurred.

Returns
The size (in bytes).

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