libmusicbrainz5  5.0.1
 All Classes Namespaces Files Functions Typedefs Enumerations Enumerator Macros Pages
List.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_LIST_H
26 #define _MUSICBRAINZ5_LIST_H
27 
28 #include "musicbrainz5/Entity.h"
29 
30 #include "musicbrainz5/xmlParser.h"
31 
32 namespace MusicBrainz5
33 {
34  class CListPrivate;
35 
36  class CList: public CEntity
37  {
38  public:
39  CList();
40  CList(const CList& Other);
41  CList& operator =(const CList& Other);
42  virtual ~CList();
43 
44  virtual CList *Clone();
45 
46  int NumItems() const;
47  int Offset() const;
48  int Count() const;
49 
50  virtual std::ostream& Serialise(std::ostream& os) const;
51  static std::string GetElementName();
52 
53  protected:
54  virtual void ParseAttribute(const std::string& Name, const std::string& Value);
55  virtual void ParseElement(const XMLNode& Node);
56 
57  void AddItem(CEntity *Item);
58  CEntity *Item(int Item) const;
59 
60  private:
61  CListPrivate *m_d;
62 
63  void Cleanup();
64  };
65 }
66 
67 #endif
68 
Definition: Alias.h:35
Definition: Entity.h:41
CList & operator=(const CList &Other)
virtual void ParseAttribute(const std::string &Name, const std::string &Value)
int NumItems() const
int Offset() const
virtual void ParseElement(const XMLNode &Node)
int Count() const
CEntity * Item(int Item) const
void AddItem(CEntity *Item)
virtual CList * Clone()
static std::string GetElementName()
virtual std::ostream & Serialise(std::ostream &os) const
Definition: List.h:36