]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - include/bancache.h
You'll hit yourself w00t. You left the ; off both the class decls :p
[user/henk/code/inspircd.git] / include / bancache.h
1 /*       +------------------------------------+
2  *       | Inspire Internet Relay Chat Daemon |
3  *       +------------------------------------+
4  *
5  *  InspIRCd: (C) 2002-2007 InspIRCd Development Team
6  * See: http://www.inspircd.org/wiki/index.php/Credits
7  *
8  * This program is free but copyrighted software; see
9  *          the file COPYING for details.
10  *
11  * ---------------------------------------------------
12  */
13
14 #ifndef __BANCACHE_H
15 #define __BANCACHE_H
16
17 #include <string>
18
19 class CoreExport BanCacheHit : public classbase
20 {
21  private:
22  public:
23         const std::string Type;
24         const std::string Reason;
25         const bool Banned;
26         const time_t Duration;
27         const time_t Creation;
28 };
29
30 // must be defined after class BanCacheHit.
31 typedef nspace::hash_map<std::string, BanCacheHit *, nspace::hash<std::string> > BanCacheHash;
32
33 class CoreExport BanCacheManager : public classbase
34 {
35  private:
36         BanCacheHash *BanHash;
37         InspIRCd *ServerInstance;
38  public:
39         BanCacheHit *AddHit(const std::string &ip, bool banned, const std::string &reason);
40         BanCacheHit *GetHit(const std::string &ip);
41
42         BanCacheManager(InspIRCd *Instance)
43         {
44                 this->ServerInstance = Instance;
45                 this->BanHash = new BanCacheHash();
46         }
47 };
48
49 #endif