loom
1#include "ReporterWithReducibleSeverity.h"
2
3using namespace simodo;
4
5ReporterWithReducibleSeverity::ReporterWithReducibleSeverity(inout::Reporter_abstract & m) : _m(m) {}
6
7void ReporterWithReducibleSeverity::report(const inout::SeverityLevel level,
8const inout::Location & location,
9const std::string & briefly,
10const std::string & atlarge) const
11{
12int16_t severity = static_cast<int16_t>(level);
13if (_reduce_severity)
14severity --;
15_m.report(static_cast<inout::SeverityLevel>(severity), location, briefly, atlarge);
16}
17
18void ReporterWithReducibleSeverity::reduceSeverity(bool reduce) { _reduce_severity = reduce; }