00001 #ifndef VERSION_CHECKER_CLASS 00002 #define VERSION_CHECKER_CLASS 00003 00004 /*****************************************************************************\ 00005 * * 00006 * Name : check_version * 00007 * Author : Chris Koeritz * 00008 * Design : Chris Koeritz & John Stockton * 00009 * * 00010 ******************************************************************************* 00011 * Copyright (c) 1996-$now By Author. This program is free software; you can * 00012 * redistribute it and/or modify it under the terms of the GNU General Public * 00013 * License as published by the Free Software Foundation; either version 2 of * 00014 * the License or (at your option) any later version. This is online at: * 00015 * http://www.fsf.org/copyleft/gpl.html * 00016 * Please send any updates to: fred@gruntose.com * 00017 \*****************************************************************************/ 00018 00019 #include "object_base.h" 00020 00021 // forward. 00022 class version; 00023 class version_record; 00024 00026 00027 class version_checker : public virtual object_base 00028 { 00029 public: 00030 version_checker(const istring &library_file_name, const version &expected, 00031 const istring &version_complaint); 00033 00048 virtual ~version_checker(); 00049 00050 bool good_version() const; 00052 00057 // base requirements. 00058 IMPLEMENT_CLASS_NAME("version_checker"); 00059 istring text_form() const; 00060 00061 static bool loaded(const istring &library_file_name); 00063 static void *get_handle(const istring &library_file_name); 00065 00067 static istring get_name(void *to_find); 00069 00071 static version get_version(const istring &pathname); 00073 00076 static bool get_record(const istring &pathname, version_record &to_fill); 00078 00084 static bool retrieve_version_info(const istring &filename, 00085 byte_array &to_fill); 00087 00088 static bool get_language(byte_array &version_chunk, u_short &high, 00089 u_short &low); 00091 00094 void complain_wrong_version(const istring &library_file_name, 00095 const version &expected_version, const version &version_found) const; 00097 00098 void complain_cannot_load(const istring &library_file_name) const; 00100 00101 private: 00102 istring *_library_file_name; 00103 version *_expected_version; 00104 istring *_version_complaint; 00105 00106 // forbidden. 00107 version_checker(const version_checker &); 00108 version_checker &operator =(const version_checker &); 00109 }; 00110 00111 #endif 00112
1.5.1