filters.h

Go to the documentation of this file.
00001 /*
00002  * MusicBrainz -- The Internet music metadatabase
00003  *
00004  * Copyright (C) 2006 Lukas Lalinsky
00005  *  
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Lesser General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2.1 of the License, or (at your option) any later version.
00010  * 
00011  * This library is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Lesser General Public License for more details.
00015  * 
00016  * You should have received a copy of the GNU Lesser General Public
00017  * License along with this library; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00019  *
00020  * $Id: filters.h 8466 2006-09-05 08:59:44Z luks $
00021  */
00022  
00023 #ifndef __MUSICBRAINZ3_FILTERS_H__
00024 #define __MUSICBRAINZ3_FILTERS_H__
00025 
00026 #include <string>
00027 #include <vector>
00028 #include <utility> 
00029 #include <musicbrainz3/musicbrainz.h>
00030 
00031 namespace MusicBrainz
00032 {
00033 
00039         class MB_API IFilter
00040         {
00041         public:
00042                 
00043                 typedef std::vector<std::pair<std::string, std::string> > ParameterList;
00044         
00045                 virtual ~IFilter() {};
00046         
00052                 virtual ParameterList createParameters() const = 0;
00053         };
00054         
00058         class MB_API ArtistFilter : public IFilter
00059         {
00060         public:
00061                 ArtistFilter &name(const std::string &name);
00062                 ArtistFilter &limit(const int limit);
00063                 ParameterList createParameters() const;
00064         private:
00065                 ParameterList parameters;
00066         };
00067         
00099         class MB_API ReleaseFilter : public IFilter
00100         {
00101         public:
00102                 ReleaseFilter &title(const std::string &value);
00103                 ReleaseFilter &discId(const std::string &value);
00104                 ReleaseFilter &releaseType(const std::string &value);
00105                 ReleaseFilter &artistName(const std::string &value);
00106                 ReleaseFilter &artistId(const std::string &value);
00107                 ReleaseFilter &limit(const int value);
00108                 ParameterList createParameters() const;
00109         private:
00110                 ParameterList parameters;
00111         };
00112         
00122         class MB_API TrackFilter : public IFilter
00123         {
00124         public:
00125                 TrackFilter &title(const std::string &value);
00126                 TrackFilter &artistName(const std::string &value);
00127                 TrackFilter &artistId(const std::string &value);
00128                 TrackFilter &releaseTitle(const std::string &value);
00129                 TrackFilter &releaseId(const std::string &value);
00130                 TrackFilter &duration(const int value);
00131                 TrackFilter &puid(const std::string &value);
00132                 TrackFilter &limit(const int value);
00133                 ParameterList createParameters() const;
00134         private:
00135                 ParameterList parameters;
00136         };
00137         
00141         class MB_API UserFilter : public IFilter
00142         {
00143         public:
00144                 UserFilter &name(const std::string &name);
00145                 ParameterList createParameters() const;
00146         private:
00147                 ParameterList parameters;
00148         };
00149         
00150 }
00151 
00152 #endif

Generated on Sat Nov 10 20:22:35 2007 for libmusicbrainz3 by  doxygen 1.5.3-20071008