KFileMetaData

mimeutils.h
1/*
2 This file is part of KFileMetaData
3 SPDX-FileCopyrightText: 2019 Stefan BrĂ¼ns <stefan.bruens@rwth-aachen.de>
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
14namespace KFileMetaData
15{
16
17/**
18 * The MimeUtils namespace
19 */
20namespace MimeUtils
21{
22
23/**
24 * Returns the MIME type for a file
25 *
26 * The function uses both content and filename to determine the
27 * \c QMimeType. In case the extension MIME type is more specific
28 * than the content MIME type, and the first inherits the latter,
29 * the extension MIME type is preferred.
30 * If the extension does not match the content, the content has
31 * higher priority.
32 * The file must exist and be readable.
33 *
34 * @since 5.57
35 *
36 * \sa QMimeDatabase::mimeTypesForFileName
37 * \sa QMimeType::inherits
38 */
39KFILEMETADATA_EXPORT
40QMimeType strictMimeType(const QString& filePath, const QMimeDatabase& db);
41
42
43} // namespace MimeUtils
44} // namespace KFileMetaData
45
46#endif // KFILEMETADATA_MIMEUTILS
QMimeType strictMimeType(const QString &filePath, const QMimeDatabase &db)
Returns the MIME type for a file.
Definition mimeutils.cpp:13
The KFileMetaData namespace.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:12:41 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.