I'm working on an app that is needs to be able to process "file paths" to import resources of different kinds. The issue is that in different situations (OS's for example), some of the file kinds are not applicable. What I want to do is define a very basic set of types that everything supports and then have a plug in architecture that supports adding new types with minimal code modification, ideally (for now) adding a single line to main() per type and linking in the needed files. Later I would like to be able to do this loading at run time via DLL/SO loading.
For now the file types I need to support include
- binary files
- text files
- directories
- zip files
- any of the above in zip files
in the future I'd like to support things like:
- HTML/XML files
- docx files
- image files
- MP3 files
- SQL sever quieries
- HTTP URL's
- e-mail via POP/IMAP
- etc.
A solution to this problem would have to support (at least) two levels of processing.
- "path" based identification to determine where to look (local files vs. MySQL vs. HTTP va. MSSQL...)
- resource type content probing to determine the exact type of the resource once it is found. (it's file, what type of file?)
Another part of the same app solves a simalar problem for output by building a hash table of output types and output handlers where the plugins register themselves with the main app.
The big question end up being: Does anyone have any advice as to how to proceeds? Has anyone build a simalar system and have any advice based on that experiences?