ostream&
operator<<(ostream& s, const Parameters& parameters)
{
- return s << "min-age:" << parameters.min_age << endl
- << "space-limit:" << parameters.space_limit
+ return s << "min-age:" << parameters.min_age << '\n'
+ << "space-limit:" << parameters.space_limit << '\n'
<< "free-limit:" << parameters.free_limit;
}
protected:
virtual list<ProxySnapshots::iterator> calculate_candidates(ProxySnapshots& snapshots,
- Range::Value value) = 0;
+ const Range::Value& value) = 0;
struct younger_than
{
void cleanup(ProxySnapshots& snapshots, std::function<bool()> condition);
ProxySnapper* snapper;
- bool verbose;
+ const bool verbose;
const Parameters& parameters;
};
#ifdef VERBOSE_LOGGING
cout << byte_to_humanstring(quota_data.size, 2) << ", "
<< byte_to_humanstring(quota_data.used, 2) << ", "
- << fraction << ", " << satisfied << endl;
+ << fraction << ", " << satisfied << '\n';
#endif
return satisfied;
#ifdef VERBOSE_LOGGING
cout << byte_to_humanstring(free_space_data.size, 2) << ", "
<< byte_to_humanstring(free_space_data.free, 2) << ", "
- << fraction << ", " << satisfied << endl;
+ << fraction << ", " << satisfied << '\n';
#endif
return satisfied;
// not enough candidates to satisfy the condition
#ifdef VERBOSE_LOGGING
- cout << "condition not satisfied" << endl;
+ cout << "condition not satisfied" << '\n';
#endif
return;
// not enough candidates to satisfy the condition
#ifdef VERBOSE_LOGGING
- cout << "condition not satisfied" << endl;
+ cout << "condition not satisfied" << '\n';
#endif
return;
}
#ifdef VERBOSE_LOGGING
- cout << "condition satisfied" << endl;
+ cout << "condition satisfied" << '\n';
#endif
}
ProxySnapshots& snapshots = snapper->getSnapshots();
#ifdef VERBOSE_LOGGING
- cout << "cleanup without condition" << endl;
+ cout << "cleanup without condition" << '\n';
#endif
cleanup(snapshots);
if (is_quota_aware())
{
#ifdef VERBOSE_LOGGING
- cout << "cleanup with quota condition" << endl;
+ cout << "cleanup with quota condition" << '\n';
#endif
cleanup(snapshots, std::bind(&Cleaner::is_quota_satisfied, this));
else
{
#ifdef VERBOSE_LOGGING
- cout << "no cleanup with quota condition" << endl;
+ cout << "no cleanup with quota condition" << '\n';
#endif
}
if (is_free_aware())
{
#ifdef VERBOSE_LOGGING
- cout << "cleanup with free condition" << endl;
+ cout << "cleanup with free condition" << '\n';
#endif
cleanup(snapshots, std::bind(&Cleaner::is_free_satisfied, this));
else
{
#ifdef VERBOSE_LOGGING
- cout << "no cleanup with free condition" << endl;
+ cout << "no cleanup with free condition" << '\n';
#endif
}
}
ostream&
operator<<(ostream& s, const NumberParameters& parameters)
{
- return s << dynamic_cast<const Parameters&>(parameters) << endl
- << "limit:" << parameters.limit << endl
+ return s << dynamic_cast<const Parameters&>(parameters) << '\n'
+ << "limit:" << parameters.limit << '\n'
<< "limit-important:" << parameters.limit_important;
}
list<ProxySnapshots::iterator>
- calculate_candidates(ProxySnapshots& snapshots, Range::Value value) override
+ calculate_candidates(ProxySnapshots& snapshots, const Range::Value& value) override
{
const NumberParameters& parameters = dynamic_cast<const NumberParameters&>(Cleaner::parameters);
ostream&
operator<<(ostream& s, const TimelineParameters& parameters)
{
- return s << dynamic_cast<const Parameters&>(parameters) << endl
- << "limit-hourly:" << parameters.limit_hourly << endl
- << "limit-daily:" << parameters.limit_daily << endl
- << "limit-weekly:" << parameters.limit_weekly << endl
- << "limit-monthly:" << parameters.limit_monthly << endl
+ return s << dynamic_cast<const Parameters&>(parameters) << '\n'
+ << "limit-hourly:" << parameters.limit_hourly << '\n'
+ << "limit-daily:" << parameters.limit_daily << '\n'
+ << "limit-weekly:" << parameters.limit_weekly << '\n'
+ << "limit-monthly:" << parameters.limit_monthly << '\n'
<< "limit-yearly:" << parameters.limit_yearly;
}
list<ProxySnapshots::iterator>
- calculate_candidates(ProxySnapshots& snapshots, Range::Value value) override
+ calculate_candidates(ProxySnapshots& snapshots, const Range::Value& value) override
{
const TimelineParameters& parameters = dynamic_cast<const TimelineParameters&>(Cleaner::parameters);
private:
list<ProxySnapshots::iterator>
- calculate_candidates(ProxySnapshots& snapshots, Range::Value value) override
+ calculate_candidates(ProxySnapshots& snapshots, const Range::Value& value) override
{
list<ProxySnapshots::iterator> ret;