added format_file_conditionally()

This commit is contained in:
2026-01-12 11:18:03 +01:00
parent 8796199757
commit 1a58577b3e
2 changed files with 76 additions and 6 deletions

View File

@@ -7,3 +7,13 @@
// @return Formatted file in std::string
std::string format_file(const std::string &TEMPLATE_FILE,
const std::string &TEMPLATE, const std::string &INPUT);
// @brief Format file conditionally. Replace everything between `{{if
// _something_}}` to `{{endif}}` If INPUT is empty then everything between
// this will be removed.
// @param TEMPLATE_FILE File that you want to format in string.
// @param TEMPLATE Full name of the if statement. For example `{{if title}}`
// @return Formatted file in std::string
std::string format_file_condtionally(const std::string &TEMPLATE_FILE,
const std::string &TEMPLATE,
const std::string &INPUT);