KDbRecordData
#include <KDbRecordData.h>
Public Member Functions | |
KDbRecordData () | |
KDbRecordData (int numCols) | |
const QVariant & | at (int i) const |
void | clear () |
void | clearValues () |
int | count () const |
bool | isEmpty () const |
bool | isNull (int i) const |
QVariant & | operator[] (int i) |
const QVariant & | operator[] (int i) const |
void | resize (int numCols) |
int | size () const |
QList< QVariant > | toList () const |
QVariant | value (int i) const |
QVariant | value (int i, const QVariant &defaultValue) const |
Detailed Description
Structure for storing single record with type information.
- Todo
consider forking QVariant to a non-shared Variant class, with type information stored elsewhere.
Variant should have toQVariant() method
look if we can have zero-copy strategy for SQLite and other backends
look if we can use memory allocator for strings, etc.
Definition at line 36 of file KDbRecordData.h.
Constructor & Destructor Documentation
◆ KDbRecordData() [1/2]
|
inline |
Creates a new empty record.
Definition at line 40 of file KDbRecordData.h.
◆ KDbRecordData() [2/2]
|
inlineexplicit |
Creates a new record data with numCols columns. Values are initialized to null.
Definition at line 44 of file KDbRecordData.h.
◆ ~KDbRecordData()
|
inline |
Definition at line 55 of file KDbRecordData.h.
Member Function Documentation
◆ at()
|
inline |
- Returns
- the value at position i. i must be a valid index. i.e. 0 <= i < size().
- See also
- value(), operator[]().
Definition at line 72 of file KDbRecordData.h.
◆ clear()
void KDbRecordData::clear | ( | ) |
Clears all columns, the record is set empty.
Definition at line 47 of file KDbRecordData.cpp.
◆ clearValues()
void KDbRecordData::clearValues | ( | ) |
Sets all column values to null, current number of columns is preserved.
Definition at line 74 of file KDbRecordData.cpp.
◆ count()
|
inline |
Definition at line 67 of file KDbRecordData.h.
◆ isEmpty()
|
inline |
Definition at line 63 of file KDbRecordData.h.
◆ isNull()
|
inline |
- Returns
- true id value at position i is null. i must be a valid index, i.e. 0 <= i < size().
Definition at line 91 of file KDbRecordData.h.
◆ operator[]() [1/2]
|
inline |
- Returns
- the value at position i as a modifiable reference. i must be a valid index, i.e. 0 <= i < size().
Definition at line 81 of file KDbRecordData.h.
◆ operator[]() [2/2]
|
inline |
Overloaded function.
Definition at line 94 of file KDbRecordData.h.
◆ resize()
void KDbRecordData::resize | ( | int | numCols | ) |
Resizes the record to numCols. If numCols differ from size(), new with record with all values set to null is created. If numCols equals size() nothing is performed.
Definition at line 58 of file KDbRecordData.cpp.
◆ size()
|
inline |
Definition at line 65 of file KDbRecordData.h.
◆ toList()
Converts this record to QList<QVariant>
Definition at line 82 of file KDbRecordData.cpp.
◆ value() [1/2]
|
inline |
- Returns
- the value at index position i in the vector. If the index i is out of bounds, the function returns a default-constructed value. If you are certain that i is within bounds, you can use at() or operator[] instead, which is slightly faster.
Definition at line 104 of file KDbRecordData.h.
◆ value() [2/2]
- Returns
- the value at index position i in the vector. This is an overloaded function. If the index i is out of bounds, the function returns a defaultValue. If you are certain that i is within bounds, you can use at() instead, which is slightly faster.
Definition at line 114 of file KDbRecordData.h.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:19:08 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.