mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-05-14 19:26:57 +02:00
Move dead submodules in-tree
Signed-off-by: swurl <swurl@swurl.xyz>
This commit is contained in:
parent
c0cceff365
commit
6c655321e6
4081 changed files with 1185566 additions and 45 deletions
44
externals/oaknut/include/oaknut/oaknut_exception.hpp
vendored
Normal file
44
externals/oaknut/include/oaknut/oaknut_exception.hpp
vendored
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
// SPDX-FileCopyrightText: Copyright (c) 2023 merryhime <https://mary.rs>
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <exception>
|
||||
|
||||
namespace oaknut {
|
||||
|
||||
enum class ExceptionType {
|
||||
#define OAKNUT_EXCEPTION(tag, str) tag,
|
||||
#include "oaknut/impl/oaknut_exception.inc.hpp"
|
||||
#undef OAKNUT_EXCEPTION
|
||||
};
|
||||
|
||||
inline const char* to_string(ExceptionType et)
|
||||
{
|
||||
switch (et) {
|
||||
#define OAKNUT_EXCEPTION(tag, str) \
|
||||
case ExceptionType::tag: \
|
||||
return str;
|
||||
#include "oaknut/impl/oaknut_exception.inc.hpp"
|
||||
#undef OAKNUT_EXCEPTION
|
||||
default:
|
||||
return "unknown ExceptionType";
|
||||
}
|
||||
}
|
||||
|
||||
class OaknutException : public std::exception {
|
||||
public:
|
||||
explicit OaknutException(ExceptionType et)
|
||||
: type{et}
|
||||
{}
|
||||
|
||||
const char* what() const noexcept override
|
||||
{
|
||||
return to_string(type);
|
||||
}
|
||||
|
||||
private:
|
||||
ExceptionType type;
|
||||
};
|
||||
|
||||
} // namespace oaknut
|
||||
Loading…
Add table
Add a link
Reference in a new issue