1818 * http://www.mozilla.org/MPL/ *
1919 ***************************************************************************/
2020
21- #ifndef HAS_MATROSKAFILE_H
22- #define HAS_MATROSKAFILE_H
21+ #ifndef TAGLIB_MATROSKAFILE_H
22+ #define TAGLIB_MATROSKAFILE_H
2323
2424#include " taglib_export.h"
2525#include " tfile.h"
@@ -30,23 +30,118 @@ namespace TagLib::Matroska {
3030 class Properties ;
3131 class Tag ;
3232 class Attachments ;
33+
34+ /* !
35+ * Implementation of TagLib::File for Matroska.
36+ */
3337 class TAGLIB_EXPORT File : public TagLib::File
3438 {
3539 public:
40+ /* !
41+ * Constructs a Matroska file from \a file. If \a readProperties is \c true the
42+ * file's audio properties will also be read.
43+ *
44+ * The \a readStyle parameter is currently unused.
45+ */
3646 explicit File (FileName file, bool readProperties = true ,
3747 Properties::ReadStyle readStyle = Properties::Average);
48+
49+ /* !
50+ * Constructs a Matroska file from \a stream. If \a readProperties is \c true the
51+ * file's audio properties will also be read.
52+ *
53+ * The \a readStyle parameter is currently unused.
54+ */
3855 explicit File (IOStream *stream, bool readProperties = true ,
3956 Properties::ReadStyle readStyle = Properties::Average);
57+
58+ /* !
59+ * Destroys this instance of the File.
60+ */
4061 ~File () override ;
62+
4163 File (const File &) = delete ;
4264 File &operator =(const File &) = delete ;
43- AudioProperties *audioProperties () const override ;
65+
66+ /* !
67+ * Returns a pointer to the tag of the file.
68+ *
69+ * It will create a tag if one does not exist and returns a valid pointer.
70+ *
71+ * \note The tag <b>is still</b> owned by the Matroska::File and should not
72+ * be deleted by the user. It will be deleted when the file (object) is
73+ * destroyed.
74+ */
4475 TagLib::Tag *tag () const override ;
45- Attachments *attachments (bool create = false ) const ;
76+
77+ /* !
78+ * Returns a pointer to the Matroska tag of the file.
79+ *
80+ * If \a create is \c false this may return a null pointer if there is no tag.
81+ * If \a create is \c true it will create a tag if one does not exist and
82+ * returns a valid pointer.
83+ *
84+ * \note The tag <b>is still</b> owned by the Matroska::File and should not
85+ * be deleted by the user. It will be deleted when the file (object)
86+ * destroyed.
87+ */
4688 Tag *tag (bool create) const ;
89+
90+ /* !
91+ * Implements the reading part of the unified property interface.
92+ */
93+ PropertyMap properties () const override ;
94+
95+ void removeUnsupportedProperties (const StringList &properties) override ;
96+
97+ /* !
98+ * Implements the writing part of the unified tag dictionary interface.
99+ */
100+ PropertyMap setProperties (const PropertyMap &) override ;
101+
102+ /* !
103+ * Returns the keys for attached files, "PICTURE" for images, the media
104+ * type, file name or UID for other attached files.
105+ * The names of the binary simple tags are included too.
106+ */
107+ StringList complexPropertyKeys () const override ;
108+
109+ /* !
110+ * Get the pictures stored in the attachments as complex properties
111+ * for \a key "PICTURE". Other attached files can be retrieved, by
112+ * media type, file name or UID.
113+ * The attached files are returned as maps with keys "data", "mimeType",
114+ * "description", "fileName, "uid".
115+ * Binary simple tags can be retrieved as maps with keys "data", "name",
116+ * "targetTypeValue", "language", "defaultLanguage".
117+ */
118+ List<VariantMap> complexProperties (const String &key) const override ;
119+
120+ /* !
121+ * Set attached files as complex properties \a value, e.g. pictures for
122+ * \a key "PICTURE" with the maps in \a value having keys "data", "mimeType",
123+ * "description", "fileName, "uid". For other attached files, the mime type,
124+ * file name or UID can be used as the \a key.
125+ * Maps with keys "name" (with the same value as \a key) and "data" are
126+ * stored as binary simple tags with additional keys "targetTypeValue",
127+ * "language", "defaultLanguage".
128+ */
129+ bool setComplexProperties (const String &key, const List<VariantMap> &value) override ;
130+
131+ /* !
132+ * Returns the Matroska::Properties for this file. If no audio properties
133+ * were read then this will return a null pointer.
134+ */
135+ AudioProperties *audioProperties () const override ;
136+
137+ /* !
138+ * Save the file.
139+ *
140+ * This returns \c true if the save was successful.
141+ */
47142 bool save () override ;
48- // PropertyMap properties() const override { return PropertyMap(); }
49- // void removeUnsupportedProperties(const StringList &properties) override { }
143+
144+ Attachments * attachments ( bool create = false ) const ;
50145
51146 /* !
52147 * Returns whether or not the given \a stream can be opened as a Matroska
0 commit comments