|
pianod2
multisource multiuser scriptable networked music player
|
String to rating conversion. More...
#include <ratings.h>


Public Member Functions | |
| bool | tryGetPrecise (const char *s, float *rating) const noexcept |
| Retrieve the enumerator corresponding to text name. More... | |
| bool | tryGetPrecise (const std::string &s, float *rating) const noexcept |
| float | getPrecise (const char *s) const |
| Get a precise rating, accepting either a rating string or number. More... | |
| float | getPrecise (const std::string &s) const |
| virtual const RATING_LOOKUP * | get (const char *s) const noexcept override |
| Retrieve the enumerator corresponding to text name. More... | |
Public Member Functions inherited from LookupTable< Rating, RATING_LOOKUP > | |
| LookupTable ()=delete | |
| LookupTable (const LookupTable< Rating, RATING_LOOKUP > &)=delete | |
| LookupTable (const LookupTable< Rating, RATING_LOOKUP > &&)=delete | |
| LookupTable (const RATING_LOOKUP *tab) | |
| Initialize the lookup table from an array. More... | |
| LookupTable (const std::initializer_list< RATING_LOOKUP > tab) | |
| Initialize the lookup table from an initializer list. More... | |
| ~LookupTable () | |
| const RATING_LOOKUP * | get (const Rating id) const |
| Retrieve a table entry by the enumerator of an entry. More... | |
| const Rating | operator[] (const char *s) const |
| Retrieve the enumerator corresponding to text name. More... | |
| const Rating | operator[] (const std::string &s) const |
| Retrieve the enumerator corresponding to text name. More... | |
| const char * | operator[] (const Rating id) const |
| Retrieve the text name of an enumerator. More... | |
| const bool | tryGetValue (const char *s, Rating *value) const |
| Retrieve the enumerator corresponding to a text value. More... | |
| const bool | tryGetValue (const std::string &s, Rating *value) const |
| const RATING_LOOKUP * | begin () const |
| const RATING_LOOKUP * | end () const |
Private Types | |
| typedef LookupTable< Rating, RATING_LOOKUP > | base_class |
String to rating conversion.
The standard Lookup functions use the ratings enumeration values, which requires rounding, suitable for storage. The Precise variations return unrounded star-range ratings (0 < rating ≤ 5), suitable for working with averages.
|
private |
|
overridevirtualnoexcept |
Retrieve the enumerator corresponding to text name.
| s | The text name |
Reimplemented from LookupTable< Rating, RATING_LOOKUP >.

| float RatingLookup::getPrecise | ( | const char * | s | ) | const |
Get a precise rating, accepting either a rating string or number.
| s | A string containing a rating. |
| E_INVALID | if the value is out of range, not a rating, or otherwise invalid. |


|
inline |

|
noexcept |
Retrieve the enumerator corresponding to text name.
| s | The text of the rating. |
| rating | [out] The parsed rating. |


|
inlinenoexcept |
