InspIRCd  3.0
snomasks.h
1 /*
2  * InspIRCd -- Internet Relay Chat Daemon
3  *
4  * Copyright (C) 2010 Daniel De Graaf <[email protected]>
5  * Copyright (C) 2008 Robin Burchell <[email protected]>
6  * Copyright (C) 2007 Dennis Friis <[email protected]>
7  * Copyright (C) 2006 Craig Edwards <[email protected]>
8  *
9  * This file is part of InspIRCd. InspIRCd is free software: you can
10  * redistribute it and/or modify it under the terms of the GNU General Public
11  * License as published by the Free Software Foundation, version 2.
12  *
13  * This program is distributed in the hope that it will be useful, but WITHOUT
14  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
16  * details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20  */
21 
22 
23 #pragma once
24 
25 class SnomaskManager;
26 class Snomask
27 {
30  std::string Description;
31 
35  std::string LastMessage;
36  char LastLetter;
37  unsigned int Count;
38 
44  static void Send(char letter, const std::string& desc, const std::string& msg);
45 
46  public:
49  Snomask();
50 
55  void SendMessage(const std::string& message, char letter);
56 
59  void Flush();
60 
66  std::string GetDescription(char letter) const;
67 
68  friend class SnomaskManager;
69 };
70 
75 class CoreExport SnomaskManager : public fakederef<SnomaskManager>
76 {
77  Snomask masks[26];
78 
79  public:
83 
91  void EnableSnomask(char letter, const std::string &description);
92 
97  void WriteToSnoMask(char letter, const std::string &text);
98 
104  void WriteToSnoMask(char letter, const char* text, ...) CUSTOM_PRINTF(3, 4);
105 
110  void WriteGlobalSno(char letter, const std::string &text);
111 
117  void WriteGlobalSno(char letter, const char* text, ...) CUSTOM_PRINTF(3, 4);
118 
127  void FlushSnotices();
128 
135  bool IsSnomaskUsable(char ch) const;
136 };
Definition: snomasks.h:26
std::string GetDescription(char letter) const
Definition: snomasks.cpp:144
void Flush()
Definition: snomasks.cpp:110
Snomask()
Definition: snomasks.cpp:83
void SendMessage(const std::string &message, char letter)
Definition: snomasks.cpp:88
Definition: inspircd.h:59
Definition: snomasks.h:75