diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2023-11-25 19:31:46 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2023-11-25 19:31:46 +0100 |
commit | 7409d8ddd39944c4e68ebd50c732ee9a9a886583 (patch) | |
tree | 81d0c3beb6b1c336db19016eeaf2ec648cd21100 /compat/debug.hpp | |
parent | 8f3c494e3d89cd146f4e032ae94ce5456328c87e (diff) |
a
Diffstat (limited to 'compat/debug.hpp')
-rw-r--r-- | compat/debug.hpp | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/compat/debug.hpp b/compat/debug.hpp index 1d8e4676..0009ce52 100644 --- a/compat/debug.hpp +++ b/compat/debug.hpp @@ -1,26 +1,31 @@ #pragma once #include <Corrade/Utility/Debug.h> #include <Corrade/Utility/Move.h> +#include <Corrade/Containers/Containers.h> namespace floormat::detail::corrade_debug { -template<typename T> struct Quoted final { const T& value; }; - -#ifndef FM_NO_CORRADE_DEBUG_EXTERN_TEMPLATE_QUOTED -extern template struct Quoted<StringView>; -#endif +struct ErrorString final { int value; }; +Debug& operator<<(Debug& dbg, ErrorString box); -Debug::Flags debug1(Debug& dbg); -Debug& debug2(Debug& dbg, Debug::Flags flags); +template<typename T> struct Quoted final { const T& value; }; +Debug::Flags debug1(Debug& dbg, char c); +Debug& debug2(Debug& dbg, Debug::Flags flags, char c); -template<typename T> -Debug& operator<<(Debug& dbg, detail::corrade_debug::Quoted<T> box) +template<typename T> Debug& operator<<(Debug& dbg, Quoted<T> box) { - Debug::Flags flags = detail::corrade_debug::debug1(dbg); + Debug::Flags flags = debug1(dbg, '\''); dbg << box.value; - return debug2(dbg, flags); + return debug2(dbg, flags, '\''); } +extern template struct Quoted<StringView>; + } // namespace floormat::detail::corrade_debug +namespace floormat { + +floormat::detail::corrade_debug::ErrorString error_string(int error); template<typename T> floormat::detail::corrade_debug::Quoted<T> quoted(const T& value) { return { value }; } + +} // namespace floormat |