add file event handlers

This commit is contained in:
seker
2021-11-11 00:08:24 +08:00
parent 6aafa89d20
commit c47ae3b15d
10 changed files with 75 additions and 28 deletions

View File

@@ -14,6 +14,7 @@
#include <string>
#include <type_traits>
#include <functional>
#include <cstdio>
#ifdef SPDLOG_COMPILED_LIB
# undef SPDLOG_HEADER_ONLY
@@ -255,6 +256,13 @@ struct source_loc
const char *funcname{nullptr};
};
typedef struct
{
std::function<void(const filename_t &filename, std::FILE *file_stream)> after_open;
std::function<void(const filename_t &filename, std::FILE *file_stream)> before_close;
std::function<void(const filename_t &filename)> after_close;
} file_event_handlers_t;
namespace details {
// make_unique support for pre c++14