syndication/rdf
rdfvocab.cpp
00001 /* 00002 * This file is part of the syndication library 00003 * 00004 * Copyright (C) 2006 Frank Osterfeld <osterfeld@kde.org> 00005 * 00006 * This library is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU Library General Public 00008 * License as published by the Free Software Foundation; either 00009 * version 2 of the License, or (at your option) any later version. 00010 * 00011 * This library is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 * Library General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU Library General Public License 00017 * along with this library; see the file COPYING.LIB. If not, write to 00018 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00019 * Boston, MA 02110-1301, USA. 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 } // namespace RDF 00098 } // namespace Syndication