From 177c2d8c1ed33391711524948fef5313c8624c75 Mon Sep 17 00:00:00 2001 From: Markus Mittendrein Date: Mon, 19 Aug 2019 13:42:48 +0200 Subject: Allow the warning handling callback to be set to a custom callback --- src/cppc4group.hpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/cppc4group.hpp') diff --git a/src/cppc4group.hpp b/src/cppc4group.hpp index 7f51629..e263ca4 100644 --- a/src/cppc4group.hpp +++ b/src/cppc4group.hpp @@ -111,6 +111,9 @@ public: using SetupCallback = bool(*)(void* const arg); using WriteCallback = bool(*)(const void* const data, size_t const size, void* const arg); + // but a more practical variant here + using WarningCallback = void(*)(const std::string& message); + // these enums are just mapped to their C-counterparts internally enum class TmpMemoryStrategy { Memory, @@ -130,6 +133,8 @@ public: // and this for your own custom strategy static void setTmpMemoryStrategy(const TmpMemoryCallback callback); + static void setWarningCallback(const WarningCallback callback); + public: // the constructor will automatically construct an internal CC4Group, so no new-equivalent method is needed // may throw std::bad_alloc if the allocation and construction of the internal CC4Group object fails -- cgit v1.2.3-54-g00ecf