aboutsummaryrefslogtreecommitdiff
path: root/src/configparser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/configparser.cpp')
-rw-r--r--src/configparser.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/configparser.cpp b/src/configparser.cpp
index ed0557db1..e05dcd6ff 100644
--- a/src/configparser.cpp
+++ b/src/configparser.cpp
@@ -504,6 +504,41 @@ void ParseStack::DoReadFile(const std::string& key, const std::string& name, int
}
}
+ParseStack::ParseStack(ServerConfig* conf)
+ : output(conf->config_data)
+ , FilesOutput(conf->Files)
+ , errstr(conf->errstr)
+{
+ // Special character escapes.
+ vars["newline"] = "\n";
+ vars["nl"] = "\n";
+
+ // XML escapes.
+ vars["amp"] = "&";
+ vars["apos"] = "'";
+ vars["gt"] = ">";
+ vars["lt"] = "<";
+ vars["quot"] = "\"";
+
+ // Directories that were set at build time.
+ vars["dir.config"] = INSPIRCD_CONFIG_PATH;
+ vars["dir.data"] = INSPIRCD_DATA_PATH;
+ vars["dir.log"] = INSPIRCD_LOG_PATH;
+ vars["dir.module"] = INSPIRCD_MODULE_PATH;
+ vars["dir.runtime"] = INSPIRCD_RUNTIME_PATH;
+
+ // IRC formatting codes.
+ vars["irc.bold"] = "\x02";
+ vars["irc.color"] = "\x03";
+ vars["irc.colour"] = "\x03";
+ vars["irc.italic"] = "\x1D";
+ vars["irc.monospace"] = "\x11";
+ vars["irc.reset"] = "\x0F";
+ vars["irc.reverse"] = "\x16";
+ vars["irc.strikethrough"] = "\x1E";
+ vars["irc.underline"] = "\x1F";
+}
+
bool ParseStack::ParseFile(const std::string& path, int flags, const std::string& mandatory_tag, bool isexec)
{
ServerInstance->Logs->Log("CONFIG", LOG_DEBUG, "Reading (isexec=%d) %s", isexec, path.c_str());