Soprano  2.8.0
parser.h
Go to the documentation of this file.
1 /* This file is part of Soprano
2  *
3  * Copyright (C) 2006 Daniele Galdi <daniele.galdi@gmail.com>
4  * Copyright (C) 2007 Sebastian Trueg <trueg@kde.org>
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public License
17  * along with this library; see the file COPYING.LIB. If not, write to
18  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  * Boston, MA 02110-1301, USA.
20  */
21 
22 #ifndef SOPRANO_PARSER_H
23 #define SOPRANO_PARSER_H
24 
25 #include "plugin.h"
26 #include "soprano_export.h"
27 #include "sopranotypes.h"
28 #include "error.h"
29 
30 #include <QtCore/QObject>
31 
32 class QTextStream;
33 class QUrl;
34 
35 
36 namespace Soprano
37 {
38  class StatementIterator;
39 
70  {
71  public:
72  virtual ~Parser();
73 
81  virtual RdfSerializations supportedSerializations() const = 0;
82 
91  virtual QStringList supportedUserSerializations() const;
92 
104  bool supportsSerialization( RdfSerialization s, const QString& userSerialization = QString() ) const;
105 
122  virtual StatementIterator parseFile( const QString& filename, const QUrl& baseUri, RdfSerialization serialization, const QString& userSerialization = QString() ) const;
123 
139  virtual StatementIterator parseString( const QString& data, const QUrl& baseUri, RdfSerialization serialization, const QString& userSerialization = QString() ) const;
140 
154  virtual StatementIterator parseStream( QTextStream& stream, const QUrl& baseUri, RdfSerialization serialization, const QString& userSerialization = QString() ) const = 0;
155 
156  protected:
157  Parser( const QString& name );
158 
159  private:
160  class Private;
161  Private* const d;
162  };
163 }
164 
165 Q_DECLARE_INTERFACE(Soprano::Parser, "org.soprano.plugins.Parser/1.0")
166 
167 #endif // SOPRANO_PARSER_H
168