Syndication

atom/parser.h
1 /*
2  This file is part of the syndication library
3  SPDX-FileCopyrightText: 2006 Frank Osterfeld <[email protected]>
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 class QString;
14 template<class T, class U>
15 class QHash;
16 
17 namespace Syndication
18 {
19 class SpecificDocument;
20 class DocumentSource;
21 
22 namespace Atom
23 {
24 /**
25  * parser implementation for Atom 1.0 and 0.3.
26  *
27  * @author Frank Osterfeld
28  */
29 class SYNDICATION_EXPORT Parser : public Syndication::AbstractParser
30 {
31 public:
32  /** default constructor */
33  Parser();
34 
35  /** destructor */
36  ~Parser() override;
37 
38  /**
39  * returns whether the source looks like an Atom 1.0 or 0.3
40  * document, by checking the root element.
41  * @param source document source to check
42  */
43  bool accept(const Syndication::DocumentSource &source) const override;
44 
45  /**
46  * parses either an EntryDocument or a FeedDocument from a
47  * document source. If the source is not an atom document,
48  * an invalid FeedDocument is returned.
49  * @see SpecificDocument::isValid()
50  * @param source the document source to parse
51  */
52  Q_REQUIRED_RESULT Syndication::SpecificDocumentPtr parse(const Syndication::DocumentSource &source) const override;
53 
54  /**
55  * returns the format string for this parser implementation, which is
56  * @c "atom"
57  * @return @c "atom"
58  */
59  Q_REQUIRED_RESULT QString format() const override;
60 
61 private:
62  Parser(const Parser &other);
63  Parser &operator=(const Parser &other);
64  class ParserPrivate;
65  ParserPrivate *const d;
66 };
67 
68 } // namespace Atom
69 } // namespace Syndication
70 
71 #endif // SYNDICATION_ATOM_PARSER_H
FeedPtr parse(const DocumentSource &src, const QString &formatHint)
parses a document from a source and returns a new Feed object wrapping the feed content.
Definition: global.cpp:54
Interface for all parsers.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Nov 28 2023 03:57:59 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.