1 | /* |
2 | This file is part of the syndication library |
3 | SPDX-FileCopyrightText: 2005 Frank Osterfeld <osterfeld@kde.org> |
4 | |
5 | SPDX-License-Identifier: LGPL-2.0-or-later |
6 | */ |
7 | |
8 | #ifndef SYNDICATION_RSS2_PARSER_H |
9 | #define |
10 | |
11 | #include <syndication/abstractparser.h> |
12 | #include <syndication/rss2/document.h> |
13 | |
14 | #include <memory> |
15 | |
16 | namespace Syndication |
17 | { |
18 | class DocumentSource; |
19 | |
20 | namespace RSS2 |
21 | { |
22 | class ; |
23 | |
24 | /** |
25 | * Parser implementation for the RSS 0.9x/2.0 format family |
26 | * |
27 | * @author Frank Osterfeld |
28 | */ |
29 | class : public Syndication::AbstractParser |
30 | { |
31 | public: |
32 | /** default constructor */ |
33 | (); |
34 | |
35 | /** destructor */ |
36 | () override; |
37 | |
38 | /** |
39 | * checks whether a document source looks like an RSS0.9x/2.0 document |
40 | * |
41 | * @param source a document source to check |
42 | * @return @c true if the source looks like an RSS2 document |
43 | */ |
44 | bool (const DocumentSource &source) const override; |
45 | |
46 | /** |
47 | * creates an RSS2 wrapper for a document source. |
48 | * The wrapper will only return useful values if the source is really |
49 | * RSS 0.9x/2.0, so call accept() before to check. |
50 | * |
51 | * @param source the source to wrap |
52 | * @return A Syndication::RSS2::Document instance wrapping the XML |
53 | * source, or a null document (not a null pointer!) if there is no @c |
54 | * <channel> root element in the source. |
55 | */ |
56 | Syndication::SpecificDocumentPtr (const DocumentSource &source) const override; |
57 | |
58 | /** |
59 | * returns the format string of this parser implementation, which is |
60 | * "rss2". |
61 | * |
62 | * @return @c "rss2" |
63 | */ |
64 | QString () const override; |
65 | |
66 | private: |
67 | (const Parser &other); |
68 | Parser &(const Parser &other); |
69 | |
70 | class ; |
71 | std::unique_ptr<ParserPrivate> const ; |
72 | }; |
73 | |
74 | } // namespace RSS2 |
75 | } // namespace Syndication |
76 | |
77 | #endif // SYNDICATION_RSS2_PARSER_H |
78 | |