libmusicbrainz3  3.0.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
query.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 #ifndef __MUSICBRAINZ3_QUERY_H__
23 #define __MUSICBRAINZ3_QUERY_H__
24 
25 #include <map>
26 #include <string>
28 #include <musicbrainz3/metadata.h>
29 #include <musicbrainz3/model.h>
30 
31 namespace MusicBrainz
32 {
33 
47  class MB_API Query
48  {
49  public:
50 
74  Query(IWebService *ws = NULL, const std::string &clientId = std::string());
75 
79  virtual ~Query();
80 
102  Artist *getArtistById(const std::string &id,
103  const ArtistIncludes *include = NULL);
104 
105  Label *getLabelById(const std::string &id,
106  const LabelIncludes *include = NULL);
107 
108  ReleaseGroup *getReleaseGroupById(const std::string &id,
109  const ReleaseGroupIncludes *include = NULL);
110 
132  Release *getReleaseById(const std::string &id,
133  const ReleaseIncludes *include = NULL);
134 
156  Track *getTrackById(const std::string &id,
157  const TrackIncludes *include = NULL);
158 
182  User *getUserByName(const std::string &name);
183 
198  ArtistResultList getArtists(const ArtistFilter *filter);
199 
200  LabelResultList getLabels(const LabelFilter *filter);
201 
202  ReleaseGroupResultList getReleaseGroups(const ReleaseGroupFilter *filter);
203 
218  ReleaseResultList getReleases(const ReleaseFilter *filter);
219 
234  TrackResultList getTracks(const TrackFilter *filter);
235 
254  void submitPuids(const std::map<std::string, std::string> &tracks2puids);
255 
274  void submitIsrcs(const std::map<std::string, std::string> &tracks2isrcs);
275 
276  protected:
277 
278  Metadata *getFromWebService(const std::string &entity,
279  const std::string &id,
280  const IIncludes *include = NULL,
281  const IFilter *filter = NULL);
282 
283  private:
284 
285  class QueryPrivate;
286  QueryPrivate *d;
287  };
288 
289 }
290 
291 #endif
A specification on how much data to return with a release group.
Definition: includes.h:180
std::vector< ReleaseGroupResult * > ReleaseGroupResultList
Definition: lists.h:65
Represents an artist.
Definition: artist.h:46
std::vector< ArtistResult * > ArtistResultList
A vector of pointers to ArtistResult objects.
Definition: lists.h:55
std::vector< TrackResult * > TrackResultList
A vector of pointers to TrackResult objects.
Definition: lists.h:73
A filter for the track collection.
Definition: filters.h:152
A specification on how much data to return with a release.
Definition: includes.h:136
Represents a MusicBrainz user.
Definition: user.h:36
A specification on how much data to return with a track.
Definition: includes.h:202
A filter for the artist collection.
Definition: filters.h:58
Represents a track.
Definition: track.h:51
Definition: filters.h:129
A simple interface to the MusicBrainz web service.
Definition: query.h:47
An interface all concrete web service classes have to implement.
Definition: iwebservice.h:40
An interface implemented by include tag generators.
Definition: includes.h:36
A filter for the release collection.
Definition: filters.h:114
Represents a Release Group.
Definition: releasegroup.h:40
A filter for collections.
Definition: filters.h:39
std::vector< LabelResult * > LabelResultList
A vector of pointers to ArtistResult objects.
Definition: lists.h:83
Represents a parsed Music Metadata XML document.
Definition: metadata.h:42
std::vector< ReleaseResult * > ReleaseResultList
A vector of pointers to ReleaseResult objects.
Definition: lists.h:67
A specification on how much data to return with a artist.
Definition: includes.h:62
A filter for the label collection.
Definition: filters.h:72
Represents a record label.
Definition: label.h:38
#define MB_API
Definition: defines.h:40
Represents a Release.
Definition: release.h:47
A specification on how much data to return with a label.
Definition: includes.h:102