File indexing completed on 2024-04-21 04:01:02

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 #include "rdfvocab.h"
0009 #include "model.h"
0010 #include "property.h"
0011 
0012 #include <QCoreApplication>
0013 #include <QString>
0014 
0015 namespace Syndication
0016 {
0017 namespace RDF
0018 {
0019 class SYNDICATION_NO_EXPORT RDFVocab::RDFVocabPrivate
0020 {
0021 public:
0022     QString namespaceURI;
0023     ResourcePtr seq;
0024     PropertyPtr type;
0025     PropertyPtr li;
0026 
0027     static RDFVocab *sSelf;
0028     static void cleanupRDFVocab()
0029     {
0030         delete sSelf;
0031         sSelf = nullptr;
0032     }
0033 };
0034 RDFVocab *RDFVocab::RDFVocabPrivate::sSelf = nullptr;
0035 
0036 RDFVocab *RDFVocab::self()
0037 {
0038     static RDFVocabPrivate p;
0039     if (!p.sSelf) {
0040         p.sSelf = new RDFVocab;
0041         qAddPostRoutine(RDFVocabPrivate::cleanupRDFVocab);
0042     }
0043     return p.sSelf;
0044 }
0045 
0046 RDFVocab::RDFVocab()
0047     : d(new RDFVocabPrivate)
0048 {
0049     QString ns = QStringLiteral("http://www.w3.org/1999/02/22-rdf-syntax-ns#");
0050 
0051     d->namespaceURI = ns;
0052 
0053     d->seq = ResourcePtr(new Resource(ns + QLatin1String("Seq")));
0054     d->type = PropertyPtr(new Property(ns + QLatin1String("type")));
0055     d->li = PropertyPtr(new Property(ns + QLatin1String("li")));
0056 }
0057 
0058 RDFVocab::~RDFVocab() = default;
0059 
0060 ResourcePtr RDFVocab::seq()
0061 {
0062     return d->seq;
0063 }
0064 
0065 PropertyPtr RDFVocab::type()
0066 {
0067     return d->type;
0068 }
0069 
0070 PropertyPtr RDFVocab::li()
0071 {
0072     return d->li;
0073 }
0074 
0075 QString RDFVocab::namespaceURI()
0076 {
0077     return d->namespaceURI;
0078 }
0079 
0080 } // namespace RDF
0081 } // namespace Syndication