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: Attribute.cc 13259 2011-08-10 12:02:50Z adhawkins $
23
----------------------------------------------------------------------------*/
25
#include "musicbrainz4/Attribute.h"
27
class MusicBrainz4::CAttributePrivate
33
MusicBrainz4::CAttribute::CAttribute(const XMLNode& Node)
35
m_d(new CAttributePrivate)
39
//std::cout << "Attribute node: " << std::endl << Node.createXMLString(true) << std::endl;
44
ProcessItem(Node,m_d->m_Text);
48
MusicBrainz4::CAttribute::CAttribute(const CAttribute& Other)
50
m_d(new CAttributePrivate)
55
MusicBrainz4::CAttribute& MusicBrainz4::CAttribute::operator =(const CAttribute& Other)
59
CEntity::operator =(Other);
61
m_d->m_Text=Other.m_d->m_Text;
67
MusicBrainz4::CAttribute::~CAttribute()
72
MusicBrainz4::CAttribute *MusicBrainz4::CAttribute::Clone()
74
return new CAttribute(*this);
77
bool MusicBrainz4::CAttribute::ParseAttribute(const std::string& Name, const std::string& /*Value*/)
81
std::cerr << "Unrecognised attribute attribute: '" << Name << "'" << std::endl;
87
bool MusicBrainz4::CAttribute::ParseElement(const XMLNode& Node)
91
std::string NodeName=Node.getName();
93
std::cerr << "Unrecognised attribute element: '" << NodeName << "'" << std::endl;
99
std::string MusicBrainz4::CAttribute::GetElementName()
104
std::string MusicBrainz4::CAttribute::Text() const
109
std::ostream& MusicBrainz4::CAttribute::Serialise(std::ostream& os) const
111
os << "Attribute:" << std::endl;
113
CEntity::Serialise(os);
115
os << "\tText: " << Text() << std::endl;