libmusicbrainz3  3.0.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
filters.h
Go to the documentation of this file.
1 /*
2  * MusicBrainz -- The Internet music metadatabase
3  *
4  * Copyright (C) 2006 Lukas Lalinsky
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  *
20  *
21  */
22 
23 #ifndef __MUSICBRAINZ3_FILTERS_H__
24 #define __MUSICBRAINZ3_FILTERS_H__
25 
26 #include <string>
27 #include <vector>
28 #include <utility>
30 
31 namespace MusicBrainz
32 {
33 
40  {
41  public:
42 
43  typedef std::vector<std::pair<std::string, std::string> > ParameterList;
44 
45  virtual ~IFilter() {};
46 
52  virtual ParameterList createParameters() const = 0;
53  };
54 
58  class MB_API ArtistFilter : public IFilter
59  {
60  public:
61  ArtistFilter &name(const std::string &name);
62  ArtistFilter &limit(const int limit);
63  ArtistFilter &query(const std::string &query);
64  ParameterList createParameters() const;
65  private:
66  ParameterList parameters;
67  };
68 
72  class MB_API LabelFilter : public IFilter
73  {
74  public:
75  LabelFilter &name(const std::string &name);
76  LabelFilter &limit(const int limit);
77  LabelFilter &query(const std::string &query);
78  ParameterList createParameters() const;
79  private:
80  ParameterList parameters;
81  };
82 
114  class MB_API ReleaseFilter : public IFilter
115  {
116  public:
117  ReleaseFilter &title(const std::string &value);
118  ReleaseFilter &discId(const std::string &value);
119  ReleaseFilter &releaseType(const std::string &value);
120  ReleaseFilter &artistName(const std::string &value);
121  ReleaseFilter &artistId(const std::string &value);
122  ReleaseFilter &limit(const int value);
123  ReleaseFilter &query(const std::string &query);
124  ParameterList createParameters() const;
125  private:
126  ParameterList parameters;
127  };
128 
130  {
131  public:
132  ReleaseGroupFilter &title(const std::string &value);
133  ReleaseGroupFilter &releaseType(const std::string &value);
134  ReleaseGroupFilter &artistName(const std::string &value);
135  ReleaseGroupFilter &artistId(const std::string &value);
136  ReleaseGroupFilter &limit(const int value);
137  ReleaseGroupFilter &query(const std::string &query);
138  ParameterList createParameters() const;
139  private:
140  ParameterList parameters;
141  };
142 
152  class MB_API TrackFilter : public IFilter
153  {
154  public:
155  TrackFilter &title(const std::string &value);
156  TrackFilter &artistName(const std::string &value);
157  TrackFilter &artistId(const std::string &value);
158  TrackFilter &releaseTitle(const std::string &value);
159  TrackFilter &releaseId(const std::string &value);
160  TrackFilter &duration(const int value);
161  TrackFilter &puid(const std::string &value);
162  TrackFilter &limit(const int value);
163  TrackFilter &query(const std::string &value);
164  ParameterList createParameters() const;
165  private:
166  ParameterList parameters;
167  };
168 
172  class MB_API UserFilter : public IFilter
173  {
174  public:
175  UserFilter &name(const std::string &name);
176  ParameterList createParameters() const;
177  private:
178  ParameterList parameters;
179  };
180 
181 }
182 
183 #endif
std::vector< std::pair< std::string, std::string > > ParameterList
Definition: filters.h:43
virtual ~IFilter()
Definition: filters.h:45
A filter for the track collection.
Definition: filters.h:152
A filter for the artist collection.
Definition: filters.h:58
Definition: filters.h:129
A filter for the release collection.
Definition: filters.h:114
A filter for collections.
Definition: filters.h:39
A filter for the label collection.
Definition: filters.h:72
#define MB_API
Definition: defines.h:40
A filter for the user collection.
Definition: filters.h:172