Syndication

rdf/parser.h
1 /*
2  This file is part of the syndication library
3  SPDX-FileCopyrightText: 2005 Frank Osterfeld <[email protected]>
4 
5  SPDX-License-Identifier: LGPL-2.0-or-later
6 */
7 
8 #ifndef SYNDICATION_RDF_PARSER_H
9 #define SYNDICATION_RDF_PARSER_H
10 
11 #include <syndication/abstractparser.h>
12 #include <syndication/rdf/document.h>
13 
14 namespace Syndication
15 {
16 class DocumentSource;
17 
18 namespace RDF
19 {
20 /**
21  * Parser implementation for RDF-based RSS 0.9 and RSS 1.0 feeds.
22  *
23  * @author Frank Osterfeld
24  */
25 class SYNDICATION_EXPORT Parser : public Syndication::AbstractParser
26 {
27 public:
28  /** default constructor */
29  Parser();
30 
31  /** destructor */
32  ~Parser() override;
33 
34  /**
35  * returns whether the passed document looks like
36  * an RSS 0.9 or RSS 1.0 document.
37  * @param source the document source to check
38  */
39  bool accept(const DocumentSource &source) const override;
40 
41  /**
42  * Parses an RSS 0.9/1.0 document from a feed source. RSS 0.9
43  * documents are converted to RSS 1.0.
44  *
45  * @param source The document source to parse
46  * @return parsed document (a Syndication::RDF::Document), or an
47  * invalid document if parsing failed.
48  * @see Document::isValid()
49  */
50  SpecificDocumentPtr parse(const DocumentSource &source) const override;
51 
52  /**
53  * format string of this parser, which is @c "rdf".
54  *
55  * @return @c "rdf"
56  */
57  QString format() const override;
58 
59 private:
60  Parser(const Parser &other);
61  Parser &operator=(const Parser &other);
62 
63  class ParserPrivate;
64  ParserPrivate *const d;
65 };
66 
67 } // namespace RDF
68 } // namespace Syndication
69 
70 #endif // SYNDICATION_RDF_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 Sat Dec 9 2023 03:49:54 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.