syndication/rdf
rdfvocab.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 "rdfvocab.h"
00024 #include "model.h"
00025 #include "property.h"
00026
00027 #include <QtCore/QCoreApplication>
00028 #include <QtCore/QString>
00029
00030 namespace Syndication {
00031 namespace RDF {
00032
00033 class RDFVocab::RDFVocabPrivate
00034 {
00035 public:
00036
00037 QString namespaceURI;
00038 ResourcePtr seq;
00039 PropertyPtr type;
00040 PropertyPtr li;
00041
00042 static RDFVocab *sSelf;
00043 static void cleanupRDFVocab()
00044 {
00045 delete sSelf;
00046 sSelf = 0;
00047 }
00048 };
00049 RDFVocab *RDFVocab::RDFVocabPrivate::sSelf = 0;
00050
00051 RDFVocab* RDFVocab::self()
00052 {
00053 static RDFVocabPrivate p;
00054 if(!p.sSelf) {
00055 p.sSelf = new RDFVocab;
00056 qAddPostRoutine(RDFVocabPrivate::cleanupRDFVocab);
00057 }
00058 return p.sSelf;
00059 }
00060
00061 RDFVocab::RDFVocab() : d(new RDFVocabPrivate)
00062 {
00063 QString ns = QString::fromUtf8("http://www.w3.org/1999/02/22-rdf-syntax-ns#");
00064
00065 d->namespaceURI = ns;
00066
00067 d->seq = ResourcePtr(new Resource(ns + QString::fromUtf8("Seq")));
00068 d->type = PropertyPtr(new Property(ns + QString::fromUtf8("type")));
00069 d->li = PropertyPtr(new Property(ns + QString::fromUtf8("li")));
00070 }
00071
00072 RDFVocab::~RDFVocab()
00073 {
00074 delete d;
00075 }
00076
00077 ResourcePtr RDFVocab::seq()
00078 {
00079 return d->seq;
00080 }
00081
00082 PropertyPtr RDFVocab::type()
00083 {
00084 return d->type;
00085 }
00086
00087 PropertyPtr RDFVocab::li()
00088 {
00089 return d->li;
00090 }
00091
00092 QString RDFVocab::namespaceURI()
00093 {
00094 return d->namespaceURI;
00095 }
00096
00097 }
00098 }