Commit f2e8abfe authored by Marco Bubke's avatar Marco Bubke
Browse files

Sqlite: Add equal operator for QString to Utf8String



Change-Id: I60993e2a140445468b6fe98604cb19329dc35b1c
Reviewed-by: default avatarNikolai Kosjar <nikolai.kosjar@theqtcompany.com>
parent 8e2bb104
......@@ -222,6 +222,11 @@ bool operator==(const Utf8String &first, const char *second)
return first.byteArray == second;
}
bool operator==(const Utf8String &first, const QString &second)
{
return first.byteArray == second.toUtf8();
}
bool operator<(const Utf8String &first, const Utf8String &second)
{
if (first.byteSize() == second.byteSize())
......
......@@ -48,6 +48,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 Utf8String &first, const QString &second);
friend SQLITE_EXPORT bool operator<(const Utf8String &first, const Utf8String &second);
friend SQLITE_EXPORT QDataStream &operator<<(QDataStream &datastream, const Utf8String &text);
......@@ -109,6 +110,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 Utf8String &first, const QString &second);
SQLITE_EXPORT bool operator<(const Utf8String &first, const Utf8String &second);
SQLITE_EXPORT QDataStream &operator<<(QDataStream &datastream, const Utf8String &text);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment