2 * InspIRCd -- Internet Relay Chat Daemon
4 * Copyright (C) 2016 Attila Molnar <attilamolnar@hush.com>
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.
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
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/>.
29 class Numeric::Numeric
35 /** Parameters of the numeric
37 std::vector<std::string> params;
41 * @param num Numeric number (RPL_*, ERR_*)
43 Numeric(unsigned int num)
48 /** Add a parameter to the numeric. The parameter will be converted to a string first with ConvToStr().
49 * @param x Parameter to add
52 Numeric& push(const T& x)
54 params.push_back(ConvToStr(x));
58 /** Get the number of the numeric as an unsigned integer
59 * @return Numeric number as an unsigned integer
61 unsigned int GetNumeric() const { return numeric; }
63 /** Get the parameters of the numeric
64 * @return Parameters of the numeric as a const vector of strings
66 const std::vector<std::string>& GetParams() const { return params; }
68 /** Get the parameters of the numeric
69 * @return Parameters of the numeric as a vector of strings
71 std::vector<std::string>& GetParams() { return params; }
76 /** ERR_NOSUCHNICK numeric
78 class NoSuchNick : public Numeric::Numeric
81 NoSuchNick(const std::string& nick)
82 : Numeric(ERR_NOSUCHNICK)
85 push("No such nick/channel");