19 #include <QStringList> 50 int i = target.indexOf(
":");
53 if (i + 1 < target.length())
54 _port = target.mid(i+1).toUInt();
65 QStringList parts = stream.split(
" ", QString::SkipEmptyParts);
66 if (parts.size() >= 4) {
74 QString
target = parts.at(3);
76 return Stream(streamId, status, circId, target);
86 int length = streamId.length();
87 if (length < 1 || length > 16)
90 for (
int i = 0;
i < length;
i++) {
91 char c = streamId[
i].toAscii();
92 if (c < '0' && c >
'9' && c < 'A' && c >
'Z' && c < 'a' && c >
'z')
102 if (!strStatus.compare(
"NEW", Qt::CaseInsensitive))
104 if (!strStatus.compare(
"NEWRESOLVE", Qt::CaseInsensitive))
106 if (!strStatus.compare(
"SENTCONNECT", Qt::CaseInsensitive))
108 if (!strStatus.compare(
"SENTRESOLVE", Qt::CaseInsensitive))
110 if (!strStatus.compare(
"SUCCEEDED", Qt::CaseInsensitive))
112 if (!strStatus.compare(
"FAILED", Qt::CaseInsensitive))
114 if (!strStatus.compare(
"CLOSED", Qt::CaseInsensitive))
116 if (!strStatus.compare(
"DETACHED", Qt::CaseInsensitive))
118 if (!strStatus.compare(
"REMAP", Qt::CaseInsensitive))
130 case New: status = tr(
"New");
break;
133 case SentConnect: status = tr(
"Connecting");
break;
134 case Succeeded: status = tr(
"Open");
break;
135 case Failed: status = tr(
"Failed");
break;
136 case Closed: status = tr(
"Closed");
break;
137 case Detached: status = tr(
"Retrying");
break;
138 case Remap: status = tr(
"Remapped");
break;
139 default: status = tr(
"Unknown");
break;
static bool isValidCircuitId(const CircuitId &circId)
static bool isValidStreamId(const StreamId &streamId)
static Stream fromString(const QString &stream)
QString statusString() const
CircuitId circuitId() const
static Status toStatus(const QString &strStatus)