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
60{
61 return d->namespaceURI;
62}
63
65{
66 return d->updatePeriod;
67}
68
70{
71 return d->updateFrequency;
72}
73
75{
76 return d->updateBase;
77}
78
79} // namespace RDF
80} // namespace Syndication
a property is node type that represents properties of things, like "name" is a property of a person,...
Definition property.h:32
Singleton providing Property constants for the Syndication module.
PropertyPtr updatePeriod() const
updatePeriod property, see Syndication::updatePeriod() for more information.
PropertyPtr updateBase() const
updateBase property, see Syndication::updateBase() for more information.
static SyndicationVocab * self()
returns the singleton instance
const QString & namespaceURI() const
namespace URI of the syndication vocabulary, "http://purl.org/rss/1.0/modules/syndication/"
PropertyPtr updateFrequency() const
updateFrequency property, see Syndication::updateFrequency() for more information.
Syndication's parser for the RDF-based RSS 0.9 and RSS 1.0 formats.
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:48:38 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.