aboutsummaryrefslogtreecommitdiffstats
path: root/SQLiteStudio3/coreSQLiteStudio/common/bistrhash.cpp
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2023-04-30 18:31:18 -0400
committerLibravatarUnit 193 <unit193@unit193.net>2023-04-30 18:31:18 -0400
commit4de57f628bc74f00ba1885e91c84ea07c5405d8f (patch)
tree5d91900751e826d491ff1b2ebc571a787e84f864 /SQLiteStudio3/coreSQLiteStudio/common/bistrhash.cpp
parent74d881cefa9097e58e129e37b9c44d680d8c7dfe (diff)
parent3565aad630864ecdbe53fdaa501ea708555b3c7c (diff)
Update upstream source from tag 'upstream/3.4.4+dfsg'
Update to upstream version '3.4.4+dfsg' with Debian dir 482614bd23f0ef52dabc9803477204ad88e917ed
Diffstat (limited to 'SQLiteStudio3/coreSQLiteStudio/common/bistrhash.cpp')
-rw-r--r--SQLiteStudio3/coreSQLiteStudio/common/bistrhash.cpp25
1 files changed, 25 insertions, 0 deletions
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();