mstch/src/mstch.cpp

19 lines
497 B
C++
Raw Normal View History

2015-04-09 20:41:27 +02:00
#include <iostream>
2015-04-12 15:35:13 +02:00
#include "mstch/mstch.hpp"
#include "render_context.hpp"
2015-04-12 16:19:55 +02:00
#include "utils.hpp"
2015-04-09 20:41:27 +02:00
using namespace mstch;
std::string mstch::render(
2015-04-11 16:29:12 +02:00
const std::string& tmplt,
2015-04-13 02:34:27 +02:00
const object& root,
2015-04-09 20:41:27 +02:00
const std::map<std::string,std::string>& partials)
{
std::map<std::string,template_type> partial_templts;
for(auto& partial: partials)
partial_templts.insert({partial.first, {partial.second}});
return render_context(root, partial_templts).render(tmplt);
2015-04-09 20:41:27 +02:00
}