BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bslx_testinstreamexception

Detailed Description

Outline

Purpose

Provide an exception class for unexternalization operations.

Classes

See also
bslx_testinstream

Description

This component defines a simple exception object for testing exceptions during unexternalization operations. The exception object bslx::TestInStreamException contains information about an unexternalization request, which can be queried by the "catcher" of the exception.

Usage

This section illustrates intended use of this component.

Example 1: Throw and Catch

In the following example, the bslx::TestInStreamException object is thrown, caught, and examined. First, set up a try block and throw the exception with the indication that the exception occurred during unexternalization of an unsigned int:

try {
throw TestInStreamException(bslx::TypeCode::e_UINT32);
@ e_UINT32
Definition bslx_typecode.h:171

Then, catch the exception and verify the indicated cause of the exception:

} catch (const bslx::TestInStreamException& e) {
}
Definition bslx_testinstreamexception.h:98
TypeCode::Enum dataType() const
Definition bslx_testinstreamexception.h:137