Matrix Science Mascot Parser toolkit
 
Loading...
Searching...
No Matches
ms_license.hpp
1/*
2##############################################################################
3# file: ms_license.hpp #
4# 'msparser' toolkit #
5# Provides read-only interface for mascot license file #
6##############################################################################
7# COPYRIGHT NOTICE #
8# Copyright 1998-2003 Matrix Science Limited All Rights Reserved. #
9# #
10##############################################################################
11# $Archive:: /Mowse/ms_mascotresfile/include/ms_license.hpp $ #
12# $Author: villek@matrixscience.com $ #
13# $Date: 2018-07-30 16:23:53 +0100 $ #
14# $Revision: 1b450440f9c97e1e41d0fc6016a27d68951d4532 | MSPARSER_REL_3_0_0-2024-09-24-0-g93ebaeb4f4 $ #
15# $NoKeywords:: $ #
16##############################################################################
17*/
18
19#ifndef MS_LICENSE_HPP
20#define MS_LICENSE_HPP
21
22
23#include <string>
24
25
26namespace matrix_science {
33
51 class MS_MASCOTRESFILE_API ms_license: public ms_errors
52 {
53 public:
55 ms_license();
56
58 ms_license(const ms_license& src);
59
61 ms_license(const char* filename);
62
65
67 void defaultValues();
68
70 void copyFrom(const ms_license* right);
71
72#ifndef SWIG
74 ms_license& operator=(const ms_license& right);
75#endif
77 std::string getFileName() const;
78
80 void setFileName(const char* filename);
81
83 void read_file();
84
86 bool isLicenseValid() const;
87
89 std::string getLicenseString() const;
90
92 std::string getLicenseVersion() const;
93
95 std::string getStartDate() const;
96
98 std::string getEndDate() const;
99
101 int getNumProcessorsLicensed() const;
102
104 std::string getLicensee() const;
105
107 std::string getDistributor() const;
108
110 std::string getFeatures() const;
111
112 int getInternalConfigurationCode() const;
113
114 private:
115 bool loadLicenseFile(FILE *f);
116 bool checkLicenseValid(const char* startDate, const char* endDate);
117 int calcChecksum(void* entity);
118 void formLicenseString();
119 void checkInternalConfiguration();
120
121 bool bLicenseValid_;
122 std::string filename_;
123 std::string strLicenseString_;
124
125 std::string licenseVer_;
126 std::string startDate_;
127 std::string endDate_;
128 int processors_;
129 std::string licensee_;
130 std::string distributor_;
131 std::string features_;
132
133 int internalConfigurationCode_;
134 }; // class ms_license // end of config_group
136} // namespace matrix_science
137
138#endif // MS_LICENSE_HPP
139
140/*------------------------------- End of File -------------------------------*/
This class is used as a base class for several Mascot Parser classes.
Definition: ms_errors.hpp:696
The class provides access license details in read-only mode.
Definition: ms_license.hpp:52