1 /* --------------------------------------------------------------------------
2 
3    libmusicbrainz5 - Client library to access MusicBrainz
4 
5    Copyright (C) 2012 Andrew Hawkins
6 
7    This file is part of libmusicbrainz5.
8 
9    This library is free software; you can redistribute it and/or
10    modify it under the terms of the GNU Lesser General Public
11    License as published by the Free Software Foundation; either
12    version 2.1 of the License, or (at your option) any later version.
13 
14    libmusicbrainz5 is distributed in the hope that it will be useful,
15    but WITHOUT ANY WARRANTY; without even the implied warranty of
16    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17    Lesser General Public License for more details.
18 
19    You should have received a copy of the GNU General Public License
20    along with this library.  If not, see <http://www.gnu.org/licenses/>.
21 
22      $Id$
23 
24 ----------------------------------------------------------------------------*/
25 
26 #ifndef _MUSICBRAINZ5_METADATA_H
27 #define _MUSICBRAINZ5_METADATA_H
28 
29 #include "musicbrainz5/Entity.h"
30 #include "musicbrainz5/ReleaseList.h"
31 #include "musicbrainz5/ArtistList.h"
32 #include "musicbrainz5/WorkList.h"
33 #include "musicbrainz5/ISRCList.h"
34 #include "musicbrainz5/LabelInfoList.h"
35 #include "musicbrainz5/ReleaseGroupList.h"
36 #include "musicbrainz5/RecordingList.h"
37 #include "musicbrainz5/LabelList.h"
38 #include "musicbrainz5/AnnotationList.h"
39 #include "musicbrainz5/CDStubList.h"
40 #include "musicbrainz5/FreeDBDiscList.h"
41 #include "musicbrainz5/TagList.h"
42 #include "musicbrainz5/UserTagList.h"
43 #include "musicbrainz5/CollectionList.h"
44 
45 #include "musicbrainz5/xmlParser.h"
46 
47 #include <string>
48 
49 namespace MusicBrainz5
50 {
51 	class CMetadataPrivate;
52 
53 	class CArtist;
54 	class CRelease;
55 	class CReleaseGroup;
56 	class CRecording;
57 	class CLabel;
58 	class CPUID;
59 	class CISRC;
60 	class CDisc;
61 	class CRating;
62 	class CUserRating;
63 	class CCollection;
64 	class CArtist;
65 	class CWork;
66 	class CCDStub;
67 	class CMessage;
68 
69 	class CMetadata: public CEntity
70 	{
71 	public:
72 		CMetadata(const XMLNode& Node=XMLNode::emptyNode());
73 		CMetadata(const CMetadata& Other);
74 		CMetadata& operator =(const CMetadata& Other);
75 		virtual ~CMetadata();
76 
77 		virtual CMetadata *Clone();
78 
79 		std::string XMLNS() const;
80 		std::string XMLNSExt() const;
81 		std::string Generator() const;
82 		std::string Created() const;
83 		CArtist *Artist() const;
84 		CRelease *Release() const;
85 		CReleaseGroup *ReleaseGroup() const;
86 		CRecording *Recording() const;
87 		CLabel *Label() const;
88 		CWork *Work() const;
89 		CPUID *PUID() const;
90 		CISRC *ISRC() const;
91 		CDisc *Disc() const;
92 		CLabelInfoList *LabelInfoList() const;
93 		CRating *Rating() const;
94 		CUserRating *UserRating() const;
95 		CCollection *Collection() const;
96 		CArtistList *ArtistList() const;
97 		CReleaseList *ReleaseList() const;
98 		CReleaseGroupList *ReleaseGroupList() const;
99 		CRecordingList *RecordingList() const;
100 		CLabelList *LabelList() const;
101 		CWorkList *WorkList() const;
102 		CISRCList *ISRCList() const;
103 		CAnnotationList *AnnotationList() const;
104 		CCDStubList *CDStubList() const;
105 		CFreeDBDiscList *FreeDBDiscList() const;
106 		CTagList *TagList() const;
107 		CUserTagList *UserTagList() const;
108 		CCollectionList *CollectionList() const;
109 		CCDStub *CDStub() const;
110 		CMessage *Message() const;
111 
112 		virtual std::ostream& Serialise(std::ostream& os) const;
113 		static std::string GetElementName();
114 
115 	protected:
116 		virtual void ParseAttribute(const std::string& Name, const std::string& Value);
117 		virtual void ParseElement(const XMLNode& Node);
118 
119 	private:
120 		void Cleanup();
121 
122 		CMetadataPrivate * const m_d;
123 	};
124 }
125 
126 #endif
127