From 6289712ceaeef9c5f6d4ae746fe7b754c8e5173e Mon Sep 17 00:00:00 2001
From: Gabriele Contini <contini.mailing@gmail.com>
Date: 周日, 13 10月 2019 15:02:19 +0800
Subject: [PATCH] refactoring - locators

---
 src/library/license++.cpp |   21 +++++++++++----------
 1 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/src/library/license++.cpp b/src/library/license++.cpp
index 03f2f2c..3e4ae40 100644
--- a/src/library/license++.cpp
+++ b/src/library/license++.cpp
@@ -9,30 +9,31 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <cstring>
+
 #include "api/license++.h"
-#include "LicenseReader.h"
+
+#include "LicenseReader.hpp"
 
 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]) {
 
 }
 
 static void mergeLicenses(vector<license::FullLicenseInfo> licenses,
 		LicenseInfo* license) {
-	if (license != NULL) {
+	if (license != nullptr) {
 		time_t curLicense_exp = 0;
 		for (auto it = licenses.begin(); it != licenses.end(); it++) {
 			//choose the license that expires later...
 			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);
 			}
 		}
@@ -69,18 +70,18 @@
 	} else {
 		result = er.getLastFailure()->event_type;
 	}
-	if (license != NULL) {
+	if (license != nullptr) {
 		er.exportLastEvents(license->status, 5);
 	}
 	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