1
/* --------------------------------------------------------------------------
3
libmusicbrainz4 - Client library to access MusicBrainz
5
Copyright (C) 2011 Andrew Hawkins
7
This file is part of libmusicbrainz4.
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.
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.
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/>.
21
$Id: ISRC.cc 13259 2011-08-10 12:02:50Z adhawkins $
23
----------------------------------------------------------------------------*/
25
#include "musicbrainz4/ISRC.h"
27
#include "musicbrainz4/RecordingList.h"
28
#include "musicbrainz4/Recording.h"
30
class MusicBrainz4::CISRCPrivate
39
CRecordingList *m_RecordingList;
42
MusicBrainz4::CISRC::CISRC(const XMLNode& Node)
48
//std::cout << "ISRC node: " << std::endl << Node.createXMLString(true) << std::endl;
54
MusicBrainz4::CISRC::CISRC(const CISRC& Other)
61
MusicBrainz4::CISRC& MusicBrainz4::CISRC::operator =(const CISRC& Other)
67
CEntity::operator =(Other);
69
m_d->m_ID=Other.m_d->m_ID;
71
if (Other.m_d->m_RecordingList)
72
m_d->m_RecordingList=new CRecordingList(*Other.m_d->m_RecordingList);
78
MusicBrainz4::CISRC::~CISRC()
85
void MusicBrainz4::CISRC::Cleanup()
87
delete m_d->m_RecordingList;
88
m_d->m_RecordingList=0;
91
MusicBrainz4::CISRC *MusicBrainz4::CISRC::Clone()
93
return new CISRC(*this);
96
bool MusicBrainz4::CISRC::ParseAttribute(const std::string& Name, const std::string& Value)
104
std::cerr << "Unrecognised isrc attribute: '" << Name << "'" << std::endl;
111
bool MusicBrainz4::CISRC::ParseElement(const XMLNode& Node)
115
std::string NodeName=Node.getName();
117
if ("recording-list"==NodeName)
119
RetVal=ProcessItem(Node,m_d->m_RecordingList);
123
std::cerr << "Unrecognised ISRC element: '" << NodeName << "'" << std::endl;
130
std::string MusicBrainz4::CISRC::GetElementName()
135
std::string MusicBrainz4::CISRC::ID() const
140
MusicBrainz4::CRecordingList *MusicBrainz4::CISRC::RecordingList() const
142
return m_d->m_RecordingList;
145
std::ostream& MusicBrainz4::CISRC::Serialise(std::ostream& os) const
147
os << "ISRC:" << std::endl;
149
CEntity::Serialise(os);
151
os << "\tID: " << ID() << std::endl;
154
os << *RecordingList() << std::endl;