Matrix Science header

ms_license.hpp

00001 /*
00002 ##############################################################################
00003 # file: ms_license.hpp                                                       #
00004 # 'msparser' toolkit                                                         #
00005 # Provides read-only interface for mascot license file                       #
00006 ##############################################################################
00007 # COPYRIGHT NOTICE                                                           #
00008 # Copyright 1998-2003 Matrix Science Limited  All Rights Reserved.           #
00009 #                                                                            #
00010 ##############################################################################
00011 #    $Archive:: /Mowse/ms_mascotresfile/include/ms_license.hpp             $ #
00012 #     $Author: villek@matrixscience.com $ #
00013 #       $Date: 2018-07-30 16:23:53 +0100 $ #
00014 #   $Revision: 1b450440f9c97e1e41d0fc6016a27d68951d4532 | MSPARSER_REL_2_8_1-0-gea32989045 $ #
00015 # $NoKeywords::                                                            $ #
00016 ##############################################################################
00017 */
00018 
00019 #ifndef MS_LICENSE_HPP
00020 #define MS_LICENSE_HPP
00021 
00022 
00023 #include <string>
00024 
00025 
00026 namespace matrix_science {
00032 
00033 
00051     class MS_MASCOTRESFILE_API ms_license: public ms_errors
00052     {
00053     public:
00055         ms_license();
00056 
00058         ms_license(const ms_license& src);
00059 
00061         ms_license(const char* filename);
00062 
00064         ~ms_license();
00065 
00067         void defaultValues();
00068 
00070         void copyFrom(const ms_license* right);
00071 
00072 #ifndef SWIG
00073 
00074         ms_license& operator=(const ms_license& right);
00075 #endif
00076 
00077         std::string getFileName() const;
00078 
00080         void setFileName(const char* filename);
00081 
00083         void read_file();
00084 
00086         bool isLicenseValid() const;
00087 
00089         std::string getLicenseString() const;
00090 
00092         std::string getLicenseVersion() const;
00093 
00095         std::string getStartDate() const;
00096 
00098         std::string getEndDate() const;
00099 
00101         int getNumProcessorsLicensed() const;
00102 
00104         std::string getLicensee() const;
00105 
00107         std::string getDistributor() const;
00108 
00110         std::string getFeatures() const;
00111 
00112         int getInternalConfigurationCode() const;
00113 
00114     private:
00115         bool loadLicenseFile(FILE *f);
00116         bool checkLicenseValid(const char* startDate, const char* endDate);
00117         int  calcChecksum(void* entity);
00118         void formLicenseString();
00119         void checkInternalConfiguration();
00120 
00121         bool bLicenseValid_;
00122         std::string filename_;
00123         std::string strLicenseString_;
00124 
00125         std::string licenseVer_;
00126         std::string startDate_;
00127         std::string endDate_;
00128         int processors_;
00129         std::string licensee_;
00130         std::string distributor_;
00131         std::string features_;
00132 
00133         int internalConfigurationCode_;
00134     }; // class ms_license // end of config_group
00136 } // namespace matrix_science
00137 
00138 #endif // MS_LICENSE_HPP
00139 
00140 /*------------------------------- End of File -------------------------------*/

Copyright © 2022 Matrix Science Ltd.  All Rights Reserved. Generated on Thu Mar 31 2022 01:12:29