Syndication

contentvocab.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 "contentvocab.h"
9#include "property.h"
10
11#include <QCoreApplication>
12#include <QString>
13
14namespace Syndication
15{
16namespace RDF
17{
18class SYNDICATION_NO_EXPORT ContentVocab::ContentVocabPrivate
19{
20public:
21 QString namespaceURI;
22 PropertyPtr encoded;
23
24 static ContentVocab *sSelf;
25 static void cleanupContentVocab()
26 {
27 delete sSelf;
28 sSelf = nullptr;
29 }
30};
31ContentVocab *ContentVocab::ContentVocabPrivate::sSelf = nullptr;
32
33ContentVocab::ContentVocab()
34 : d(new ContentVocabPrivate)
35{
36 QString ns = QStringLiteral("http://purl.org/rss/1.0/modules/content/");
37
38 d->namespaceURI = ns;
39
40 d->encoded = PropertyPtr(new Property(ns + QLatin1String("encoded")));
41}
42
43ContentVocab::~ContentVocab() = default;
44
45ContentVocab *ContentVocab::self()
46{
47 static ContentVocabPrivate p;
48 if (!p.sSelf) {
49 p.sSelf = new ContentVocab;
50 qAddPostRoutine(ContentVocabPrivate::cleanupContentVocab);
51 }
52 return p.sSelf;
53}
54
55const QString &ContentVocab::namespaceURI() const
56{
57 return d->namespaceURI;
58}
59
60PropertyPtr ContentVocab::encoded() const
61{
62 return d->encoded;
63}
64
65} // namespace RDF
66} // 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.