add filewatch
Some checks are pending
ContinuousIntegration / macos (push) Waiting to run
ContinuousIntegration / windows (push) Waiting to run
ContinuousIntegration / linux (push) Successful in 20s

This commit is contained in:
2024-06-10 22:27:19 +02:00
parent 0e358157f2
commit fcafb1bd7e
4 changed files with 40 additions and 1 deletions

View File

@@ -5,7 +5,13 @@
#include "./log_parse.hpp"
Factorio::Factorio(Contact3Registry& cr, RegistryMessageModel& rmm) : _cr(cr), _rmm(rmm) {
Factorio::Factorio(Contact3Registry& cr, RegistryMessageModel& rmm) :
_cr(cr),
_rmm(rmm),
_fw("test.txt", [this](const auto& path, const auto event){ this->onFileEvent(path, event);})
{
_rmm.subscribe(this, RegistryMessageModel_Event::message_construct);
}
@@ -16,3 +22,7 @@ bool Factorio::onEvent(const Message::Events::MessageConstruct& e) {
return false;
}
void onFileEvent(const std::string& path, const filewatch::Event change_type) {
std::cout << "file even " << filewatch::event_to_string(change_type) << " on '" << path << "'\n";
}