diff options
| author | Markus Mittendrein <git@maxmitti.tk> | 2019-08-19 13:42:48 +0200 |
|---|---|---|
| committer | Markus Mittendrein <git@maxmitti.tk> | 2019-08-19 18:56:58 +0200 |
| commit | 177c2d8c1ed33391711524948fef5313c8624c75 (patch) | |
| tree | 6bf8d0e17b2f6c2d69d77b611213139adbc74b9d /src/cppc4group.hpp | |
| parent | 228bce0f6612044a18569919798d7e89e18a29c8 (diff) | |
| download | cc4group-177c2d8c1ed33391711524948fef5313c8624c75.tar.gz cc4group-177c2d8c1ed33391711524948fef5313c8624c75.zip | |
Allow the warning handling callback to be set to a custom callback
Diffstat (limited to 'src/cppc4group.hpp')
| -rw-r--r-- | src/cppc4group.hpp | 5 |
1 files changed, 5 insertions, 0 deletions
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 |
