2021-07-06 15:43:33 +02:00
|
|
|
#ifndef YERBACON_HPP
|
|
|
|
#define YERBACON_HPP
|
|
|
|
|
2021-07-06 17:29:26 +02:00
|
|
|
#ifndef YBCON_VERSION
|
2021-07-07 20:06:18 +02:00
|
|
|
#warning "YBCON_VERSION is unknown and will therefore be set to a default value"
|
2021-07-06 17:29:26 +02:00
|
|
|
#define YBCON_VERSION "UNKNOWN"
|
|
|
|
#endif
|
|
|
|
|
2021-07-29 17:35:35 +02:00
|
|
|
#include <exception>
|
|
|
|
#include <string_view>
|
|
|
|
#include <string>
|
|
|
|
|
2021-07-06 15:43:33 +02:00
|
|
|
namespace Yerbacon {
|
|
|
|
consteval const char* getVersion() noexcept { return YBCON_VERSION; }
|
2021-07-29 17:35:35 +02:00
|
|
|
class Exception: public std::exception {
|
|
|
|
std::string exceptionCause;
|
|
|
|
[[nodiscard]] const char* what() const noexcept override {
|
|
|
|
return exceptionCause.data();
|
|
|
|
}
|
|
|
|
public:
|
|
|
|
explicit Exception(const std::string_view& cause): exceptionCause(cause) {}
|
|
|
|
};
|
2021-07-06 15:43:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|