64 lines
1.8 KiB
C++
64 lines
1.8 KiB
C++
#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 std::optional<QString> checkForSDCard(QString const &dirPathUnderMountPath = ".");
|
|
static QString getUSBMountPath(QString const &dirPathUnderMountPath = ".");
|
|
static QString getSDMountPath(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);
|
|
static QString getDCFileOnUsbStick(QString const &mountPath);
|
|
static QString getDCFileOnSDCard(QString const &mountPath);
|
|
};
|
|
|
|
#endif // SYSTEM_H
|