KFileMetaData

extractionresult.cpp
1 /*
2  * Copyright (C) 2013 Vishesh Handa <[email protected]>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) version 3, or any
8  * later version accepted by the membership of KDE e.V. (or its
9  * successor approved by the membership of KDE e.V.), which shall
10  * act as a proxy defined in Section 6 of version 3 of the license.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #include "extractionresult.h"
23 
24 #include <QMimeDatabase>
25 
26 using namespace KFileMetaData;
27 
28 class Q_DECL_HIDDEN ExtractionResult::Private
29 {
30 public:
31  QString url;
34 };
35 
36 ExtractionResult::ExtractionResult(const QString& url, const QString& mimetype, const Flags& flags)
37  : d(new Private)
38 {
39  d->url = url;
40  d->mimetype = mimetype;
41  if (mimetype.isEmpty()) {
42  d->mimetype = QMimeDatabase().mimeTypeForFile(url).name();
43  }
44  d->flags = flags;
45 }
46 
48  : d(new Private(*rhs.d))
49 {
50 }
51 
52 ExtractionResult::~ExtractionResult()
53 {
54  delete d;
55 }
56 
58 {
59  return d->url;
60 }
61 
63 {
64  return d->mimetype;
65 }
66 
68 {
69  return d->flags;
70 }
71 
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 Tue May 26 2020 23:11:36 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.