-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathevent.hpp
43 lines (32 loc) · 1.45 KB
/
event.hpp
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
#ifndef EVENT_HPP
#define EVENT_HPP
#include <string>
#include <array>
#include "event_size.hpp"
class event_t
{
private:
std::string weekday;
unsigned warn_time{0}, start_time{0}, end_time{0};
std::string warn_notif, start_notif, end_notif, about_to_start_notif, in_progress_notif;
unsigned parse_time(const std::string&, const std::string&) const;
inline bool validate_times(const unsigned, const unsigned, const unsigned) const;
std::string unparse_notif(std::string, std::string) const;
void find_replace(std::string&, const std::string&, const std::string&) const;
std::string compose_notif(const std::string&, const std::string&) const;
std::string unparse_cmd(const std::string&) const;
public:
event_t() = default;
event_t(const std::array<std::string, event_constant::size>&);
bool operator<(const event_t& event) const;
void load_event(const std::array<std::string, event_constant::size>&);
friend void send_notif(const event_t&, const unsigned short);
friend void send_notif(const std::string&, const std::string&);
friend void send_notif(const std::string&);
unsigned time(const unsigned short) const;
std::string notif(const unsigned short) const;
};
void send_notif(const event_t&, const unsigned short);
void send_notif(const std::string&, const std::string&);
void send_notif(const std::string&);
#endif