* \brief Parses a CSS numeric value string with units into a float. * * Converts string representations of numbers (with or without units) into * floating-point values. Handles invalid input gracefully by returning the * provided default value. * * \param value The numeric string to parse (e.g., "10px", "15.5"). * \param default_value The value to return if parsing fails. * \return The par
| 626 | * \return The parsed float value, or default_value on error. |
| 627 | */ |
| 628 | float COMPUTED_STYLE::parse_string_to_float(const std::string &value, const float default_value) |
| 629 | { |
| 630 | try |
| 631 | { |
| 632 | float num_value = std::stof(value); |
| 633 | return num_value; |
| 634 | } |
| 635 | catch (...) |
| 636 | { |
| 637 | return default_value; |
| 638 | } |
| 639 | } |
| 640 | |
| 641 | /** |
| 642 | * \brief Returns the inherited color value as a hex string. |
nothing calls this directly
no outgoing calls
no test coverage detected