[Development] Enhancement to QIODevice?
Andrzej Ostruszka
andrzej.ostruszka at gmail.com
Tue Sep 15 10:36:40 CEST 2015
On 09/14/2015 12:43 PM, André Somers wrote
> I guess that also means that your countTo() would need to be virtual,
> right? That would not be bc.
No. This would be just additional functionality of the
QIODevicePrivateLinearBuffer.
Since this buffer is available from QIODevicePrivate which itself is
available to all descendants of QIODevice I could implement what I want
by subclassing QSerialPort.
> Would it not make sense to just add a non-virtual getter and a setter
> for the delimitation marker in the QIODevice API, instead of hard-coding
> '\n'? Obviously you would default that to '\n', but for your usecase you
> would then set it to '\r' and everything else remain as-is...
Yes, that's another option. This way we still would be doubly searching
for the delimiter (once in canReadLine and second time in readLine) but
I can live with that :)
Regards
Andrzej
More information about the Development
mailing list