Soprano
2.7.6
|
00001 /* 00002 * This file is part of Soprano Project. 00003 * 00004 * Copyright (C) 2006 Daniele Galdi <daniele.galdi@gmail.com> 00005 * Copyright (C) 2007-2009 Sebastian Trueg <trueg@kde.org> 00006 * 00007 * This library is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU Library General Public 00009 * License as published by the Free Software Foundation; either 00010 * version 2 of the License, or (at your option) any later version. 00011 * 00012 * This library is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 * Library General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU Library General Public License 00018 * along with this library; see the file COPYING.LIB. If not, write to 00019 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00020 * Boston, MA 02110-1301, USA. 00021 */ 00022 00023 #ifndef SOPRANO_RESULT_SET_H 00024 #define SOPRANO_RESULT_SET_H 00025 00026 #include "iterator.h" 00027 #include "bindingset.h" 00028 #include "statement.h" 00029 #include "soprano_export.h" 00030 00031 #include <QtCore/QString> 00032 #include <QtCore/QStringList> 00033 00034 00035 namespace Soprano { 00036 00037 class Node; 00038 class NodeIterator; 00039 class QueryResultIteratorBackend; 00040 class StatementIterator; 00041 class BindingSet; 00042 00108 class SOPRANO_EXPORT QueryResultIterator : public Iterator<BindingSet> 00109 { 00110 public: 00112 00115 QueryResultIterator(); 00116 00120 QueryResultIterator( const QueryResultIterator& ); 00121 00126 QueryResultIterator( QueryResultIteratorBackend *qr ); 00127 00131 virtual ~QueryResultIterator(); 00132 00136 QueryResultIterator& operator=( const QueryResultIterator& ); 00138 00140 00144 Statement currentStatement() const; 00145 00150 BindingSet currentBindings() const; 00151 00159 bool boolValue() const; 00161 00163 00175 Node operator[]( int offset ) const; 00176 00189 Node operator[]( const QString name ) const; 00190 00201 Node binding( const QString &name ) const; 00202 00213 Node binding( int offset ) const; 00214 00222 int bindingCount() const; 00223 00229 QStringList bindingNames() const; 00231 00233 00239 bool isGraph() const; 00240 00247 bool isBinding() const; 00248 00257 bool isBool() const; 00259 00261 00265 QList<BindingSet> allBindings(); 00266 00276 StatementIterator iterateStatements() const; 00277 00290 NodeIterator iterateBindings( const QString& variableName ) const; 00291 00304 NodeIterator iterateBindings( int offset ) const; 00305 00336 StatementIterator iterateStatementsFromBindings( const QString& subjectBindingName, 00337 const QString& predicateBindingName, 00338 const QString& objectBindingName, 00339 const QString& contextBindingName = QString(), 00340 const Statement& templateStatement = Statement() ) const; 00342 }; 00343 } 00344 00345 #endif // SOPRANO_RESULT_SET_H