31 if( aRules.IsEmpty() )
35 if( aBoardPath.GetName().IsEmpty() )
41 wxFileName rulesPath( aBoardPath );
50 rulesFile.Open( rulesPath.GetFullPath(), wxFile::write_excl );
53 if( !rulesFile.IsOpened() )
55 aReporter.
Report( wxString::Format( rulesPath.FileExists()
56 ?
_(
"Imported design rules were not saved, '%s' already exists.\n" )
57 :
_(
"Could not write imported design rules to '%s'\n" ),
58 rulesPath.GetFullPath() ),
63 bool written = rulesFile.Write( aRules );
65 if( !rulesFile.Close() )
71 wxRemoveFile( rulesPath.GetFullPath() );
73 aReporter.
Report( wxString::Format(
_(
"Could not write imported design rules to '%s'\n" ),
74 rulesPath.GetFullPath() ),
bool SaveImportedDesignRules(const wxString &aRules, const wxFileName &aBoardPath, REPORTER &aReporter)
Save the custom rules an importer derived beside the board it produced.