Changeset View
Changeset View
Standalone View
Standalone View
src/core/udsentry.cpp
Show All 40 Lines | 40 | public: | |||
---|---|---|---|---|---|
41 | void reserve(int size); | 41 | void reserve(int size); | ||
42 | void insert(uint udsField, const QString &value); | 42 | void insert(uint udsField, const QString &value); | ||
43 | void replace(uint udsField, const QString &value); | 43 | void replace(uint udsField, const QString &value); | ||
44 | void insert(uint udsField, long long value); | 44 | void insert(uint udsField, long long value); | ||
45 | void replace(uint udsField, long long value); | 45 | void replace(uint udsField, long long value); | ||
46 | int count() const; | 46 | int count() const; | ||
47 | QString stringValue(uint udsField) const; | 47 | QString stringValue(uint udsField) const; | ||
48 | long long numberValue(uint udsField, long long defaultValue = -1) const; | 48 | long long numberValue(uint udsField, long long defaultValue = -1) const; | ||
49 | #ifndef KIOCORE_NO_DEPRECATED | | |||
50 | QList<uint> listFields() const; | 49 | QList<uint> listFields() const; | ||
51 | #endif | | |||
52 | QVector<uint> fields() const; | 50 | QVector<uint> fields() const; | ||
53 | bool contains(uint udsField) const; | 51 | bool contains(uint udsField) const; | ||
54 | void clear(); | 52 | void clear(); | ||
55 | void save(QDataStream &s) const; | 53 | void save(QDataStream &s) const; | ||
56 | void load(QDataStream &s); | 54 | void load(QDataStream &s); | ||
57 | void debugUDSEntry(QDebug &stream) const; | 55 | void debugUDSEntry(QDebug &stream) const; | ||
58 | /** | 56 | /** | ||
59 | * @param field numeric UDS field id | 57 | * @param field numeric UDS field id | ||
▲ Show 20 Lines • Show All 80 Lines • ▼ Show 20 Line(s) | 137 | { | |||
140 | auto it = std::find_if(storage.cbegin(), storage.cend(), | 138 | auto it = std::find_if(storage.cbegin(), storage.cend(), | ||
141 | [udsField](const Field &entry) {return entry.m_index == udsField;}); | 139 | [udsField](const Field &entry) {return entry.m_index == udsField;}); | ||
142 | if (it != storage.cend()) { | 140 | if (it != storage.cend()) { | ||
143 | return it->m_long; | 141 | return it->m_long; | ||
144 | } | 142 | } | ||
145 | return defaultValue; | 143 | return defaultValue; | ||
146 | } | 144 | } | ||
147 | 145 | | |||
148 | #ifndef KIOCORE_NO_DEPRECATED | | |||
149 | QList<uint> UDSEntryPrivate::listFields() const | 146 | QList<uint> UDSEntryPrivate::listFields() const | ||
150 | { | 147 | { | ||
151 | QList<uint> res; | 148 | QList<uint> res; | ||
152 | res.reserve(storage.size()); | 149 | res.reserve(storage.size()); | ||
153 | for (const Field &field : storage) { | 150 | for (const Field &field : storage) { | ||
154 | res.append(field.m_index); | 151 | res.append(field.m_index); | ||
155 | } | 152 | } | ||
156 | return res; | 153 | return res; | ||
157 | } | 154 | } | ||
158 | #endif | | |||
159 | 155 | | |||
160 | QVector<uint> UDSEntryPrivate::fields() const | 156 | QVector<uint> UDSEntryPrivate::fields() const | ||
161 | { | 157 | { | ||
162 | QVector<uint> res; | 158 | QVector<uint> res; | ||
163 | res.reserve(storage.size()); | 159 | res.reserve(storage.size()); | ||
164 | for (const Field &field : storage) { | 160 | for (const Field &field : storage) { | ||
165 | res.append(field.m_index); | 161 | res.append(field.m_index); | ||
166 | } | 162 | } | ||
▲ Show 20 Lines • Show All 245 Lines • ▼ Show 20 Line(s) | 407 | { | |||
412 | d->replace(field, value); | 408 | d->replace(field, value); | ||
413 | } | 409 | } | ||
414 | 410 | | |||
415 | void UDSEntry::replace(uint field, long long value) | 411 | void UDSEntry::replace(uint field, long long value) | ||
416 | { | 412 | { | ||
417 | d->replace(field, value); | 413 | d->replace(field, value); | ||
418 | } | 414 | } | ||
419 | 415 | | |||
420 | #ifndef KIOCORE_NO_DEPRECATED | | |||
421 | QList<uint> UDSEntry::listFields() const | 416 | QList<uint> UDSEntry::listFields() const | ||
422 | { | 417 | { | ||
423 | return d->listFields(); | 418 | return d->listFields(); | ||
424 | } | 419 | } | ||
425 | #endif | | |||
426 | 420 | | |||
427 | QVector<uint> UDSEntry::fields() const | 421 | QVector<uint> UDSEntry::fields() const | ||
428 | { | 422 | { | ||
429 | return d->fields(); | 423 | return d->fields(); | ||
430 | } | 424 | } | ||
431 | 425 | | |||
432 | int UDSEntry::count() const | 426 | int UDSEntry::count() const | ||
433 | { | 427 | { | ||
▲ Show 20 Lines • Show All 62 Lines • Show Last 20 Lines |