Sqlite: Add additional Utf8String::operator==.

There was operator==(const Utf8String &, const char *), but not the
counterpart with the argument types switched.

Change-Id: Ie9ef5c21da0c39881ecad7ea080b87eefe6c4d02
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
This commit is contained in:
Christian Kandeler
2016-02-02 14:39:29 +01:00
parent f1139b1d51
commit d14257736e
2 changed files with 7 additions and 0 deletions

View File

@@ -227,6 +227,11 @@ bool operator==(const Utf8String &first, const char *second)
return first.byteArray == second;
}
bool operator==(const char *first, const Utf8String &second)
{
return second == first;
}
bool operator==(const Utf8String &first, const QString &second)
{
return first.byteArray == second.toUtf8();

View File

@@ -45,6 +45,7 @@ class SQLITE_EXPORT Utf8String
friend SQLITE_EXPORT bool operator!=(const Utf8String &first, const Utf8String &second);
friend SQLITE_EXPORT bool operator==(const Utf8String &first, const Utf8String &second);
friend SQLITE_EXPORT bool operator==(const Utf8String &first, const char *second);
friend SQLITE_EXPORT bool operator==(const char *first, const Utf8String &second);
friend SQLITE_EXPORT bool operator==(const Utf8String &first, const QString &second);
friend SQLITE_EXPORT bool operator<(const Utf8String &first, const Utf8String &second);
@@ -111,6 +112,7 @@ SQLITE_EXPORT const Utf8String operator+(const Utf8String &first, const Utf8Stri
SQLITE_EXPORT bool operator!=(const Utf8String &first, const Utf8String &second);
SQLITE_EXPORT bool operator==(const Utf8String &first, const Utf8String &second);
SQLITE_EXPORT bool operator==(const Utf8String &first, const char *second);
SQLITE_EXPORT bool operator==(const char *first, const Utf8String &second);
SQLITE_EXPORT bool operator==(const Utf8String &first, const QString &second);
SQLITE_EXPORT bool operator<(const Utf8String &first, const Utf8String &second);