summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2017-07-12 16:41:28 +0100
committerGitHub <noreply@github.com>2017-07-12 16:41:28 +0100
commit7851faac62d7a83c94cd5d37e0109b5d0a152bf9 (patch)
treea5140013cb0e0d8c1a2f484645a32001a4bc808c /include
parent834c94679b7df475e50d87ccb11311e297a78718 (diff)
parent4b37c612257fa94a790d4698a2660112473599ae (diff)
Merge pull request #1267 from SaberUK/master+config
Store config values in a map instead of a unique vector of pairs.
Diffstat (limited to 'include')
-rw-r--r--include/configparser.h2
-rw-r--r--include/configreader.h8
-rw-r--r--include/typedefs.h6
3 files changed, 8 insertions, 8 deletions
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<std::string> reading;
- insp::flat_map<std::string, std::string> vars;
+ insp::flat_map<std::string, std::string, irc::insensitive_swo> vars;
ConfigDataHash& output;
ConfigFileCache& FilesOutput;
std::stringstream& errstr;
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 \<tag> in config */
class CoreExport ConfigTag : public refcountbase
{
- std::vector<KeyVal> 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<KeyVal>& 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<KeyVal>*& 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..873382999 100644
--- a/include/typedefs.h
+++ b/include/typedefs.h
@@ -66,13 +66,13 @@ typedef std::vector<Membership*> IncludeChanList;
*/
typedef std::vector<std::string> file_cache;
-/** A configuration key and value pair
+/** A mapping of configuration keys to their assigned values.
*/
-typedef std::pair<std::string, std::string> KeyVal;
+typedef insp::flat_map<std::string, std::string, irc::insensitive_swo> ConfigItems;
/** The entire configuration
*/
-typedef std::multimap<std::string, reference<ConfigTag> > ConfigDataHash;
+typedef std::multimap<std::string, reference<ConfigTag>, irc::insensitive_swo> ConfigDataHash;
/** Iterator of ConfigDataHash */
typedef ConfigDataHash::const_iterator ConfigIter;