Files
sd_gen/include/licenceReader.h
2024-01-24 08:25:44 +01:00

60 lines
1.3 KiB
C++

#ifndef LICENCE_READER_H_
#define LICENCE_READER_H_
#include "utils.h"
// #include "licenceCommon.h"
#include "licenceELC11.h"
#include "licenceELC21.h"
#include "licenceELC31.h"
using namespace std;
struct InitStructure
{
int licenceType = 0;
int licenceVersion = 0;
int licenceIndex = 0;
int compatibility = 0;
string licenceFilePath = "";
string cid_csd_filePath = "";
};
class LicenceReader
{
public:
int elcSwitchType;
string operationErrors = "";
bool argumentsCorrect = false;
ErrorMessage error;
LicenceELC11 *licence11;
LicenceELC21 *licence21;
LicenceELC31 *licence31;
LicenceReader();
~LicenceReader();
bool init(int elcType, int licenceType, int licenceVersion, int licenceIndex, int compatibility);
bool init(int elcType, InitStructure &initStructure);
bool initread(int elcType, int licenceType, int licenceVersion, int licenceIndex, int compatibility);
bool initread(int elcType, InitStructure &initStructure);
void readLicenceFile();
bool getLicenceInfo(void *returnStructure);
bool getLicenceItemInfo(int protocolId, void *returnItemStructure);
LicenceInfoGeneral licenceInfo;
private:
LicenceIdentification licIdentification;
LicData licData;
string configFileName = "";
void *licence = nullptr;
void readLicenceELC1();
void readLicenceELC2();
void readLicenceELC3();
};
#endif