oddělení generatoru od readeru

This commit is contained in:
2024-01-29 14:50:12 +01:00
parent 36a799057c
commit a7fc519138
62 changed files with 1147 additions and 932 deletions

View File

@@ -1,14 +1,13 @@
#include <stdio.h>
#include "utils.h"
#include "licenceGenerator.h"
#include "licenceReader.h"
#include "licenceCommon.h"
/// @brief hlavní funkce
/// @param argc
/// @param argv parametry pro generování licence
/// @return
int main()
int mainno()
{
// unordered_map<string, string> arguments = getArguments(argc, argv);
// try
@@ -29,7 +28,8 @@ int main()
try
{
int protocolId = 222;
int protocolId = 444;
LicenceReader licenceReader1 {};
@@ -50,17 +50,15 @@ int main()
if (licenceReader1.getLicenceInfo(&info))
{
std::cout << "Počet licenčních bodů pro : " << protocolId << ": " << info.reqDataPointsCount << std::endl;
if (info.licences.count(protocolId) > 0) cout << "Počet z vectoru pro : " << protocolId << ": " << info.licences.at(protocolId) << endl;
cout << "Všechny licenční body: " << endl;
for (const auto &pair : info.licences) { std::cout << "<" << pair.first << ", " << pair.second << ">" << endl; }
}
else
cerr << "Došlo k chybě: " << licenceReader1.error.message;
else cout << "Došlo k chybě: " << licenceReader1.error.message;
}
else
{
cerr << "Došlo k chybě: " << licenceReader1.error.message;
cout << "Došlo k chybě: " << licenceReader1.error.message;
}
cout << "\n" << "-- verze #2: init a iterace" << "\n";
@@ -77,16 +75,16 @@ int main()
std::cout << "Počet licenčních bodů pro " << info.protocolId << ": " << info.dataPointsCount << std::endl;
}
else
cerr << "Došlo k chybě: " << licenceReader2.error.message;
cout << "Došlo k chybě: " << licenceReader2.error.message;
}
else
{
cerr << "Došlo k chybě: " << licenceReader2.error.message;
cout << "Došlo k chybě: " << licenceReader2.error.message;
}
}
catch (...)
{
cerr << "Obecná chyba\n";
cout << "Obecná chyba\n";
}
system("pause");