KFileMetaData

extractionresult.cpp
1 /*
2  SPDX-FileCopyrightText: 2013 Vishesh Handa <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5 */
6 
7 #include "extractionresult.h"
8 
9 #include <QMimeDatabase>
10 
11 using namespace KFileMetaData;
12 
13 class Q_DECL_HIDDEN ExtractionResult::Private
14 {
15 public:
16  QString url;
19 };
20 
21 ExtractionResult::ExtractionResult(const QString& url, const QString& mimetype, const Flags& flags)
22  : d(new Private)
23 {
24  d->url = url;
25  d->mimetype = mimetype;
26  if (mimetype.isEmpty()) {
27  d->mimetype = QMimeDatabase().mimeTypeForFile(url).name();
28  }
29  d->flags = flags;
30 }
31 
33  : d(new Private(*rhs.d))
34 {
35 }
36 
37 ExtractionResult::~ExtractionResult()
38 {
39  delete d;
40 }
41 
43 {
44  return d->url;
45 }
46 
48 {
49  return d->mimetype;
50 }
51 
53 {
54  return d->flags;
55 }
56 
QMimeType mimeTypeForFile(const QString &fileName, QMimeDatabase::MatchMode mode) const const
bool isEmpty() const const
KIOCORE_EXPORT MimetypeJob * mimetype(const QUrl &url, JobFlags flags=DefaultFlags)
QString inputMimetype() const
The input mimetype.
ExtractionResult(const QString &url, const QString &mimetype=QString(), const Flags &flags=ExtractEverything)
Create an ExtractionResult which can be passed be to Extractors.
The ExtractionResult class is where all the data extracted by the indexer is saved.
Flags inputFlags() const
The flags which the extraction plugin should considering following when extracting metadata from the ...
QString inputUrl() const
The input url which the plugins will use to locate the file.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Wed Sep 30 2020 23:02:27 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.