Chatsync  bbffde5c0c672a526bdc83637acf66dc20a80fbf
filechannel.hpp
Go to the documentation of this file.
1 #pragma once
2 #include "channel.hpp"
3 #include <fstream>
4 
5 namespace fileChannel {
6 
13  std::fstream _file;
23  int openPipe(const std::string& filename);
24 
25  std::future<void> activate() override;
26  const messaging::message_ptr parse(const char* line) const override;
28  public:
29  explicit FileChannel(Hub::Hub* hub, const std::string& config);
30  ~FileChannel();
31 
32  std::string type() const override { return "file"; };
33 
34  protected:
35  void incoming(const messaging::message_ptr&& msg) override;
36  };
38 }
static const channeling::ChannelCreatorImpl< FileChannel > creator
Definition: filechannel.hpp:27
std::string type() const override
Definition: filechannel.hpp:32
FileChannel(Hub::Hub *hub, const std::string &config)
Definition: filechannel.cpp:8
Definition: config.cpp:10
std::fstream _file
Definition: filechannel.hpp:13
std::future< void > activate() override
Definition: filechannel.cpp:12
~FileChannel()
Definition: filechannel.cpp:48
std::shared_ptr< const Message > message_ptr
Definition: message.hpp:36
void incoming(const messaging::message_ptr &&msg) override
Definition: filechannel.cpp:25
Definition: channel.hpp:225
Definition: filechannel.hpp:12
Definition: channel.hpp:63
Definition: filechannel.cpp:6
Definition: hub.hpp:24
const messaging::message_ptr parse(const char *line) const override
Definition: filechannel.cpp:40
int openPipe(const std::string &filename)
Definition: filechannel.cpp:65