Skip to content
API Documentation
BastionGuard™
JsonEventSink.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <filesystem>
4#include <fstream>
5#include <mutex>
6#include <string>
8
10
11class JsonEventSink final : public IEventSink {
12public:
13 explicit JsonEventSink(const std::filesystem::path& path);
14 void onEvent(const rg_event& event) noexcept override;
15
16private:
17 static std::string escape(const char* value);
18
19 std::ofstream stream_;
20 std::mutex mutex_;
21};
22
23} // namespace bastionguard::rootguard
JsonEventSink(const std::filesystem::path &path)
void onEvent(const rg_event &event) noexcept override
static std::string escape(const char *value)