1/*
2 * Copyright (C) 2014 Vishesh Handa <me@vhanda.in>
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) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 *
18 */
19
20#ifndef KFILEMETADATA_SimpleExtractionResult_H
21#define KFILEMETADATA_SimpleExtractionResult_H
22
23#include "extractionresult.h"
24#include <QVector>
25#include <QString>
26
27namespace KFileMetaData {
28
29/**
30 * \class SimpleExtractionResult simpleextractionresult.h <KFileMetaData/SimpleExtractionResult>
31 *
32 * A simple ExtractionResult implementation which stores
33 * all the data in memory.
34 *
35 * This should ideally not be used in production applications as
36 * it holds all of the plain text in memory, and that can get quite large
37 * when extracting certain documents.
38 */
39class KFILEMETADATA_EXPORT SimpleExtractionResult : public ExtractionResult
40{
41public:
42 SimpleExtractionResult(const QString& url, const QString& mimetype = QString(), const Flags& flags = ExtractEverything);
43 SimpleExtractionResult(const SimpleExtractionResult& rhs);
44 ~SimpleExtractionResult() override;
45
46 SimpleExtractionResult& operator=(const SimpleExtractionResult& rhs);
47 bool operator==(const SimpleExtractionResult& rhs) const;
48
49 void add(Property::Property property, const QVariant& value) override;
50 void addType(Type::Type type) override;
51 void append(const QString& text) override;
52
53 PropertyMap properties() const;
54 QString text() const;
55 QVector<Type::Type> types() const;
56
57private:
58 class Private;
59 Private* d;
60};
61
62}
63
64#endif // KFILEMETADATA_SimpleExtractionResult_H
65