From d04a312d0d1edd1223b55ed89b7fb707ceca3117 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Mon, 14 Apr 2025 11:31:19 +0100 Subject: Add Anope::Templace and switch all template strings to use it. --- include/anope.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include') 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 &vars); } /** sepstream allows for splitting token separated lists. -- cgit