Provides basic capabilities to Exceptions in Inflection.
More...
#include <Throwable.hpp>
Provides basic capabilities to Exceptions in Inflection.
This class is meant to be subclassed by Exception. It provides a common interface for throwable exceptions by inheriting specifically from std::exception
. It provides two common access methods for data in subclasses - Throwable::what()
and Throwable::getMessage()
, where what() returns a C-type string (const char*
) and getMessage() returns a std::u16string
. The messages returned by these two methods are typically identical, except for the fact that some characters may be lost in conversion from UTF16 → C-type string.
Definition at line 19 of file Throwable.hpp.
◆ Throwable() [1/2]
inflection::exception::Throwable::Throwable |
( |
| ) |
|
◆ Throwable() [2/2]
inflection::exception::Throwable::Throwable |
( |
const std::u16string & |
message | ) |
|
|
explicit |
Constructs a new Throwable with the input message. The message will be stored as both a std::u16string
and a C-type string.
- Parameters
-
message | The input message. |
◆ ~Throwable()
inflection::exception::Throwable::~Throwable |
( |
| ) |
|
|
override |
◆ getMessage()
virtual const ::std::u16string & inflection::exception::Throwable::getMessage |
( |
| ) |
const |
|
virtualnoexcept |
Returns the Throwable message as a std::u16string
.
- Returns
- The Throwable message as a
std::u16string
.
◆ what()
const char * inflection::exception::Throwable::what |
( |
| ) |
const |
|
overridenoexcept |
Returns the Throwable message as a C-type string.
- Returns
- The Throwable message as a C-type string.
The documentation for this class was generated from the following file:
- /home/runner/work/inflection/inflection/inflection/build/inflection_headers/inflection/exception/Throwable.hpp