X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fcommon%2Ftypes.h;h=c6a4bb1d23bd3e078fa2eb547c1725ebf0704d62;hb=92789e6323ca73383a7954d834ecfc093234f5e2;hp=949306b8faae2433ec7dc92862074596155d0029;hpb=ee6e4f90ce63d7eb3a54937cffb33510398d2349;p=quassel.git diff --git a/src/common/types.h b/src/common/types.h index 949306b8..c6a4bb1d 100644 --- a/src/common/types.h +++ b/src/common/types.h @@ -18,12 +18,13 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#ifndef _TYPES_H_ -#define _TYPES_H_ +#ifndef TYPES_H_ +#define TYPES_H_ #include #include #include +#include class SignedId { protected: @@ -37,6 +38,9 @@ class SignedId { inline bool operator==(const SignedId &other) const { return id == other.id; } inline bool operator!=(const SignedId &other) const { return id != other.id; } inline bool operator<(const SignedId &other) const { return id < other.id; } + inline bool operator<=(const SignedId &other) const { return id <= other.id; } + inline bool operator>(const SignedId &other) const { return id > other.id; } + inline bool operator>=(const SignedId &other) const { return id >= other.id; } inline bool operator==(int i) const { return id == i; } inline bool operator!=(int i) const { return id != i; } inline bool operator<(int i) const { return id < i; } @@ -51,6 +55,7 @@ class SignedId { inline QDataStream &operator<<(QDataStream &out, const SignedId &signedId) { out << signedId.toInt(); return out; } inline QDataStream &operator>>(QDataStream &in, SignedId &signedId) { in >> signedId.id; return in; } +inline QTextStream &operator<<(QTextStream &out, const SignedId &signedId) { out << QString::number(signedId.toInt()); return out; } inline QDebug operator<<(QDebug dbg, const SignedId &signedId) { dbg.space() << signedId.toInt(); return dbg; } inline uint qHash(const SignedId &id) { return qHash(id.toInt()); }