Syndication

rdfvocab.cpp
1 /*
2  This file is part of the syndication library
3  SPDX-FileCopyrightText: 2006 Frank Osterfeld <[email protected]>
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()
59 {
60  delete d;
61 }
62 
63 ResourcePtr RDFVocab::seq()
64 {
65  return d->seq;
66 }
67 
68 PropertyPtr RDFVocab::type()
69 {
70  return d->type;
71 }
72 
73 PropertyPtr RDFVocab::li()
74 {
75  return d->li;
76 }
77 
78 QString RDFVocab::namespaceURI()
79 {
80  return d->namespaceURI;
81 }
82 
83 } // namespace RDF
84 } // namespace Syndication
Type type(const QSqlDatabase &db)
Property()
creates a null property
Definition: property.cpp:15
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Thu Nov 30 2023 03:51:26 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.