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 
90  virtual QStringList supportedUserSerializations() const;
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 
147  QHash<QString, QUrl> prefixes() const;
148 
149  protected:
150  Serializer( const QString& name );
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 
soprano_export.h
QUrl
Soprano::Serializer
Soprano::Serializer defines the interface for a Soprano RDF serializer plugin.
Definition: serializer.h:68
plugin.h
SOPRANO_EXPORT
#define SOPRANO_EXPORT
Definition: soprano_export.h:37
Soprano::Error::ErrorCache
Core class of Soprano's exception system.
Definition: error.h:234
sopranotypes.h
QTextStream
error.h
Soprano::Plugin
Base class for all plugins in Soprano.
Definition: plugin.h:44
Soprano::Vocabulary::Xesam::name
SOPRANO_EXPORT QUrl name()
Soprano::StatementIterator
An iterator that provides a stream of Statements.
Definition: statementiterator.h:75
Soprano
Definition: backend.h:35
Soprano::RdfSerialization
RdfSerialization
Definition: sopranotypes.h:39
QHash
QString
QStringList