| 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 | #include "rdfvocab.h" |
| 9 | #include "model.h" |
| 10 | #include "property.h" |
| 11 | |
| 12 | #include <QCoreApplication> |
| 13 | #include <QString> |
| 14 | |
| 15 | namespace Syndication |
| 16 | { |
| 17 | namespace RDF |
| 18 | { |
| 19 | class SYNDICATION_NO_EXPORT RDFVocab::RDFVocabPrivate |
| 20 | { |
| 21 | public: |
| 22 | QString namespaceURI; |
| 23 | ResourcePtr seq; |
| 24 | PropertyPtr type; |
| 25 | PropertyPtr li; |
| 26 | |
| 27 | static RDFVocab *sSelf; |
| 28 | static void cleanupRDFVocab() |
| 29 | { |
| 30 | delete sSelf; |
| 31 | sSelf = nullptr; |
| 32 | } |
| 33 | }; |
| 34 | RDFVocab *RDFVocab::RDFVocabPrivate::sSelf = nullptr; |
| 35 | |
| 36 | RDFVocab *RDFVocab::self() |
| 37 | { |
| 38 | static RDFVocabPrivate p; |
| 39 | if (!p.sSelf) { |
| 40 | p.sSelf = new RDFVocab; |
| 41 | qAddPostRoutine(RDFVocabPrivate::cleanupRDFVocab); |
| 42 | } |
| 43 | return p.sSelf; |
| 44 | } |
| 45 | |
| 46 | RDFVocab::RDFVocab() |
| 47 | : d(new RDFVocabPrivate) |
| 48 | { |
| 49 | QString ns = QStringLiteral("http://www.w3.org/1999/02/22-rdf-syntax-ns#"); |
| 50 | |
| 51 | d->namespaceURI = ns; |
| 52 | |
| 53 | d->seq = ResourcePtr(new Resource(ns + QLatin1String("Seq"))); |
| 54 | d->type = PropertyPtr(new Property(ns + QLatin1String("type"))); |
| 55 | d->li = PropertyPtr(new Property(ns + QLatin1String("li"))); |
| 56 | } |
| 57 | |
| 58 | RDFVocab::~RDFVocab() = default; |
| 59 | |
| 60 | ResourcePtr RDFVocab::seq() |
| 61 | { |
| 62 | return d->seq; |
| 63 | } |
| 64 | |
| 65 | PropertyPtr RDFVocab::type() |
| 66 | { |
| 67 | return d->type; |
| 68 | } |
| 69 | |
| 70 | PropertyPtr RDFVocab::li() |
| 71 | { |
| 72 | return d->li; |
| 73 | } |
| 74 | |
| 75 | QString RDFVocab::namespaceURI() |
| 76 | { |
| 77 | return d->namespaceURI; |
| 78 | } |
| 79 | |
| 80 | } // namespace RDF |
| 81 | } // namespace Syndication |
| 82 |
