| 1 | /* |
| 2 | This file is part of the syndication library |
| 3 | SPDX-FileCopyrightText: 2006 Frank Osterfeld <osterfeld@kde.org> |
| 4 | |
| 5 | SPDX-License-Identifier: LGPL-2.0-or-later |
| 6 | */ |
| 7 | |
| 8 | #ifndef SYNDICATION_RDF_MODELMAKER_H |
| 9 | #define SYNDICATION_RDF_MODELMAKER_H |
| 10 | |
| 11 | #include <QSharedPointer> |
| 12 | |
| 13 | #include "../syndication_export.h" |
| 14 | |
| 15 | class QDomDocument; |
| 16 | class QDomElement; |
| 17 | |
| 18 | namespace Syndication |
| 19 | { |
| 20 | namespace RDF |
| 21 | { |
| 22 | class Model; |
| 23 | class Resource; |
| 24 | //@cond PRIVATE |
| 25 | typedef QSharedPointer<Resource> ResourcePtr; |
| 26 | //@endcond |
| 27 | |
| 28 | /*! |
| 29 | * An RDF parser, used to parse an RDF model from RDF/XML. It doesn't support |
| 30 | * the complete RDF specification, but suffices for our purposes. |
| 31 | * |
| 32 | * @author Frank Osterfeld |
| 33 | */ |
| 34 | class ModelMaker |
| 35 | { |
| 36 | public: |
| 37 | /*! |
| 38 | * parses an RDF model from RDF/XML |
| 39 | * \a doc an DOM document, must contain RDF/XML |
| 40 | * @return the parsed model, or an empty model if parsing failed |
| 41 | */ |
| 42 | Model createFromXML(const QDomDocument &doc); |
| 43 | |
| 44 | private: |
| 45 | ResourcePtr readResource(Model &model, const QDomElement &el); |
| 46 | }; |
| 47 | |
| 48 | } // namespace RDF |
| 49 | } // namespace Syndication |
| 50 | |
| 51 | #endif // SYNDICATION_RDF_MODELMAKER_H |
| 52 | |