00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040 #ifndef QSPARQL_ENDPOINT_H
00041 #define QSPARQL_ENDPOINT_H
00042
00043 #include <QtSparql/private/qsparqldriver_p.h>
00044 #include <QtSparql/qsparqlresult.h>
00045
00046 #if defined (Q_OS_WIN32)
00047 #include <QtCore/qt_windows.h>
00048 #endif
00049
00050 #ifdef QT_PLUGIN
00051 #define Q_EXPORT_SPARQLDRIVER_ENDPOINT
00052 #else
00053 #define Q_EXPORT_SPARQLDRIVER_ENDPOINT Q_SPARQL_EXPORT
00054 #endif
00055
00056 QT_BEGIN_HEADER
00057
00058 QT_BEGIN_NAMESPACE
00059
00060 class EndpointDriverPrivate;
00061 class EndpointResultPrivate;
00062 class EndpointDriver;
00063
00064 class EndpointResult : public QSparqlResult
00065 {
00066 Q_OBJECT
00067 friend class EndpointResultPrivate;
00068 public:
00069 explicit EndpointResult(EndpointDriverPrivate* p);
00070 ~EndpointResult();
00071
00072 QVariant handle() const;
00073
00074 bool exec(const QString& query, QSparqlQuery::StatementType type, const QString& prefixes);
00075
00076 QSparqlBinding binding(int field) const;
00077 QVariant value(int field) const;
00078 int size() const;
00079 QSparqlResultRow current() const;
00080
00081 void waitForFinished();
00082 bool isFinished() const;
00083
00084 protected:
00085 void cleanup();
00086
00087 private:
00088 EndpointResultPrivate* d;
00089 };
00090
00091 class Q_EXPORT_SPARQLDRIVER_ENDPOINT EndpointDriver : public QSparqlDriver
00092 {
00093 Q_OBJECT
00094 public:
00095 explicit EndpointDriver(QObject *parent=0);
00096
00097 ~EndpointDriver();
00098 bool hasFeature(QSparqlConnection::Feature f) const;
00099 bool open(const QSparqlConnectionOptions& options);
00100 void close();
00101 EndpointResult* createResult() const;
00102 EndpointResult* exec(const QString& query, QSparqlQuery::StatementType type, const QSparqlQueryOptions& options);
00103
00104 private:
00105 EndpointDriverPrivate* d;
00106 };
00107
00108 QT_END_NAMESPACE
00109
00110 QT_END_HEADER
00111
00112 #endif // QSPARQL_ENDPOINT_H