20#ifndef JOB_IMPORT_UTILS_H
21#define JOB_IMPORT_UTILS_H
56 wxString m_sourceFile;
57 wxString m_sourceFormat;
58 wxString m_outputFile;
62 std::vector<std::pair<wxString, size_t>> m_statistics;
66 nlohmann::json m_extraJson = nlohmann::json::object();
68 std::vector<wxString> m_warnings;
69 std::vector<wxString> m_errors;
91 void Clear()
override;
121 const wxString& aKiCadExt );
143 const wxString& aReportFile,
const IMPORT_REPORT_DATA& aData );
Reporter handed to an importer during an import job.
bool HasMessage() const override
Returns true if any messages were reported.
IMPORT_MESSAGE_COLLECTOR(REPORTER &aJobReporter)
std::vector< wxString > m_warnings
std::vector< wxString > m_errors
A pure virtual class used to derive REPORTER objects from.
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)
Report a string with a given severity.
KICOMMON_API bool LoadLayerMapFile(const wxString &aFile, std::map< wxString, wxString > &aMap, wxString &aError)
Load an explicit layer-mapping file into aMap.
NLOHMANN_JSON_SERIALIZE_ENUM(IMPORT_REPORT_FORMAT, { { IMPORT_REPORT_FORMAT::NONE, "none" }, { IMPORT_REPORT_FORMAT::JSON, "json" }, { IMPORT_REPORT_FORMAT::TEXT, "text" } }) struct KICOMMON_API IMPORT_REPORT_DATA
Data describing a completed import, rendered uniformly by WriteImportReport for both the board and sc...
KICOMMON_API bool ParseImportReportFormat(const wxString &aText, IMPORT_REPORT_FORMAT &aFormat)
Parse the user-facing report format name ("none", "json" or "text") into its enum.
KICOMMON_API wxString DefaultImportOutputPath(const wxString &aInputFile, const wxString &aKiCadExt)
Build the default output path for an import by swapping the input file's extension for the given KiCa...
IMPORT_REPORT_FORMAT
Output format for the report shared by the board and schematic import jobs.
KICOMMON_API bool WriteImportReport(REPORTER *aReporter, IMPORT_REPORT_FORMAT aFormat, const wxString &aReportFile, const IMPORT_REPORT_DATA &aData)
Emit an import report in the requested format to aReportFile, or to aReporter (at INFO severity) when...