StormByte C++ Library 0.0.9999
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).
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages Concepts
Public Member Functions | List of all members
StormByte::Exception Class Reference

Base class for exceptions in the StormByte library. More...

#include <exception.hxx>

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

Public Member Functions

 Exception (const std::string &message)
 Constructor.
 
 Exception (std::string &&message)
 Constructor.
 
template<typename... Args>
 Exception (std::format_string< Args... > fmt, Args &&... args)
 Constructor forwards the message to the std::format function.
 
 Exception (const Exception &e)
 Copy constructor.
 
 Exception (Exception &&e) noexcept
 Move constructor.
 
virtual ~Exception () noexcept
 Destructor.
 
Exceptionoperator= (const Exception &e)
 Copy assignment operator.
 
Exceptionoperator= (Exception &&e) noexcept
 Move assignment operator.
 
virtual const charwhat () const noexcept
 Gets the exception message.
 

Detailed Description

Base class for exceptions in the StormByte library.

The Exception class provides a consistent mechanism for handling errors across library boundaries. It ensures compatibility with both Windows and Linux platforms and avoids issues with std::string across DLL boundaries by using const char* for internal storage.

Constructor & Destructor Documentation

◆ Exception() [1/5]

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

Constructor.

Parameters
messageException message as a std::string

◆ Exception() [2/5]

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

Constructor.

Parameters
messageException message as a moved std::string

◆ Exception() [3/5]

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

Constructor forwards the message to the std::format function.

Template Parameters
ArgsFormat argument types
Parameters
fmtFormat string
argsArguments for formatting

If no arguments are provided, the format string is used as the exception message directly.

◆ Exception() [4/5]

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

Copy constructor.

Parameters
eException to copy

◆ Exception() [5/5]

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

Move constructor.

Parameters
eException to move

Member Function Documentation

◆ operator=() [1/2]

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

Copy assignment operator.

Parameters
eException to copy
Returns
Reference to this exception

◆ operator=() [2/2]

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

Move assignment operator.

Parameters
eException to move
Returns
Reference to this exception

◆ what()

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

Gets the exception message.

Returns
Exception message as const char*

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