Soprano 2.6.0
|
00001 /* This file is part of Soprano 00002 * 00003 * Copyright (C) 2007 Sebastian Trueg <trueg@kde.org> 00004 * 00005 * This library is free software; you can redistribute it and/or 00006 * modify it under the terms of the GNU Library General Public 00007 * License as published by the Free Software Foundation; either 00008 * version 2 of the License, or (at your option) any later version. 00009 * 00010 * This library is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 * Library General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU Library General Public License 00016 * along with this library; see the file COPYING.LIB. If not, write to 00017 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00018 * Boston, MA 02110-1301, USA. 00019 */ 00020 00021 #ifndef SOPRANO_SERIALIZER_H 00022 #define SOPRANO_SERIALIZER_H 00023 00024 #include "plugin.h" 00025 #include "soprano_export.h" 00026 #include "sopranotypes.h" 00027 #include "error.h" 00028 00029 #include <QtCore/QObject> 00030 #include <QtCore/QHash> 00031 #include <QtCore/QUrl> 00032 #include <QtCore/QString> 00033 00034 class QTextStream; 00035 00036 00037 namespace Soprano 00038 { 00039 class StatementIterator; 00040 00068 class SOPRANO_EXPORT Serializer : public Plugin, public Error::ErrorCache 00069 { 00070 public: 00071 virtual ~Serializer(); 00072 00080 virtual RdfSerializations supportedSerializations() const = 0; 00081 00090 virtual QStringList supportedUserSerializations() const; 00091 00103 bool supportsSerialization( RdfSerialization s, const QString& userSerialization = QString() ) const; 00104 00117 virtual bool serialize( StatementIterator it, QTextStream& stream, RdfSerialization serialization, const QString& userSerialization = QString() ) const = 0; 00118 00129 void addPrefix( const QString& qname, const QUrl& uri ) const; 00130 00138 void clearPrefixes() const; 00139 00147 QHash<QString, QUrl> prefixes() const; 00148 00149 protected: 00150 Serializer( const QString& name ); 00151 00152 private: 00153 class Private; 00154 Private* const d; 00155 }; 00156 } 00157 00158 Q_DECLARE_INTERFACE(Soprano::Serializer, "org.soprano.plugins.Serializer/1.0") 00159 00160 #endif 00161