| Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/sql/kernel/qsqlindex.cpp |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||
| 2 | - | |||||||||||||
| 3 | - | |||||||||||||
| 4 | - | |||||||||||||
| 5 | - | |||||||||||||
| 6 | static_assert(bool((sizeof(QList<bool>) == sizeof(QVector<bool>))), "(sizeof(QList<bool>) == sizeof(QVector<bool>))"); | - | ||||||||||||
| 7 | QSqlIndex::QSqlIndex(const QString& cursorname, const QString& name) | - | ||||||||||||
| 8 | : cursor(cursorname), nm(name) | - | ||||||||||||
| 9 | { | - | ||||||||||||
| 10 | } executed 695 times by 6 tests: end of blockExecuted by:
| 695 | ||||||||||||
| 11 | - | |||||||||||||
| 12 | - | |||||||||||||
| 13 | - | |||||||||||||
| 14 | - | |||||||||||||
| 15 | - | |||||||||||||
| 16 | QSqlIndex::QSqlIndex(const QSqlIndex& other) | - | ||||||||||||
| 17 | : QSqlRecord(other), cursor(other.cursor), nm(other.nm), sorts(other.sorts) | - | ||||||||||||
| 18 | { | - | ||||||||||||
| 19 | } executed 1 time by 1 test: end of blockExecuted by:
| 1 | ||||||||||||
| 20 | - | |||||||||||||
| 21 | - | |||||||||||||
| 22 | - | |||||||||||||
| 23 | - | |||||||||||||
| 24 | - | |||||||||||||
| 25 | QSqlIndex& QSqlIndex::operator=(const QSqlIndex& other) | - | ||||||||||||
| 26 | { | - | ||||||||||||
| 27 | cursor = other.cursor; | - | ||||||||||||
| 28 | nm = other.nm; | - | ||||||||||||
| 29 | sorts = other.sorts; | - | ||||||||||||
| 30 | QSqlRecord::operator=(other); | - | ||||||||||||
| 31 | return executed 187 times by 4 tests: *this;return *this;Executed by:
executed 187 times by 4 tests: return *this;Executed by:
| 187 | ||||||||||||
| 32 | } | - | ||||||||||||
| 33 | - | |||||||||||||
| 34 | - | |||||||||||||
| 35 | - | |||||||||||||
| 36 | - | |||||||||||||
| 37 | - | |||||||||||||
| 38 | QSqlIndex::~QSqlIndex() | - | ||||||||||||
| 39 | { | - | ||||||||||||
| 40 | - | |||||||||||||
| 41 | } | - | ||||||||||||
| 42 | - | |||||||||||||
| 43 | - | |||||||||||||
| 44 | - | |||||||||||||
| 45 | - | |||||||||||||
| 46 | - | |||||||||||||
| 47 | void QSqlIndex::setName(const QString& name) | - | ||||||||||||
| 48 | { | - | ||||||||||||
| 49 | nm = name; | - | ||||||||||||
| 50 | } never executed: end of block | 0 | ||||||||||||
| 51 | void QSqlIndex::append(const QSqlField& field) | - | ||||||||||||
| 52 | { | - | ||||||||||||
| 53 | append(field, false); | - | ||||||||||||
| 54 | } executed 967 times by 6 tests: end of blockExecuted by:
| 967 | ||||||||||||
| 55 | void QSqlIndex::append(const QSqlField& field, bool desc) | - | ||||||||||||
| 56 | { | - | ||||||||||||
| 57 | sorts.append(desc); | - | ||||||||||||
| 58 | QSqlRecord::append(field); | - | ||||||||||||
| 59 | } executed 967 times by 6 tests: end of blockExecuted by:
| 967 | ||||||||||||
| 60 | - | |||||||||||||
| 61 | - | |||||||||||||
| 62 | - | |||||||||||||
| 63 | - | |||||||||||||
| 64 | - | |||||||||||||
| 65 | - | |||||||||||||
| 66 | - | |||||||||||||
| 67 | bool QSqlIndex::isDescending(int i) const | - | ||||||||||||
| 68 | { | - | ||||||||||||
| 69 | if (i >= 0
| 0 | ||||||||||||
| 70 | return never executed: sorts[i];return sorts[i];never executed: return sorts[i]; | 0 | ||||||||||||
| 71 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||
| 72 | } | - | ||||||||||||
| 73 | - | |||||||||||||
| 74 | - | |||||||||||||
| 75 | - | |||||||||||||
| 76 | - | |||||||||||||
| 77 | - | |||||||||||||
| 78 | - | |||||||||||||
| 79 | - | |||||||||||||
| 80 | void QSqlIndex::setDescending(int i, bool desc) | - | ||||||||||||
| 81 | { | - | ||||||||||||
| 82 | if (i >= 0
| 0 | ||||||||||||
| 83 | sorts[i] = desc; never executed: sorts[i] = desc; | 0 | ||||||||||||
| 84 | } never executed: end of block | 0 | ||||||||||||
| 85 | QString QSqlIndex::createField(int i, const QString& prefix, bool verbose) const | - | ||||||||||||
| 86 | { | - | ||||||||||||
| 87 | QString f; | - | ||||||||||||
| 88 | if (!prefix.isEmpty()
| 0 | ||||||||||||
| 89 | f += prefix + QLatin1Char('.'); never executed: f += prefix + QLatin1Char('.'); | 0 | ||||||||||||
| 90 | f += field(i).name(); | - | ||||||||||||
| 91 | if (verbose
| 0 | ||||||||||||
| 92 | f += QLatin1Char(' ') + QString((isDescending(i) never executed: f += QLatin1Char(' ') + QString((isDescending(i) ? QLatin1String("DESC") : QLatin1String("ASC"))); | 0 | ||||||||||||
| 93 | ? QLatin1String("DESC") : QLatin1String("ASC"))); never executed: f += QLatin1Char(' ') + QString((isDescending(i) ? QLatin1String("DESC") : QLatin1String("ASC"))); | 0 | ||||||||||||
| 94 | return never executed: f;return f;never executed: return f; | 0 | ||||||||||||
| 95 | } | - | ||||||||||||
| 96 | void QSqlIndex::setCursorName(const QString& cursorName) | - | ||||||||||||
| 97 | { | - | ||||||||||||
| 98 | cursor = cursorName; | - | ||||||||||||
| 99 | } never executed: end of block | 0 | ||||||||||||
| 100 | - | |||||||||||||
| 101 | - | |||||||||||||
| Switch to Source code | Preprocessed file |