Refactoring, added functionality
I have decided to refactor the project and expand classes hierarchy to avoid duplication of common code. Seven operation modes of IFFChunkTool can be divided into three groups:
- LIST mode alone.
- EXTRACT and DUMP, they look for a chunk specified as argument, then process it.
- APPEND, INSERT, REMOVE, REPLACE. They operate with destination IFF, and are basically chunk copiers, doing some modifications while copying.
Then I have created three base classes for these categories: ChunkLister, ChunkPicker and ChunkCopier. Each of them has different IFF parse loop. Next I have 6 subclasses implementing operating modes. ChunkExtractor and ChunkDumper inherit from ChunkPicker. They are implemented and tested. Four more classes will inherit from ChunkCopier.
LIST, EXTRACT and DUMP modes can be seen in action on the example screenshot. I have analyzed an IFF ILBM image there. I have also shown that thanks to refactoring I'm still below 5 kB of executable. I hope to keep it below 10 kB with all planned functionality added.

Leave a comment
Log in with itch.io to leave a comment.