From 0d8b39c94e9bee14ec9c33fa6a53c48f20f0ac70 Mon Sep 17 00:00:00 2001 From: Maximilien Siavelis <maximilien.siavelis@simulease.com> Date: 周日, 21 4月 2019 23:06:05 +0800 Subject: [PATCH] copy ini/SimpleIni.h into install directory --- src/library/license++.cpp | 21 ++++++++++----------- 1 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/library/license++.cpp b/src/library/license++.cpp index f0b20d0..fd07af8 100644 --- a/src/library/license++.cpp +++ b/src/library/license++.cpp @@ -10,15 +10,14 @@ #include <stdlib.h> #include <cstring> #include "api/license++.h" -#include "reader/LicenseReader.h" +#include "LicenseReader.h" using namespace std; -DllExport void print_error(char out_buffer[256], LicenseInfo* licenseInfo) { +void print_error(char out_buffer[256], LicenseInfo* licenseInfo) { } -DllExport void identify_pc(IDENTIFICATION_STRATEGY pc_id_method, - char chbuffer[PC_IDENTIFIER_SIZE + 1]) { +void identify_pc(IDENTIFICATION_STRATEGY pc_id_method, char chbuffer[PC_IDENTIFIER_SIZE + 1]) { } @@ -31,16 +30,16 @@ if (!it->has_expiry) { it->toLicenseInfo(license); break; - } else if (curLicense_exp < it->to_date) { - curLicense_exp = it->to_date; + } else if (curLicense_exp < it->expires_on()) { + curLicense_exp = it->expires_on(); it->toLicenseInfo(license); } } } } -EVENT_TYPE acquire_license(char * product, LicenseLocation licenseLocation, - LicenseInfo* license) { +EVENT_TYPE acquire_license(const char * product, + LicenseLocation licenseLocation, LicenseInfo* license) { license::LicenseReader lr = license::LicenseReader(licenseLocation); vector<license::FullLicenseInfo> licenses; license::EventRegistry er = lr.readLicenses(string(product), licenses); @@ -50,7 +49,7 @@ vector<license::FullLicenseInfo> licenses_ok; for (auto it = licenses.begin(); it != licenses.end(); it++) { license::EventRegistry validation_er = it->validate(0); - if (er.isGood()) { + if (validation_er.isGood()) { licenses_ok.push_back(*it); } else { licenses_with_errors.push_back(*it); @@ -75,12 +74,12 @@ return result; } -DllExport enum EVENT_TYPE confirm_license(char * product, +EVENT_TYPE confirm_license(char * product, LicenseLocation licenseLocation) { return LICENSE_OK; } -DllExport enum EVENT_TYPE release_license(char * product, +EVENT_TYPE release_license(char * product, LicenseLocation licenseLocation) { return LICENSE_OK; } -- Gitblit v1.9.1