2020-03-04 16:55:40 +01:00
|
|
|
#ifndef UDISKS2API_H
|
|
|
|
#define UDISKS2API_H
|
|
|
|
|
|
|
|
/*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
2022-02-03 11:48:21 +01:00
|
|
|
* Copyright (C) 2020 Raspberry Pi Ltd
|
2020-03-04 16:55:40 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
#include <QFile>
|
2021-11-22 00:21:30 +01:00
|
|
|
|
|
|
|
class QDBusInterface;
|
2020-03-04 16:55:40 +01:00
|
|
|
|
|
|
|
class UDisks2Api : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
explicit UDisks2Api(QObject *parent = nullptr);
|
|
|
|
int authOpen(const QString &device, const QString &mode = "rw");
|
|
|
|
bool formatDrive(const QString &device, bool mountAfterwards = true);
|
2021-01-17 17:43:17 +01:00
|
|
|
QString mountDevice(const QString &device);
|
|
|
|
void unmountDrive(const QString &device);
|
2021-11-20 13:08:52 +01:00
|
|
|
QByteArrayList mountPoints(const QString &partitionDevice);
|
|
|
|
QByteArrayList mountPoints(const QDBusInterface &filesystem);
|
2020-03-04 16:55:40 +01:00
|
|
|
|
|
|
|
protected:
|
|
|
|
QString _resolveDevice(const QString &device);
|
|
|
|
void _unmountDrive(const QString &driveDbusPath);
|
|
|
|
|
|
|
|
signals:
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // UDISKS2API_H
|