From 3565aad630864ecdbe53fdaa501ea708555b3c7c Mon Sep 17 00:00:00 2001 From: Unit 193 Date: Sun, 30 Apr 2023 18:30:36 -0400 Subject: New upstream version 3.4.4+dfsg. --- .../coreSQLiteStudio/common/bistrhash.cpp | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'SQLiteStudio3/coreSQLiteStudio/common/bistrhash.cpp') diff --git a/SQLiteStudio3/coreSQLiteStudio/common/bistrhash.cpp b/SQLiteStudio3/coreSQLiteStudio/common/bistrhash.cpp index 5aac017..f2c1b2c 100644 --- a/SQLiteStudio3/coreSQLiteStudio/common/bistrhash.cpp +++ b/SQLiteStudio3/coreSQLiteStudio/common/bistrhash.cpp @@ -17,6 +17,15 @@ BiStrHash::BiStrHash(const BiStrHash& other) : hash(other.hash), inverted(other. { } +BiStrHash& BiStrHash::operator=(const BiStrHash& other) +{ + this->hash = other.hash; + this->inverted = other.inverted; + this->lowerHash = other.lowerHash; + this->lowerInverted = other.lowerInverted; + return *this; +} + void BiStrHash::insert(const QString& left, const QString& right) { if (lowerHash.contains(left.toLower())) @@ -163,6 +172,14 @@ QString BiStrHash::valueByLeft(const QString& left, Qt::CaseSensitivity cs) cons return hash.value(lowerHash.value(left.toLower())); } +QString BiStrHash::valueByLeft(const QString& left, const QString& defaultValue, Qt::CaseSensitivity cs) const +{ + if (containsLeft(left, cs)) + return valueByLeft(left, cs); + + return defaultValue; +} + QString BiStrHash::valueByRight(const QString& right, Qt::CaseSensitivity cs) const { if (cs == Qt::CaseSensitive) @@ -171,6 +188,14 @@ QString BiStrHash::valueByRight(const QString& right, Qt::CaseSensitivity cs) co return inverted.value(lowerInverted.value(right.toLower())); } +QString BiStrHash::valueByRight(const QString& right, const QString& defaultValue, Qt::CaseSensitivity cs) const +{ + if (containsRight(right, cs)) + return valueByRight(right, cs); + + return defaultValue; +} + QStringList BiStrHash::leftValues() const { return hash.keys(); -- cgit v1.2.3