Pages
API Documentation
On this page

Syndication::AbstractParser Class

Interface for all parsers. More...

  • Header: #include <Syndication/AbstractParser>
  • CMake: find_package(KF6 REQUIRED COMPONENTS Syndication)
    target_link_libraries(mytarget PRIVATE KF6::Syndication)
  • Inherited By: Syndication::Atom::Parser

List of all members, including inherited members

Public Functions

Detailed Description

The parsers for the various formats must implement this interface and register themselves at the ParserRegistry.

Member Function Documentation

[pure virtual] bool AbstractParser::accept(const Syndication::DocumentSource &source) const

Lets the parser check if it can parse the passed source.

Parser implementations should do a _quick_ check for the file format (i.e. check for feed format and version number in the root element) to find out if the source is in a supported format. They should _not_ completely parse the document to test for full compliance to the format specification.

source the document source to be checked

Returns whether source seems to be in a format supported by the parser

[pure virtual] QString AbstractParser::format() const

Returns the name of the format supported by this parser.

Returns a string like "rss2", "atom" or "rdf"

[pure virtual] Syndication::SpecificDocumentPtr AbstractParser::parse(const Syndication::DocumentSource &source) const

Lets the parser parse a document source.

The parser returns a valid document instance if successful, or an invalid one if not.

source The document source to be parsed

Returns a newly created document parsed from source

See also SpecificDocument::isValid()

We use cookies to personalize content and to analyze our traffic. Please decide if you are willing to accept cookies from our website.