32 m_expression( aExpression ),
52 aReporter->
Report(
_(
"ERROR in expression." ) );
62 [&](
const wxString& aMessage,
int aOffset )
64 aReporter->
Report(
_(
"ERROR:" ) + wxS(
" " ) + aMessage );
73 if(
m_ucode->Run( &ctx )->AsDouble() != 0.0 )
81 if(
m_ucode->Run( &ctx )->AsDouble() != 0.0 )
96 [&](
const wxString& aMessage,
int aOffset )
99 wxString first = aMessage.BeforeFirst(
'|', &rest );
100 wxString msg = wxString::Format(
_(
"ERROR: <a href='%d:%d'>%s</a>%s" ),
102 aSourceOffset + aOffset,
110 m_ucode = std::make_unique<PCBEXPR_UCODE>();
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
std::unique_ptr< PCBEXPR_UCODE > m_ucode
DRC_RULE_CONDITION(const wxString &aExpression="")
bool Compile(REPORTER *aReporter, int aSourceLine=0, int aSourceOffset=0)
wxString GetExpression() const
bool EvaluateFor(const BOARD_ITEM *aItemA, const BOARD_ITEM *aItemB, int aConstraint, PCB_LAYER_ID aLayer, REPORTER *aReporter=nullptr)
void SetErrorCallback(std::function< void(const wxString &aMessage, int aOffset)> aCallback)
bool Compile(const wxString &aString, UCODE *aCode, CONTEXT *aPreflightContext)
void SetErrorCallback(std::function< void(const wxString &aMessage, int aOffset)> aCallback)
void SetItems(BOARD_ITEM *a, BOARD_ITEM *b=nullptr)
A pure virtual class used to derive REPORTER objects from.
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)=0
Report a string with a given severity.
PCB_LAYER_ID
A quick note on layer IDs: