[project @ 2005-07-07 21:19:26 by unknown_lamer]
[clinton/bobotpp.git] / source / ShitEntry.H
1 // ShitEntry.H -*- C++ -*-
2 // Copyright (c) 1998 Etienne BERNARD
3 // Copyright (c) 2002 Clinton Ebadi
4
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 2 of the License, or
8 // any later version.
9
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 // 02110-1301, USA.
19
20 #ifndef SHITENTRY_H
21 #define SHITENTRY_H
22
23 #include <ctime>
24
25 #include "Mask.H"
26
27 class ShitList;
28 class UserCommands;
29
30 class ShitEntry {
31 Mask shitMask;
32 Mask shitChannelMask;
33 int shitLevel;
34 std::time_t expirationDate;
35 String shitReason;
36
37 public:
38
39 enum {
40 SHIT_NOSHIT = 0,
41 SHIT_NOOP = 1,
42 SHIT_NOJOIN = 2,
43 SHIT_NODEBAN = 3
44 };
45
46 ShitEntry(String, String, int, std::time_t, String);
47
48 bool matches(String, String);
49 bool isStillValid();
50
51 String getMask();
52 String getChannelMask();
53
54 int getShitLevel() const;
55 time_t getExpirationDate() const;
56 String getShitReason() const;
57
58 friend class ShitList;
59 friend class UserCommands;
60 };
61
62 #endif