TagLib API Documentation
matroskaattachedfile.h
Go to the documentation of this file.
1/***************************************************************************
2 * This library is free software; you can redistribute it and/or modify *
3 * it under the terms of the GNU Lesser General Public License version *
4 * 2.1 as published by the Free Software Foundation. *
5 * *
6 * This library is distributed in the hope that it will be useful, but *
7 * WITHOUT ANY WARRANTY; without even the implied warranty of *
8 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
9 * Lesser General Public License for more details. *
10 * *
11 * You should have received a copy of the GNU Lesser General Public *
12 * License along with this library; if not, write to the Free Software *
13 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA *
14 * 02110-1301 USA *
15 * *
16 * Alternatively, this file is available under the Mozilla Public *
17 * License Version 1.1. You may obtain a copy of the License at *
18 * http://www.mozilla.org/MPL/ *
19 ***************************************************************************/
20
21#ifndef TAGLIB_MATROSKAATTACHEDFILE_H
22#define TAGLIB_MATROSKAATTACHEDFILE_H
23
24#include <memory>
25#include "taglib.h"
26#include "tstring.h"
27#include "taglib_export.h"
28
29namespace TagLib {
30 class String;
31 class ByteVector;
32
33 namespace EBML {
34 class MkAttachments;
35 }
36
37 namespace Matroska {
38 class File;
39
42 {
43 public:
45 using UID = unsigned long long;
46
50 AttachedFile(const ByteVector &data, const String &fileName,
51 const String &mediaType, UID uid = 0,
52 const String &description = String());
53
58
62 AttachedFile(AttachedFile &&other) noexcept;
63
68
73
78
82 void swap(AttachedFile &other) noexcept;
83
87 const String &fileName() const;
88
92 const String &description() const;
93
97 const String &mediaType() const;
98
107 const ByteVector &data() const;
108
112 UID uid() const;
113
114 private:
115 friend class EBML::MkAttachments;
116 friend class File;
117 class AttachedFilePrivate;
118
124 AttachedFile(offset_t dataOffset, offset_t dataSize,
125 const String &fileName, const String &mediaType, UID uid,
126 const String &description);
127
129 bool isDataDeferred() const;
130
132 offset_t deferredDataOffset() const;
133
135 offset_t deferredDataSize() const;
136
138 void setLoadedData(const ByteVector &data);
139
141 std::unique_ptr<AttachedFilePrivate> d;
142 };
143 }
144}
145
146#endif
A byte vector.
Definition tbytevector.h:46
Attached file embedded into a Matroska file.
Definition matroskaattachedfile.h:42
AttachedFile(const AttachedFile &other)
AttachedFile & operator=(const AttachedFile &other)
const String & mediaType() const
unsigned long long UID
Unique identifier.
Definition matroskaattachedfile.h:45
void swap(AttachedFile &other) noexcept
AttachedFile(const ByteVector &data, const String &fileName, const String &mediaType, UID uid=0, const String &description=String())
const String & fileName() const
const String & description() const
const ByteVector & data() const
AttachedFile(AttachedFile &&other) noexcept
AttachedFile & operator=(AttachedFile &&other) noexcept
An implementation of TagLib::File with Matroska specific methods.
Definition matroskafile.h:41
A wide string class suitable for unicode.
Definition tstring.h:83
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