ATBUpdateTool/UpdatePTUDevCtrl/utils.h

48 lines
1.8 KiB
C
Raw Normal View History

#ifndef UTILS_H_INCLUDED
#define UTILS_H_INCLUDED
#include <QObject>
#include <QString>
#include <QStringList>
#include <QFile>
#include <QFileInfo>
#include <QDateTime>
#include <QDir>
2023-10-22 19:44:45 +02:00
#include <QDebug>
2024-12-20 13:01:34 +01:00
#include <QPair>
2025-01-10 14:19:43 +01:00
#include <QProcess>
2025-01-10 14:19:43 +01:00
class Worker;
namespace Utils {
int read1stLineOfFile(QString fileName);
QString getLocation(QString fileName);
QString getTariffVersion(QString fileName);
QString getTariffInfo(QString fileName);
QString zoneName(quint8 i);
2023-10-22 19:44:45 +02:00
void printCriticalErrorMsg(QString const &errorMsg, bool upper=false, bool lower=false);
void printCriticalErrorMsg(QStringList const &errorMsg);
2023-10-22 19:44:45 +02:00
void printInfoMsg(QString const &infoMsg, bool upper=false, bool lower=false);
void printInfoMsg(QStringList const &infoMsg);
2023-11-03 13:46:23 +01:00
void printUpdateStatusMsg(QDebug debug, QStringList const &updateMsg);
void printUpdateStatusMsg(QStringList const &updateMsg);
2023-10-22 19:44:45 +02:00
void printUpdateStatusMsg(QString const &updateMsg, bool upper=false, bool lower=false);
2023-11-03 13:46:23 +01:00
void printUpdateStatusMsg(QDebug debug, QString const &updateMsg, bool upper=false, bool lower=false);
void printLineEditInfo(QStringList const &lines);
QString getTariffLoadTime(QString fileName);
QString rstrip(QString const &str);
bool sameFilesInDirs(QDir const &dir1, QDir const &dir2,
QStringList const &nameFilters = {"*.json"});
QString getParentName();
2023-09-09 14:33:13 +02:00
bool isATBQTRunning();
2024-12-20 13:01:34 +01:00
QVector<QPair<QString, QString>> installedPackages();
2025-01-10 14:19:43 +01:00
QVector<QPair<QString, QString>> installedJsonFiles(Worker const *worker, QDir const &customerDir);
QVector<QPair<QString, QString>> installedTariffFiles(Worker const *worker, QDir const &customerDir);
void finished(int exitCode, QProcess::ExitStatus exitStatus);
}
#endif // UTILS_H_INCLUDED