aboutsummaryrefslogtreecommitdiff
path: root/src/configparser.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2021-09-30 20:12:36 +0100
committerGravatar Sadie Powell2021-09-30 20:12:36 +0100
commit6b99684a09e013d379dec51f659b439e4680bc0e (patch)
tree051fab6c94176047f78b79945fb3a67593a54106 /src/configparser.cpp
parentUse regex_stdlib as the default regular expression engine. (diff)
parentMove the ParseStack constructor out of the header. (diff)
Merge branch 'insp3' into master.
Diffstat (limited to 'src/configparser.cpp')
-rw-r--r--src/configparser.cpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/configparser.cpp b/src/configparser.cpp
index 59a8d7f6c..7e18af0e0 100644
--- a/src/configparser.cpp
+++ b/src/configparser.cpp
@@ -462,6 +462,43 @@ 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)
+{
+ vars = {
+ // Special character escapes.
+ { "newline", "\n" },
+ { "nl", "\n" },
+
+ // XML escapes.
+ { "amp", "&" },
+ { "apos", "'" },
+ { "gt", ">" },
+ { "lt", "<" },
+ { "quot", "\"" },
+
+ // Directories that were set at build time.
+ { "dir.config", INSPIRCD_CONFIG_PATH },
+ { "dir.data", INSPIRCD_DATA_PATH },
+ { "dir.log", INSPIRCD_LOG_PATH },
+ { "dir.module", INSPIRCD_MODULE_PATH },
+ { "dir.runtime", INSPIRCD_RUNTIME_PATH },
+
+ // IRC formatting codes.
+ { "irc.bold", "\x02" },
+ { "irc.color", "\x03" },
+ { "irc.colour", "\x03" },
+ { "irc.italic", "\x1D" },
+ { "irc.monospace", "\x11" },
+ { "irc.reset", "\x0F" },
+ { "irc.reverse", "\x16" },
+ { "irc.strikethrough", "\x1E" },
+ { "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());