00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
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 };
00136 }
00137
00138 #endif // MS_LICENSE_HPP
00139
00140