Syndication::AbstractParser
#include <abstractparser.h>
Public Member Functions | |
virtual | ~AbstractParser () |
virtual bool | accept (const DocumentSource &source) const =0 |
virtual QString | format () const =0 |
virtual SpecificDocumentPtr | parse (const DocumentSource &source) const =0 |
Detailed Description
Interface for all parsers.
The parsers for the various formats must implement this interface and register themselves at the ParserRegistry.
Definition at line 27 of file abstractparser.h.
Constructor & Destructor Documentation
◆ ~AbstractParser()
|
virtual |
virtual destructor
Definition at line 12 of file abstractparser.cpp.
Member Function Documentation
◆ accept()
|
pure virtual |
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.
- Parameters
-
source the document source to be checked
- Returns
- whether
source
seems to be in a format supported by the parser
Implemented in Syndication::Atom::Parser, Syndication::RDF::Parser, and Syndication::RSS2::Parser.
◆ format()
|
pure virtual |
Returns the name of the format supported by this parser.
- Returns
- a string like "rss2", "atom" or "rdf"
Implemented in Syndication::Atom::Parser, Syndication::RDF::Parser, and Syndication::RSS2::Parser.
◆ parse()
|
pure virtual |
Lets the parser parse a document source.
The parser returns a valid document instance if successful, or an invalid one if not.
- See also
- SpecificDocument::isValid()
- Parameters
-
source The document source to be parsed
- Returns
- a newly created document parsed from
source
Implemented in Syndication::Atom::Parser, Syndication::RDF::Parser, and Syndication::RSS2::Parser.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:03:18 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.