Syndication

syndicationvocab.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 "syndicationvocab.h"
9#include "property.h"
10
11#include <QCoreApplication>
12#include <QString>
13
14namespace Syndication
15{
16namespace RDF
17{
18class SYNDICATION_NO_EXPORT SyndicationVocab::SyndicationVocabPrivate
19{
20public:
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};
33SyndicationVocab *SyndicationVocab::SyndicationVocabPrivate::sSelf = nullptr;
34
35SyndicationVocab::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
47SyndicationVocab::~SyndicationVocab() = default;
48
49SyndicationVocab *SyndicationVocab::self()
50{
51 static SyndicationVocabPrivate p;
52 if (!p.sSelf) {
53 p.sSelf = new SyndicationVocab;
54 qAddPostRoutine(SyndicationVocabPrivate::cleanupSyndicationVocab);
55 }
56 return p.sSelf;
57}
58
59const QString &SyndicationVocab::namespaceURI() const
60{
61 return d->namespaceURI;
62}
63
64PropertyPtr SyndicationVocab::updatePeriod() const
65{
66 return d->updatePeriod;
67}
68
69PropertyPtr SyndicationVocab::updateFrequency() const
70{
71 return d->updateFrequency;
72}
73
74PropertyPtr SyndicationVocab::updateBase() const
75{
76 return d->updateBase;
77}
78
79} // namespace RDF
80} // namespace Syndication
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.