Syndication

atom/parser.h
1/*
2 This file is part of the syndication library
3 SPDX-FileCopyrightText: 2006 Frank Osterfeld <osterfeld@kde.org>
4
5 SPDX-License-Identifier: LGPL-2.0-or-later
6*/
7
8#ifndef SYNDICATION_ATOM_PARSER_H
9#define SYNDICATION_ATOM_PARSER_H
10
11#include <syndication/abstractparser.h>
12
13#include <memory>
14
15class QString;
16template<class T, class U>
17class QHash;
18
19namespace Syndication
20{
21class SpecificDocument;
22class DocumentSource;
23
24namespace Atom
25{
26/**
27 * parser implementation for Atom 1.0 and 0.3.
28 *
29 * @author Frank Osterfeld
30 */
31class SYNDICATION_EXPORT Parser : public Syndication::AbstractParser
32{
33public:
34 /** default constructor */
35 Parser();
36
37 /** destructor */
38 ~Parser() override;
39
40 /**
41 * returns whether the source looks like an Atom 1.0 or 0.3
42 * document, by checking the root element.
43 * @param source document source to check
44 */
45 bool accept(const Syndication::DocumentSource &source) const override;
46
47 /**
48 * parses either an EntryDocument or a FeedDocument from a
49 * document source. If the source is not an atom document,
50 * an invalid FeedDocument is returned.
51 * @see SpecificDocument::isValid()
52 * @param source the document source to parse
53 */
54 Q_REQUIRED_RESULT Syndication::SpecificDocumentPtr parse(const Syndication::DocumentSource &source) const override;
55
56 /**
57 * returns the format string for this parser implementation, which is
58 * @c "atom"
59 * @return @c "atom"
60 */
61 Q_REQUIRED_RESULT QString format() const override;
62
63private:
64 Parser(const Parser &other);
65 Parser &operator=(const Parser &other);
66 class ParserPrivate;
67 std::unique_ptr<ParserPrivate> const d;
68};
69
70} // namespace Atom
71} // namespace Syndication
72
73#endif // SYNDICATION_ATOM_PARSER_H
Interface for all parsers.
KHEALTHCERTIFICATE_EXPORT QVariant parse(const QByteArray &data)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:14:15 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.