2020-09-28 00:45:21 +01:00
|
|
|
/*
|
|
|
|
SPDX-FileCopyrightText: 2017 Pali Rohár <pali.rohar@gmail.com>
|
|
|
|
SPDX-FileCopyrightText: 2017 Andrius Štikonas <andrius@stikonas.eu>
|
|
|
|
SPDX-FileCopyrightText: 2020 Arnaud Ferraris <arnaud.ferraris@collabora.com>
|
|
|
|
SPDX-FileCopyrightText: 2020 Gaël PORTAY <gael.portay@collabora.com>
|
2019-06-12 17:41:11 +01:00
|
|
|
|
2020-09-28 00:45:21 +01:00
|
|
|
SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef KPMCORE_UDF_H
|
2017-09-10 20:12:52 +01:00
|
|
|
#define KPMCORE_UDF_H
|
2017-08-17 09:07:24 +01:00
|
|
|
|
|
|
|
#include "util/libpartitionmanagerexport.h"
|
|
|
|
|
|
|
|
#include "fs/filesystem.h"
|
|
|
|
|
2019-06-12 17:41:11 +01:00
|
|
|
#include <QtGlobal>
|
|
|
|
|
2017-08-17 09:07:24 +01:00
|
|
|
class Report;
|
|
|
|
|
2019-06-12 17:41:11 +01:00
|
|
|
class QString;
|
|
|
|
|
2017-08-17 09:07:24 +01:00
|
|
|
namespace FS
|
|
|
|
{
|
|
|
|
/** A udf file system.
|
|
|
|
@author Pali Rohár <pali.rohar@gmail.com>
|
|
|
|
*/
|
|
|
|
class LIBKPMCORE_EXPORT udf : public FileSystem
|
|
|
|
{
|
|
|
|
public:
|
2020-03-21 13:18:13 +00:00
|
|
|
udf(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {});
|
2017-08-17 09:07:24 +01:00
|
|
|
|
|
|
|
public:
|
|
|
|
void init() override;
|
|
|
|
|
2018-01-03 18:09:45 +00:00
|
|
|
qint64 readUsedCapacity(const QString& deviceNode) const override;
|
2017-08-17 09:07:24 +01:00
|
|
|
bool create(Report& report, const QString& deviceNode) override;
|
2017-08-18 12:45:15 +01:00
|
|
|
bool createWithLabel(Report& report, const QString& deviceNode, const QString& label) override;
|
2018-01-03 18:09:45 +00:00
|
|
|
bool writeLabel(Report& report, const QString& deviceNode, const QString& newLabel) override;
|
|
|
|
bool updateUUID(Report& report, const QString& deviceNode) const override;
|
2017-08-17 09:07:24 +01:00
|
|
|
|
2018-01-03 18:09:45 +00:00
|
|
|
CommandSupportType supportGetUsed() const override {
|
|
|
|
return m_GetUsed;
|
|
|
|
}
|
2017-08-17 09:07:24 +01:00
|
|
|
CommandSupportType supportGetLabel() const override {
|
|
|
|
return cmdSupportCore;
|
|
|
|
}
|
|
|
|
CommandSupportType supportCreate() const override {
|
|
|
|
return m_Create;
|
|
|
|
}
|
2017-08-18 12:45:15 +01:00
|
|
|
CommandSupportType supportCreateWithLabel() const override {
|
|
|
|
return m_Create;
|
|
|
|
}
|
2017-08-17 09:07:24 +01:00
|
|
|
CommandSupportType supportMove() const override {
|
|
|
|
return cmdSupportCore;
|
|
|
|
}
|
|
|
|
CommandSupportType supportCopy() const override {
|
|
|
|
return cmdSupportCore;
|
|
|
|
}
|
|
|
|
CommandSupportType supportBackup() const override {
|
|
|
|
return cmdSupportCore;
|
|
|
|
}
|
2018-01-03 18:09:45 +00:00
|
|
|
CommandSupportType supportSetLabel() const override {
|
|
|
|
return m_SetLabel;
|
|
|
|
}
|
|
|
|
CommandSupportType supportUpdateUUID() const override {
|
|
|
|
return m_UpdateUUID;
|
|
|
|
}
|
2017-08-17 09:07:24 +01:00
|
|
|
CommandSupportType supportGetUUID() const override {
|
|
|
|
return cmdSupportCore;
|
|
|
|
}
|
|
|
|
|
|
|
|
qint64 minCapacity() const override;
|
|
|
|
qint64 maxCapacity() const override;
|
2017-09-11 16:52:20 +01:00
|
|
|
int maxLabelLength() const override;
|
2017-09-05 13:39:09 +01:00
|
|
|
QValidator* labelValidator(QObject *parent = nullptr) const override;
|
2017-08-17 09:07:24 +01:00
|
|
|
SupportTool supportToolName() const override;
|
|
|
|
bool supportToolFound() const override;
|
|
|
|
|
|
|
|
public:
|
2018-01-03 18:09:45 +00:00
|
|
|
static CommandSupportType m_GetUsed;
|
|
|
|
static CommandSupportType m_SetLabel;
|
|
|
|
static CommandSupportType m_UpdateUUID;
|
2017-08-17 09:07:24 +01:00
|
|
|
static CommandSupportType m_Create;
|
2017-09-05 16:20:50 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
static bool oldMkudffsVersion;
|
2017-08-17 09:07:24 +01:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|