1/*
2 SPDX-FileCopyrightText: 2012 Vishesh Handa <me@vhanda.in>
3
4 SPDX-License-Identifier: LGPL-2.1-or-later
5*/
6
7#ifndef _KFILEMETADATA_EXTRACTORCOLLECTION_H
8#define _KFILEMETADATA_EXTRACTORCOLLECTION_H
9
10#include "extractor.h"
11#include "kfilemetadata_export.h"
12
13#include <memory>
14
15namespace KFileMetaData
16{
17class ExtractorCollectionPrivate;
18/*!
19 * \class KFileMetaData::ExtractorCollection
20 * \inheaderfile KFileMetaData/ExtractorCollection
21 * \inmodule KFileMetaData
22 *
23 * \brief The ExtractorCollection is a helper class which internally
24 * loads all the extractor plugins.
25 *
26 * It can be used to fetch a certain
27 * subset of these plugins based on a given mimetype.
28 *
29 * Once the appropriate plugins have been fetched, an ExtractionResult
30 * should be created and passed to the plugin's extract function.
31 */
32class KFILEMETADATA_EXPORT ExtractorCollection
33{
34public:
35 /*!
36 *
37 */
38 explicit ExtractorCollection();
39 virtual ~ExtractorCollection();
40
41 /*!
42 * Fetch the extractors which can be used to extract
43 * data for the respective file with the given MIME type.
44 *
45 * If no match is found then the best matching plugins
46 * are returned, determined by MIME type inheritance.
47 *
48 * \sa QMimeType::allAncestors
49 */
50 QList<Extractor*> fetchExtractors(const QString& mimetype) const;
51
52private:
53 friend class ExtractorCollectionTest;
54 // exported for ExtractorCollectionTest
55 QList<Extractor*> allExtractors();
56
57 const std::unique_ptr<ExtractorCollectionPrivate> d;
58};
59}
60
61#endif
62

source code of kfilemetadata/src/extractorcollection.h