Qt 4.8
Classes | Functions
qsqlresult.cpp File Reference
#include "qvariant.h"
#include "qhash.h"
#include "qregexp.h"
#include "qsqlerror.h"
#include "qsqlfield.h"
#include "qsqlrecord.h"
#include "qsqlresult.h"
#include "qvector.h"
#include "qsqldriver.h"
#include "qpointer.h"
#include <QDebug>

Go to the source code of this file.

Classes

struct  QHolder
 
class  QSqlResultPrivate
 

Functions

static QString qFieldSerial (int i)
 
static bool qIsAlnum (QChar ch)
 

Function Documentation

◆ qFieldSerial()

static QString qFieldSerial ( int  i)
static

Definition at line 130 of file qsqlresult.cpp.

Referenced by QSqlResult::bindValue(), and QSqlResultPrivate::positionalToNamedBinding().

131 {
132  ushort arr[] = { ':', 'f', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
133  ushort *ptr = &arr[1];
134 
135  while (i > 0) {
136  *(++ptr) = 'a' + i % 16;
137  i >>= 4;
138  }
139 
140  return QString(reinterpret_cast<const QChar *>(arr), int(ptr - arr) + 1);
141 }
The QString class provides a Unicode character string.
Definition: qstring.h:83
const T * ptr(const T &t)
unsigned short ushort
Definition: qglobal.h:995

◆ qIsAlnum()

static bool qIsAlnum ( QChar  ch)
static

Definition at line 143 of file qsqlresult.cpp.

Referenced by QSqlResultPrivate::namedToPositionalBinding(), and QSqlResult::prepare().

144 {
145  uint u = uint(ch.unicode());
146  // matches [a-zA-Z0-9_]
147  return u - 'a' < 26 || u - 'A' < 26 || u - '0' < 10 || u == '_';
148 }
ushort unicode() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: qchar.h:251
quint16 u
unsigned int uint
Definition: qglobal.h:996