[Qt-interest] Binary & ASCII in QByteArray

Paul England pengland at cmt-asia.com
Tue Aug 3 11:05:45 CEST 2010


Andre

Indeed I have started tinkering to find differences.  In all honesty, I
think I've figured out how to "append"... or at least a rough idea. 
But, the more I know the better.

And yes, I asked the authors of the program, who are pros at ignorning
people.  Why make something easy, right?  :D

I'll look into QDataStream.  Thanks.

-Paul


On 08/03/2010 05:41 PM, Andre Somers wrote:
> Op Di, 3 augustus, 2010 9:58 am, schreef Paul England:
>   
>> Hi
>>
>> I'm not very familiar with parsing binary data, other than casting
>> something that I'm expecting.
>>
>> I've got a file from a program that has Binary & ASCII values in it.
>> I've taken a look at hexdump and I have a rough idea of what it looks
>> like, but other than that, kind of stumped.  I can read it in to a
>> QByteArray() but after that, I'm a bit lost on what I should do.
>> Obviously "messing around" to find out how many bytes to read in at a
>> time is the way to go.  Hoping to find some pointers (or maybe some
>> tricks unique to QByteArray) before that endeavor.
>>     
> First and foremost, you need to have a good understanding of the structure
> of the file you are trying to read. As long as you don't know, you will
> not be able to read it in in any meaningful or safe way. Try googling for
> a description, contacting the author of the format, reverse engineering
> the source of the application that made the file or just solve the puzzel
> yourself by changing things in the program that creates the files and
> seeing what changes in the file, but you really need to get to a
> specification of the format.
>
> Having said that, I think you should familarize yourself with QDataStream.
> You can use it's stream operators to read in data from a binairy file into
> variables.
>
> André
>
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>   



More information about the Qt-interest-old mailing list