KFileMetaData

mimeutils.h
1 /*
2  This file is part of KFileMetaData
3  SPDX-FileCopyrightText: 2019 Stefan BrĂ¼ns <[email protected]>
4 
5  SPDX-License-Identifier: LGPL-2.1-or-later
6 */
7 
8 #ifndef KFILEMETADATA_MIMEUTILS
9 #define KFILEMETADATA_MIMEUTILS
10 
11 #include <QMimeDatabase>
12 #include "kfilemetadata_export.h"
13 
14 namespace KFileMetaData
15 {
16 namespace MimeUtils
17 {
18 
19 /**
20  * Returns the mimetype for a file
21  *
22  * The function uses both content and filename to determine the
23  * \c QMimeType. In case the extension mimetype is more specific
24  * than the content mimetype, and the first inherits the latter,
25  * the extension mimetype is preferred.
26  * If the extension does not match the content, the content has
27  * higher priority.
28  * The file must exist and be readable.
29  *
30  * @since 5.57
31  *
32  * \sa QMimeDatabase::mimeTypesForFileName
33  * \sa QMimeType::inherits
34  */
35 KFILEMETADATA_EXPORT
36 QMimeType strictMimeType(const QString& filePath, const QMimeDatabase& db);
37 
38 
39 } // namespace MimeUtils
40 } // namespace KFileMetaData
41 
42 #endif // KFILEMETADATA_MIMEUTILS
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Thu May 26 2022 03:46:07 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.