Add filename/line information to all ConfigTag objects

git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11886 e03df62e-2008-0410-955e-edbf42e46eb7
This commit is contained in:
danieldg 2009-10-17 17:53:22 +00:00
parent 0388139f5d
commit a34b7ce9ed
2 changed files with 383 additions and 506 deletions

View File

@ -40,9 +40,12 @@ typedef std::pair<std::string, std::string> KeyVal;
struct ConfigTag : public refcountbase
{
const std::string tag;
const std::string src_name;
const int src_line;
std::vector<KeyVal> 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<std::string> 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<std::string, std::istream*> 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 };

File diff suppressed because it is too large Load Diff