8#ifndef TWOBLUECUBES_CATCH_INTERFACES_EXCEPTION_H_INCLUDED
9#define TWOBLUECUBES_CATCH_INTERFACES_EXCEPTION_H_INCLUDED
13#if defined(CATCH_CONFIG_DISABLE)
14 #define INTERNAL_CATCH_TRANSLATE_EXCEPTION_NO_REG( translatorName, signature) \
15 static std::string translatorName( signature )
30 virtual std::string
translate( ExceptionTranslators::const_iterator it, ExceptionTranslators::const_iterator itEnd )
const = 0;
44 ExceptionTranslator( std::string(*translateFunction)(
T& ) )
45 : m_translateFunction( translateFunction )
48 std::string translate( ExceptionTranslators::const_iterator it, ExceptionTranslators::const_iterator itEnd )
const override {
51 std::rethrow_exception(std::current_exception());
53 return (*it)->translate( it+1, itEnd );
56 return m_translateFunction( ex );
61 std::string(*m_translateFunction)(
T& );
68 (
new ExceptionTranslator<T>( translateFunction ) );
74#define INTERNAL_CATCH_TRANSLATE_EXCEPTION2( translatorName, signature ) \
75 static std::string translatorName( signature ); \
76 CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
77 namespace{ Catch::ExceptionTranslatorRegistrar INTERNAL_CATCH_UNIQUE_NAME( catch_internal_ExceptionRegistrar )( &translatorName ); } \
78 CATCH_INTERNAL_UNSUPPRESS_GLOBALS_WARNINGS \
79 static std::string translatorName( signature )
81#define INTERNAL_CATCH_TRANSLATE_EXCEPTION( signature ) INTERNAL_CATCH_TRANSLATE_EXCEPTION2( INTERNAL_CATCH_UNIQUE_NAME( catch_internal_ExceptionTranslator ), signature )
ExceptionTranslatorRegistrar(std::string(*translateFunction)(T &))
std::vector< std::unique_ptr< IExceptionTranslator const > > ExceptionTranslators
IMutableRegistryHub & getMutableRegistryHub()
std::string(*)() exceptionTranslateFunction
#define T(meth, val, expected)
virtual std::string translate(ExceptionTranslators::const_iterator it, ExceptionTranslators::const_iterator itEnd) const =0
virtual ~IExceptionTranslator()
virtual ~IExceptionTranslatorRegistry()
virtual std::string translateActiveException() const =0
virtual void registerTranslator(const IExceptionTranslator *translator)=0