Main Page   Class Hierarchy   Compound List   File List   Compound Members  

DynLib.h

00001 /********************************************************************
00002 ** Copyright (C) 2000 SOMELib Project
00003 **
00004 ** This library is free software; you can redistribute it and/or
00005 ** modify it under the terms of the GNU Library General Public
00006 ** License as published by the Free Software Foundation; either
00007 ** version 2 of the License, or (at your option) any later version.
00008 **
00009 ** This library is distributed in the hope that it will be useful,
00010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012 ** Library General Public License for more details.
00013 **
00014 ** You should have received a copy of the GNU Library General Public
00015 ** License along with this library; if not, write to the
00016 ** Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00017 ** Boston, MA  02111-1307, USA.
00018 **
00019 *******************************************************************/
00020 
00021 #ifndef WINDOWS_DLL_DYN_LIB_HEADER
00022 #define WINDOWS_DLL_DYN_LIB_HEADER
00023 
00024 #include "../BasicDynLib.h"
00025 
00026 #define WIN32_LEAN_AND_MEAN
00027 #include <Windows.h>
00028 
00029 namespace SOME
00030 {
00031 
00032 class DynLib: public SOME::BasicDynLib
00033 {
00034 private:
00035     DynLib();
00036     friend SOME::BasicDynLib* SOME::newDynLib();
00037 
00038 public:
00039     ~DynLib()
00040     {
00041         unloadLibrary();
00042     }
00043     virtual bool loadLibrary(const char* filepath);
00044     virtual void* getFunction(const char* func);
00045 
00046 protected:
00047     virtual bool parsePath( const std::string &path, std::string &return_dir, std::string &return_pattern );
00048     virtual std::list < std::string > enumPlatformDirectory( const std::string& path );
00049 
00050 private:
00051     virtual void unloadLibrary();
00052 
00053 private:
00054     HMODULE lib;
00055 };
00056 
00057 } //namespace SOME
00058 
00059 #endif

Generated at Fri Dec 8 14:24:48 2000 for SOMELib by doxygen1.2.1 written by Dimitri van Heesch, © 1997-2000