forked from qt-creator/qt-creator
Core: Add streaming operators for Core::Id
Only used once so far, but makes intended usage clear. Change-Id: Ia628f5356dd02282e233846268d6c0629e93e3fe Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
@@ -354,3 +354,21 @@ QString Id::suffixAfter(Id baseId) const
|
||||
}
|
||||
|
||||
} // namespace Core
|
||||
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
QDataStream &operator<<(QDataStream &ds, const Core::Id &id)
|
||||
{
|
||||
return ds << id.name();
|
||||
}
|
||||
|
||||
QDataStream &operator>>(QDataStream &ds, Core::Id &id)
|
||||
{
|
||||
QByteArray ba;
|
||||
ds >> ba;
|
||||
id = Core::Id::fromName(ba);
|
||||
return ds;
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
Reference in New Issue
Block a user