PDA

View Full Version : What is the format of QByteArray's storage?



LiCodeX
30th October 2007, 13:34
Hi all,

In my application, I'm storing a character string into a QByteArray, I want to know whether the QbyteArray, storing signed data or a unsigned data??
(considering the fact that, there are extended character set of having ASCII value more than 127, which can drastically affect the characters getting saved into the QByteArray)

Thanks and Regards

marcel
30th October 2007, 13:40
QByteArray has no support for that, it just stores raw data, but you can just test a byte. If it is greater than 127 or not.

LiCodeX
31st October 2007, 07:17
Thanks for the reply marcel.
but I guess the question was not clear enough, actually I'm not at all checking whether the QByteArray storing the byte in signed or unsinged way, I just wanted to know how does the Qbytearray store the data, whether in signed format or unsigned format?
lets say for example, when there is a character of having ASCII value more than 127, it will be stored as 2's compliment of the value in the normal arrays, and in signed storage it will appear as if a negative value whereas in unsigned storage it will be the other way round.

so wanted to know whether the QByteArray has anything as such, b'coz it also stores only characters data!

Thanks and Regards

marcel
31st October 2007, 07:30
Well, since it works only with "char" and not "unsigned char" it is safe to assume that it works with signed data.

LiCodeX
31st October 2007, 09:21
oh well I guessed the same but wanted to confirm with someone over here.
and I'm bit wary about whether or not its really good to use QByteArray when handling a data which can be sign critical.

Thanks and Regards