Syndication

syndicationvocab.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 "syndicationvocab.h"
9 #include "property.h"
10 
11 #include <QCoreApplication>
12 #include <QString>
13 
14 namespace Syndication
15 {
16 namespace RDF
17 {
18 class SYNDICATION_NO_EXPORT SyndicationVocab::SyndicationVocabPrivate
19 {
20 public:
21  QString namespaceURI;
22  PropertyPtr updatePeriod;
23  PropertyPtr updateFrequency;
24  PropertyPtr updateBase;
25 
26  static SyndicationVocab *sSelf;
27  static void cleanupSyndicationVocab()
28  {
29  delete sSelf;
30  sSelf = nullptr;
31  }
32 };
33 SyndicationVocab *SyndicationVocab::SyndicationVocabPrivate::sSelf = nullptr;
34 
35 SyndicationVocab::SyndicationVocab()
36  : d(new SyndicationVocabPrivate)
37 {
38  QString ns = QStringLiteral("http://purl.org/rss/1.0/modules/syndication/");
39 
40  d->namespaceURI = ns;
41 
42  d->updatePeriod = PropertyPtr(new Property(ns + QLatin1String("updatePeriod")));
43  d->updateFrequency = PropertyPtr(new Property(ns + QLatin1String("updateFrequency")));
44  d->updateBase = PropertyPtr(new Property(ns + QLatin1String("updateBase")));
45 }
46 
47 SyndicationVocab::~SyndicationVocab()
48 {
49  delete d;
50 }
51 
52 SyndicationVocab *SyndicationVocab::self()
53 {
54  static SyndicationVocabPrivate p;
55  if (!p.sSelf) {
56  p.sSelf = new SyndicationVocab;
57  qAddPostRoutine(SyndicationVocabPrivate::cleanupSyndicationVocab);
58  }
59  return p.sSelf;
60 }
61 
62 const QString &SyndicationVocab::namespaceURI() const
63 {
64  return d->namespaceURI;
65 }
66 
67 PropertyPtr SyndicationVocab::updatePeriod() const
68 {
69  return d->updatePeriod;
70 }
71 
72 PropertyPtr SyndicationVocab::updateFrequency() const
73 {
74  return d->updateFrequency;
75 }
76 
77 PropertyPtr SyndicationVocab::updateBase() const
78 {
79  return d->updateBase;
80 }
81 
82 } // namespace RDF
83 } // namespace Syndication
Property
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon May 8 2023 03:57:11 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.