Add QDataStream operator<< and >> for Utf8StringVector

It's just a QVector, but let's be explicit.

Change-Id: Ic46ff326a6ba46bc877cfffd148325c9c1354fa5
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
Thiago Macieira
2016-11-01 23:04:11 -07:00
parent 89b3d53b27
commit 6a061b2a35

View File

@@ -28,6 +28,7 @@
#include "sqliteglobal.h" #include "sqliteglobal.h"
#include "utf8string.h" #include "utf8string.h"
#include <QDataStream>
#include <QVector> #include <QVector>
class SQLITE_EXPORT Utf8StringVector : public QVector<Utf8String> class SQLITE_EXPORT Utf8StringVector : public QVector<Utf8String>
@@ -63,6 +64,11 @@ bool Utf8StringVector::removeFast(const Utf8String &valueToBeRemoved)
return hasEntry; return hasEntry;
} }
inline QDataStream &operator<<(QDataStream &s, const Utf8StringVector &v)
{ return s << static_cast<const QVector<Utf8String> &>(v); }
inline QDataStream &operator>>(QDataStream &s, Utf8StringVector &v)
{ return s >> static_cast<QVector<Utf8String> &>(v); }
SQLITE_EXPORT QDebug operator<<(QDebug debug, const Utf8StringVector &textVector); SQLITE_EXPORT QDebug operator<<(QDebug debug, const Utf8StringVector &textVector);
SQLITE_EXPORT void PrintTo(const Utf8StringVector &textVector, ::std::ostream* os); SQLITE_EXPORT void PrintTo(const Utf8StringVector &textVector, ::std::ostream* os);