2017-08-17 09:07:24 +01:00
|
|
|
/*************************************************************************
|
|
|
|
* Copyright (C) 2017 by Pali Rohár <pali.rohar@gmail.com> *
|
|
|
|
* *
|
|
|
|
* This program is free software; you can redistribute it and/or *
|
|
|
|
* modify it under the terms of the GNU General Public License as *
|
|
|
|
* published by the Free Software Foundation; either version 3 of *
|
|
|
|
* the License, or (at your option) any later version. *
|
|
|
|
* *
|
|
|
|
* This program is distributed in the hope that it will be useful, *
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
|
|
* GNU General Public License for more details. *
|
|
|
|
* *
|
|
|
|
* You should have received a copy of the GNU General Public License *
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.*
|
|
|
|
*************************************************************************/
|
|
|
|
|
2017-09-10 20:12:52 +01:00
|
|
|
#if !defined(KPMCORE_UDF_H)
|
2017-08-17 09:07:24 +01:00
|
|
|
|
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"
|
|
|
|
|
|
|
|
#include <QtGlobal>
|
|
|
|
|
|
|
|
class Report;
|
|
|
|
|
|
|
|
class QString;
|
|
|
|
|
|
|
|
namespace FS
|
|
|
|
{
|
|
|
|
/** A udf file system.
|
|
|
|
@author Pali Rohár <pali.rohar@gmail.com>
|
|
|
|
*/
|
|
|
|
class LIBKPMCORE_EXPORT udf : public FileSystem
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
udf(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label);
|
|
|
|
|
|
|
|
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
|