17 : message_(
std::move(text))
22 int nptrs = backtrace(buffer, stack);
26 strings = backtrace_symbols(buffer, nptrs);
28 for (
int j = 2; j < nptrs - 2; j++)
32 std::string beginName =
"";
38 for (
char* p = strings[j]; *p; ++p)
42 if ((*p ==
'(') && !dep)
53 char* ret = abi::__cxa_demangle(beginName.c_str(),
58 for (
char* p = ret; *p; ++p)
100 :
Exception(text +
" (" +
std::to_string(badNumber) +
")")
101 , badNumber_(badNumber)
106 :
Exception(text +
" (" + badNumber +
")")
112 std::size_t upperBound)
113 :
Exception(
std::to_string(badInt) +
" out of [" +
std::to_string(lowerBound) +
", " +
std::to_string(upperBound) +
"] " +
std::move(text))
115 , bounds_{{lowerBound, upperBound}}
122 :
Exception(
"Incorrect size " +
std::to_string(badSize) +
", expected " +
std::to_string(correctSize) +
". " + text)
124 , correctSize_(correctSize)
130 :
Exception(
std::to_string(badValue) +
" out of [" +
std::to_string(lowerBound) +
", " +
131 std::to_string(upperBound) +
"]" +
std::move(text))
132 , badValue_(badValue)
133 , bounds_{{lowerBound, upperBound}}
const std::string & message() const noexcept
Access the message as a std::string.
Exception(std::string text, int stack=10)
Build a new Exception.
NotImplementedException(std::string text)
Build a new NotImplementedException.
std::size_t getBadSize() const
const char * what() const noexcept override
Method to get the message of the exception (STL method redefinition).
double getBadValue() const
std::array< double, 2 > bounds_
double getUpperBound() const
double getLowerBound() const
int getBadInteger() const
Get the integer that threw this exception.
std::size_t getCorrectSize() const
double getBadNumber() const
Get the number that threw this exception.
BadSizeException(std::string text, std::size_t badSize, std::size_t correctSize)
Build a new BadSizeException.
IndexOutOfBoundsException(std::string text, std::size_t badInt, std::size_t lowerBound, std::size_t upperBound)
Build a new IndexOutOfBoundsException.
IOException(std::string text)
Build a new IOException.
std::array< std::size_t, 2 > bounds_
NullPointerException(std::string text)
Build a new NullPointerException.
Exception base class. Overload exception constructor (to control the exceptions mechanism). Destructor is already virtual (from std::exception)
std::size_t getBadIndex() const
OutOfRangeException(std::string text, double badValue, double lowerBound, double upperBound)
Build a new OutOfRangeException.
const std::array< std::size_t, 2 > & getBounds() const
Get the bounds.
ZeroDivisionException(std::string text)
Build a new ZeroDivisionException.
BadIntegerException(std::string text, int badInt)
Build a new BadIntegerException.
BadNumberException(std::string text, double badNumber)
Build a new BadNumberException.