| 7 | namespace { |
| 8 | |
| 9 | void trim(std::string& s) { |
| 10 | if (s.empty()) { |
| 11 | return; |
| 12 | } |
| 13 | |
| 14 | s.erase(0, s.find_first_not_of(" ")); |
| 15 | s.erase(s.find_last_not_of(" ") + 1); |
| 16 | } |
| 17 | std::string render_with_cbk( |
| 18 | const std::string& template_str, std::regex regx, |
| 19 | const StringTemplate::KvMap kv_map, const StringTemplate::FuncMap func_map) { |