libmusicbrainz3  3.0.2
 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  * $Id: filters.h 8466 2006-09-05 08:59:44Z luks $
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  ParameterList createParameters() const;
64  private:
65  ParameterList parameters;
66  };
67 
99  class MB_API ReleaseFilter : public IFilter
100  {
101  public:
102  ReleaseFilter &title(const std::string &value);
103  ReleaseFilter &discId(const std::string &value);
104  ReleaseFilter &releaseType(const std::string &value);
105  ReleaseFilter &artistName(const std::string &value);
106  ReleaseFilter &artistId(const std::string &value);
107  ReleaseFilter &limit(const int value);
108  ParameterList createParameters() const;
109  private:
110  ParameterList parameters;
111  };
112 
122  class MB_API TrackFilter : public IFilter
123  {
124  public:
125  TrackFilter &title(const std::string &value);
126  TrackFilter &artistName(const std::string &value);
127  TrackFilter &artistId(const std::string &value);
128  TrackFilter &releaseTitle(const std::string &value);
129  TrackFilter &releaseId(const std::string &value);
130  TrackFilter &duration(const int value);
131  TrackFilter &puid(const std::string &value);
132  TrackFilter &limit(const int value);
133  ParameterList createParameters() const;
134  private:
135  ParameterList parameters;
136  };
137 
141  class MB_API UserFilter : public IFilter
142  {
143  public:
144  UserFilter &name(const std::string &name);
145  ParameterList createParameters() const;
146  private:
147  ParameterList parameters;
148  };
149 
150 }
151 
152 #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:122
A filter for the artist collection.
Definition: filters.h:58
Definition: artist.h:32
A filter for the release collection.
Definition: filters.h:99
A filter for collections.
Definition: filters.h:39
#define MB_API
Definition: defines.h:40
A filter for the user collection.
Definition: filters.h:141