I want to partition a QByteArray message efficiently, so this function I implemented take the Bytes, the part I want to extract, and toEnd flag which tells if I want to extr
What about this:
QByteArray Server::getPart(const QByteArray& message, int part, bool toEnd) { int characters(toEnd ? -1 : message.indexOf(' ', part) - part); return message.mid(part, characters); }
Why not make it a regular QString and use split. That will give you a QStringList.