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{
16namespace 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 */
35KFILEMETADATA_EXPORT
36QMimeType 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-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:17:54 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.