2024-03-11 12:14:28 +01:00
|
|
|
#include <QCoreApplication>
|
|
|
|
#include <QString>
|
2024-03-04 16:31:14 +01:00
|
|
|
#include <QDebug>
|
2024-03-11 12:14:28 +01:00
|
|
|
#include <QLibrary>
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
#include "message_handler.h"
|
2024-03-04 16:31:14 +01:00
|
|
|
|
|
|
|
#include "calculator_c_interface_lib.h"
|
|
|
|
|
2024-03-11 12:14:28 +01:00
|
|
|
//#include "tariff_calculator.h"
|
|
|
|
|
|
|
|
typedef TariffCalculator *TariffCalculatorHandle;
|
|
|
|
|
|
|
|
typedef TariffCalculatorHandle (*NewTariffCalculatorFunc)();
|
|
|
|
typedef void (*DeleteTariffCalculatorFunc)(TariffCalculatorHandle handle);
|
|
|
|
|
|
|
|
int main(int argc, char *argv[])
|
|
|
|
{
|
|
|
|
QCoreApplication a(argc, argv);
|
|
|
|
|
|
|
|
if (!messageHandlerInstalled()) {
|
|
|
|
atbInstallMessageHandler(atbDebugOutput);
|
|
|
|
//setDebugLevel(LOG_NOTICE);
|
|
|
|
}
|
|
|
|
|
2024-03-11 16:37:06 +01:00
|
|
|
#if 1
|
2024-03-11 14:27:33 +01:00
|
|
|
|
|
|
|
//TariffCalculatorHandle handle = NewTariffCalculator();
|
|
|
|
//DeleteTariffCalculator(handle);
|
|
|
|
|
|
|
|
if (InitGitLibrary() > 0) {
|
2024-03-11 16:37:06 +01:00
|
|
|
qCritical() << CloneRepository("https://git.mimbach49.de/GerhardHoffmann/customer_999.git", "C:\\tmp\\customer_999");
|
2024-03-13 13:17:02 +01:00
|
|
|
qCritical() << CheckoutLocalBranch("C:\\tmp\\customer_999", "master");
|
2024-03-11 14:27:33 +01:00
|
|
|
ShutdownGitLibrary();
|
|
|
|
}
|
|
|
|
#else
|
2024-03-11 12:14:28 +01:00
|
|
|
QLibrary library("C:\\build-ATBTariffCalculator-Desktop_Qt_6_5_0_MinGW_64_bit-Release\\CalculatorCInterface\\release\\CalculatorCInterface.dll");
|
|
|
|
if (library.load()) {
|
|
|
|
qCritical() << "loaded";
|
|
|
|
NewTariffCalculatorFunc f = (NewTariffCalculatorFunc) library.resolve("NewTariffCalculator");
|
|
|
|
TariffCalculatorHandle handle = 0;
|
|
|
|
if (f) {
|
|
|
|
qCritical() << "resolved";
|
|
|
|
handle = f();
|
|
|
|
}
|
|
|
|
DeleteTariffCalculatorFunc d = (DeleteTariffCalculatorFunc) library.resolve("DeleteTariffCalculator");
|
|
|
|
if (d) {
|
|
|
|
qCritical() << "resolved";
|
|
|
|
d(handle);
|
|
|
|
}
|
|
|
|
}
|
2024-03-11 14:27:33 +01:00
|
|
|
#endif
|
2024-03-04 16:31:14 +01:00
|
|
|
|
2024-03-11 12:14:28 +01:00
|
|
|
return 0; // a.exec();
|
2024-03-04 16:31:14 +01:00
|
|
|
}
|