diff options
author | Peter Powell <petpow@saberuk.com> | 2016-12-08 01:57:47 +0000 |
---|---|---|
committer | Peter Powell <petpow@saberuk.com> | 2016-12-08 02:01:40 +0000 |
commit | 3fd1ba753d0e4cb56ecb22ddfdabd6795e17ff25 (patch) | |
tree | b6737fd91223d5291477fc960f0bf880f9d0b40c /include | |
parent | 5366dd2abd8fdeecf4a6ff173faf1f241d185628 (diff) |
Store config values in a map instead of a unique vector of pairs.
Diffstat (limited to 'include')
-rw-r--r-- | include/configreader.h | 8 | ||||
-rw-r--r-- | include/typedefs.h | 4 |
2 files changed, 6 insertions, 6 deletions
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..d7bfadc60 100644 --- a/include/typedefs.h +++ b/include/typedefs.h @@ -66,9 +66,9 @@ 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> ConfigItems; /** The entire configuration */ |