fileWatcher.h
1 #pragma once
2 
3 #include <string>
4 #include <boost/function.hpp>
5 #include <boost/system/error_code.hpp>
6 
8 enum class FileStatus
9 {
10  modified
11 };
12 
18 {
19 
20 public:
21 
22  FileWatcher();
23  virtual ~FileWatcher();
24  void start(boost::function<void(std::string, FileStatus)> action);
25  void setFilePath(std::string fullPath);
26 
27 private:
28 
29  std::string mPathToWatch;
30  std::string mFilePath;
31  std::string mConfFileName;
32  boost::function<void(std::string, FileStatus)> mCallback;
33 
34  void inotifyFile(boost::system::error_code& ec);
35 
36 };
Implement the interaction with a inotify tool.
Definition: fileWatcher.h:17