Inflection
Morphology Inflection
Loading...
Searching...
No Matches
Public Member Functions | List of all members
inflection::exception::Throwable Class Reference

Provides basic capabilities to Exceptions in Inflection. More...

#include <Throwable.hpp>

+ Inheritance diagram for inflection::exception::Throwable:

Public Member Functions

 Throwable ()
 
 Throwable (const std::u16string &message)
 
 ~Throwable () override
 
const char * what () const noexcept override
 
virtual const ::std::u16string & getMessage () const noexcept
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ Throwable() [1/2]

inflection::exception::Throwable::Throwable ( )

Default constructor

◆ 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
messageThe input message.

◆ ~Throwable()

inflection::exception::Throwable::~Throwable ( )
override

Destructor

Member Function Documentation

◆ 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: