38 auto res = std::find_if( aRefDes.rbegin(), aRefDes.rend(),
41 return aChr !=
'?' && !std::isdigit( aChr );
44 return { aRefDes.begin(),
res.base() };
57 size_t firstnum = aRefDes.find_first_of( wxS(
"0123456789" ) );
59 if( firstnum != wxString::npos )
61 wxString candidateValue = aRefDes.Mid( firstnum );
64 if( !candidateValue.ToLong( &result ) )
67 retval =
static_cast<int>( result );
A model subscriber implementation using links to represent connections.
wxString GetRefDesPrefix(const wxString &aRefDes)
Get the (non-numeric) prefix from a refdes - e.g.
wxString GetRefDesUnannotated(const wxString &aSource)
Return an unannotated refdes from either a prefix or an existing refdes.
int GetRefDesNumber(const wxString &aRefDes)
Get the numeric suffix from a refdes - e.g.
Collection of utility functions for component reference designators (refdes)