00001 /* 00002 * This file is part of Soprano Project. 00003 * 00004 * Copyright (C) 2006 Daniele Galdi <daniele.galdi@gmail.com> 00005 * Copyright (C) 2007 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 "soprano_export.h" 00029 00030 #include <QtCore/QString> 00031 #include <QtCore/QStringList> 00032 00033 00034 namespace Soprano { 00035 00036 class Node; 00037 class NodeIterator; 00038 class QueryResultIteratorBackend; 00039 class Statement; 00040 class StatementIterator; 00041 class BindingSet; 00042 00106 class SOPRANO_EXPORT QueryResultIterator : public Iterator<BindingSet> 00107 { 00108 public: 00110 00113 QueryResultIterator(); 00114 00118 QueryResultIterator( const QueryResultIterator& ); 00119 00124 QueryResultIterator( QueryResultIteratorBackend *qr ); 00125 00129 virtual ~QueryResultIterator(); 00130 00134 QueryResultIterator& operator=( const QueryResultIterator& ); 00136 00138 00142 Statement currentStatement() const; 00143 00148 BindingSet currentBindings() const; 00149 00157 bool boolValue() const; 00159 00161 00171 Node binding( const QString &name ) const; 00172 00183 Node binding( int offset ) const; 00184 00192 int bindingCount() const; 00193 00199 QStringList bindingNames() const; 00201 00203 00209 bool isGraph() const; 00210 00217 bool isBinding() const; 00218 00228 bool isBool() const; 00230 00232 00236 QList<BindingSet> allBindings(); 00237 00247 StatementIterator iterateStatements() const; 00248 00261 NodeIterator iterateBindings( const QString& variableName ) const; 00262 00275 NodeIterator iterateBindings( int offset ) const; 00277 }; 00278 } 00279 00280 #endif // SOPRANO_RESULT_SET_H