Files
Catch2/src/catch2/interfaces/catch_interfaces_exception.hpp

37 lines
1.1 KiB
C++
Raw Normal View History

// Copyright Catch2 Authors
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE.txt or copy at
// https://www.boost.org/LICENSE_1_0.txt)
// SPDX-License-Identifier: BSL-1.0
#ifndef CATCH_INTERFACES_EXCEPTION_HPP_INCLUDED
#define CATCH_INTERFACES_EXCEPTION_HPP_INCLUDED
2011-04-20 15:40:40 +01:00
#include <catch2/internal/catch_unique_ptr.hpp>
2011-04-20 15:40:40 +01:00
#include <string>
#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
class IExceptionTranslator;
using ExceptionTranslators = std::vector<Detail::unique_ptr<IExceptionTranslator const>>;
2015-12-04 10:20:33 +00:00
class IExceptionTranslator {
public:
virtual ~IExceptionTranslator(); // = default
virtual std::string translate( ExceptionTranslators::const_iterator it, ExceptionTranslators::const_iterator itEnd ) const = 0;
2011-04-20 15:40:40 +01:00
};
class IExceptionTranslatorRegistry {
public:
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
};
} // namespace Catch
2011-04-20 19:09:41 +01:00
#endif // CATCH_INTERFACES_EXCEPTION_HPP_INCLUDED