109 lines
2.8 KiB
C++
109 lines
2.8 KiB
C++
|
|
#include "precomp.h"
|
||
|
|
#include "anslicensing.h"
|
||
|
|
#include "license.h"
|
||
|
|
#include "uniconv.h"
|
||
|
|
#include "licensevalidationargs.h"
|
||
|
|
|
||
|
|
namespace ANSCENTER {
|
||
|
|
namespace Licensing {
|
||
|
|
|
||
|
|
template<>
|
||
|
|
LicenseValidationArgsT<char>::LicenseValidationArgsT():
|
||
|
|
m_Impl(*new LicenseValidationArgsImpl())
|
||
|
|
{
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
template<>
|
||
|
|
LicenseValidationArgsT<wchar_t>::LicenseValidationArgsT() :
|
||
|
|
m_Impl(*new LicenseValidationArgsImpl())
|
||
|
|
{
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
template<>
|
||
|
|
LicenseValidationArgsT<char>::~LicenseValidationArgsT()
|
||
|
|
{
|
||
|
|
delete & m_Impl;
|
||
|
|
}
|
||
|
|
|
||
|
|
template<>
|
||
|
|
LicenseValidationArgsT<wchar_t>::~LicenseValidationArgsT()
|
||
|
|
{
|
||
|
|
delete & m_Impl;
|
||
|
|
}
|
||
|
|
|
||
|
|
template<>
|
||
|
|
void LicenseValidationArgsT<char>::SetLicenseKey(const char * licenseKey)
|
||
|
|
{
|
||
|
|
m_Impl.SetLicenseKey(licenseKey);
|
||
|
|
}
|
||
|
|
|
||
|
|
template<>
|
||
|
|
void LicenseValidationArgsT<wchar_t>::SetLicenseKey(const wchar_t * licenseKey)
|
||
|
|
{
|
||
|
|
m_Impl.SetLicenseKey(w2s(licenseKey).c_str());
|
||
|
|
}
|
||
|
|
|
||
|
|
template<>
|
||
|
|
void LicenseValidationArgsT<char>::SetLicense(const LicenseT<char> * license)
|
||
|
|
{
|
||
|
|
m_Impl.SetLicense(&license->m_Impl);
|
||
|
|
}
|
||
|
|
|
||
|
|
template<>
|
||
|
|
void LicenseValidationArgsT<wchar_t>::SetLicense(const LicenseT<wchar_t> * license)
|
||
|
|
{
|
||
|
|
m_Impl.SetLicense(&license->m_Impl);
|
||
|
|
}
|
||
|
|
|
||
|
|
template<>
|
||
|
|
void LicenseValidationArgsT<char>::SetLicenseKeyValidationData(const char * fieldName, int fieldValue)
|
||
|
|
{
|
||
|
|
m_Impl.SetLicenseKeyValidationData(fieldName, fieldValue);
|
||
|
|
}
|
||
|
|
|
||
|
|
template<>
|
||
|
|
void LicenseValidationArgsT<wchar_t>::SetLicenseKeyValidationData(const wchar_t * fieldName, int fieldValue)
|
||
|
|
{
|
||
|
|
m_Impl.SetLicenseKeyValidationData(w2s(fieldName).c_str(), fieldValue);
|
||
|
|
}
|
||
|
|
|
||
|
|
template<>
|
||
|
|
void LicenseValidationArgsT<char>::SetLicenseKeyValidationData(const char * fieldName, const char * fieldValue)
|
||
|
|
{
|
||
|
|
m_Impl.SetLicenseKeyValidationData(fieldName, fieldValue);
|
||
|
|
}
|
||
|
|
|
||
|
|
template<>
|
||
|
|
void LicenseValidationArgsT<wchar_t>::SetLicenseKeyValidationData(const wchar_t * fieldName, const wchar_t * fieldValue)
|
||
|
|
{
|
||
|
|
m_Impl.SetLicenseKeyValidationData(w2s(fieldName).c_str(), w2s(fieldValue).c_str());
|
||
|
|
}
|
||
|
|
|
||
|
|
template<>
|
||
|
|
void LicenseValidationArgsT<char>::SetLicenseKeyValidationData(const char * fieldName, int year, int month, int day)
|
||
|
|
{
|
||
|
|
m_Impl.SetLicenseKeyValidationData(fieldName, year, month, day);
|
||
|
|
}
|
||
|
|
|
||
|
|
template<>
|
||
|
|
void LicenseValidationArgsT<wchar_t>::SetLicenseKeyValidationData(const wchar_t * fieldName, int year, int month, int day)
|
||
|
|
{
|
||
|
|
m_Impl.SetLicenseKeyValidationData(w2s(fieldName).c_str(), year, month, day);
|
||
|
|
}
|
||
|
|
|
||
|
|
template<>
|
||
|
|
void LicenseValidationArgsT<char>::SetLicenseKeyValidationData(const char * fieldName, void * data, int len)
|
||
|
|
{
|
||
|
|
m_Impl.SetLicenseKeyValidationData(fieldName, data, len);
|
||
|
|
}
|
||
|
|
|
||
|
|
template<>
|
||
|
|
void LicenseValidationArgsT<wchar_t>::SetLicenseKeyValidationData(const wchar_t * fieldName, void * data, int len)
|
||
|
|
{
|
||
|
|
m_Impl.SetLicenseKeyValidationData(w2s(fieldName).c_str(), data, len);
|
||
|
|
}
|
||
|
|
};
|
||
|
|
};
|