2010-04-13 21:43:08 +02:00
|
|
|
/****************************************************************************
|
|
|
|
**
|
2015-04-11 22:45:04 +02:00
|
|
|
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
|
|
|
|
** Contact: http://www.qt-project.org/legal
|
2010-04-13 21:43:08 +02:00
|
|
|
**
|
|
|
|
** This file is part of the QtSql module of the Qt Toolkit.
|
|
|
|
**
|
|
|
|
** $QT_BEGIN_LICENSE:LGPL$
|
2015-04-11 22:45:04 +02:00
|
|
|
** Commercial License Usage
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
|
|
|
** a written agreement between you and Digia. For licensing terms and
|
|
|
|
** conditions see http://qt.digia.com/licensing. For further information
|
|
|
|
** use the contact form at http://qt.digia.com/contact-us.
|
2010-04-13 21:43:08 +02:00
|
|
|
**
|
|
|
|
** GNU Lesser General Public License Usage
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
|
|
|
** General Public License version 2.1 as published by the Free Software
|
|
|
|
** Foundation and appearing in the file LICENSE.LGPL included in the
|
|
|
|
** packaging of this file. Please review the following information to
|
|
|
|
** ensure the GNU Lesser General Public License version 2.1 requirements
|
|
|
|
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|
|
|
**
|
2015-04-11 22:45:04 +02:00
|
|
|
** In addition, as a special exception, Digia gives you certain additional
|
|
|
|
** rights. These rights are described in the Digia Qt LGPL Exception
|
2010-04-13 21:43:08 +02:00
|
|
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
|
|
**
|
2015-04-11 22:45:04 +02:00
|
|
|
** GNU General Public License Usage
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
** General Public License version 3.0 as published by the Free Software
|
|
|
|
** Foundation and appearing in the file LICENSE.GPL included in the
|
|
|
|
** packaging of this file. Please review the following information to
|
|
|
|
** ensure the GNU General Public License version 3.0 requirements will be
|
|
|
|
** met: http://www.gnu.org/copyleft/gpl.html.
|
2010-04-13 21:43:08 +02:00
|
|
|
**
|
|
|
|
**
|
|
|
|
** $QT_END_LICENSE$
|
|
|
|
**
|
|
|
|
****************************************************************************/
|
|
|
|
|
2015-04-11 22:45:04 +02:00
|
|
|
#ifndef QSQLCACHEDRESULT_P_H
|
|
|
|
#define QSQLCACHEDRESULT_P_H
|
|
|
|
|
|
|
|
//
|
|
|
|
// W A R N I N G
|
|
|
|
// -------------
|
|
|
|
//
|
|
|
|
// This file is not part of the Qt API. It exists for the convenience
|
|
|
|
// of other Qt classes. This header file may change from version to
|
|
|
|
// version without notice, or even be removed.
|
|
|
|
//
|
|
|
|
// We mean it.
|
|
|
|
//
|
2010-04-13 21:43:08 +02:00
|
|
|
|
2017-01-09 15:19:18 +01:00
|
|
|
#include <QtSql/qsqlresult.h>
|
2015-04-11 22:45:04 +02:00
|
|
|
|
|
|
|
QT_BEGIN_NAMESPACE
|
2010-04-13 21:43:08 +02:00
|
|
|
|
|
|
|
class QVariant;
|
|
|
|
template <typename T> class QVector;
|
|
|
|
|
|
|
|
class ClementineSqlCachedResultPrivate;
|
|
|
|
|
2017-01-09 15:19:18 +01:00
|
|
|
class ClementineSqlCachedResult: public QSqlResult
|
2010-04-13 21:43:08 +02:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual ~ClementineSqlCachedResult();
|
|
|
|
|
|
|
|
typedef QVector<QVariant> ValueCache;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
ClementineSqlCachedResult(const QSqlDriver * db);
|
|
|
|
|
|
|
|
void init(int colCount);
|
|
|
|
void cleanup();
|
|
|
|
void clearValues();
|
|
|
|
|
|
|
|
virtual bool gotoNext(ValueCache &values, int index) = 0;
|
|
|
|
|
|
|
|
QVariant data(int i);
|
|
|
|
bool isNull(int i);
|
|
|
|
bool fetch(int i);
|
|
|
|
bool fetchNext();
|
|
|
|
bool fetchPrevious();
|
|
|
|
bool fetchFirst();
|
|
|
|
bool fetchLast();
|
|
|
|
|
|
|
|
int colCount() const;
|
|
|
|
ValueCache &cache();
|
|
|
|
|
|
|
|
void virtual_hook(int id, void *data);
|
2015-04-11 22:45:04 +02:00
|
|
|
void detachFromResultSet();
|
|
|
|
void setNumericalPrecisionPolicy(QSql::NumericalPrecisionPolicy policy);
|
2010-04-13 21:43:08 +02:00
|
|
|
private:
|
|
|
|
bool cacheNext();
|
|
|
|
ClementineSqlCachedResultPrivate *d;
|
|
|
|
};
|
|
|
|
|
2015-04-11 22:45:04 +02:00
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
|
|
|
#endif // QSQLCACHEDRESULT_P_H
|