aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorGravatar Sadie Powell2020-11-03 22:30:58 +0000
committerGravatar Sadie Powell2020-11-03 22:30:58 +0000
commit3075cc7bd0aa6db5752e76183c267d091584705f (patch)
tree0dc08804108dd3391e158ed79a2bbedfed0911dc /include
parentStore the SQL row id in the synthesised sqloper config tags. (diff)
Move config typedefs to ServerConfig and use auto in more places.
Diffstat (limited to 'include')
-rw-r--r--include/configparser.h2
-rw-r--r--include/configreader.h12
-rw-r--r--include/typedefs.h10
3 files changed, 10 insertions, 14 deletions
diff --git a/include/configparser.h b/include/configparser.h
index 87f4cdf5f..6a5428b13 100644
--- a/include/configparser.h
+++ b/include/configparser.h
@@ -26,7 +26,7 @@ struct ParseStack
{
std::vector<std::string> reading;
insp::flat_map<std::string, std::string, irc::insensitive_swo> vars;
- ConfigDataHash& output;
+ ServerConfig::TagMap& output;
ConfigFileCache& FilesOutput;
std::stringstream& errstr;
diff --git a/include/configreader.h b/include/configreader.h
index 521c0726f..f66d61080 100644
--- a/include/configreader.h
+++ b/include/configreader.h
@@ -292,6 +292,12 @@ class CoreExport ServerConfig
*/
typedef insp::flat_map<std::string, std::shared_ptr<OperInfo>> OperIndex;
+ /** Holds the server config. */
+ typedef std::multimap<std::string, std::shared_ptr<ConfigTag>, irc::insensitive_swo> TagMap;
+
+ /** Holds iterators to a subsection of the server config map. */
+ typedef stdalgo::iterator_range<TagMap::const_iterator> TagList;
+
/** Get a configuration tag by name. If one or more tags are present then the first is returned.
* @param tag The name of the tag to get.
* @returns Either a tag from the config or EmptyTag.
@@ -300,9 +306,9 @@ class CoreExport ServerConfig
/** Get a list of configuration tags by name.
* @param tag The name of the tags to get.
- * @returns Either a list of tags from the config or an empty ConfigTagList.
+ * @returns Either a list of tags from the config or an empty TagList.
*/
- ConfigTagList ConfTags(const std::string& tag);
+ TagList ConfTags(const std::string& tag);
/** An empty configuration tag. */
std::shared_ptr<ConfigTag> EmptyTag;
@@ -320,7 +326,7 @@ class CoreExport ServerConfig
/** This holds all the information in the config file,
* it's indexed by tag name to a vector of key/values.
*/
- ConfigDataHash config_data;
+ TagMap config_data;
/** This holds all extra files that have been read in the configuration
* (for example, MOTD and RULES files are stored here)
diff --git a/include/typedefs.h b/include/typedefs.h
index 90d2d93db..7907ea035 100644
--- a/include/typedefs.h
+++ b/include/typedefs.h
@@ -95,16 +95,6 @@ typedef std::vector<Membership*> IncludeChanList;
*/
typedef std::vector<std::string> file_cache;
-/** The entire configuration
- */
-typedef std::multimap<std::string, std::shared_ptr<ConfigTag>, irc::insensitive_swo> ConfigDataHash;
-
-/** Iterator of ConfigDataHash */
-typedef ConfigDataHash::const_iterator ConfigIter;
-
-/** Iterator pair, used for tag-name ranges */
-typedef stdalgo::iterator_range<ConfigIter> ConfigTagList;
-
/** Files read by the configuration */
typedef std::map<std::string, file_cache> ConfigFileCache;