<HTML><BODY>> read a value that <br>is an offset from some other position (from top of file, start of <br>header, current position...)<br><br>It is possible. In my DBF file parser I have goto-bof and goto-record. I'll think about generalization/standartization for it.<br><br>> to follow linked lists<br><br>Not yet understand, how linked list is implemented in file. Will read sources of racket-mediafile.<br><br>> and to have conditionals.<br><br>It is the main goal of binary-class. One may select type of next field, depending on the value of previous field, or even change class of all object, depending of some field value. It is showed in ID3 parser, where ID3v2.3 and ID3v2.2 selected by tag in the header.<br><br>> <a href="http://www.neilvandyke.org/racket-mediafile/#%28part._.Content_.Types%29" target="_blank" data-mce-href="http://www.neilvandyke.org/racket-mediafile/#%28part._.Content_.Types%29"></a><a href="http://www.neilvandyke.org/racket-mediafile/#%28part._.Content_.Types%29">http://www.neilvandyke.org/racket-mediafile/#%28part._.Content_.Types%29</a><br><br>I'll try to port racket-media to my binary-class library.<br><br>Sun, 15 Jun 2014 21:59:24 -0400 от Neil Van Dyke <neil@neilvandyke.org>:<br>
<blockquote style="border-left:1px solid #0857A6; margin:10px; padding:0 0 0 10px;">
<div id="">
<div class="js-helper js-readmsg-msg">
<style type="text/css"></style>
<div>
<base target="_self" href="https://e.mail.ru/">
<div id="style_14028839690000000353_BODY">Roman, this looks good.<br>
<br>
I think one good test of your abstractions would be to parse JPEG Exif <br>
with some MakerNotes. IIRC, you have to things like read a value that <br>
is an offset from some other position (from top of file, start of <br>
header, current position...), to follow linked lists, and to have <br>
conditionals.<br>
<br>
Another test would be getting video metadata out of popular video stream <br>
and container formats. This would also be very useful for working with <br>
video files.<br>
<br>
Some documentation references are here:<br>
<a href="http://www.neilvandyke.org/racket-mediafile/#%28part._.Content_.Types%29" target="_blank">http://www.neilvandyke.org/racket-mediafile/#%28part._.Content_.Types%29</a><br>
I didn't come up with a generalized high-level abstraction, but looks <br>
like you're on your way to doing it better than I did.<br>
<br>
Neil V.<br>
<br>
Roman Klochkov wrote at 06/15/2014 02:42 PM:<br>
> I've written universal library for parsing binary files or their parts <br>
> into Racket objects.<br>
> You may install it with 'raco pkg install binary-class'. This library <br>
> has verbose documentation and easy syntax.<br>
> You simply describe your data in terms of class fields and load the <br>
> object from the file.<br>
><br>
> I've written parsers for MP3 ID3 tags (binary-class-mp3 package) and <br>
> DBF files (binary-class-dbf package, no docs yet, only Readme at <br>
> <a href="https://github.com/Kalimehtar/binary-class-dbf" target="_blank">https://github.com/Kalimehtar/binary-class-dbf</a>). You may treat them as <br>
> usage examples for the library.<br>
><br>
> Please, give me feedback. Maybe I can do something better, or maybe <br>
> somebody write another file format to the library.<br>
><br>
><br>
> -- <br>
> Roman Klochkov<br>
<br>
</div>
<base target="_self" href="https://e.mail.ru/">
</div>
</div>
</div>
</blockquote>
<br>
<br>-- <br>Roman Klochkov<br></BODY></HTML>