]> jfr.im git - irc/evilnet/mod.chanfix.git/blob - sqlChanOp.cc
Fixed missing include, corebug fix was already applied here.
[irc/evilnet/mod.chanfix.git] / sqlChanOp.cc
1 /**
2 * sqlChanOp.cc
3 *
4 * Author: Matthias Crauwels <ultimate_@wol.be>
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
19 * USA.
20 *
21 * $Id$
22 */
23
24 #include <sstream>
25 #include <string>
26
27 #include "dbHandle.h"
28
29 #include "ELog.h"
30 #include "misc.h"
31
32 #include "chanfix.h"
33 #include "sqlChanOp.h"
34
35 namespace gnuworld
36 {
37
38 namespace cf
39 {
40
41 sqlChanOp::sqlChanOp(sqlManager* _myManager) :
42 channel(""),
43 account(""),
44 nickUserHost(""),
45 points(0),
46 ts_firstopped(0),
47 ts_lastopped(0),
48 day()
49 {
50 myManager = _myManager;
51 }
52
53 void sqlChanOp::setAllMembers(dbHandle* theDB, int row)
54 {
55 channel = theDB->GetValue(row, 0);
56 account = theDB->GetValue(row, 1);
57 nickUserHost = theDB->GetValue(row, 2);
58 ts_firstopped = atoi(theDB->GetValue(row, 3));
59 ts_lastopped = atoi(theDB->GetValue(row, 4));
60 day[0] = atoi(theDB->GetValue(row, 5));
61 day[1] = atoi(theDB->GetValue(row, 6));
62 day[2] = atoi(theDB->GetValue(row, 7));
63 day[3] = atoi(theDB->GetValue(row, 8));
64 day[4] = atoi(theDB->GetValue(row, 9));
65 day[5] = atoi(theDB->GetValue(row, 10));
66 day[6] = atoi(theDB->GetValue(row, 11));
67 day[7] = atoi(theDB->GetValue(row, 12));
68 day[8] = atoi(theDB->GetValue(row, 13));
69 day[9] = atoi(theDB->GetValue(row, 14));
70 day[10] = atoi(theDB->GetValue(row, 15));
71 day[11] = atoi(theDB->GetValue(row, 16));
72 day[12] = atoi(theDB->GetValue(row, 17));
73 day[13] = atoi(theDB->GetValue(row, 18));
74 calcTotalPoints();
75 }
76
77 void sqlChanOp::calcTotalPoints()
78 {
79 int i;
80 points = 0;
81 for (i = 0; i < DAYSAMPLES; i++) {
82 points += day[i];
83 }
84 }
85
86 sqlChanOp::~sqlChanOp()
87 {
88 // No heap space allocated
89 }
90
91 } // namespace cf
92
93 } // namespace gnuworld