/*
WickedDocs
(C) Copyright 2020
John Ryland
*/
#ifndef LICENSE_CHECK_H
#define LICENSE_CHECK_H
#include <string>
#include <map>
class LicenseChecker
{
public:
LicenseChecker();
bool LicenseExists() { return licenseFound; }
bool LicenseValid() { return licenseFound && licenseValid; }
bool IsTrial() { return trial; }
bool InstallLicense(std::string licenseText);
static std::string LicenseFileLocation();
static bool ValidateData(const std::vector<uint8_t>& data, const std::vector<uint8_t>& signature);
static bool ValidateLicense(const std::string& licenseText);
std::string Date() const { return keyValuePairs.count("Date") ? keyValuePairs.at("Date") : "01/01/2020"; }
private:
bool licenseFound;
bool licenseValid;
std::map<std::string,std::string> keyValuePairs;
int trialExecutionsRemaining;
bool trial;
std::string version;
};
bool CheckLicense();
#endif // LICENSE_CHECK_H