KFileMetaData

extractor.h
1/*
2 SPDX-FileCopyrightText: 2014 Vishesh Handa <me@vhanda.in>
3
4 SPDX-License-Identifier: LGPL-2.1-or-later
5*/
6
7#ifndef KFILEMETADATA_EXTRACTOR_H
8#define KFILEMETADATA_EXTRACTOR_H
9
10#include "kfilemetadata_export.h"
11#include <QStringList>
12#include <QVariantMap>
13
14#include <memory>
15
16namespace KFileMetaData {
17
18class ExtractionResult;
19class ExtractorCollection;
20class ExtractorPlugin;
21class ExtractorPrivate;
22
23/**
24 * \class Extractor extractor.h <KFileMetaData/Extractor>
25 *
26 * \brief The Extractor class is used to extract data from a file.
27 */
28class KFILEMETADATA_EXPORT Extractor
29{
30 enum ExtractorPluginOwnership {
31 AutoDeletePlugin,
32 DoNotDeletePlugin,
33 };
34
35public:
37 virtual ~Extractor() noexcept;
38
39 void extract(ExtractionResult* result);
40 QStringList mimetypes() const;
41 QVariantMap extractorProperties() const;
42
43private:
44 KFILEMETADATA_NO_EXPORT Extractor();
45
46 Extractor(const Extractor&) = delete;
47 void operator =(const Extractor&) = delete;
48
49 KFILEMETADATA_NO_EXPORT void setExtractorPlugin(ExtractorPlugin *extractorPlugin);
50
51 KFILEMETADATA_NO_EXPORT void setAutoDeletePlugin(ExtractorPluginOwnership autoDelete);
52
53 KFILEMETADATA_NO_EXPORT void setMetaData(const QVariantMap &metaData);
54
55 friend class ExtractorCollection;
56 friend class ExtractorCollectionPrivate;
57 friend class ExtractorPrivate;
58 std::unique_ptr<ExtractorPrivate> d;
59};
60}
61
62#endif // KFILEMETADATA_EXTRACTOR_H
The ExtractionResult class is where all the data extracted by the indexer is saved.
The ExtractorCollection is a helper class which internally loads all the extractor plugins.
The ExtractorPlugin is the base class for all file metadata extractors.
The Extractor class is used to extract data from a file.
Definition extractor.h:29
The KFileMetaData namespace.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:15:13 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.