Soprano  2.9.4
serializer.h
Go to the documentation of this file.
1 /* This file is part of Soprano
2  *
3  * Copyright (C) 2007 Sebastian Trueg <trueg@kde.org>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Library General Public License
16  * along with this library; see the file COPYING.LIB. If not, write to
17  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  * Boston, MA 02110-1301, USA.
19  */
20 
21 #ifndef SOPRANO_SERIALIZER_H
22 #define SOPRANO_SERIALIZER_H
23 
24 #include "plugin.h"
25 #include "soprano_export.h"
26 #include "sopranotypes.h"
27 #include "error.h"
28 
29 #include <QtCore/QObject>
30 #include <QtCore/QHash>
31 #include <QtCore/QUrl>
32 #include <QtCore/QString>
33 
34 class QTextStream;
35 
36 
37 namespace Soprano
38 {
39  class StatementIterator;
40 
69  {
70  public:
71  virtual ~Serializer();
72 
80  virtual RdfSerializations supportedSerializations() const = 0;
81 
91 
103  bool supportsSerialization( RdfSerialization s, const QString& userSerialization = QString() ) const;
104 
117  virtual bool serialize( StatementIterator it, QTextStream& stream, RdfSerialization serialization, const QString& userSerialization = QString() ) const = 0;
118 
129  void addPrefix( const QString& qname, const QUrl& uri ) const;
130 
138  void clearPrefixes() const;
139 
148 
149  protected:
151 
152  private:
153  class Private;
154  Private* const d;
155  };
156 }
157 
158 Q_DECLARE_INTERFACE(Soprano::Serializer, "org.soprano.plugins.Serializer/1.0")
159 
160 #endif
161 
Core class of Soprano's exception system.
Definition: error.h:235
Base class for all plugins in Soprano.
Definition: plugin.h:45
Soprano::Serializer defines the interface for a Soprano RDF serializer plugin.
Definition: serializer.h:69
virtual QStringList supportedUserSerializations() const
virtual bool serialize(StatementIterator it, QTextStream &stream, RdfSerialization serialization, const QString &userSerialization=QString()) const =0
virtual RdfSerializations supportedSerializations() const =0
QHash< QString, QUrl > prefixes() const
void clearPrefixes() const
Serializer(const QString &name)
bool supportsSerialization(RdfSerialization s, const QString &userSerialization=QString()) const
void addPrefix(const QString &qname, const QUrl &uri) const
An iterator that provides a stream of Statements.
SOPRANO_EXPORT QUrl name()
RdfSerialization
Definition: sopranotypes.h:39
#define SOPRANO_EXPORT