LoadableModule.h++
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef __ccxx_LoadableModule_hxx
00024 #define __ccxx_LoadableModule_hxx
00025
00026 #include <commonc++/Common.h++>
00027 #include <commonc++/IOException.h++>
00028 #include <commonc++/String.h++>
00029 #include <commonc++/Version.h++>
00030
00031 namespace ccxx {
00032
00041 class COMMONCPP_API LoadableModule
00042 {
00043 public:
00044
00051 LoadableModule(const String &path = String::null);
00052
00055 ~LoadableModule() throw();
00056
00063 void open() throw(IOException);
00064
00067 void close() throw();
00068
00072 inline bool isOpen() const throw()
00073 { return(_open); }
00074
00082 void *lookup(const char *symbol) throw();
00083
00091 inline void * lookup(const String &symbol) throw()
00092 { return(lookup(symbol.c_str())); }
00093
00101 inline void * operator[](const char *symbol) throw()
00102 { return(lookup(symbol)); }
00103
00111 inline void * operator[](const String &symbol) throw()
00112 { return(lookup(symbol.c_str())); }
00113
00118 inline void setPath(const String &path) throw()
00119 { if(!_open) _path = path; }
00120
00124 inline String getPath() const throw()
00125 { return(_path); }
00126
00132 static String getExtension() throw();
00133
00139 static String getPrefix() throw();
00140
00150 static String fileNameForStem(const String& stem) throw();
00151
00165 static String fileNameForStem(const String& stem, const Version& version)
00166 throw();
00167
00174 static bool isLoadableModuleFile(const String& fileName) throw();
00175
00176 private:
00177
00178 String _path;
00179 bool _open;
00180
00181 #ifdef CCXX_OS_WINDOWS
00182 HINSTANCE _handle;
00183 #else
00184 void *_handle;
00185 #endif
00186
00187 CCXX_COPY_DECLS(LoadableModule);
00188 };
00189
00190 };
00191
00192 #endif // __ccxx_LoadableModule_hxx
00193
00194