{
return prefix+body+suffix;
}
+
+list<string> Pattern::apply_list(const list<Pattern> &patterns, const string &body)
+{
+ list<string> result;
+ for(list<Pattern>::const_iterator i=patterns.begin(); i!=patterns.end(); ++i)
+ result.push_back(i->apply(body));
+ return result;
+}
#ifndef PATTERN_H_
#define PATTERN_H_
+#include <list>
#include <string>
/**
/** Applies the pattern to a body string. */
std::string apply(const std::string &) const;
+
+ /** Applies a list of patterns to the same body. */
+ static std::list<std::string> apply_list(const std::list<Pattern> &, const std::string &);
};
#endif
list<string> shared_names;
if(mode!=BuildInfo::FORCE_STATIC)
- {
- const list<Pattern> &shared_patterns = arch.get_shared_library_patterns();
- for(list<Pattern>::const_iterator i=shared_patterns.begin(); i!=shared_patterns.end(); ++i)
- shared_names.push_back(i->apply(lib));
- }
+ shared_names = Pattern::apply_list(arch.get_shared_library_patterns(), lib);
list<string> static_names;
if(mode!=BuildInfo::FORCE_DYNAMIC)
- {
- const list<Pattern> &static_patterns = arch.get_static_library_patterns();
- for(list<Pattern>::const_iterator i=static_patterns.begin(); i!=static_patterns.end(); ++i)
- static_names.push_back(i->apply(lib));
- }
+ static_names = Pattern::apply_list(arch.get_static_library_patterns(), lib);
for(list<FS::Path>::const_iterator i=combined_path.begin(); i!=combined_path.end(); ++i)
{