20#ifndef DRC_RULE_DOCUMENT_H
21#define DRC_RULE_DOCUMENT_H
55 void LoadFrom(
const wxString& aPath );
60 bool Save( wxString* aError );
72 void SetText(
const wxString& aText );
124 bool load(
const wxString& aPath );
Information pertinent to a Pcbnew printed circuit board.
bool HasUnparsedText() const
True while the Custom Rules text could not be parsed.
std::vector< int > IndicesSetting(DRC_CONSTRAINT_T aConstraint) const
Every rule that sets aConstraint, whichever page edits it.
void SetText(const wxString &aText)
Take the text of the Custom Rules page.
bool Save(wxString *aError)
Write the board's rules file.
static size_t FindConstraintClause(const wxString &aText, const wxString &aCode)
Position of the constraint clause for aCode in rule text, or npos.
void UpdateEntry(int aIndex, const DRC_RE_LOADED_PANEL_ENTRY &aEdited)
Write an edited rule back.
std::vector< DRC_RE_LOADED_PANEL_ENTRY > & Entries()
std::vector< int > IndicesFor(DRC_RULE_EDITOR_CONSTRAINT_NAME aType) const
void Load()
Read the board's own rules file.
static std::set< DRC_CONSTRAINT_T > ConstraintsOf(const DRC_RE_LOADED_PANEL_ENTRY &aEntry)
The DRC constraints a rule sets, read back through the rules parser.
bool parseInto(const wxString &aText)
wxString UniqueRuleName(const wxString &aBase) const
std::vector< DRC_RE_LOADED_PANEL_ENTRY > m_entries
int Add(const DRC_RE_LOADED_PANEL_ENTRY &aEntry)
DRC_RULE_DOCUMENT(BOARD *aBoard)
void LoadFrom(const wxString &aPath)
Replace the rules with those of another board's file, as an import.
bool IsRuleNameUnique(const wxString &aName, DRC_RULE_EDITOR_CONSTRAINT_NAME aType, int aExceptIndex) const
DRC_RE_FILE_TRIVIA m_trivia
bool load(const wxString &aPath)
Returns false when the file could not be read, leaving the document as it was.
wxString GetText() const
The rules as text, for the Custom Rules page.
int Duplicate(int aIndex)
bool Move(int aIndex, int aDelta, DRC_RULE_EDITOR_CONSTRAINT_NAME aType)
Move a rule one step among the rules listed for aType.
DRC_RULE_EDITOR_CONSTRAINT_NAME
The text of a rules file that lies outside every rule, kept so a save can reproduce it.
Represents a rule loaded from a .kicad_dru file and mapped to a panel.