1
0

feat: move all print work into main file in BMapInspector

This commit is contained in:
2026-01-31 23:38:26 +08:00
parent c664eaba0e
commit def46d1b8f
6 changed files with 111 additions and 67 deletions

View File

@@ -6,12 +6,18 @@
#include <string_view>
#include <vector>
namespace BMapInspector {
namespace BMapInspector::Reporter {
struct Report {
Utils::ReportLevel level; ///< The level of this report.
std::u8string rule; ///< The name of rule adding this report.
std::u8string content; ///< The content of this report.
Utils::ReportLevel level; ///< The level of this report.
std::u8string rule; ///< The name of rule adding this report.
std::u8string content; ///< The content of this report.
};
struct ReporterDigest {
size_t cnt_err; ///< The count of error report.
size_t cnt_warn; ///< The count of warning report.
size_t cnt_info; ///< The count of info report.
};
class Reporter {
@@ -32,11 +38,11 @@ namespace BMapInspector {
void FormatError(const std::u8string_view& rule, const char8_t* fmt, ...);
public:
void PrintConclusion() const;
void PrintReport() const;
ReporterDigest GetDigest() const;
const std::vector<Report>& GetReports() const;
private:
std::vector<Report> reports;
};
} // namespace BMapInspector::Utils
} // namespace BMapInspector