2020-08-30 15:43:45 +02:00
|
|
|
|
|
|
|
|
// Copyright Catch2 Authors
|
|
|
|
|
// Distributed under the Boost Software License, Version 1.0.
|
2022-10-28 11:22:53 +02:00
|
|
|
// (See accompanying file LICENSE.txt or copy at
|
2020-08-30 15:43:45 +02:00
|
|
|
// https://www.boost.org/LICENSE_1_0.txt)
|
|
|
|
|
|
|
|
|
|
// SPDX-License-Identifier: BSL-1.0
|
2020-08-29 20:48:32 +02:00
|
|
|
#ifndef CATCH_INTERFACES_EXCEPTION_HPP_INCLUDED
|
|
|
|
|
#define CATCH_INTERFACES_EXCEPTION_HPP_INCLUDED
|
2011-04-20 15:40:40 +01:00
|
|
|
|
2020-05-25 09:45:24 +02:00
|
|
|
#include <catch2/internal/catch_unique_ptr.hpp>
|
2017-08-29 09:52:25 +02:00
|
|
|
|
2011-04-20 15:40:40 +01:00
|
|
|
#include <string>
|
2015-11-18 08:39:21 +00:00
|
|
|
#include <vector>
|
|
|
|
|
|
2012-05-15 08:02:36 +01:00
|
|
|
namespace Catch {
|
2017-07-27 12:24:21 +02:00
|
|
|
using exceptionTranslateFunction = std::string(*)();
|
2011-04-20 15:40:40 +01:00
|
|
|
|
2022-04-11 00:00:19 +02:00
|
|
|
class IExceptionTranslator;
|
2020-05-25 09:45:24 +02:00
|
|
|
using ExceptionTranslators = std::vector<Detail::unique_ptr<IExceptionTranslator const>>;
|
2015-12-04 10:20:33 +00:00
|
|
|
|
2022-04-11 00:00:19 +02:00
|
|
|
class IExceptionTranslator {
|
|
|
|
|
public:
|
2021-05-12 23:31:08 +02:00
|
|
|
virtual ~IExceptionTranslator(); // = default
|
2015-11-18 08:39:21 +00:00
|
|
|
virtual std::string translate( ExceptionTranslators::const_iterator it, ExceptionTranslators::const_iterator itEnd ) const = 0;
|
2011-04-20 15:40:40 +01:00
|
|
|
};
|
2013-07-03 19:14:59 +01:00
|
|
|
|
2022-04-11 00:00:19 +02:00
|
|
|
class IExceptionTranslatorRegistry {
|
|
|
|
|
public:
|
2021-05-12 23:31:08 +02:00
|
|
|
virtual ~IExceptionTranslatorRegistry(); // = default
|
2012-05-15 08:02:36 +01:00
|
|
|
virtual std::string translateActiveException() const = 0;
|
2011-04-20 15:40:40 +01:00
|
|
|
};
|
|
|
|
|
|
2020-05-19 21:16:33 +02:00
|
|
|
} // namespace Catch
|
2011-04-20 19:09:41 +01:00
|
|
|
|
2020-08-29 20:48:32 +02:00
|
|
|
#endif // CATCH_INTERFACES_EXCEPTION_HPP_INCLUDED
|