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