TagLib  2.2.1
mp4item.h
Go to the documentation of this file.
1 /**************************************************************************
2  copyright : (C) 2007 by Lukáš Lalinský
3  email : lalinsky@gmail.com
4  **************************************************************************/
5 
6 /***************************************************************************
7  * This library is free software; you can redistribute it and/or modify *
8  * it under the terms of the GNU Lesser General Public License version *
9  * 2.1 as published by the Free Software Foundation. *
10  * *
11  * This library is distributed in the hope that it will be useful, but *
12  * WITHOUT ANY WARRANTY; without even the implied warranty of *
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
14  * Lesser General Public License for more details. *
15  * *
16  * You should have received a copy of the GNU Lesser General Public *
17  * License along with this library; if not, write to the Free Software *
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA *
19  * 02110-1301 USA *
20  * *
21  * Alternatively, this file is available under the Mozilla Public *
22  * License Version 1.1. You may obtain a copy of the License at *
23  * http://www.mozilla.org/MPL/ *
24  ***************************************************************************/
25 
26 #ifndef TAGLIB_MP4ITEM_H
27 #define TAGLIB_MP4ITEM_H
28 
29 #include "tstringlist.h"
30 #include "taglib_export.h"
31 #include "mp4coverart.h"
32 #include "mp4stem.h"
33 
34 namespace TagLib {
35  namespace MP4 {
38  {
39  public:
43  enum class Type : unsigned char {
44  Void,
45  Bool,
46  Int,
47  IntPair,
48  Byte,
49  UInt,
50  LongLong,
51  StringList,
54  Stem,
55  };
56 
57  struct IntPair {
58  int first, second;
59  };
60 
61  Item();
62  Item(const Item &item);
63 
67  Item &operator=(const Item &item);
68 
72  void swap(Item &item) noexcept;
73 
74  ~Item();
75 
76  Item(int value);
77  Item(unsigned char value);
78  Item(unsigned int value);
79  Item(long long value);
80  Item(bool value);
81  Item(int value1, int value2);
82  Item(const StringList &value);
83  Item(const ByteVectorList &value);
84  Item(const CoverArtList &value);
85  Item(const Stem &value);
86 
87  void setAtomDataType(AtomDataType type);
88  AtomDataType atomDataType() const;
89 
90  int toInt() const;
91  unsigned char toByte() const;
92  unsigned int toUInt() const;
93  long long toLongLong() const;
94  bool toBool() const;
95  IntPair toIntPair() const;
96  StringList toStringList() const;
97  ByteVectorList toByteVectorList() const;
98  CoverArtList toCoverArtList() const;
99  Stem toStem() const;
100 
101  bool isValid() const;
102 
103  Type type() const;
104 
109  bool operator==(const Item &other) const;
110 
114  bool operator!=(const Item &other) const;
115 
116  private:
117  class ItemPrivate;
119  std::shared_ptr<ItemPrivate> d;
120  };
121 
123  } // namespace MP4
124 } // namespace TagLib
125 #endif
A list of ByteVectors.
Definition: tbytevectorlist.h:41
A generic, implicitly shared list.
Definition: tlist.h:53
AtomDataType
Definition: mp4atom.h:37
Definition: mp4item.h:57
Definition: mp4stem.h:40
Type
Definition: mp4item.h:43
#define TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
Definition: taglib_export.h:55
A generic, implicitly shared map.
Definition: tmap.h:44
MP4 item.
Definition: mp4item.h:37
A list of strings.
Definition: tstringlist.h:43
#define TAGLIB_EXPORT
Definition: taglib_export.h:40
List< CoverArt > CoverArtList
Definition: mp4coverart.h:89
int second
Definition: mp4item.h:58
TAGLIB_EXPORT unsigned int toUInt(const ByteVector &data)
A namespace for all TagLib related classes and functions.
Definition: apefile.h:41