File indexing completed on 2024-04-28 15:34:25

0001 /*
0002     This file is part of the syndication library
0003     SPDX-FileCopyrightText: 2006 Frank Osterfeld <osterfeld@kde.org>
0004 
0005     SPDX-License-Identifier: LGPL-2.0-or-later
0006 */
0007 
0008 #ifndef SYNDICATION_RDF_MODELMAKER_H
0009 #define SYNDICATION_RDF_MODELMAKER_H
0010 
0011 #include <QSharedPointer>
0012 
0013 #include <syndication_export.h>
0014 
0015 class QDomDocument;
0016 class QDomElement;
0017 
0018 namespace Syndication
0019 {
0020 namespace RDF
0021 {
0022 class Model;
0023 class Resource;
0024 //@cond PRIVATE
0025 typedef QSharedPointer<Resource> ResourcePtr;
0026 //@endcond
0027 
0028 /**
0029  * An RDF parser, used to parse an RDF model from RDF/XML. It doesn't support
0030  * the complete RDF specification, but suffices for our purposes.
0031  *
0032  * @author Frank Osterfeld
0033  */
0034 class SYNDICATION_EXPORT ModelMaker
0035 {
0036 public:
0037     /**
0038      * parses an RDF model from RDF/XML
0039      * @param doc an DOM document, must contain RDF/XML
0040      * @return the parsed model, or an empty model if parsing failed
0041      */
0042     Model createFromXML(const QDomDocument &doc);
0043 
0044 private:
0045     SYNDICATION_NO_EXPORT ResourcePtr readResource(Model &model, const QDomElement &el);
0046 };
0047 
0048 } // namespace RDF
0049 } // namespace Syndication
0050 
0051 #endif // SYNDICATION_RDF_MODELMAKER_H