[libcalamares] Add a more convenient find() to NamedEnum

- In most cases, you **know** the table covers all the enum
  values, and the extra parameter *ok* is just annoying.
  Provide a convenience that doesn't distinguish empty
  from empty-but-valid.
main
Adriaan de Groot 4 years ago
parent 197cb9982c
commit f0c4164515

@ -105,6 +105,16 @@ struct NamedEnumTable
// ok is still false
return string_t();
}
/** @brief Find a value @p s in the table and return its name.
*
* Returns emptry string if the value is not found.
*/
string_t find( enum_t s ) const
{
bool ok = false;
return find( s, ok );
}
};
/** @brief Smashes an enum value to its underlying type. */

Loading…
Cancel
Save