00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _piomanager_h_
00021 #define _piomanager_h_
00022
00023 #include <pclasses/pexport.h>
00024 #include <pclasses/pcriticalsection.h>
00025 #include <pclasses/piohandler.h>
00026 #include <pclasses/piorequest.h>
00027 #include <pclasses/pioplugin.h>
00028 #include <map>
00029
00049 namespace P {
00050
00052
00057 class PIO_EXPORT IOManager {
00058 public:
00059 IOManager();
00060 ~IOManager();
00061
00062 inline void addPlugin(const char* path) throw(SystemError)
00063 { m_pluginFactory.addPlugin(path); }
00064
00065 inline void addPluginDir(const char* path) throw(SystemError)
00066 { m_pluginFactory.addPluginDir(path); }
00067
00069 IORequest_Get* get(const URL& url);
00070
00072 IORequest_Put* put(const URL& url);
00073
00075 IORequest_Unlink* unlink(const URL& url);
00076
00078 IORequest_MakeDir* mkdir(const URL& url);
00079
00081 IORequest_RemoveDir* rmdir(const URL& url);
00082
00084 IORequest_ListDir* list(const URL& url);
00085
00087 void finish(IORequest* job);
00088
00089 private:
00090 IOHandler* findCreateHandler(const std::string& proto);
00091
00092 IOHandlerPluginFactory m_pluginFactory;
00093 std::map<std::string, IOHandler*> m_plugins;
00094
00095 };
00096
00097 }
00098
00099 #endif