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 * \class Syndication::Atom::Parser
28 * \inmodule Syndication
29 * \inheaderfile Syndication/Atom/Parser
30 *
31 * \brief parser implementation for Atom 1.0 and 0.3.
32 */
33class SYNDICATION_EXPORT Parser : public Syndication::AbstractParser
34{
35public:
36 /*! default constructor */
37 Parser();
38
39 ~Parser() override;
40
41 /*!
42 * returns whether the source looks like an Atom 1.0 or 0.3
43 * document, by checking the root element.
44 *
45 * \a source document source to check
46 */
47 bool accept(const Syndication::DocumentSource &source) const override;
48
49 /*!
50 * parses either an EntryDocument or a FeedDocument from a
51 * document source. If the source is not an atom document,
52 * an invalid FeedDocument is returned.
53 *
54 * \a source the document source to parse
55 *
56 * \sa SpecificDocument::isValid()
57 */
58 Q_REQUIRED_RESULT Syndication::SpecificDocumentPtr parse(const Syndication::DocumentSource &source) const override;
59
60 /*!
61 * returns the format string for this parser implementation, which is
62 * \c "atom"
63 *
64 * Returns \c "atom"
65 */
66 Q_REQUIRED_RESULT QString format() const override;
67
68private:
69 Parser(const Parser &other);
70 Parser &operator=(const Parser &other);
71 class ParserPrivate;
72 std::unique_ptr<ParserPrivate> const d;
73};
74
75} // namespace Atom
76} // namespace Syndication
77
78#endif // SYNDICATION_ATOM_PARSER_H
79

source code of syndication/src/atom/parser.h