[physfs] abstract archivers...
Ryan C. Gordon
icculus at icculus.org
Wed Nov 28 01:52:17 EST 2012
This is work in progress and will be changing a little before we ship a
formal 2.1.0 release.
I've just pushed the changes to allow application-defined archivers,
which means you can supply your own implementation at runtime and it
will be available to PhysicsFS just like the built-in .zip, etc handlers.
One use for this is to supply your own archive formats without making
changes to PhysicsFS directly. Another is to supply a "virtual" archive
that has no file format at all, but as far as the library is concerned,
it still can query for directory info, open fake file streams, etc.
Think of this as making PhysicsFS a lot like FUSE: you can do any crazy
thing you like and make it look like a filesystem, and live in the same
virtual tree as real files (and files in archives, etc). Want to
PHYSFS_openRead() a file on an HTTP server? You can do it now, with
enough coding effort in your app.
The interface that your app provides, PHYSFS_Archiver, is going to be
simplified a little...it's got a few legacy complexities to shake out
still. I still need to work out the API to say "mount this virtual thing
with this archiver and don't look for a real file," and test things in
Basic API details at this point:
More information about the physfs