Soprano  2.9.4
datastream.h
Go to the documentation of this file.
1 /*
2  * This file is part of Soprano Project.
3  *
4  * Copyright (C) 2008 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_DATA_STREAM_H_
23 #define _SOPRANO_DATA_STREAM_H_
24 
25 #include "soprano_export.h"
26 #include "error.h"
27 
28 class QUrl;
29 class QByteArray;
30 
31 namespace Soprano {
32 
33  class LiteralValue;
34  class BindingSet;
35  class BackendSetting;
36  class Node;
37  class Statement;
38  namespace Error {
39  class Locator;
40  }
41 
56  {
57  public:
59  virtual ~DataStream();
60 
61  bool writeByteArray( const QByteArray& );
62  bool writeString( const QString& );
63  bool writeUrl( const QUrl& );
64 // bool writeVariant( const QVariant& );
65  bool writeUnsignedInt8( quint8 );
66  bool writeUnsignedInt16( quint16 );
67  bool writeUnsignedInt32( quint32 );
68  bool writeInt32( qint32 );
69  bool writeBool( bool );
70 
72  bool writeLocator( const Error::Locator& );
73  bool writeError( const Error::Error& );
74 // bool writeBackendSetting( const BackendSetting& );
76  bool writeNode( const Node& );
77  bool writeStatement( const Statement& );
78  bool writeBindingSet( const BindingSet& );
79 
81  bool readString( QString& );
82  bool readUrl( QUrl& );
83 // bool readVariant( QVariant& );
84  bool readUnsignedInt8( quint8& );
85  bool readUnsignedInt16( quint16& );
86  bool readUnsignedInt32( quint32& );
87  bool readInt32( qint32& );
88  bool readBool( bool& );
89 
93 // bool readBackendSetting( BackendSetting& );
95  bool readNode( Node& );
98 
99  protected:
104  virtual bool read( char* data, qint64 size ) = 0;
105 
110  virtual bool write( const char* data, qint64 size ) = 0;
111  };
112 }
113 
114 #endif
soprano_export.h
Soprano::DataStream::readBindingSet
bool readBindingSet(BindingSet &)
Soprano::DataStream::writeLocator
bool writeLocator(const Error::Locator &)
Soprano::DataStream::writeErrorCode
bool writeErrorCode(Error::ErrorCode code)
QUrl
Soprano::DataStream::writeUnsignedInt32
bool writeUnsignedInt32(quint32)
Soprano::DataStream::writeBool
bool writeBool(bool)
Soprano::DataStream::writeNode
bool writeNode(const Node &)
Soprano::DataStream::readByteArray
bool readByteArray(QByteArray &)
Soprano::DataStream::readInt32
bool readInt32(qint32 &)
Soprano::Vocabulary::RDF::Statement
SOPRANO_EXPORT QUrl Statement()
Soprano::DataStream::writeUnsignedInt8
bool writeUnsignedInt8(quint8)
Soprano::DataStream::readNode
bool readNode(Node &)
Soprano::LiteralValue
Represents a literal value of an RDF Node.
Definition: literalvalue.h:67
SOPRANO_EXPORT
#define SOPRANO_EXPORT
Definition: soprano_export.h:37
Soprano::Error::ErrorCache
Core class of Soprano's exception system.
Definition: error.h:235
Soprano::Vocabulary::Xesam::size
SOPRANO_EXPORT QUrl size()
Soprano::DataStream::DataStream
DataStream()
Soprano::Statement
A Statement instance represents one RDF quadruple.
Definition: statement.h:48
Soprano::DataStream::readUrl
bool readUrl(QUrl &)
Soprano::DataStream::writeBindingSet
bool writeBindingSet(const BindingSet &)
Soprano::DataStream
Definition: datastream.h:56
Soprano::Error::Error
Represents an error in Soprano.
Definition: error.h:78
Soprano::DataStream::readUnsignedInt16
bool readUnsignedInt16(quint16 &)
Soprano::DataStream::readErrorCode
bool readErrorCode(Error::ErrorCode &code)
Soprano::DataStream::writeString
bool writeString(const QString &)
Soprano::DataStream::writeUrl
bool writeUrl(const QUrl &)
Soprano::DataStream::readStatement
bool readStatement(Statement &)
Soprano::DataStream::writeStatement
bool writeStatement(const Statement &)
error.h
Soprano::DataStream::write
virtual bool write(const char *data, qint64 size)=0
Soprano::DataStream::writeUnsignedInt16
bool writeUnsignedInt16(quint16)
Soprano::DataStream::readString
bool readString(QString &)
Soprano::DataStream::~DataStream
virtual ~DataStream()
Soprano::DataStream::read
virtual bool read(char *data, qint64 size)=0
Soprano::DataStream::readUnsignedInt32
bool readUnsignedInt32(quint32 &)
Soprano::DataStream::readLocator
bool readLocator(Error::Locator &)
Soprano::Error::Locator
Details of a parser Error.
Definition: locator.h:41
Soprano::DataStream::readBool
bool readBool(bool &)
Soprano::DataStream::readError
bool readError(Error::Error &)
Soprano
Definition: backend.h:36
Soprano::BindingSet
Represents one set of bindings in the result of a select query.
Definition: bindingset.h:49
Soprano::DataStream::readLiteralValue
bool readLiteralValue(LiteralValue &)
Soprano::DataStream::writeByteArray
bool writeByteArray(const QByteArray &)
Soprano::DataStream::writeInt32
bool writeInt32(qint32)
Soprano::DataStream::writeLiteralValue
bool writeLiteralValue(const LiteralValue &)
Soprano::DataStream::readUnsignedInt8
bool readUnsignedInt8(quint8 &)
Soprano::Node
A Node represents one RDF resource.
Definition: node.h:54
Soprano::Error::ErrorCode
ErrorCode
Definition: error.h:40
QString
QByteArray
Soprano::DataStream::writeError
bool writeError(const Error::Error &)