ORIGINAL
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
original::error Class Reference

Base class for all exceptions in the Original project. More...

#include <error.h>

Inheritance diagram for original::error:
Inheritance graph
Collaboration diagram for original::error:
Collaboration graph

Public Member Functions

 error (std::string msg)
 Constructs an exception with an optional message.
 
std::string className () const override
 Returns the class name as string.
 
std::string message () const noexcept
 Generates formatted error message.
 
const charwhat () const noexcept override
 Returns the full error message.
 
- Public Member Functions inherited from original::printable
virtual std::string toString (bool enter) const
 Generates formatted string representation.
 
 operator std::string () const
 Explicit conversion to std::string.
 
 operator const char * () const
 Explicit conversion to C-style string.
 
const chartoCString (bool enter) const
 Direct C-string access with formatting control.
 
template<typename TYPE >
auto formatString (const TYPE &t) -> std::string
 
template<typename TYPE >
auto formatCString (const TYPE &t) -> const char *
 
template<typename TYPE >
auto formatEnum (const TYPE &t) -> std::string
 
template<typename TYPE >
auto formatString (TYPE *const &ptr) -> std::string
 

Protected Member Functions

virtual std::string defaultMsg () const
 Provides default message when no custom message is supplied.
 

Protected Attributes

std::string msg_
 

Additional Inherited Members

- Static Public Member Functions inherited from original::printable
template<typename TYPE >
static std::string formatString (const TYPE &t)
 Universal value-to-string conversion with type-specific formatting.
 
template<Printable TYPE>
static std::string formatString (const TYPE &t)
 Specialization for types deriving from printable.
 
template<EnumType TYPE>
static std::string formatString (const TYPE &t)
 Specialization for enum types with type-safe formatting.
 
template<typename TYPE >
static std::string formatString (TYPE *const &ptr)
 Pointer-specific formatting with null safety.
 
template<typename TYPE >
static const charformatCString (const TYPE &t)
 C-string cache for temporary usage with static storage.
 
template<typename TYPE >
static std::string formatEnum (const TYPE &t)
 Enum formatting utility with underlying value extraction.
 
template<>
auto formatString (const char &t) -> std::string
 
template<>
auto formatString (const bool &t) -> std::string
 
template<>
auto formatString (const char *const &ptr) -> std::string
 

Detailed Description

Base class for all exceptions in the Original project.

Inherits from std::exception and implements the printable interface for custom formatting.

Note
All exceptions in Original should inherit from this class to maintain consistent error handling behavior across the codebase.

Features

Constructor & Destructor Documentation

◆ error()

original::error::error ( std::string  msg)
inlineexplicit

Constructs an exception with an optional message.

Parameters
msgOptional custom error message.

Member Function Documentation

◆ className()

std::string original::error::className ( ) const
inlineoverridevirtual

Returns the class name as string.

Returns
Class name identifier

Reimplemented from original::printable.

Reimplemented in original::outOfBoundError, original::valueError, original::nullPointerError, original::unSupportedMethodError, original::noElementError, and original::sysError.

◆ defaultMsg()

virtual std::string original::error::defaultMsg ( ) const
inlineprotectedvirtual

◆ message()

std::string original::error::message ( ) const
inlinenoexcept

Generates formatted error message.

Returns
Complete error message with class name and description

◆ what()

const char * original::error::what ( ) const
inlineoverridenoexcept

Returns the full error message.

Returns
C-style string of the error message

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