KiCad PCB EDA Suite
Loading...
Searching...
No Matches
import_design_rules.cpp File Reference
#include "import_design_rules.h"
#include <reporter.h>
#include <wildcards_and_files_ext.h>
#include <wx/file.h>
#include <wx/filefn.h>
#include <wx/log.h>

Go to the source code of this file.

Functions

bool SaveImportedDesignRules (const wxString &aRules, const wxFileName &aBoardPath, REPORTER &aReporter)
 Save the custom rules an importer derived beside the board it produced.
 

Function Documentation

◆ SaveImportedDesignRules()

bool SaveImportedDesignRules ( const wxString & aRules,
const wxFileName & aBoardPath,
REPORTER & aReporter )

Save the custom rules an importer derived beside the board it produced.

An existing rules file is the user's and is never replaced.

Shared by the board editor import and the kicad-cli import job.

Parameters
[in]aRulesis the rules text, nothing is written when it is empty.
[in]aBoardPathis the board the rules belong to, the rules take its name.
[in]aReporterreceives a warning when the rules are not written.
Returns
true if the rules file was written.

Definition at line 29 of file import_design_rules.cpp.

References _, FILEEXT::DesignRulesFileExtension, REPORTER::Report(), and RPT_SEVERITY_WARNING.

Referenced by BOOST_AUTO_TEST_CASE(), and PCB_EDIT_FRAME::OpenProjectFiles().