46 lines
1.3 KiB
C++
Executable File
46 lines
1.3 KiB
C++
Executable File
/**
|
|
* @RDE_HEADER@
|
|
* Licence Library
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
* Created by hjl, SLSE, 2016-06-01
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <LtsLicence/ltslicence_export.h>
|
|
#include <QString>
|
|
#include <QVector>
|
|
#include <QDateTime>
|
|
|
|
namespace LtsLicence
|
|
{
|
|
|
|
struct LTSLICENCE_EXPORT Licence
|
|
{
|
|
QString name; ///< licence name
|
|
bool ignoreMaxCount = false; ///< true=ignore false=consider maxCount
|
|
bool ignoreExpiration = false; ///< true=ignore false=consider expiration
|
|
int maxCount = 0; ///< max. number of available licences
|
|
QDateTime expiration; ///< expiration date
|
|
int licenceRefCount = 0; ///< number of assignable licences
|
|
|
|
QString toString() const;
|
|
};
|
|
|
|
/**
|
|
* Convert the given XML licence data into an QVector of licence struct
|
|
* @param unencryptedXmlData xml data to be converted
|
|
* @return QVector<Licence>, in case of an error the QVector is empty.
|
|
*/
|
|
LTSLICENCE_EXPORT QVector<Licence> readLicences(const QByteArray &unencryptedXmlData);
|
|
|
|
/**
|
|
* Convert the given licence vector data into XML format
|
|
* @param licences Vector with data to be converted
|
|
* @return XML formatted data, in case of an error the QByteArray is empty.
|
|
*/
|
|
LTSLICENCE_EXPORT QByteArray writeUnencryptedLicences(const QVector<Licence> &licences);
|
|
}
|