thanks for you input.
i will try to give some more information.
I am trying to analyse the data contained within a hex file.
so for example:
array = file.readAll();
int numBytes = array.length();
if (numBytes > 0 )
{
a = 0; // counter for position in the array
while (( a < numBytes ) && (data_parsed == 0))
{
long sequenceCode = 0;
a = array.indexOf(71, a); // looking for hex 47
std::cout << "position of first 47 hex byte = " << a << std::endl;
arrayReadBytes = array.mid(a,3);
b = a+3;
...
array = file.readAll();
int numBytes = array.length();
if (numBytes > 0 )
{
a = 0; // counter for position in the array
while (( a < numBytes ) && (data_parsed == 0))
{
long sequenceCode = 0;
a = array.indexOf(71, a); // looking for hex 47
std::cout << "position of first 47 hex byte = " << a << std::endl;
arrayReadBytes = array.mid(a,3);
b = a+3;
...
To copy to clipboard, switch view to plain text mode
so basically i need to search the required file for certain bytes and then act on them.
Then later on, I am checking the following bytes:
array2 = array.mid(b,2);
QByteArray array2;
array2 = array.mid(b,2);
To copy to clipboard, switch view to plain text mode
its at this point that I fall down, as i mentioned before, i am overflowing.
As for using QDatastream, I have checked the documentation, and I can't seem to see the search functionality that i had from using a qbytearray....
Bookmarks