Clementine-audio-player-Mac.../src/libraryquery.h

38 lines
694 B
C
Raw Normal View History

2009-12-24 20:16:07 +01:00
#ifndef LIBRARYQUERY_H
#define LIBRARYQUERY_H
#include <QString>
#include <QVariant>
#include <QSqlQuery>
#include <QStringList>
#include <QVariantList>
class Song;
2009-12-24 20:16:07 +01:00
struct QueryOptions {
QueryOptions() : max_age(-1) {}
bool Matches(const Song& song) const;
2009-12-24 20:16:07 +01:00
QString filter;
int max_age;
};
class LibraryQuery {
public:
LibraryQuery();
LibraryQuery(const QueryOptions& options);
void SetColumnSpec(const QString& spec) { column_spec_ = spec; }
void AddWhere(const QString& column, const QVariant& value);
QSqlQuery Query(QSqlDatabase db) const;
private:
QString column_spec_;
QStringList where_clauses_;
QVariantList bound_values_;
};
#endif // LIBRARYQUERY_H