ATBUpdateTool/common/include/System.h

61 lines
1.5 KiB
C
Raw Permalink Normal View History

#ifndef SYSTEM_H
#define SYSTEM_H
#include <QObject>
#include <QStringList>
#include <optional>
#include <initializer_list>
class System : public QObject
{
Q_OBJECT
private:
explicit System(QObject *parent = 0);
static QString errorMsg;
public:
static const QStringList allowedJsonFiles;
static bool checkForSDCard();
static bool umountSDCard();
static std::optional<QString> checkForUSBStick(QString const &dirPathUnderMountPath = ".");
static QString getUSBMountPath(QString const &dirPathUnderMountPath = ".");
//static QString getUSBDeviceName();
static bool umountUSBStick();
static bool test_mount(const QString& dev, const QString &mountpoint);
static bool test_dir(const QString& dir);
static quint32 getFreeDiskSpace(const QString& dev);
static quint32 getFreeDiskSpaceSDCard();
static bool isSDCardWritable();
static quint32 getFreeDiskSpaceUSBStick();
static bool isUSBStickWritable();
static quint8 createLogFileBackup(const QString & targzfile, const QString &filelistfile = "");
static QString getSDCardMountPath();
static QString getSDCardDeviceName();
static QString getUniqueDeviceId();
static QString getErrorMessage();
static QString readStringFromFile(const QString & filename);
static int readIntFromFile(const QString & filename);
static QString getPTU4SerialNumber();
static QString getPTU4MACAddress();
static QStringList getJsonFilesOnUsbStick(QString const &mountPath);
};
#endif // SYSTEM_H