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_SimpleExtractionResult_H
8#define KFILEMETADATA_SimpleExtractionResult_H
9
10#include "extractionresult.h"
11#include <QList>
12#include <QString>
13
14#include <memory>
15
16namespace KFileMetaData {
17
18class SimpleExtractionResultPrivate;
19
20/*!
21 * \class KFileMetaData::SimpleExtractionResult
22 * \inheaderfile KFileMetaData/SimpleExtractionResult
23 * \inmodule KFileMetaData
24 *
25 * \brief A simple ExtractionResult implementation which stores
26 * all the data in memory.
27 *
28 * This should ideally not be used in production applications as
29 * it holds all of the plain text in memory, and that can get quite large
30 * when extracting certain documents.
31 */
32class KFILEMETADATA_EXPORT SimpleExtractionResult : public ExtractionResult
33{
34public:
35 /*!
36 *
37 */
38 SimpleExtractionResult(const QString& url, const QString& mimetype = QString(), const Flags& flags = Flags{ExtractPlainText | ExtractMetaData});
39 SimpleExtractionResult(const SimpleExtractionResult& rhs);
40 ~SimpleExtractionResult() override;
41
42 SimpleExtractionResult& operator=(const SimpleExtractionResult& rhs);
43
44 /*!
45 *
46 */
47 bool operator==(const SimpleExtractionResult& rhs) const;
48
49 /*!
50 *
51 */
52 void add(Property::Property property, const QVariant& value) override;
53
54 /*!
55 *
56 */
57 void addType(Type::Type type) override;
58
59 /*!
60 *
61 */
62 void append(const QString& text) override;
63
64 /*!
65 * Returns the properties of the extraction result.
66 */
67 PropertyMultiMap properties() const;
68
69 /*!
70 *
71 */
72 QString text() const;
73
74 /*!
75 *
76 */
77 QList<Type::Type> types() const;
78
79private:
80 const std::unique_ptr<SimpleExtractionResultPrivate> d;
81};
82
83}
84
85#endif // KFILEMETADATA_SimpleExtractionResult_H
86

source code of kfilemetadata/src/simpleextractionresult.h