libmusicbrainz5  5.0.1
 All Classes Namespaces Files Functions Typedefs Enumerations Enumerator Macros Pages
Track.h
Go to the documentation of this file.
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 v2 of the GNU Lesser General Public
11  License as published by the Free Software Foundation.
12 
13  libmusicbrainz5 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 _MUSICBRAINZ5_TRACK_H
26 #define _MUSICBRAINZ5_TRACK_H
27 
28 #include <string>
29 #include <iostream>
30 
31 #include "musicbrainz5/Entity.h"
32 
33 #include "musicbrainz5/xmlParser.h"
34 
35 namespace MusicBrainz5
36 {
37  class CTrackPrivate;
38 
39  class CRecording;
40  class CArtistCredit;
41 
42  class CTrack: public CEntity
43  {
44  public:
45  CTrack(const XMLNode& Node=XMLNode::emptyNode());
46  CTrack(const CTrack& Other);
47  CTrack& operator =(const CTrack& Other);
48  virtual ~CTrack();
49 
50  virtual CTrack *Clone();
51 
52  int Position() const;
53  std::string Title() const;
54  CRecording *Recording() const;
55  int Length() const;
56  CArtistCredit *ArtistCredit() const;
57  std::string Number() const;
58 
59  virtual std::ostream& Serialise(std::ostream& os) const;
60  static std::string GetElementName();
61 
62  protected:
63  virtual void ParseAttribute(const std::string& Name, const std::string& Value);
64  virtual void ParseElement(const XMLNode& Node);
65 
66  private:
67  void Cleanup();
68 
69  CTrackPrivate * const m_d;
70  };
71 }
72 
73 #endif
Definition: Track.h:42
virtual CTrack * Clone()
Definition: Alias.h:35
virtual void ParseElement(const XMLNode &Node)
Definition: Entity.h:41
virtual void ParseAttribute(const std::string &Name, const std::string &Value)
CArtistCredit * ArtistCredit() const
int Length() const
CTrack & operator=(const CTrack &Other)
static std::string GetElementName()
int Position() const
virtual std::ostream & Serialise(std::ostream &os) const
Definition: Recording.h:54
CRecording * Recording() const
CTrack(const XMLNode &Node=XMLNode::emptyNode())
Definition: ArtistCredit.h:39
std::string Title() const
std::string Number() const