KiCad PCB EDA Suite
Loading...
Searching...
No Matches
REGEX_VALIDATOR Class Reference

Custom validator that checks verifies that a string exactly matches a regular expression. More...

#include <validators.h>

Inheritance diagram for REGEX_VALIDATOR:

Public Member Functions

 REGEX_VALIDATOR (const wxString &aRegEx, wxString *aValue=nullptr)
 
 REGEX_VALIDATOR (const wxString &aRegEx, int aFlags, wxString *aValue=nullptr)
 
 REGEX_VALIDATOR (const REGEX_VALIDATOR &aOther)
 
virtual wxObject * Clone () const override
 
bool Validate (wxWindow *aParent) override
 
const wxString & GetRegEx () const
 

Protected Member Functions

void compileRegEx (const wxString &aRegEx, int aFlags)
 < Compiles and stores a regular expression
 

Protected Attributes

wxString m_regExString
 Original compilation flags (for copy constructor)
 
int m_regExFlags
 Compiled regex.
 
wxRegEx m_regEx
 

Detailed Description

Custom validator that checks verifies that a string exactly matches a regular expression.

Definition at line 112 of file validators.h.

Constructor & Destructor Documentation

◆ REGEX_VALIDATOR() [1/3]

REGEX_VALIDATOR::REGEX_VALIDATOR ( const wxString &  aRegEx,
wxString *  aValue = nullptr 
)
inline
Parameters
aRegExis a regular expression to validate strings.
aValueis a pointer to a wxString containing the value to validate.

Definition at line 119 of file validators.h.

References compileRegEx().

◆ REGEX_VALIDATOR() [2/3]

REGEX_VALIDATOR::REGEX_VALIDATOR ( const wxString &  aRegEx,
int  aFlags,
wxString *  aValue = nullptr 
)
inline
Parameters
aRegExis a regular expression to validate strings.
aFlagsare compilation flags (normally wxRE_DEFAULT).
aValueis a pointer to a wxString containing the value to validate.

Definition at line 130 of file validators.h.

References compileRegEx().

◆ REGEX_VALIDATOR() [3/3]

REGEX_VALIDATOR::REGEX_VALIDATOR ( const REGEX_VALIDATOR aOther)
inline

Definition at line 136 of file validators.h.

References compileRegEx(), m_regExFlags, and m_regExString.

Member Function Documentation

◆ Clone()

virtual wxObject * REGEX_VALIDATOR::Clone ( ) const
inlineoverridevirtual

Definition at line 141 of file validators.h.

◆ compileRegEx()

void REGEX_VALIDATOR::compileRegEx ( const wxString &  aRegEx,
int  aFlags 
)
protected

< Compiles and stores a regular expression

Original regular expression (for copy constructor)

Definition at line 232 of file validators.cpp.

References m_regEx, m_regExFlags, and m_regExString.

Referenced by REGEX_VALIDATOR().

◆ GetRegEx()

const wxString & REGEX_VALIDATOR::GetRegEx ( ) const
inline

Definition at line 148 of file validators.h.

References m_regExString.

◆ Validate()

bool REGEX_VALIDATOR::Validate ( wxWindow *  aParent)
override

Definition at line 194 of file validators.cpp.

References _, DisplayErrorMessage(), and m_regEx.

Member Data Documentation

◆ m_regEx

wxRegEx REGEX_VALIDATOR::m_regEx
protected

Definition at line 164 of file validators.h.

Referenced by compileRegEx(), and Validate().

◆ m_regExFlags

int REGEX_VALIDATOR::m_regExFlags
protected

Compiled regex.

Definition at line 161 of file validators.h.

Referenced by compileRegEx(), and REGEX_VALIDATOR().

◆ m_regExString

wxString REGEX_VALIDATOR::m_regExString
protected

Original compilation flags (for copy constructor)

Definition at line 158 of file validators.h.

Referenced by compileRegEx(), GetRegEx(), and REGEX_VALIDATOR().


The documentation for this class was generated from the following files: