StormByte-Database 3.0.0
C++26 database module of the StormByte suite
Loading...
Searching...
No Matches
StormByte::Database::Exception Class Reference

Root exception for Database. More...

#include <StormByte/database/exception.hxx>

Inheritance diagram for StormByte::Database::Exception:
Collaboration diagram for StormByte::Database::Exception:

Classes

struct  Path
 Additional path segments nested below StormByte.Database. More...

Public Member Functions

template<typename... Args>
requires (sizeof...(Args) >= 1)
 Exception (std::string_view pattern, Args &&... args)
 Replace literal {} under StormByte.Database.
 Exception (std::string_view message)
 Copy a plain message under StormByte.Database.
 Exception (Path path, std::string_view message)
 Plain message under an additional Database path.
template<typename... Args>
requires (sizeof...(Args) >= 1)
 Exception (Path path, std::string_view pattern, Args &&... args)
 Replace literal {} under an additional Database path.
 Exception (const Exception &other)=default
 Copy constructor.
 Exception (Exception &&other) noexcept=default
 Move constructor.
 ~Exception () noexcept override
 Destructor.
Exception & operator= (const Exception &other)=default
 Copy assignment operator.
Exception & operator= (Exception &&other) noexcept=default
 Move assignment operator.
Public Member Functions inherited from StormByte::Exception
 Exception (std::string_view message)
 Exception (const Exception &other)
 Exception (Exception &&other) noexcept
Exception & operator= (const Exception &other)
Exception & operator= (Exception &&other) noexcept
virtual const char * what () const noexcept

Static Protected Member Functions

static StormByte::Safe::String Segment (std::string_view prefix, std::string_view component)
 Join a fixed prefix and a dynamic segment.

Additional Inherited Members

Protected Member Functions inherited from StormByte::Exception
 Exception () noexcept
 Exception (Path path, std::string_view message)
 Exception (Path path, Safe::String &&message)
 Exception (Path path, std::string_view pattern, Args &&... args)

Detailed Description

Root exception for Database.

what() is StormByte.Database: message.

This type applies the Database segment. A further segment is an Path. The body does not include the path. Literal {} are replaced by StormByte::Safe::String::ReplaceToken. This does not call std::format. The destructor is defined in this module.

Constructor & Destructor Documentation

◆ Exception() [1/6]

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

Replace literal {} under StormByte.Database.

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

◆ Exception() [2/6]

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

Copy a plain message under StormByte.Database.

Parameters
messageException text. Not a format string.

◆ Exception() [3/6]

StormByte::Database::Exception::Exception ( Path path,
std::string_view message )

Plain message under an additional Database path.

Parameters
pathAdditional segments nested below StormByte.Database.
messageException text. Not a format string.

◆ Exception() [4/6]

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

Replace literal {} under an additional Database path.

Template Parameters
ArgsViews, numbers, or types that convert to std::string. A number uses std::to_string.
Parameters
pathAdditional segments nested below StormByte.Database.
patternBody with literal {} tokens. Not a std::format string.
argsReplacements. One per token, in order.

◆ Exception() [5/6]

StormByte::Database::Exception::Exception ( const Exception & other)
default

Copy constructor.

Parameters
otherException to copy.

◆ Exception() [6/6]

StormByte::Database::Exception::Exception ( Exception && other)
defaultnoexcept

Move constructor.

Parameters
otherException to move.

◆ ~Exception()

StormByte::Database::Exception::~Exception ( )
overridevirtualnoexcept

Destructor.

Defined in this module so catch matches across a DLL.

Reimplemented from StormByte::Exception.

Member Function Documentation

◆ operator=() [1/2]

Exception & StormByte::Database::Exception::operator= ( const Exception & other)
default

Copy assignment operator.

Parameters
otherException to copy.
Returns
This exception.

◆ operator=() [2/2]

Exception & StormByte::Database::Exception::operator= ( Exception && other)
defaultnoexcept

Move assignment operator.

Parameters
otherException to move.
Returns
This exception.

◆ Segment()

StormByte::Safe::String StormByte::Database::Exception::Segment ( std::string_view prefix,
std::string_view component )
inlinestaticprotected

Join a fixed prefix and a dynamic segment.

Parameters
prefixFixed text, including a trailing dot when the segment follows.
componentDynamic segment.
Returns
Owned text. The view it converts to lives for the calling expression.

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