1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
|
#ifndef CONVERSION_UTILITIES_CONVERSIONEXCEPTION_H
#define CONVERSION_UTILITIES_CONVERSIONEXCEPTION_H
#include "../global.h"
#include <stdexcept>
#include <string>
namespace CppUtilities {
class CPP_UTILITIES_EXPORT ConversionException : public std::runtime_error {
public:
ConversionException() noexcept;
ConversionException(const std::string &what) noexcept;
ConversionException(const char *what) noexcept;
~ConversionException() override;
};
/*!
* \class ConversionException
* \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)
{
}
/*!
* \brief Constructs a new ConversionException. \a what is a C-style string
* describing the cause of the ConversionException.
*/
inline ConversionException::ConversionException(const char *what) noexcept
: std::runtime_error(what)
{
}
} // namespace CppUtilities
#endif // CONVERSION_UTILITIES_CONVERSIONEXCEPTION_H
|