TagLib  2.0.2
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 
33 namespace TagLib {
34  namespace MP4 {
37  {
38  public:
42  enum class Type : unsigned char {
43  Void,
44  Bool,
45  Int,
46  IntPair,
47  Byte,
48  UInt,
49  LongLong,
50  StringList,
53  };
54 
55  struct IntPair {
56  int first, second;
57  };
58 
59  Item();
60  Item(const Item &item);
61 
65  Item &operator=(const Item &item);
66 
70  void swap(Item &item) noexcept;
71 
72  ~Item();
73 
74  Item(int value);
75  Item(unsigned char value);
76  Item(unsigned int value);
77  Item(long long value);
78  Item(bool value);
79  Item(int value1, int value2);
80  Item(const StringList &value);
81  Item(const ByteVectorList &value);
82  Item(const CoverArtList &value);
83 
84  void setAtomDataType(AtomDataType type);
85  AtomDataType atomDataType() const;
86 
87  int toInt() const;
88  unsigned char toByte() const;
89  unsigned int toUInt() const;
90  long long toLongLong() const;
91  bool toBool() const;
92  IntPair toIntPair() const;
93  StringList toStringList() const;
94  ByteVectorList toByteVectorList() const;
95  CoverArtList toCoverArtList() const;
96 
97  bool isValid() const;
98 
99  Type type() const;
100 
105  bool operator==(const Item &other) const;
106 
110  bool operator!=(const Item &other) const;
111 
112  private:
113  class ItemPrivate;
115  std::shared_ptr<ItemPrivate> d;
116  };
117 
119  } // namespace MP4
120 } // namespace TagLib
121 #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:55
Type
Definition: mp4item.h:42
#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:36
A list of strings.
Definition: tstringlist.h:43
#define TAGLIB_EXPORT
Definition: taglib_export.h:40
int second
Definition: mp4item.h:56
TAGLIB_EXPORT unsigned int toUInt(const ByteVector &data)
A namespace for all TagLib related classes and functions.
Definition: apefile.h:41