GUECS: Minimal components from zedcaster that will let me make a GUI for a game.

This commit is contained in:
Zed A. Shaw 2025-04-21 23:45:04 -04:00
parent 10ecf50bc0
commit 1be770d62d
28 changed files with 2528 additions and 30 deletions

35
dbc.hpp
View file

@ -3,6 +3,7 @@
#include <string>
#include <fmt/core.h>
#include <functional>
#include <source_location>
using std::string;
@ -19,11 +20,31 @@ namespace dbc {
class PreCondError : public Error {};
class PostCondError : public Error {};
void log(const string &message);
void sentinel(const string &message);
void pre(const string &message, bool test);
void pre(const string &message, std::function<bool()> tester);
void post(const string &message, bool test);
void post(const string &message, std::function<bool()> tester);
void check(bool test, const string &message);
void log(const string &message,
const std::source_location location =
std::source_location::current());
[[noreturn]] void sentinel(const string &message,
const std::source_location location =
std::source_location::current());
void pre(const string &message, bool test,
const std::source_location location =
std::source_location::current());
void pre(const string &message, std::function<bool()> tester,
const std::source_location location =
std::source_location::current());
void post(const string &message, bool test,
const std::source_location location =
std::source_location::current());
void post(const string &message, std::function<bool()> tester,
const std::source_location location =
std::source_location::current());
void check(bool test, const string &message,
const std::source_location location =
std::source_location::current());
}