-
Notifications
You must be signed in to change notification settings - Fork 83
Add common interface for archive and converter #14
Comments
BTW, the only reason why
produces
and not
Because of this, the code needs to be duplicated all over the place:
If |
I tried implementing this by making If I am to merge these classes indeed, The other option to detect how to name the file is to do it after the fact. If the transformer produced more than two files, it should create a folder for them, if not, place it aside the original file. Detecting this is difficult, because it would require file pooling to be able to tell how to proceed before saving, or renaming the files after the fact. Both variants can get a little mind-numbing when considering nested archives. Needless to say, I'd prefer automatic way over manual, failure-prone micromanagement. I'm going to try file pools this weekend. Until then, I'll focus on making handling nested archives less pain in the ass (see 6a270ee for what I mean). |
Actually I just stumbled across a use case that makes manual file naming convention injecting seem much more reasonable. Imagine archive containing files, that, once extracted, make up for the final file system:
So forget about file pools for now, gonna go with |
- Removed need to implement internal archive unpacking manually thanks to new add_transformer(Archive*). - Replaced existing implementations with add_transformer(). - Changed archive/converter ownership management: transformers now need to be bound to Archive::Internals. This change makes possible to support recursive archives (e.g. .zip inside .zip). - Changed add_transformer visibility to protected - because they're now given raw pointers and are intended to be used only from within Archives, it makes sense. - Changed naming of ABMP7/ABMP10 files. It's much nicer now. - Broken naming of ANM. This is something that needs to be addressed through #14.
Fuck yeah 💯 The naming management is now hard-to-follow, but it works better than before, made project structure much cleaner and unit tests should convey why it needs to be like this. I'm quite satisfied with the results. |
For #13 to work nicely,
Archive
andConverter
should derive from a new class,Transformer
, which has pure virtual methods such asadd_cli_help
andparse_cli_options
.The text was updated successfully, but these errors were encountered: