23std::string
Compose(
const std::string& source) {
24 const std::string::size_type pos = source.find(
"##");
25 const std::string visible =
26 (pos == std::string::npos) ? source : source.substr(0, pos);
27 if (visible.empty()) {
31 const std::string& out_visible =
32 (translated !=
nullptr && !translated->empty()) ? *translated : visible;
33 if (pos == std::string::npos) {
36 return out_visible + source.substr(pos);