#include #include #include "mustache/mustache.hpp" std::string Mustache::render(const std::string& tmplt,const std::map& context) { std::string result = tmplt; for(std::map::const_iterator it=context.begin(); it!=context.end(); ++it) { std::regex reg("\\{\\{"+it->first+"\\}\\}"); result = std::regex_replace(result,reg,std::string(it->second)); } return result; }