KiCad PCB EDA Suite
class_netlist_object.cpp File Reference

Class NETLIST_OBJECT to handle 1 item connected (in netlist and erc calculations) More...

#include <fctsys.h>
#include <macros.h>
#include <schframe.h>
#include <sch_component.h>
#include <class_netlist_object.h>
#include <wx/regex.h>

Go to the source code of this file.

Functions

static wxRegEx busLabelRe (wxT("^([^[:space:]]+)(\\[[\\d]+\\.+[\\d]+\\])$"), wxRE_ADVANCED)
 The regular expression string for label bus notation. More...
 
bool IsBusLabel (const wxString &aLabel)
 Function IsBusLabel test if aLabel has a bus notation. More...
 

Detailed Description

Class NETLIST_OBJECT to handle 1 item connected (in netlist and erc calculations)

Definition in file class_netlist_object.cpp.

Function Documentation

static wxRegEx busLabelRe ( wxT("^([^[:space:]]+)(\\[[\\d]+\\.+[\\d]+\\])$")  ,
wxRE_ADVANCED   
)
static

The regular expression string for label bus notation.

Valid bus labels are defined as one or more non-whitespace characters from the beginning of the string followed by the bus notation [nn...mm] with no characters after the closing bracket.

Referenced by NETLIST_OBJECT::ConvertBusToNetListItems(), and IsBusLabel().

bool IsBusLabel ( const wxString &  aLabel)

Function IsBusLabel test if aLabel has a bus notation.

Parameters
aLabelA wxString object containing the label to test.
Returns
true if text is a bus notation format otherwise false is returned.

Definition at line 49 of file class_netlist_object.cpp.

References busLabelRe().

Referenced by NETLIST_OBJECT::ConvertBusToNetListItems(), SCH_TEXT::GetNetListItem(), SCH_SHEET::GetNetListItem(), and SCH_SCREEN::IsTerminalPoint().

50 {
51  wxCHECK_MSG( busLabelRe.IsValid(), false,
52  wxT( "Invalid regular expression in IsBusLabel()." ) );
53 
54  return busLabelRe.Matches( aLabel );
55 }
static wxRegEx busLabelRe(wxT("^([^[:space:]]+)(\\[[\\d]+\\.+[\\d]+\\])$"), wxRE_ADVANCED)
The regular expression string for label bus notation.