uprava souboru

This commit is contained in:
2023-08-28 08:01:54 +02:00
parent eaf88b506a
commit ed2cf088a6

View File

@@ -5,7 +5,6 @@
#include "utils.h" #include "utils.h"
#include "pugixml.hpp" #include "pugixml.hpp"
#define CID_LENGTH 32 #define CID_LENGTH 32
#define CSD_LENGTH 32 #define CSD_LENGTH 32
@@ -60,8 +59,13 @@ PlcLicence::PlcLicence()
/// @param dataFileName /// @param dataFileName
void PlcLicence::processConfigFile(string &dataFileName) void PlcLicence::processConfigFile(string &dataFileName)
{ {
string fullFile = getCompletePath(dataFileName);
const int fileNameLength = fullFile.length();
char fileName[fileNameLength] = {};
getCharsFromString(fullFile, fileName, fileNameLength);
pugi::xml_document doc; pugi::xml_document doc;
pugi::xml_parse_result result = doc.load_file("licData.xml"); pugi::xml_parse_result result = doc.load_file(fileName);
if (result) if (result)
{ {
this->stationName = doc.child("data").child("station").child_value(); this->stationName = doc.child("data").child("station").child_value();
@@ -531,7 +535,7 @@ bool PlcLicence::CreateLicence()
// for (int i=0;i<totalEncryptedLength;i++) cout << totalEncryptedArray[i]; // for (int i=0;i<totalEncryptedLength;i++) cout << totalEncryptedArray[i];
string fullFile = getCompletePath(licenseFileName); string fullFile = getCompletePath(licenseFileName);
if (binaryGeneration == BinaryGenerationType::File) if (binaryGeneration == BinaryGenerationType::File)
{ {
std::ofstream outputFile(fullFile); std::ofstream outputFile(fullFile);