Development: wxFileSystem & wxUrl
Jump to navigation
Jump to search
There was a lengthy discussion on wx-dev a while back, see the archives here.
What Needs to Happen
- A reworking of the wxFileSystem API and with write support added to handlers
- wxUrl handling only url parsing
- URI parsing
- Somehow move the protocal work being done in wxUrl into some kind of seperate mechanism.
- Allow enumeration of available protocols
- Have API to query handler capabilities (read/write/enum/local-files-only/...)
- Solve multiple handler registration problem (preferably using wxRTTI as I believe you proposed, provided we solve the problem with linkers optimizing static linkage, but we have to solve it for XRC2 anyway)
- Get rid of wxFSFile ugliness
- There's a few ways this can be done:
- Have wxFSFile Inherit a wxInputStream and wxOutputStream and just outdate the functions.
- Create a new class.
- Try to work with existing functionality, while maintaining backwards compatability, but no wxStream support and RTTI will be difficult to implement.
- There's a few ways this can be done:
- Use wxStreams
- Enumerate files using intelligent API (read: wxDir; itegrate with wxDir?)
- Vadim says that wxDir should stay the way it is.
- Handle files metadata
Problems
- It has very fragile URIs parsing (and filename<->URI conversion that doesn't cover all legal cases)
- Messy way of stacking protocols
- (file:foo.zip#zip:archiveFile.html), is HTML-centric (special support for HTML anchors)
- You must create own wxFileSystem to access the data, so that it can keep track of its "virtual" current directory -- this should be fixed, wxFileSystem should become some wxVFS that is *stateless* (and wxVFSLocation would provide means to absolutize relative URIs)
- Stateful files enumeration
- Too complicated access to data (create wxFSFile, obtain stream from it, delete wxFSFile object instead of "get stream for this URI")
- No protection against adding same handler twice
- RTTI should fix this
- (wishlist) No loadable handlers support and native VFS integration
- RTTI will take care of the first one
- Only Gnome & KDE have VFS to my knowledge - yet XP IIRC can open zip files natively, does it have one too? None on the mac side it seems.
- Read-only