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