Qt 4.8
Classes | Typedefs | Functions | Variables
qsql_sqlite2.cpp File Reference
#include "qsql_sqlite2.h"
#include <qcoreapplication.h>
#include <qvariant.h>
#include <qdatetime.h>
#include <qfile.h>
#include <qregexp.h>
#include <qsqlerror.h>
#include <qsqlfield.h>
#include <qsqlindex.h>
#include <qsqlquery.h>
#include <qstringlist.h>
#include <qvector.h>
#include <sqlite.h>

Go to the source code of this file.

Classes

class  QSQLite2DriverPrivate
 
class  QSQLite2ResultPrivate
 

Typedefs

typedef struct sqlite_vm sqlite_vm
 

Functions

static QVariant::Type nameToType (const QString &typeName)
 

Variables

static const uint initial_cache_size = 128
 

Typedef Documentation

◆ sqlite_vm

typedef struct sqlite_vm sqlite_vm

Definition at line 61 of file qsql_sqlite2.cpp.

Function Documentation

◆ nameToType()

static QVariant::Type nameToType ( const QString typeName)
static

Definition at line 68 of file qsql_sqlite2.cpp.

Referenced by QSQLite2ResultPrivate::init(), and QVariant::swap().

69 {
70  QString tName = typeName.toUpper();
71  if (tName.startsWith(QLatin1String("INT")))
72  return QVariant::Int;
73  if (tName.startsWith(QLatin1String("FLOAT")) || tName.startsWith(QLatin1String("NUMERIC")))
74  return QVariant::Double;
75  if (tName.startsWith(QLatin1String("BOOL")))
76  return QVariant::Bool;
77  // SQLite is typeless - consider everything else as string
78  return QVariant::String;
79 }
QString toUpper() const Q_REQUIRED_RESULT
Returns an uppercase copy of the string.
Definition: qstring.cpp:5483
bool startsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string starts with s; otherwise returns false.
Definition: qstring.cpp:3734
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
The QString class provides a Unicode character string.
Definition: qstring.h:83
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
Definition: qstring.h:654

Variable Documentation

◆ initial_cache_size

const uint initial_cache_size = 128
static

Definition at line 120 of file qsql_sqlite2.cpp.