-
Notifications
You must be signed in to change notification settings - Fork 16
/
filemonitor.h
46 lines (38 loc) · 1.16 KB
/
filemonitor.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef _FILEMONITOR_H_
#define _FILEMONITOR_H_
#include <iostream>
#include <sstream>
#include <thread>
#include <list>
#include <strings.h>
#include <sys/stat.h>
#include "configure.h"
#include "pagelist.h"
/**
* @brief Watches for changes to teletext page files and updates the page list as needed
* www.ibm.com/developerworks/linux/library/l-ubuntu-inotify/index.html
*/
namespace vbit
{
class FileMonitor
{
public:
/** Default constructor */
FileMonitor();
FileMonitor(ttx::Configure *configure, Debug *debug, ttx::PageList *pageList);
/** Default destructor */
virtual ~FileMonitor();
/**
* Runs the monitoring thread and does not terminate (at least for now)
* @return Nothing useful yet. Perhaps return an error status if something goes wrong
*/
void run();
protected:
private:
ttx::Configure* _configure; /// Member reference to the configuration settings
Debug* _debug;
ttx::PageList* _pageList;
int readDirectory(std::string path);
};
}
#endif // _FILEMONITOR_H_