KItinerary

extractorresult.h
1/*
2 SPDX-FileCopyrightText: 2019-2021 Volker Krause <vkrause@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "kitinerary_export.h"
10
11#include <QJsonArray>
12#include <QList>
13#include <QVariant>
14
15namespace KItinerary {
16
17/** Generic extraction result.
18 * This can represent results both in JSON-LD serialized form and in QVariant decoded form.
19 */
20class KITINERARY_EXPORT ExtractorResult
21{
22public:
24 ExtractorResult(const QJsonArray &result);
25 ExtractorResult(const QList<QVariant> &result);
27
28 /** Checks if there is any relevant result set in here. */
29 bool isEmpty() const;
30 /** Amount of contained result elements. */
31 int size() const;
32
33 /** JSON-LD data extracted from this document or page. */
34 QJsonArray jsonLdResult() const;
35 /** Result in decoded form. */
36 QList<QVariant> result() const;
37
38 /** Append another result to this one. */
39 void append(ExtractorResult &&other);
40
41private:
42 mutable QJsonArray m_jsonLdResult;
43 mutable QList<QVariant> m_result;
44};
45
46}
47
Generic extraction result.
Classes for reservation/travel data models, data extraction and data augmentation.
Definition berelement.h:17
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 20 2024 11:52:36 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.