1
0
Fork 0
mirror of https://github.com/KingDuckZ/kamokan.git synced 2024-11-23 00:33:44 +00:00

Use string_view directly with mstch.

This commit is contained in:
King_DuckZ 2017-06-07 00:40:03 +01:00
parent 056e7dcde4
commit 108a8c8e06
2 changed files with 3 additions and 7 deletions

@ -1 +1 @@
Subproject commit 333869e83e552c07d99718fa4352925ea9fca172
Subproject commit 45122d1d515c90a54d509d4b2d8d9279348518f5

View file

@ -47,10 +47,6 @@ namespace tawashi {
// return path.substr(start_index, substr_len);
//}
std::string to_string (const boost::string_view& parStr) {
return std::string(parStr.data(), parStr.size());
}
std::string make_root_path (const SettingsBag& parSettings) {
auto retval = parSettings["website_root"];
if (retval.empty()) {
@ -177,8 +173,8 @@ namespace tawashi {
SPDLOG_TRACE(statuslog, "Preparing mustache dictionary");
mstch::map mustache_context {
{"version", std::string{STRINGIZE(VERSION_MAJOR) "." STRINGIZE(VERSION_MINOR) "." STRINGIZE(VERSION_PATCH)}},
{"base_uri", std::string(base_uri())},
{"host_path", to_string(make_host_path(this->settings()))},
{"base_uri", base_uri()},
{"host_path", make_host_path(this->settings())},
{"languages", make_mstch_langmap(*m_settings)}
};