Syndication

rdfvocab.cpp
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
15namespace Syndication
16{
17namespace RDF
18{
19class SYNDICATION_NO_EXPORT RDFVocab::RDFVocabPrivate
20{
21public:
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};
34RDFVocab *RDFVocab::RDFVocabPrivate::sSelf = nullptr;
35
36RDFVocab *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
46RDFVocab::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
58RDFVocab::~RDFVocab() = default;
59
60ResourcePtr RDFVocab::seq()
61{
62 return d->seq;
63}
64
65PropertyPtr RDFVocab::type()
66{
67 return d->type;
68}
69
70PropertyPtr RDFVocab::li()
71{
72 return d->li;
73}
74
75QString RDFVocab::namespaceURI()
76{
77 return d->namespaceURI;
78}
79
80} // namespace RDF
81} // namespace Syndication
Type type(const QSqlDatabase &db)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:14:15 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.