libmusicbrainz3  3.0.2
 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  * $Id: query.h 8789 2007-01-13 23:01:56Z luks $
21  */
22 
23 #ifndef __MUSICBRAINZ3_QUERY_H__
24 #define __MUSICBRAINZ3_QUERY_H__
25 
26 #include <map>
27 #include <string>
29 #include <musicbrainz3/metadata.h>
30 #include <musicbrainz3/model.h>
31 
32 namespace MusicBrainz
33 {
34 
48  class MB_API Query
49  {
50  public:
51 
75  Query(IWebService *ws = NULL, const std::string &clientId = std::string());
76 
80  virtual ~Query();
81 
103  Artist *getArtistById(const std::string &id,
104  const ArtistIncludes *include = NULL);
105 
127  Release *getReleaseById(const std::string &id,
128  const ReleaseIncludes *include = NULL);
129 
151  Track *getTrackById(const std::string &id,
152  const TrackIncludes *include = NULL);
153 
177  User *getUserByName(const std::string &name);
178 
193  ArtistResultList getArtists(const ArtistFilter *filter);
194 
209  ReleaseResultList getReleases(const ReleaseFilter *filter);
210 
225  TrackResultList getTracks(const TrackFilter *filter);
226 
245  void submitPuids(const std::map<std::string, std::string> &tracks2puids);
246 
247  protected:
248 
249  Metadata *getFromWebService(const std::string &entity,
250  const std::string &id,
251  const IIncludes *include = NULL,
252  const IFilter *filter = NULL);
253 
254  private:
255 
256  class QueryPrivate;
257  QueryPrivate *d;
258  };
259 
260 }
261 
262 #endif
Represents an artist.
Definition: artist.h:46
std::vector< ArtistResult * > ArtistResultList
A vector of pointers to ArtistResult objects.
Definition: lists.h:52
std::vector< TrackResult * > TrackResultList
A vector of pointers to TrackResult objects.
Definition: lists.h:68
A filter for the track collection.
Definition: filters.h:122
A specification on how much data to return with a release.
Definition: includes.h:96
Represents a MusicBrainz user.
Definition: user.h:36
A specification on how much data to return with a track.
Definition: includes.h:132
A filter for the artist collection.
Definition: filters.h:58
Represents a track.
Definition: track.h:51
Definition: artist.h:32
A simple interface to the MusicBrainz web service.
Definition: query.h:48
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:99
A filter for collections.
Definition: filters.h:39
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:62
A specification on how much data to return with a track.
Definition: includes.h:62
#define MB_API
Definition: defines.h:40
Represents a Release.
Definition: release.h:47