InspIRCd  4.0
channelmanager.h
1 /*
2  * InspIRCd -- Internet Relay Chat Daemon
3  *
4  * Copyright (C) 2020 Sadie Powell <[email protected]>
5  *
6  * This file is part of InspIRCd. InspIRCd is free software: you can
7  * redistribute it and/or modify it under the terms of the GNU General Public
8  * License as published by the Free Software Foundation, version 2.
9  *
10  * This program is distributed in the hope that it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
13  * details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 
20 #pragma once
21 
22 typedef std::unordered_map<std::string, Channel*, irc::insensitive, irc::StrHashComp> ChannelMap;
23 
25 class CoreExport ChannelManager
26 {
27  private:
29  ChannelMap channels;
30 
31  public:
33  std::function<bool(const std::string&)> IsChannel = DefaultIsChannel;
34 
40  static bool DefaultIsChannel(const std::string& channel);
41 
46  Channel* Find(const std::string& channel) const;
47 
49  ChannelMap& GetChans() { return channels; }
50  const ChannelMap& GetChans() const { return channels; }
51 
56  bool IsPrefix(unsigned char prefix) const;
57 };
Definition: channels.h:41
Definition: channelmanager.h:26
ChannelMap & GetChans()
Definition: channelmanager.h:49