]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - include/configparser.h
Use IsCTCP in blockcolor for ignoring CTCPs.
[user/henk/code/inspircd.git] / include / configparser.h
1 /*
2  * InspIRCd -- Internet Relay Chat Daemon
3  *
4  *   Copyright (C) 2014 Attila Molnar <attilamolnar@hush.com>
5  *   Copyright (C) 2013, 2016, 2021 Sadie Powell <sadie@witchery.services>
6  *   Copyright (C) 2012 Robby <robby@chatbelgie.be>
7  *   Copyright (C) 2009-2010 Daniel De Graaf <danieldg@inspircd.org>
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 struct ParseStack
26 {
27         std::vector<std::string> reading;
28         insp::flat_map<std::string, std::string, irc::insensitive_swo> vars;
29         ConfigDataHash& output;
30         ConfigFileCache& FilesOutput;
31         std::stringstream& errstr;
32
33         ParseStack(ServerConfig* conf)
34                 : output(conf->config_data), FilesOutput(conf->Files), errstr(conf->errstr)
35         {
36                 // Special character escapes.
37                 vars["newline"] = "\n";
38                 vars["nl"]      = "\n";
39
40                 // XML escapes.
41                 vars["amp"]  = "&";
42                 vars["apos"] = "'";
43                 vars["gt"]   = ">";
44                 vars["lt"]   = "<";
45                 vars["quot"] = "\"";
46
47                 // IRC formatting codes.
48                 vars["irc.bold"]          = "\x02";
49                 vars["irc.color"]         = "\x03";
50                 vars["irc.colour"]        = "\x03";
51                 vars["irc.italic"]        = "\x1D";
52                 vars["irc.monospace"]     = "\x11";
53                 vars["irc.reset"]         = "\x0F";
54                 vars["irc.reverse"]       = "\x16";
55                 vars["irc.strikethrough"] = "\x1E";
56                 vars["irc.underline"]     = "\x1F";
57         }
58         bool ParseFile(const std::string& name, int flags, const std::string& mandatory_tag = std::string(), bool isexec = false);
59         void DoInclude(ConfigTag* includeTag, int flags);
60         void DoReadFile(const std::string& key, const std::string& file, int flags, bool exec);
61 };