KFileMetaData

extractor.cpp
1 /*
2  * <one line to give the library's name and an idea of what it does.>
3  * Copyright (C) 2014 Vishesh Handa <[email protected]>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18  *
19  */
20 
21 #include "extractor.h"
22 #include "extractor_p.h"
23 #include "extractorplugin.h"
24 
25 using namespace KFileMetaData;
26 
27 Extractor::Extractor()
28  : d(new ExtractorPrivate)
29 {
30 }
31 
32 Extractor::~Extractor()
33 {
34  delete d;
35 }
36 
37 Extractor::Extractor(Extractor&& other)
38 {
39  d = other.d;
40  other.d = nullptr;
41 }
42 
43 void Extractor::extract(ExtractionResult* result)
44 {
45  d->m_plugin->extract(result);
46 }
47 
48 QStringList Extractor::mimetypes() const
49 {
50  return d->m_plugin->mimetypes();
51 }
52 
53 QVariantMap Extractor::extractorProperties() const
54 {
55  return d->m_metaData;
56 }
57 
58 void Extractor::setExtractorPlugin(ExtractorPlugin *extractorPlugin)
59 {
60  d->m_plugin = extractorPlugin;
61 }
62 
63 void Extractor::setAutoDeletePlugin(ExtractorPluginOwnership autoDelete)
64 {
65  d->m_autoDeletePlugin = autoDelete;
66 }
67 
68 void Extractor::setMetaData(const QVariantMap &metaData)
69 {
70  d->m_metaData = metaData;
71 }
The ExtractorPlugin is the base class for all file metadata extractors.
The ExtractionResult class is where all the data extracted by the indexer is saved.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Wed May 27 2020 23:08:35 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.