102 const std::string &value = parameter.
get();
103 const std::size_t first = value.find_first_not_of(
" \t\r\n" );
104 if( first == std::string::npos )
108 const std::string text = value.substr( first, value.find_last_not_of(
" \t\r\n" ) - first + 1 );
111 if( text.rfind(
"0x", 0 ) == 0 )
114 if(
const auto [end,
error] = std::from_chars( text.data() + 2, text.data() + text.size(), coordinate, 16 );
115 error != std::errc() || end != text.data() + text.size() )
119 return static_cast<double>( coordinate );
123 std::istringstream stream( text );
124 stream.imbue( std::locale::classic() );
126 double coordinate = 0.0;
127 stream >> coordinate;
130 if( stream.fail() || !stream.eof() || !std::isfinite( coordinate ) )
Result< std::string > get_parameter_value(const std::string &name) const
GatePin * get_pin() const
GateType * get_type() const
bool has_property(GateTypeProperty property) const
bool is_delay(const Gate *gate)
bool is_mux(const Gate *gate)
bool is_connected_to_control_pin(const Endpoint *endpoint)
bool is_control_pin(PinType pin_type)
bool is_inverter(const Gate *gate)
bool is_buffer(const Gate *gate)
bool is_latch(const Gate *gate)
bool is_pll(const Gate *gate)
std::optional< double > read_parameter_coordinate(const Gate *gate, const std::string &name)
bool is_ff(const Gate *gate)
bool is_oscillator(const Gate *gate)