forked from filgy/watcher
-
Notifications
You must be signed in to change notification settings - Fork 1
/
callback.cpp
76 lines (60 loc) · 1.52 KB
/
callback.cpp
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#include "callback.h"
/* - - - - - - - - - - - - - - - - - - - - - -
Class: trigger
------------------------------------------- */
trigger::trigger(string name, string pattern, string command){
this->name = name;
this->pattern = pattern;
this->command = command;
}
string trigger::getName(){
return this->name;
}
string trigger::getPattern(){
return this->pattern;
}
string trigger::getCommand(){
return this->command;
}
/* - - - - - - - - - - - - - - - - - - - - - -
Class: callback
------------------------------------------- */
callback::callback(string file, string name, string logfile, long position, long size)
{
this->file = file;
this->name = name;
this->logfile = logfile;
this->position = position;
this->size = size;
this->triggers.clear();
}
void callback::setPosition(long position){
this->position = position;
}
void callback::setSize(long size){
this->size = size;
}
string callback::getFile(){
return this->file;
}
string callback::getName(){
return this->name;
}
string callback::getLogfile(){
return this->logfile;
}
long callback::getPosition(){
return this->position;
}
long callback::getSize(){
return this->size;
}
int callback::getTriggersCount(){
return this->triggers.size();
}
void callback::addTrigger(string name, string pattern, string command){
this->triggers.insert(make_pair(name, trigger(name, pattern, command)));
}
map<string, trigger> callback::getTriggers(){
return this->triggers;
}