From a34b7ce9edcae893a655d2fb42b5d93a441a7013 Mon Sep 17 00:00:00 2001 From: danieldg Date: Sat, 17 Oct 2009 17:53:22 +0000 Subject: Add filename/line information to all ConfigTag objects git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11886 e03df62e-2008-0410-955e-edbf42e46eb7 --- include/configreader.h | 36 ++++++------------------------------ 1 file changed, 6 insertions(+), 30 deletions(-) (limited to 'include/configreader.h') diff --git a/include/configreader.h b/include/configreader.h index 754d17379..8d969b360 100644 --- a/include/configreader.h +++ b/include/configreader.h @@ -40,9 +40,12 @@ typedef std::pair KeyVal; struct ConfigTag : public refcountbase { const std::string tag; + const std::string src_name; + const int src_line; std::vector items; - ConfigTag(const std::string& Tag) : tag(Tag) {} + ConfigTag(const std::string& Tag, const std::string& file, int line) + : tag(Tag), src_name(file), src_line(line) {} std::string getString(const std::string& key, const std::string& def = ""); long getInt(const std::string& key, long def = 0); @@ -50,6 +53,8 @@ struct ConfigTag : public refcountbase bool getBool(const std::string& key, bool def = false); bool readString(const std::string& key, std::string& value, bool allow_newline = false); + + std::string getTagLocation(); }; /** An entire config file, built up of KeyValLists @@ -115,35 +120,10 @@ class ServerLimits class CoreExport ServerConfig : public classbase { private: - /** This variable holds the names of all - * files included from the main one. This - * is used to make sure that no files are - * recursively included. - */ - std::vector include_stack; - - /** This private method processes one line of - * configutation, appending errors to errorstream - * and setting error if an error has occured. - */ - bool ParseLine(const std::string &filename, std::string &line, long &linenumber, bool allowexeinc); - - /** Check that there is only one of each configuration item - */ - bool CheckOnce(const char* tag); - void CrossCheckOperClassType(); void CrossCheckConnectBlocks(ServerConfig* current); public: - /** Process an include executable directive - */ - bool DoPipe(const std::string &file); - - /** Process an include file directive - */ - bool DoInclude(const std::string &file, bool allowexeinc); - /** Error stream, contains error output from any failed configuration parsing. */ std::stringstream errstr; @@ -151,10 +131,6 @@ class CoreExport ServerConfig : public classbase /** True if this configuration is valid enough to run with */ bool valid; - /** Set of included files. Do we use this any more? - */ - std::map IncludedFiles; - /** Used to indicate who we announce invites to on a channel */ enum InviteAnnounceState { INVITE_ANNOUNCE_NONE, INVITE_ANNOUNCE_ALL, INVITE_ANNOUNCE_OPS, INVITE_ANNOUNCE_DYNAMIC }; -- cgit v1.2.3