From 5d9314f134ddd3dc4c853e398ac90ba247fb2e4f Mon Sep 17 00:00:00 2001 From: Unit 193 Date: Mon, 13 Jun 2016 18:42:42 -0400 Subject: Imported Upstream version 3.1.0 --- SQLiteStudio3/coreSQLiteStudio/common/strhash.h | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'SQLiteStudio3/coreSQLiteStudio/common/strhash.h') diff --git a/SQLiteStudio3/coreSQLiteStudio/common/strhash.h b/SQLiteStudio3/coreSQLiteStudio/common/strhash.h index 4fb7bb3..41b3d11 100644 --- a/SQLiteStudio3/coreSQLiteStudio/common/strhash.h +++ b/SQLiteStudio3/coreSQLiteStudio/common/strhash.h @@ -11,12 +11,12 @@ class StrHash { public: StrHash() {} - StrHash(std::initializer_list> list) : hash(QHash(list)) + StrHash(std::initializer_list> list) : hash(QHash(list)) { initLower(); } - StrHash(const QHash& other) : hash(QHash(other)) + StrHash(const QHash& other) : hash(QHash(other)) { initLower(); } @@ -87,9 +87,9 @@ class StrHash return *this; } - StrHash& unite(const QHash& other) + StrHash& unite(const QHash& other) { - QHashIterator it(other); + QHashIterator it(other); while (it.hasNext()) { it.next(); @@ -117,9 +117,9 @@ class StrHash return hash.keys(); } - QHashIterator iterator() const + QHashIterator iterator() const { - return QHashIterator(hash); + return QHashIterator(hash); } void clear() @@ -146,6 +146,11 @@ class StrHash return hash.isEmpty(); } + QHash toQHash() const + { + return hash; + } + T& operator[](const QString& key) { if (lowerCaseHash.contains(key.toLower()) && !hash.contains(key)) @@ -167,7 +172,7 @@ class StrHash private: void initLower() { - QHashIterator it(hash); + QHashIterator it(hash); while (it.hasNext()) { it.next(); @@ -175,8 +180,8 @@ class StrHash } } - QHash lowerCaseHash; - QHash hash; + QHash lowerCaseHash; + QHash hash; }; #endif // STRHASH_H -- cgit v1.2.3