This allows naming a library component "libsomething" without the final
file name having a double lib prefix.
string Pattern::apply(const string &body) const
{
- return prefix+body+suffix;
+ string result = body;
+ if(body.compare(0, prefix.size(), prefix))
+ result = prefix+result;
+ if(body.size()>suffix.size() && body.compare(body.size()-suffix.size(), suffix.size(), suffix))
+ result += suffix;
+ return result;
}
list<string> Pattern::apply_list(const list<Pattern> &patterns, const string &body)