Syndication

contentvocab.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 "contentvocab.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 ContentVocab::ContentVocabPrivate
19 {
20 public:
21  QString namespaceURI;
22  PropertyPtr encoded;
23 
24  static ContentVocab *sSelf;
25  static void cleanupContentVocab()
26  {
27  delete sSelf;
28  sSelf = nullptr;
29  }
30 };
31 ContentVocab *ContentVocab::ContentVocabPrivate::sSelf = nullptr;
32 
33 ContentVocab::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 
43 ContentVocab::~ContentVocab()
44 {
45  delete d;
46 }
47 
48 ContentVocab *ContentVocab::self()
49 {
50  static ContentVocabPrivate p;
51  if (!p.sSelf) {
52  p.sSelf = new ContentVocab;
53  qAddPostRoutine(ContentVocabPrivate::cleanupContentVocab);
54  }
55  return p.sSelf;
56 }
57 
58 const QString &ContentVocab::namespaceURI() const
59 {
60  return d->namespaceURI;
61 }
62 
63 PropertyPtr ContentVocab::encoded() const
64 {
65  return d->encoded;
66 }
67 
68 } // namespace RDF
69 } // namespace Syndication
Property
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Thu Nov 30 2023 03:51:25 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.