|
pianod2
multisource multiuser scriptable networked music player
|
Nodes for the filter parse tree. More...
#include <filter.h>

Classes | |
| union | value_t |
Public Member Functions | |
| Operation () | |
| ~Operation () | |
| std::string | toString () |
| Operation (const Action _action, const Field _field) | |
| Construct a check or comparision. More... | |
| Operation (const Action action, std::unique_ptr< Filter::Operation > &&left, std::unique_ptr< Filter::Operation > &&right) | |
| Operation (const Action action, const Field field, const std::string &_value, const bool wildcard=false) | |
| Construct a string comparison. More... | |
| Operation (const Action action, const Field field, const long value) | |
| Construct a numeric comparison operation. More... | |
| Operation (const Action action, const Field field, const FilterRating value, const User *user) | |
| Construct a rating comparison. More... | |
| Operation (const Action action, const Field field, const MusicThingie::Type type) | |
| Construct a type comparision. More... | |
| Operation (const Operation &)=delete | |
| Operation & | operator= (const Operation &)=delete |
| Operation (Operation &&from) | |
| Move-construct an operation. More... | |
| Operation & | operator= (Operation &&from) |
| Move-assign an operation. More... | |
| template<typename DiffType > | |
| bool | applyOperation (DiffType diff) const |
| Apply operation to difference, yielding truth. More... | |
| bool | numericCheck (long compare_to) const |
| Perform a numeric comparision. More... | |
| bool | stringCheck (const std::string &compare_to) const |
| Check if string value matches filter comparison. More... | |
| bool | genreCheck (const std::string &list) const |
| Check if a genre/genre list matches the filter comparison. More... | |
| bool | evaluate (const PianodPlaylist *playlist) const |
| Determine if a playlist matches a filter. More... | |
| bool | evaluate (const PianodArtist *artist) const |
| Determine if an artist (or artist components of an album or song) match a filter. More... | |
| bool | evaluate (const PianodAlbum *album) const |
| Determine if an album (or album components of a song) match a filter. More... | |
| bool | evaluate (const PianodSong *track) const |
| Determine if a song matches a filter. More... | |
Static Public Member Functions | |
| static bool | isNumericOperator (Action action) |
| Check if an operation applies to numeric values. More... | |
| static bool | isStringOperator (Action action) |
| Check if an operation applies to strings. More... | |
| static bool | isStringField (Field field) |
| Check if a field contains string values. More... | |
| static MusicThingie::Type | getTypeFromField (const Filter::Field field) |
| Get the music thingie type corresponding to a field name. More... | |
Private Member Functions | |
| void | clear () |
| Release value in an operation node. More... | |
Private Attributes | |
| Field | field = Field::Invalid |
| For comparison operations, the field to match. More... | |
| Action | action = Action::Noop |
| The operation: and/or, comparison type, etc. More... | |
| bool | invert = false |
| Apply not operator to result of action. More... | |
| union Filter::Operation::value_t | value |
Friends | |
| class | Query::List |
| Op | Filter::parseNegation (const char **const command) |
Nodes for the filter parse tree.
|
inline |
|
inline |

Construct a check or comparision.
| _action | The manner of comparison: equal, not equal, etc. |
| _field | The field on which to compare or test. |
| Filter::Operation::Operation | ( | const Action | action, |
| std::unique_ptr< Filter::Operation > && | left, | ||
| std::unique_ptr< Filter::Operation > && | right | ||
| ) |
| Filter::Operation::Operation | ( | const Action | _action, |
| const Field | _field, | ||
| const std::string & | _value, | ||
| const bool | wildcard = false |
||
| ) |
Construct a string comparison.
| _action | The manner of comparison. |
| _field | The field to compare. |
| _value | The value to compare to. |
| wildcard | If true, _value need only match the start of string. |

Construct a numeric comparison operation.
| _action | The manner of comparison. |
| _field | The field to compare. |
| _value | The value to compare to. |

| Filter::Operation::Operation | ( | const Action | _action, |
| const Field | _field, | ||
| const FilterRating | rating, | ||
| const User * | user | ||
| ) |
Construct a rating comparison.
| _action | The manner of comparison. |
| _field | The field to compare to. |
| rating | The value to compare to. |
| user | The user to apply the comparison to, if applicable. |

| Filter::Operation::Operation | ( | const Action | _action, |
| const Field | _field, | ||
| const MusicThingie::Type | _type | ||
| ) |
Construct a type comparision.
| _action | The manner of comparison. |
| _field | The field to compare to: always Field::Type. |
| _type | The type to compare to. |
|
delete |
| Filter::Operation::Operation | ( | Operation && | from | ) |
Move-construct an operation.
| bool Filter::Operation::applyOperation | ( | DiffType | diff | ) | const |
Apply operation to difference, yielding truth.
| diff | Difference between two items, or 0 for equal. |

|
private |
Release value in an operation node.
Does not reset the node; invoking this twice will double-release unless the values have been replaced.

| bool Filter::Operation::evaluate | ( | const PianodAlbum * | album | ) | const |
Determine if an album (or album components of a song) match a filter.

| bool Filter::Operation::evaluate | ( | const PianodArtist * | artist | ) | const |
Determine if an artist (or artist components of an album or song) match a filter.

| bool Filter::Operation::evaluate | ( | const PianodPlaylist * | playlist | ) | const |
Determine if a playlist matches a filter.

| bool Filter::Operation::evaluate | ( | const PianodSong * | track | ) | const |
Determine if a song matches a filter.

| bool Filter::Operation::genreCheck | ( | const std::string & | list | ) | const |
Check if a genre/genre list matches the filter comparison.
| list | A genre or list separated by commas, slashes and plus. |

|
static |
Get the music thingie type corresponding to a field name.
| field | The field to get the type of. |
| InvalidValue | if the field has no associated MusicThingie type. |

|
static |
Check if an operation applies to numeric values.
| action | The operation to check. |

|
static |
Check if a field contains string values.
| field | The field to check. |

|
static |
Check if an operation applies to strings.
| action | The operation to check. |

|
inline |
Perform a numeric comparision.
| compare_to | Value being compared. Zero is null, so always false. |

| Filter::Operation & Filter::Operation::operator= | ( | Operation && | from | ) |
Move-assign an operation.
| bool Filter::Operation::stringCheck | ( | const std::string & | compare_to | ) | const |
Check if string value matches filter comparison.
| compare_to | The string to check against. |

| std::string Filter::Operation::toString | ( | ) |


|
friend |
|
friend |
|
private |
The operation: and/or, comparison type, etc.
|
private |
For comparison operations, the field to match.
|
private |
Apply not operator to result of action.
|
private |