Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef __MUSICBRAINZ3_RELATION_H__
00024 #define __MUSICBRAINZ3_RELATION_H__
00025
00026 #include <string>
00027 #include <vector>
00028 #include <musicbrainz3/musicbrainz.h>
00029
00030 namespace MusicBrainz
00031 {
00032
00033 class Entity;
00034
00046 class MB_API Relation
00047 {
00048 public:
00049
00051 static const std::string TO_ARTIST;
00053 static const std::string TO_RELEASE;
00055 static const std::string TO_TRACK;
00057 static const std::string TO_URL;
00058
00059 enum Direction {
00061 DIR_BOTH,
00063 DIR_FORWARD,
00065 DIR_BACKWARD
00066 };
00067
00069 typedef std::vector<std::string> Attributes;
00070
00084 Relation(const std::string &relationType = std::string(),
00085 const std::string &targetType = std::string(),
00086 const std::string &targetId = std::string(),
00087 const Direction direction = DIR_BOTH,
00088 const Attributes &attributes = Attributes(),
00089 const std::string &beginDate = std::string(),
00090 const std::string &endDate = std::string(),
00091 Entity *target = NULL);
00092
00096 virtual ~Relation();
00097
00103 std::string getType() const;
00104
00110 void setType(const std::string &type);
00111
00120 std::string getTargetId() const;
00121
00129 void setTargetId(const std::string &targetId);
00130
00142 std::string getTargetType() const;
00143
00151 void setTargetType(const std::string &targetType);
00152
00163 std::string getBeginDate() const;
00164
00172 void setBeginDate(const std::string &dateStr);
00173
00185 std::string getEndDate() const;
00186
00194 void setEndDate(const std::string &dateStr);
00195
00210 Direction getDirection() const;
00211
00220 void setDirection(const Direction direction);
00221
00229 Attributes &getAttributes();
00230
00240 int getNumAttributes() const;
00241
00251 std::string getAttribute(int index) const;
00252
00258 void addAttribute(const std::string &attribute);
00259
00268 Entity *getTarget() const;
00269
00278 void setTarget(Entity *target);
00279
00280 private:
00281
00282 class RelationPrivate;
00283 RelationPrivate *d;
00284 };
00285
00286 }
00287
00288 #endif
00289