diff options
author | Toni Uhlig <matzeton@googlemail.com> | 2021-11-11 17:09:40 +0100 |
---|---|---|
committer | Toni Uhlig <matzeton@googlemail.com> | 2021-11-11 17:09:40 +0100 |
commit | cb3a3ba618b33247d1be61d7aa6e9f3de628b876 (patch) | |
tree | 2d15ce16cc9029f26645184cfb5a79bf4ee7e853 | |
parent | 95f17c2ae374efa9e17f132950b29f00d0fbc0ab (diff) |
Inja callback "itoa".
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
-rw-r--r-- | src/TemplateManager.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/TemplateManager.cpp b/src/TemplateManager.cpp index ff14610..025ceb8 100644 --- a/src/TemplateManager.cpp +++ b/src/TemplateManager.cpp @@ -13,6 +13,12 @@ TemplateManager::TemplateManager() return true; }); /* + * itoa(convertable); + */ + AddInjaCallback("itoa", 1, [](inja::Arguments & args) { + return std::to_string(args.at(0)->get<int>()); + }); + /* * indent(input: str, width: int, first: bool, blank: bool); */ AddInjaCallback("indent", 4, [](inja::Arguments & args) { |