From 3fd1ba753d0e4cb56ecb22ddfdabd6795e17ff25 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Thu, 8 Dec 2016 01:57:47 +0000 Subject: Store config values in a map instead of a unique vector of pairs. --- include/configreader.h | 8 ++++---- include/typedefs.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/configreader.h b/include/configreader.h index 005d4a37d..4d70d8510 100644 --- a/include/configreader.h +++ b/include/configreader.h @@ -35,7 +35,7 @@ /** Structure representing a single \ in config */ class CoreExport ConfigTag : public refcountbase { - std::vector items; + ConfigItems items; public: const std::string tag; const std::string src_name; @@ -80,10 +80,10 @@ class CoreExport ConfigTag : public refcountbase std::string getTagLocation(); - inline const std::vector& getItems() const { return items; } + inline const ConfigItems& getItems() const { return items; } - /** Create a new ConfigTag, giving access to the private KeyVal item list */ - static ConfigTag* create(const std::string& Tag, const std::string& file, int line, std::vector*& Items); + /** Create a new ConfigTag, giving access to the private ConfigItems item list */ + static ConfigTag* create(const std::string& Tag, const std::string& file, int line, ConfigItems*& Items); private: ConfigTag(const std::string& Tag, const std::string& file, int line); }; diff --git a/include/typedefs.h b/include/typedefs.h index 879ef0627..d7bfadc60 100644 --- a/include/typedefs.h +++ b/include/typedefs.h @@ -66,9 +66,9 @@ typedef std::vector IncludeChanList; */ typedef std::vector file_cache; -/** A configuration key and value pair +/** A mapping of configuration keys to their assigned values. */ -typedef std::pair KeyVal; +typedef insp::flat_map ConfigItems; /** The entire configuration */ -- cgit v1.2.3 From 4b37c612257fa94a790d4698a2660112473599ae Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Thu, 8 Dec 2016 01:58:59 +0000 Subject: Make the config system case insensitive. --- include/configparser.h | 2 +- include/typedefs.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/configparser.h b/include/configparser.h index 02619e759..c9790c59f 100644 --- a/include/configparser.h +++ b/include/configparser.h @@ -41,7 +41,7 @@ enum ParseFlags struct ParseStack { std::vector reading; - insp::flat_map vars; + insp::flat_map vars; ConfigDataHash& output; ConfigFileCache& FilesOutput; std::stringstream& errstr; diff --git a/include/typedefs.h b/include/typedefs.h index d7bfadc60..873382999 100644 --- a/include/typedefs.h +++ b/include/typedefs.h @@ -68,11 +68,11 @@ typedef std::vector file_cache; /** A mapping of configuration keys to their assigned values. */ -typedef insp::flat_map ConfigItems; +typedef insp::flat_map ConfigItems; /** The entire configuration */ -typedef std::multimap > ConfigDataHash; +typedef std::multimap, irc::insensitive_swo> ConfigDataHash; /** Iterator of ConfigDataHash */ typedef ConfigDataHash::const_iterator ConfigIter; -- cgit v1.2.3