Add overloaded constructor to LiveMessageToken to accept an int

This commit is contained in:
Micke Prag 2011-12-29 17:28:22 +01:00
parent cd6e59baa5
commit b8955deed8
2 changed files with 6 additions and 0 deletions

View file

@ -11,6 +11,11 @@ LiveMessageToken::LiveMessageToken(const QString &value) {
stringVal = value;
}
LiveMessageToken::LiveMessageToken(int value) {
valueType = Int;
intVal = value;
}
QByteArray LiveMessageToken::toByteArray() const {
if (valueType == Int) {
return QString("i%1s").arg(intVal, 0, 16).toUtf8();

View file

@ -12,6 +12,7 @@ public:
LiveMessageToken();
LiveMessageToken(const QString &value);
LiveMessageToken(int value);
QByteArray toByteArray() const;
static LiveMessageToken parseToken(const QByteArray &string, int* start);