mirror of https://github.com/aria2/aria2
2008-05-11 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Rewritten * src/FeatureConfig.cc (featureSummary)pull/1/head
parent
05f0646112
commit
9fd38f12b7
|
@ -1,3 +1,8 @@
|
|||
2008-05-11 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
||||
|
||||
Rewritten
|
||||
* src/FeatureConfig.cc (featureSummary)
|
||||
|
||||
2008-05-11 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
||||
|
||||
Changed method signature:
|
||||
|
|
|
@ -121,22 +121,16 @@ bool FeatureConfig::isSupported(const std::string& feature) const
|
|||
}
|
||||
}
|
||||
|
||||
class AccFeature {
|
||||
public:
|
||||
std::string operator()(std::string line, const FeatureMap::value_type& v)
|
||||
{
|
||||
if(v.second) {
|
||||
line += v.first+", ";
|
||||
}
|
||||
return line;
|
||||
}
|
||||
};
|
||||
|
||||
std::string FeatureConfig::featureSummary() const
|
||||
{
|
||||
return Util::trim
|
||||
(std::accumulate(_features.begin(), _features.end(), std::string(),
|
||||
AccFeature()), ", ");
|
||||
std::string s;
|
||||
for(FeatureMap::const_iterator i = _features.begin();
|
||||
i != _features.end(); ++i) {
|
||||
if((*i).second) {
|
||||
s += (*i).first+", ";
|
||||
}
|
||||
}
|
||||
return Util::trim(s, ", ");
|
||||
}
|
||||
|
||||
} // namespace aria2
|
||||
|
|
Loading…
Reference in New Issue