syndication/rdf
contentvocab.cpp
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #include "contentvocab.h"
00024 #include "property.h"
00025
00026 #include <QtCore/QCoreApplication>
00027 #include <QtCore/QString>
00028
00029 namespace Syndication {
00030 namespace RDF {
00031
00032 class ContentVocab::ContentVocabPrivate
00033 {
00034 public:
00035
00036 QString namespaceURI;
00037 PropertyPtr encoded;
00038
00039 static ContentVocab *sSelf;
00040 static void cleanupContentVocab()
00041 {
00042 delete sSelf;
00043 sSelf = 0;
00044 }
00045 };
00046 ContentVocab *ContentVocab::ContentVocabPrivate::sSelf = 0;
00047
00048 ContentVocab::ContentVocab() : d(new ContentVocabPrivate)
00049 {
00050 QString ns = QString::fromUtf8("http://purl.org/rss/1.0/modules/content/");
00051
00052 d->namespaceURI = ns;
00053
00054 d->encoded = PropertyPtr( new Property(ns + QString::fromUtf8("encoded")) );
00055
00056 }
00057
00058 ContentVocab::~ContentVocab()
00059 {
00060 delete d;
00061 }
00062
00063 ContentVocab* ContentVocab::self()
00064 {
00065 static ContentVocabPrivate p;
00066 if(!p.sSelf) {
00067 p.sSelf = new ContentVocab;
00068 qAddPostRoutine(ContentVocabPrivate::cleanupContentVocab);
00069 }
00070 return p.sSelf;
00071 }
00072
00073 const QString& ContentVocab::namespaceURI() const
00074 {
00075 return d->namespaceURI;
00076 }
00077
00078 PropertyPtr ContentVocab::encoded() const
00079 {
00080 return d->encoded;
00081 }
00082
00083 }
00084 }