aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Sadie Powell2021-09-30 19:15:18 +0100
committerGravatar Sadie Powell2021-09-30 19:15:18 +0100
commit1befd6ea00733b59df861731e09de7779146bcda (patch)
treea7afc74b1599e99191818bda986e7fb167f950db
parentUse CXX11_OVERRIDE instead of the override keyword. (diff)
downloadinspircd++-1befd6ea00733b59df861731e09de7779146bcda.tar.gz
inspircd++-1befd6ea00733b59df861731e09de7779146bcda.tar.bz2
inspircd++-1befd6ea00733b59df861731e09de7779146bcda.zip
Move the ParseStack constructor out of the header.
-rw-r--r--include/configparser.h33
-rw-r--r--src/configparser.cpp35
2 files changed, 36 insertions, 32 deletions
diff --git a/include/configparser.h b/include/configparser.h
index 0f6295e37..1a842df3c 100644
--- a/include/configparser.h
+++ b/include/configparser.h
@@ -30,38 +30,7 @@ struct ParseStack
ConfigFileCache& FilesOutput;
std::stringstream& errstr;
- 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";
- }
+ ParseStack(ServerConfig* conf);
bool ParseFile(const std::string& name, int flags, const std::string& mandatory_tag = std::string(), bool isexec = false);
void DoInclude(ConfigTag* includeTag, int flags);
void DoReadFile(const std::string& key, const std::string& file, int flags, bool exec);
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());