diff options
| author | 2016-06-13 18:42:57 -0400 | |
|---|---|---|
| committer | 2016-06-13 18:42:57 -0400 | |
| commit | 65d5f68cc6dc81799c5a5d90400a2c1f0dd02547 (patch) | |
| tree | 6f245ba901b87ef42fed69965aea22f5eea6b590 /SQLiteStudio3/coreSQLiteStudio/common/strhash.h | |
| parent | aeb6bad01630d325a4e768e798a7a6d44e18fdaf (diff) | |
| parent | 5d9314f134ddd3dc4c853e398ac90ba247fb2e4f (diff) | |
Merge tag 'upstream/3.1.0'
Upstream version 3.1.0
# gpg: Signature made Mon 13 Jun 2016 06:42:54 PM EDT using RSA key ID EBE9BD91
# gpg: Good signature from "Unit 193 <unit193@gmail.com>"
# gpg: aka "Unit 193 <unit193@ninthfloor.org>"
# gpg: aka "Unit 193 <unit193@ubuntu.com>"
# gpg: aka "Unit 193 <unit193@ninthfloor.com>"
Diffstat (limited to 'SQLiteStudio3/coreSQLiteStudio/common/strhash.h')
| -rw-r--r-- | SQLiteStudio3/coreSQLiteStudio/common/strhash.h | 23 |
1 files changed, 14 insertions, 9 deletions
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<std::pair<QString,T>> list) : hash(QHash<QString,T>(list))
+ StrHash(std::initializer_list<std::pair<QString, T>> list) : hash(QHash<QString, T>(list))
{
initLower();
}
- StrHash(const QHash<QString,T>& other) : hash(QHash<QString,T>(other))
+ StrHash(const QHash<QString, T>& other) : hash(QHash<QString, T>(other))
{
initLower();
}
@@ -87,9 +87,9 @@ class StrHash return *this;
}
- StrHash<T>& unite(const QHash<QString,T>& other)
+ StrHash<T>& unite(const QHash<QString, T>& other)
{
- QHashIterator<QString,T> it(other);
+ QHashIterator<QString, T> it(other);
while (it.hasNext())
{
it.next();
@@ -117,9 +117,9 @@ class StrHash return hash.keys();
}
- QHashIterator<QString,T> iterator() const
+ QHashIterator<QString, T> iterator() const
{
- return QHashIterator<QString,T>(hash);
+ return QHashIterator<QString, T>(hash);
}
void clear()
@@ -146,6 +146,11 @@ class StrHash return hash.isEmpty();
}
+ QHash<QString, T> 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<QString,T> it(hash);
+ QHashIterator<QString, T> it(hash);
while (it.hasNext())
{
it.next();
@@ -175,8 +180,8 @@ class StrHash }
}
- QHash<QString,QString> lowerCaseHash;
- QHash<QString,T> hash;
+ QHash<QString, QString> lowerCaseHash;
+ QHash<QString, T> hash;
};
#endif // STRHASH_H
|
