summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2025-04-14 11:31:19 +0100
committerSadie Powell <sadie@witchery.services>2025-04-14 11:31:19 +0100
commitd04a312d0d1edd1223b55ed89b7fb707ceca3117 (patch)
tree39b0c165b17d5ff4571423b2bc279b34546c3b72 /include
parent099f0ce43a7e34e4a6e74d91aa911c745c262ba8 (diff)
Add Anope::Templace and switch all template strings to use it.
Diffstat (limited to 'include')
-rw-r--r--include/anope.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/anope.h b/include/anope.h
index 08dff4af3..9c109d9ee 100644
--- a/include/anope.h
+++ b/include/anope.h
@@ -608,6 +608,13 @@ namespace Anope
* @return True if the message was a well formed CTCP; otherwise, false.
*/
extern CoreExport bool ParseCTCP(const Anope::string &text, Anope::string &name, Anope::string &body);
+
+ /** Replaces template variables within a string with values from a map.
+ * @param str The string to template from.
+ * @param vars The variables to replace within the string.
+ * @return The specified string with all variables replaced within it.
+ */
+ extern CoreExport Anope::string Template(const Anope::string &str, const Anope::map<Anope::string> &vars);
}
/** sepstream allows for splitting token separated lists.