StormByte 3.0.0
C++26 foundation of the StormByte suite
Loading...
Searching...
No Matches
StormByte::Safe::Exception Class Reference

Base exception for Safe. More...

#include <StormByte/safe/exception.hxx>

Inheritance diagram for StormByte::Safe::Exception:
Collaboration diagram for StormByte::Safe::Exception:

Public Member Functions

 Exception (std::string_view message)
 Copy a body into StormByte.Safe: message.
 Exception (const Exception &other)
 Copy constructor.
 Exception (Exception &&other) noexcept
 Move constructor.
 ~Exception () noexcept override
 Destructor.
Exception & operator= (const Exception &other)
 Copy assignment.
Exception & operator= (Exception &&other) noexcept
 Move assignment.
template<typename... Args>
requires (sizeof...(Args) >= 1)
 Exception (std::string_view pattern, Args &&... args)
 Replace literal {} under the Safe path.
Public Member Functions inherited from StormByte::Exception
 Exception (std::string_view message)
 Copies text into StormByte: message.
 Exception (const Exception &other)
 Copy constructor.
 Exception (Exception &&other) noexcept
 Move constructor.
Exception & operator= (const Exception &other)
 Copy assignment.
Exception & operator= (Exception &&other) noexcept
 Move assignment.
virtual const char * what () const noexcept
 Message pointer.

Protected Member Functions

 Exception () noexcept
 Construct without allocating message storage.
Protected Member Functions inherited from StormByte::Exception
 Exception () noexcept
 Construct without allocating message storage.
 Exception (Path path, std::string_view message)
 Stores StormByte.path: message, or StormByte: message when path is empty.
 Exception (Path path, Safe::String &&message)
 Stores StormByte.path: message, taking the body.
template<typename... Args>
requires (sizeof...(Args) >= 1)
 Exception (Path path, std::string_view pattern, Args &&... args)
 Stores StormByte.path: message after replacing literal {}.

Detailed Description

Base exception for Safe.

Leaf text is StormByte.Safe: message.

The body does not include the path. This type applies the Safe segment. Copy, move and the destructor are defined in the Base DLL. A leaf that must not allocate uses the empty constructor and overrides what(). The message constructor takes a view. A String converts to that view and is copied. There is no move constructor.

Constructor & Destructor Documentation

◆ Exception() [1/5]

StormByte::Safe::Exception::Exception ( std::string_view message)
explicit

Copy a body into StormByte.Safe: message.

Parameters
messageBody. Not a path and not a format string.

◆ Exception() [2/5]

StormByte::Safe::Exception::Exception ( const Exception & other)

Copy constructor.

Defined in the Base DLL.

Parameters
otherException to copy.

◆ Exception() [3/5]

StormByte::Safe::Exception::Exception ( Exception && other)
noexcept

Move constructor.

Defined in the Base DLL.

Parameters
otherException to take.

◆ ~Exception()

StormByte::Safe::Exception::~Exception ( )
overridevirtualnoexcept

Destructor.

Defined in the Base DLL so catch matches across modules.

Reimplemented from StormByte::Exception.

◆ Exception() [4/5]

template<typename... Args>
requires (sizeof...(Args) >= 1)
StormByte::Safe::Exception::Exception ( std::string_view pattern,
Args &&... args )
inline

Replace literal {} under the Safe path.

Template Parameters
ArgsViews, numbers, or types that convert to std::string. A number uses std::to_string.
Parameters
patternBody with literal {} tokens.
argsReplacements. One per token, in order.

◆ Exception() [5/5]

StormByte::Safe::Exception::Exception ( )
protectednoexcept

Construct without allocating message storage.

Used by a leaf that overrides what() with a static string.

Member Function Documentation

◆ operator=() [1/2]

Exception & StormByte::Safe::Exception::operator= ( const Exception & other)

Copy assignment.

Defined in the Base DLL.

Parameters
otherException to copy.
Returns
This exception.

◆ operator=() [2/2]

Exception & StormByte::Safe::Exception::operator= ( Exception && other)
noexcept

Move assignment.

Defined in the Base DLL.

Parameters
otherException to take.
Returns
This exception.

The documentation for this class was generated from the following file: