KiCad PCB EDA Suite
SIM_VALUE_GRAMMAR Namespace Reference

Classes

struct  digits
 
struct  exponent
 
struct  exponentPrefix
 
struct  exponentWithPrefix
 
struct  fracPart
 
struct  garbageSuffix
 
struct  garbageSuffix< NOTATION::SI >
 
struct  garbageSuffix< NOTATION::SPICE >
 
struct  intPart
 
struct  metricSuffix
 
struct  metricSuffix< SIM_VALUE::TYPE_FLOAT, NOTATION::SI >
 
struct  metricSuffix< SIM_VALUE::TYPE_FLOAT, NOTATION::SPICE >
 
struct  metricSuffix< SIM_VALUE::TYPE_INT, NOTATION::SI >
 
struct  metricSuffix< SIM_VALUE::TYPE_INT, NOTATION::SPICE >
 
struct  number
 
struct  numberGrammar
 
struct  sign
 
struct  significand
 
struct  significand< SIM_VALUE::TYPE_FLOAT >
 
struct  significand< SIM_VALUE::TYPE_INT >
 

Enumerations

enum class  NOTATION { SI , SPICE }
 

Functions

bool IsValid (const std::string &aString, SIM_VALUE::TYPE aValueType=SIM_VALUE::TYPE_FLOAT, NOTATION aNotation=NOTATION::SI)
 

Variables

template<NOTATION Notation>
std::string allowedIntChars
 

Enumeration Type Documentation

◆ NOTATION

enum class SIM_VALUE_GRAMMAR::NOTATION
strong
Enumerator
SI 
SPICE 

Definition at line 39 of file sim_value.h.

Function Documentation

◆ IsValid()

bool SIM_VALUE_GRAMMAR::IsValid ( const std::string &  aString,
SIM_VALUE::TYPE  aValueType = SIM_VALUE::TYPE_FLOAT,
NOTATION  aNotation = NOTATION::SI 
)

Definition at line 127 of file sim_value.cpp.

130{
131 tao::pegtl::string_input<> in( aString, "from_content" );
132
133 try
134 {
135 CALL_INSTANCE( aValueType, aNotation, doIsValid, in );
136 }
137 catch( const tao::pegtl::parse_error& )
138 {
139 return false;
140 }
141
142 return true;
143}
#define CALL_INSTANCE(ValueType, Notation, func,...)
Definition: sim_value.cpp:33
static void doIsValid(tao::pegtl::string_input<> &aIn)
Definition: sim_value.cpp:121

References CALL_INSTANCE, and doIsValid().

Referenced by SIM_STRING_VALIDATOR::isValid(), LIB_TREE::onPreselect(), LIB_TREE::onQueryCharHook(), SYMBOL_VIEWER_FRAME::OnSelectSymbol(), LIB_TREE::onTreeActivate(), SCH_BASE_FRAME::PickSymbolFromLibTree(), FOOTPRINT_EDIT_FRAME::retainLastFootprint(), and DIALOG_EDIT_SYMBOLS_LIBID::validateLibIds().

Variable Documentation

◆ allowedIntChars

template<NOTATION Notation>
std::string SIM_VALUE_GRAMMAR::allowedIntChars

Definition at line 148 of file sim_value.h.