C++ Utilities  5.10.5
Useful C++ classes and routines such as argument parser, IO and conversion utilities
conversionexception.h
Go to the documentation of this file.
1 #ifndef CONVERSION_UTILITIES_CONVERSIONEXCEPTION_H
2 #define CONVERSION_UTILITIES_CONVERSIONEXCEPTION_H
3 
4 #include "../global.h"
5 
6 #include <stdexcept>
7 #include <string>
8 
9 namespace CppUtilities {
10 
11 class CPP_UTILITIES_EXPORT ConversionException : public std::runtime_error {
12 public:
13  ConversionException() noexcept;
14  ConversionException(const std::string &what) noexcept;
15  ConversionException(const char *what) noexcept;
16  ~ConversionException() override;
17 };
18 
29  : runtime_error("unable to convert")
30 {
31 }
32 
37 inline ConversionException::ConversionException(const std::string &what) noexcept
38  : runtime_error(what)
39 {
40 }
41 
46 inline ConversionException::ConversionException(const char *what) noexcept
47  : std::runtime_error(what)
48 {
49 }
50 
51 } // namespace CppUtilities
52 
53 #endif // CONVERSION_UTILITIES_CONVERSIONEXCEPTION_H
The ConversionException class is thrown by the various conversion functions of this library when a co...
ConversionException() noexcept
Constructs a new ConversionException.
#define CPP_UTILITIES_EXPORT
Marks the symbol to be exported by the c++utilities library.
TargetType convert(const char *value)
Contains all utilities provides by the c++utilities library.