TagLib API Documentation
mp4atom.h
Go to the documentation of this file.
1/**************************************************************************
2 copyright : (C) 2007,2011 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// This file is not part of the public API!
27
28#ifndef TAGLIB_MP4ATOM_H
29#define TAGLIB_MP4ATOM_H
30
31#include "tfile.h"
32#include "tlist.h"
33
34namespace TagLib {
35 namespace MP4 {
36
81
82#ifndef DO_NOT_DOCUMENT
83 struct AtomData {
84 AtomData(AtomDataType ptype, const ByteVector &pdata) :
85 type(ptype), data(pdata) { }
86 AtomDataType type;
87 int locale { 0 };
88 ByteVector data;
89 };
90
91 class Atom;
92 using AtomList = TagLib::List<Atom *>;
93 using AtomDataList = TagLib::List<AtomData>;
94
95 class TAGLIB_EXPORT Atom
96 {
97 public:
98 Atom(File *file);
99 ~Atom();
100 Atom(const Atom &) = delete;
101 Atom &operator=(const Atom &) = delete;
102 Atom *find(const char *name1, const char *name2 = nullptr, const char *name3 = nullptr, const char *name4 = nullptr);
103 bool path(AtomList &path, const char *name1, const char *name2 = nullptr, const char *name3 = nullptr);
104 AtomList findall(const char *name, bool recursive = false) const;
105 void addToOffset(offset_t delta);
106 void prependChild(Atom *atom);
107 bool removeChild(Atom *meta);
108 offset_t offset() const;
109 offset_t length() const;
110 const ByteVector &name() const;
111 const AtomList &children() const;
112
113 protected:
114 Atom(File *file, int depth);
115
116 private:
117 class AtomPrivate;
119 std::unique_ptr<AtomPrivate> d;
120 };
121
123 class TAGLIB_EXPORT Atoms
124 {
125 public:
126 Atoms(File *file);
127 ~Atoms();
128 Atoms(const Atoms &) = delete;
129 Atoms &operator=(const Atoms &) = delete;
130 Atom *find(const char *name1, const char *name2 = nullptr, const char *name3 = nullptr, const char *name4 = nullptr) const;
131 AtomList path(const char *name1, const char *name2 = nullptr, const char *name3 = nullptr, const char *name4 = nullptr) const;
132 bool checkRootLevelAtoms();
133 const AtomList &atoms() const;
134
135 private:
136 class AtomsPrivate;
138 std::unique_ptr<AtomsPrivate> d;
139 };
140#endif // DO_NOT_DOCUMENT
141 } // namespace MP4
142} // namespace TagLib
143
144#endif
A byte vector.
Definition tbytevector.h:46
A generic, implicitly shared list.
Definition tlist.h:54
AtomDataType
Definition mp4atom.h:37
@ TypeGenred
A list of enumerated values.
Definition mp4atom.h:69
@ TypeUUID
Also known as GUID; stored as 16 bytes in binary (valid as an ID)
Definition mp4atom.h:51
@ TypeBMP
Windows bitmap image.
Definition mp4atom.h:77
@ TypeMI3P
Stored as UTF-8 text (valid as an ID)
Definition mp4atom.h:55
@ TypeImplicit
For use with tags for which no type needs to be indicated because only one type is allowed.
Definition mp4atom.h:39
@ TypeXML
The XML header must identify the DTD or schemas.
Definition mp4atom.h:49
@ TypeDuration
In milliseconds, 32-bit integer.
Definition mp4atom.h:65
@ TypeUndefined
Undefined.
Definition mp4atom.h:79
@ TypeISRC
Stored as UTF-8 text (valid as an ID)
Definition mp4atom.h:53
@ TypeURL
Absolute, in UTF-8 characters.
Definition mp4atom.h:63
@ TypeUPC
Universal Product Code, in text UTF-8 format (valid as an ID)
Definition mp4atom.h:75
@ TypeSJIS
Deprecated unless it is needed for special Japanese characters.
Definition mp4atom.h:45
@ TypeUTF16
Also known as UTF-16BE.
Definition mp4atom.h:43
@ TypeUTF8
Without any count or null terminator.
Definition mp4atom.h:41
@ TypeInteger
A signed big-endian integer with length one of { 1,2,3,4,8 } bytes.
Definition mp4atom.h:71
@ TypeRIAAPA
RIAA parental advisory; { -1=no, 1=yes, 0=unspecified }, 8-bit integer.
Definition mp4atom.h:73
@ TypePNG
A PNG image.
Definition mp4atom.h:61
@ TypeJPEG
A JPEG image.
Definition mp4atom.h:59
@ TypeHTML
The HTML file header specifies which HTML version.
Definition mp4atom.h:47
@ TypeGIF
(Deprecated) A GIF image
Definition mp4atom.h:57
@ TypeDateTime
In UTC, counting seconds since midnight, January 1, 1904; 32 or 64-bits.
Definition mp4atom.h:67
A namespace for all TagLib related classes and functions.
Definition apefile.h:41
off_t offset_t
Definition taglib.h:64
#define TAGLIB_EXPORT
Definition taglib_export.h:40
#define TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
Definition taglib_export.h:55