KItinerary

abstractextractor.h
1/*
2 SPDX-FileCopyrightText: 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
11class QString;
12
13namespace KItinerary {
14class ExtractorDocumentNode;
15class ExtractorEngine;
16class ExtractorResult;
17
18/** Abstract base class for data extractors. */
19class KITINERARY_EXPORT AbstractExtractor
20{
21public:
22 virtual ~AbstractExtractor();
23
24 /** Identifier for this extractor.
25 * Mainly used for diagnostics and tooling.
26 */
27 virtual QString name() const = 0;
28
29 /** Fast check whether this extractor is applicable for @p node. */
30 virtual bool canHandle(const ExtractorDocumentNode &node) const = 0;
31
32 /** Extract data from @p node. */
33 virtual ExtractorResult extract(const ExtractorDocumentNode &node, const ExtractorEngine *engine) const = 0;
34};
35
36}
37
Abstract base class for data extractors.
virtual bool canHandle(const ExtractorDocumentNode &node) const =0
Fast check whether this extractor is applicable for node.
virtual ExtractorResult extract(const ExtractorDocumentNode &node, const ExtractorEngine *engine) const =0
Extract data from node.
virtual QString name() const =0
Identifier for this extractor.
A node in the extracted document object tree.
Semantic data extraction engine.
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 Mon Nov 4 2024 16:28:48 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.