StormByte C++ Library 1.2.0
StormByte is a comprehensive, cross-platform C++ library aimed at easing system programming, configuration management, logging, and database handling tasks. This library provides a unified API that abstracts away the complexities and inconsistencies of different platforms (Windows, Linux).
Loading...
Searching...
No Matches
Public Member Functions | List of all members
StormByte::Exception Class Reference

Base exception type for the suite. More...

#include <StormByte/exception.hxx>

Inheritance diagram for StormByte::Exception:
Inheritance graph
[legend]

Public Member Functions

 Exception (const std::string &message)
 Constructs from a string.
 
 Exception (std::string &&message)
 Constructs from a moved string.
 
template<typename... Args>
 Exception (std::format_string< Args... > fmt, Args &&... args)
 Constructs with std::format.
 
template<typename... Args>
 Exception (Component component, std::format_string< Args... > fmt, Args &&... args)
 Constructs with a component prefix and std::format.
 
 Exception (const Exception &e)
 Copy constructor.
 
 Exception (Exception &&e) noexcept
 Move constructor.
 
virtual ~Exception () noexcept
 Destructor.
 
Exceptionoperator= (const Exception &e)
 Copy assignment.
 
Exceptionoperator= (Exception &&e) noexcept
 Move assignment.
 
virtual const char * what () const noexcept
 Message pointer.
 

Detailed Description

Base exception type for the suite.

Stores the message as const char* so a std::string does not cross a DLL boundary on Windows.

Constructor & Destructor Documentation

◆ Exception() [1/6]

StormByte::Exception::Exception ( const std::string &  message)
explicit

Constructs from a string.

Parameters
messageException text.

◆ Exception() [2/6]

StormByte::Exception::Exception ( std::string &&  message)
explicit

Constructs from a moved string.

Parameters
messageException text.

◆ Exception() [3/6]

template<typename... Args>
StormByte::Exception::Exception ( std::format_string< Args... >  fmt,
Args &&...  args 
)
inline

Constructs with std::format.

Template Parameters
ArgsFormat argument types.
Parameters
fmtFormat string.
argsFormat arguments.
Note
With zero arguments the format string is the message as-is.

◆ Exception() [4/6]

template<typename... Args>
StormByte::Exception::Exception ( Component  component,
std::format_string< Args... >  fmt,
Args &&...  args 
)
inline

Constructs with a component prefix and std::format.

Template Parameters
ArgsFormat argument types.
Parameters
componentModule name, wrapped so it cannot be mistaken for fmt.
fmtFormat string.
argsFormat arguments.
Note
Final text is StormByte::<component>: <formatted>.

◆ Exception() [5/6]

StormByte::Exception::Exception ( const Exception e)

Copy constructor.

Parameters
eException to copy.

◆ Exception() [6/6]

StormByte::Exception::Exception ( Exception &&  e)
noexcept

Move constructor.

Parameters
eException to move.

◆ ~Exception()

virtual StormByte::Exception::~Exception ( )
virtualnoexcept

Destructor.

Member Function Documentation

◆ operator=() [1/2]

Exception & StormByte::Exception::operator= ( const Exception e)

Copy assignment.

Parameters
eException to copy.
Returns
Reference to this exception.

◆ operator=() [2/2]

Exception & StormByte::Exception::operator= ( Exception &&  e)
noexcept

Move assignment.

Parameters
eException to move.
Returns
Reference to this exception.

◆ what()

virtual const char * StormByte::Exception::what ( ) const
virtualnoexcept

Message pointer.

Returns
NUL-terminated message; owned by this object.

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