25#ifndef __DCONV_ERROR_HPP__
26#define __DCONV_ERROR_HPP__
29#include <system_error>
54 const char*
name () const noexcept
override
64 std::string
message (
int code)
const override
66 switch (
static_cast<Errc> (code))
69 return "number is invalid";
71 return "number is an integer";
97 return std::error_code (
static_cast<int> (code),
errorCategory ());
107 return std::error_condition (
static_cast<int> (code),
errorCategory ());
115 struct is_error_code_enum<
dconv::Errc> :
public true_type
conversion error category.
Definition error.hpp:48
std::string message(int code) const override
translate conversion error code to human readable error string.
Definition error.hpp:64
const char * name() const noexcept override
get conversion error category name.
Definition error.hpp:54
const std::error_category & errorCategory() noexcept
get error category.
Definition error.hpp:85
Errc
conversion error codes.
Definition error.hpp:38
std::error_code make_error_code(Errc code) noexcept
create an std::error_code object.
Definition error.hpp:95
std::error_condition make_error_condition(Errc code) noexcept
create an std::error_condition object.
Definition error.hpp:105
const ErrorCategory errorCategoryInstance
conversion error category instance.
Definition error.hpp:79