pianod2
multisource multiuser scriptable networked music player
Classes | Namespaces | Macros | Enumerations | Functions | Variables
predicate.cpp File Reference

Predicate handling. More...

#include <config.h>
#include <cstdlib>
#include <memory>
#include <unordered_set>
#include <exception>
#include <algorithm>
#include <football/football.h>
#include <parsnip/parsnip.h>
#include <parsnip/parsnip_command.h>
#include "fundamentals.h"
#include "lookup.h"
#include "utility.h"
#include "interpreter.h"
#include "predicate.h"
#include "connection.h"
#include "retainedlist.h"
#include "filter.h"
#include "querylist.h"
#include "mediaunit.h"
#include "mediamanager.h"
Include dependency graph for predicate.cpp:

Classes

struct  Predicate::Predicate
 

Namespaces

 Predicate
 Functions and types for parsing and interpreting predicates.
 

Macros

#define PREDKEY_EXPRESSION   "expression"
 
#define PREDKEY_ITEMLIST   "items"
 
#define PREDKEY_FULFILLMENT   "fulfill"
 
#define PREDKEY_SOURCENAME   "sourcename"
 
#define PREDKEY_SEEDTYPE   "seedtype"
 
#define SEEDPREP   " <to|from|for>"
 

Enumerations

enum class  Predicate::MANNER {
  Predicate::NAME , Predicate::ID , Predicate::WHERE , Predicate::LIKE ,
  Predicate::SOURCE
}
 Manners in which predicates may be specified. More...
 

Functions

void Predicate::construct_predicate_parsers (PianodParser *parser)
 
static Predicate Predicate::getFullPredicate (const PianodConnection &conn, const Parsnip::Data &predicate, Filter::Field field)
 Parse a command's predicate and return a matching filter. More...
 
std::unique_ptr< FilterPredicate::getPredicate (const PianodConnection &conn, const Parsnip::Data &predicate, Filter::Field field)
 Return just the filter portion of a predicate, for external use. More...
 
static ThingieList Predicate::getPredicateIdItems (const Parsnip::Data &predicate)
 Specialization for getting things by ID. More...
 
static ThingieList Predicate::getPartialSpecifiedThings (Predicate &pred, SearchRange search_what)
 Gather a list of assorted things specified by a predicate, which must be present. More...
 
ThingieList Predicate::getSpecifiedThings (const PianodConnection &conn, const Parsnip::Data &predicate, SearchRange search_what)
 Gather a list of assorted things specified by a predicate. More...
 
MusicThingiePredicate::getSpecifiedThing (const PianodConnection &conn, const Parsnip::Data &predicate)
 Interpret a request for an unspecified type of thing and return it. More...
 
static PlaylistList Predicate::getSpecifiedPlaylistsById (const Parsnip::Data &predicate)
 Get playlist items by id. More...
 
PlaylistList Predicate::getSpecifiedPlaylists (const PianodConnection &conn, const Parsnip::Data &predicate)
 Interpret a list of playlists specified by a predicate. More...
 
PianodPlaylistPredicate::getSpecifiedPlaylist (const PianodConnection &conn, const Parsnip::Data &predicate)
 Gather a request for a single playlist and return it. More...
 
SongList Predicate::getSpecifiedSongs (const PianodConnection &conn, const Parsnip::Data &predicate, SearchRange search_what)
 Interpret a list of songs specified by a predicate. More...
 
PianodSongPredicate::getSpecifiedSong (const PianodConnection &conn, const Parsnip::Data &predicate)
 Gather a request for a single song and return it. More...
 

Variables

const LookupTable< MANNER > Predicate::PredicateManners ({ { "name", MANNER::NAME }, { "id", MANNER::ID }, { "where", MANNER::WHERE }, { "like", MANNER::LIKE } })
 Lookup table for manner names to enumeration. More...
 
const LookupTable< Filter::FieldPredicate::SearchFields ({ { "any", Filter::Field::Search }, { "artist", Filter::Field::Artist }, { "album", Filter::Field::Album }, { "song", Filter::Field::Title }, { "playlist", Filter::Field::Playlist }, { "genre", Filter::Field::Genre } })
 Lookup table for optional type to filter field. More...
 

Detailed Description

Predicate handling.

Predicate parsing and interpretation.

Macro Definition Documentation

◆ PREDKEY_EXPRESSION

#define PREDKEY_EXPRESSION   "expression"

◆ PREDKEY_FULFILLMENT

#define PREDKEY_FULFILLMENT   "fulfill"

◆ PREDKEY_ITEMLIST

#define PREDKEY_ITEMLIST   "items"

◆ PREDKEY_SEEDTYPE

#define PREDKEY_SEEDTYPE   "seedtype"

◆ PREDKEY_SOURCENAME

#define PREDKEY_SOURCENAME   "sourcename"

◆ SEEDPREP

#define SEEDPREP   " <to|from|for>"