[Development] QUtf8String{, View}

Matthew Woehlke mwoehlke.floss at gmail.com
Sat May 16 20:51:23 CEST 2020


On 15/05/2020 14.31, Thiago Macieira wrote:
> Python's bstr still behaves string-like and has methods like 
> QByteArray::indexOf(const char *).  QVector has no such methods.
> 
> But since we do have QListSpecialMethods, we can add inject them into
> QVector too.

Right; I was assuming that would happen for e.g. decoding. I think
'block of memory' type functions also make sense, for example,
startsWith. Byte arrays are unique in that *sequences* of elements often
have meaning, which is not often the case for other sorts of arrays.
It's quite reasonable to ask if a byte array starts with 0xDE, 0xAD,
0xBE, 0xEF (which is not text!) or to search for such sequences. Slicing
(left, mid, right) are also useful, though those are probably useful for
*any* array.

-- 
Matthew


More information about the Development mailing list