2016-06-11 19:09:14 +02:00
|
|
|
#ifndef CONVERSION_UTILITIES_CONVERSIONEXCEPTION_H
|
|
|
|
#define CONVERSION_UTILITIES_CONVERSIONEXCEPTION_H
|
2015-04-22 18:36:40 +02:00
|
|
|
|
2016-08-29 15:35:48 +02:00
|
|
|
#include "../global.h"
|
2015-04-22 18:36:40 +02:00
|
|
|
|
|
|
|
#include <stdexcept>
|
|
|
|
#include <string>
|
|
|
|
|
2019-06-10 21:56:46 +02:00
|
|
|
namespace CppUtilities {
|
2015-04-22 18:36:40 +02:00
|
|
|
|
2017-05-01 03:13:11 +02:00
|
|
|
class CPP_UTILITIES_EXPORT ConversionException : public std::runtime_error {
|
2015-04-22 18:36:40 +02:00
|
|
|
public:
|
2018-03-11 22:39:01 +01:00
|
|
|
ConversionException() noexcept;
|
|
|
|
ConversionException(const std::string &what) noexcept;
|
|
|
|
ConversionException(const char *what) noexcept;
|
|
|
|
~ConversionException() override;
|
2015-04-22 18:36:40 +02:00
|
|
|
};
|
2018-03-11 22:36:59 +01:00
|
|
|
|
2018-03-11 22:39:01 +01:00
|
|
|
/*!
|
2019-09-04 18:45:28 +02:00
|
|
|
* \class ConversionException
|
2018-03-11 22:39:01 +01:00
|
|
|
* \brief The ConversionException class is thrown by the various conversion
|
|
|
|
* functions of this library when a conversion error occurs.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief Constructs a new ConversionException.
|
|
|
|
*/
|
|
|
|
inline ConversionException::ConversionException() noexcept
|
|
|
|
: runtime_error("unable to convert")
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief Constructs a new ConversionException. \a what is a std::string
|
|
|
|
* describing the cause of the ConversionException.
|
|
|
|
*/
|
|
|
|
inline ConversionException::ConversionException(const std::string &what) noexcept
|
|
|
|
: runtime_error(what)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2018-03-11 22:36:59 +01:00
|
|
|
/*!
|
|
|
|
* \brief Constructs a new ConversionException. \a what is a C-style string
|
|
|
|
* describing the cause of the ConversionException.
|
|
|
|
*/
|
2018-03-11 22:39:01 +01:00
|
|
|
inline ConversionException::ConversionException(const char *what) noexcept
|
|
|
|
: std::runtime_error(what)
|
2018-03-11 22:36:59 +01:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2019-06-10 21:56:46 +02:00
|
|
|
} // namespace CppUtilities
|
2015-04-22 18:36:40 +02:00
|
|
|
|
2016-06-11 19:09:14 +02:00
|
|
|
#endif // CONVERSION_UTILITIES_CONVERSIONEXCEPTION_H
|