Merge branch 'gportay/kpmcore-update-filesystem-features-api'
This commit is contained in:
commit
a810d0d2fd
|
@ -11,7 +11,6 @@ set(FS_SRC
|
|||
fs/fat12.cpp
|
||||
fs/fat16.cpp
|
||||
fs/fat32.cpp
|
||||
fs/feature.cpp
|
||||
fs/filesystem.cpp
|
||||
fs/filesystemfactory.cpp
|
||||
fs/hfs.cpp
|
||||
|
@ -51,7 +50,6 @@ set(FS_LIB_HDRS
|
|||
fs/fat12.h
|
||||
fs/fat16.h
|
||||
fs/fat32.h
|
||||
fs/feature.h
|
||||
fs/filesystem.h
|
||||
fs/filesystemfactory.h
|
||||
fs/hfs.h
|
||||
|
|
|
@ -23,7 +23,7 @@ FileSystem::CommandSupportType apfs::m_Move = FileSystem::cmdSupportCore;
|
|||
FileSystem::CommandSupportType apfs::m_Copy = FileSystem::cmdSupportCore;
|
||||
FileSystem::CommandSupportType apfs::m_Backup = FileSystem::cmdSupportCore;
|
||||
|
||||
apfs::apfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QList<FSFeature>& features) :
|
||||
apfs::apfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features) :
|
||||
FileSystem(firstsector, lastsector, sectorsused, label, features, FileSystem::Type::Apfs)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ namespace FS
|
|||
class LIBKPMCORE_EXPORT apfs : public FileSystem
|
||||
{
|
||||
public:
|
||||
apfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QList<FSFeature>& features = {});
|
||||
apfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {});
|
||||
|
||||
public:
|
||||
CommandSupportType supportMove() const override {
|
||||
|
|
|
@ -23,7 +23,7 @@ FileSystem::CommandSupportType bitlocker::m_Move = FileSystem::cmdSupportCore;
|
|||
FileSystem::CommandSupportType bitlocker::m_Copy = FileSystem::cmdSupportCore;
|
||||
FileSystem::CommandSupportType bitlocker::m_Backup = FileSystem::cmdSupportCore;
|
||||
|
||||
bitlocker::bitlocker(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QList<FSFeature>& features) :
|
||||
bitlocker::bitlocker(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features) :
|
||||
FileSystem(firstsector, lastsector, sectorsused, label, features, FileSystem::Type::BitLocker)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ namespace FS
|
|||
class LIBKPMCORE_EXPORT bitlocker : public FileSystem
|
||||
{
|
||||
public:
|
||||
bitlocker(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QList<FSFeature>& features = {});
|
||||
bitlocker(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {});
|
||||
|
||||
public:
|
||||
CommandSupportType supportMove() const override {
|
||||
|
|
|
@ -43,7 +43,7 @@ FileSystem::CommandSupportType btrfs::m_SetLabel = FileSystem::cmdSupportNone;
|
|||
FileSystem::CommandSupportType btrfs::m_UpdateUUID = FileSystem::cmdSupportNone;
|
||||
FileSystem::CommandSupportType btrfs::m_GetUUID = FileSystem::cmdSupportNone;
|
||||
|
||||
btrfs::btrfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QList<FSFeature>& features) :
|
||||
btrfs::btrfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features) :
|
||||
FileSystem(firstsector, lastsector, sectorsused, label, features, FileSystem::Type::Btrfs)
|
||||
{
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ void btrfs::init()
|
|||
// First line is introductory text, we don't need it
|
||||
lines.removeFirst();
|
||||
|
||||
for (auto l : lines) {
|
||||
for (const auto& l: lines) {
|
||||
if (!l.isEmpty())
|
||||
addAvailableFeature(l.split(QStringLiteral(" ")).first());
|
||||
}
|
||||
|
@ -148,12 +148,15 @@ bool btrfs::create(Report& report, const QString& deviceNode)
|
|||
|
||||
if (!this->features().isEmpty()) {
|
||||
QStringList feature_list = QStringList();
|
||||
for (auto f : this->features()) {
|
||||
if (f.type() == FSFeature::Type::Bool) {
|
||||
if (f.bValue())
|
||||
feature_list << f.name();
|
||||
else
|
||||
feature_list << (QStringLiteral("^") + f.name());
|
||||
for (const auto& k : this->features().keys()) {
|
||||
const auto& v = this->features().value(k);
|
||||
if (v.type() == QVariant::Type::Bool) {
|
||||
if (v.toBool())
|
||||
feature_list << k;
|
||||
else
|
||||
feature_list << (QStringLiteral("^") + k);
|
||||
} else {
|
||||
qWarning() << "Ignoring feature" << k << "of type" << v.type() << "; requires type QVariant::bool.";
|
||||
}
|
||||
}
|
||||
args << QStringLiteral("--features") << feature_list.join(QStringLiteral(","));
|
||||
|
|
|
@ -38,7 +38,7 @@ namespace FS
|
|||
class LIBKPMCORE_EXPORT btrfs : public FileSystem
|
||||
{
|
||||
public:
|
||||
btrfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QList<FSFeature>& features = {});
|
||||
btrfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {});
|
||||
|
||||
public:
|
||||
void init() override;
|
||||
|
|
|
@ -38,7 +38,7 @@ FileSystem::CommandSupportType exfat::m_SetLabel = FileSystem::cmdSupportNone;
|
|||
FileSystem::CommandSupportType exfat::m_UpdateUUID = FileSystem::cmdSupportNone;
|
||||
FileSystem::CommandSupportType exfat::m_GetUUID = FileSystem::cmdSupportNone;
|
||||
|
||||
exfat::exfat(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QList<FSFeature>& features) :
|
||||
exfat::exfat(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features) :
|
||||
FileSystem(firstsector, lastsector, sectorsused, label, features, FileSystem::Type::Exfat)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ namespace FS
|
|||
class LIBKPMCORE_EXPORT exfat : public FileSystem
|
||||
{
|
||||
public:
|
||||
exfat(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QList<FSFeature>& features = {});
|
||||
exfat(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {});
|
||||
|
||||
public:
|
||||
void init() override;
|
||||
|
|
|
@ -39,7 +39,7 @@ FileSystem::CommandSupportType ext2::m_SetLabel = FileSystem::cmdSupportNone;
|
|||
FileSystem::CommandSupportType ext2::m_UpdateUUID = FileSystem::cmdSupportNone;
|
||||
FileSystem::CommandSupportType ext2::m_GetUUID = FileSystem::cmdSupportNone;
|
||||
|
||||
ext2::ext2(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QList<FSFeature>& features, FileSystem::Type t) :
|
||||
ext2::ext2(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features, FileSystem::Type t) :
|
||||
FileSystem(firstsector, lastsector, sectorsused, label, features, t)
|
||||
{
|
||||
}
|
||||
|
@ -168,12 +168,15 @@ bool ext2::create(Report& report, const QString& deviceNode)
|
|||
|
||||
if (!this->features().isEmpty()) {
|
||||
QStringList feature_list = QStringList();
|
||||
for (auto f : this->features()) {
|
||||
if (f.type() == FSFeature::Type::Bool) {
|
||||
if (f.bValue())
|
||||
feature_list << f.name();
|
||||
else
|
||||
feature_list << (QStringLiteral("^") + f.name());
|
||||
for (const auto& k : this->features().keys()) {
|
||||
const auto& v = this->features().value(k);
|
||||
if (v.type() == QVariant::Type::Bool) {
|
||||
if (v.toBool())
|
||||
feature_list << k;
|
||||
else
|
||||
feature_list << (QStringLiteral("^") + k);
|
||||
} else {
|
||||
qWarning() << "Ignoring feature" << k << "of type" << v.type() << "; requires type QVariant::bool.";
|
||||
}
|
||||
}
|
||||
args << QStringLiteral("-O") << feature_list.join(QStringLiteral(","));
|
||||
|
|
|
@ -37,7 +37,7 @@ namespace FS
|
|||
class LIBKPMCORE_EXPORT ext2 : public FileSystem
|
||||
{
|
||||
public:
|
||||
ext2(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QList<FSFeature>& features = {}, FileSystem::Type t = FileSystem::Type::Ext2);
|
||||
ext2(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {}, FileSystem::Type t = FileSystem::Type::Ext2);
|
||||
|
||||
public:
|
||||
void init() override;
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
namespace FS
|
||||
{
|
||||
ext3::ext3(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QList<FSFeature>& features) :
|
||||
ext3::ext3(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features) :
|
||||
ext2(firstsector, lastsector, sectorsused, label, features, FileSystem::Type::Ext3)
|
||||
{
|
||||
}
|
||||
|
@ -40,12 +40,15 @@ bool ext3::create(Report& report, const QString& deviceNode)
|
|||
|
||||
if (!this->features().isEmpty()) {
|
||||
QStringList feature_list = QStringList();
|
||||
for (auto f : this->features()) {
|
||||
if (f.type() == FSFeature::Type::Bool) {
|
||||
if (f.bValue())
|
||||
feature_list << f.name();
|
||||
else
|
||||
feature_list << (QStringLiteral("^") + f.name());
|
||||
for (const auto& k : this->features().keys()) {
|
||||
const auto& v = this->features().value(k);
|
||||
if (v.type() == QVariant::Type::Bool) {
|
||||
if (v.toBool())
|
||||
feature_list << k;
|
||||
else
|
||||
feature_list << (QStringLiteral("^") + k);
|
||||
} else {
|
||||
qWarning() << "Ignoring feature" << k << "of type" << v.type() << "; requires type QVariant::bool.";
|
||||
}
|
||||
}
|
||||
args << QStringLiteral("-O") << feature_list.join(QStringLiteral(","));
|
||||
|
|
|
@ -40,7 +40,7 @@ namespace FS
|
|||
class LIBKPMCORE_EXPORT ext3 : public ext2
|
||||
{
|
||||
public:
|
||||
ext3(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QList<FSFeature>& features = {});
|
||||
ext3(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {});
|
||||
|
||||
public:
|
||||
bool create(Report& report, const QString& deviceNode) override;
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
namespace FS
|
||||
{
|
||||
ext4::ext4(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QList<FSFeature>& features) :
|
||||
ext4::ext4(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features) :
|
||||
ext2(firstsector, lastsector, sectorsused, label, features, FileSystem::Type::Ext4)
|
||||
{
|
||||
}
|
||||
|
@ -40,12 +40,15 @@ bool ext4::create(Report& report, const QString& deviceNode)
|
|||
|
||||
if (!this->features().isEmpty()) {
|
||||
QStringList feature_list = QStringList();
|
||||
for (auto f : this->features()) {
|
||||
if (f.type() == FSFeature::Type::Bool) {
|
||||
if (f.bValue())
|
||||
feature_list << f.name();
|
||||
else
|
||||
feature_list << (QStringLiteral("^") + f.name());
|
||||
for (const auto& k : this->features().keys()) {
|
||||
const auto& v = this->features().value(k);
|
||||
if (v.type() == QVariant::Type::Bool) {
|
||||
if (v.toBool())
|
||||
feature_list << k;
|
||||
else
|
||||
feature_list << (QStringLiteral("^") + k);
|
||||
} else {
|
||||
qWarning() << "Ignoring feature" << k << "of type" << v.type() << "; requires type QVariant::bool.";
|
||||
}
|
||||
}
|
||||
args << QStringLiteral("-O") << feature_list.join(QStringLiteral(","));
|
||||
|
|
|
@ -40,7 +40,7 @@ namespace FS
|
|||
class LIBKPMCORE_EXPORT ext4 : public ext2
|
||||
{
|
||||
public:
|
||||
ext4(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QList<FSFeature>& features = {});
|
||||
ext4(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {});
|
||||
|
||||
public:
|
||||
bool create(Report& report, const QString& deviceNode) override;
|
||||
|
|
|
@ -24,7 +24,7 @@ FileSystem::CommandSupportType extended::m_Grow = FileSystem::cmdSupportCore;
|
|||
FileSystem::CommandSupportType extended::m_Shrink = FileSystem::cmdSupportCore;
|
||||
FileSystem::CommandSupportType extended::m_Move = FileSystem::cmdSupportCore;
|
||||
|
||||
extended::extended(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QList<FSFeature>& features) :
|
||||
extended::extended(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features) :
|
||||
FileSystem(firstsector, lastsector, sectorsused, label, features, FileSystem::Type::Extended)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ namespace FS
|
|||
class LIBKPMCORE_EXPORT extended : public FileSystem
|
||||
{
|
||||
public:
|
||||
extended(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QList<FSFeature>& features = {});
|
||||
extended(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {});
|
||||
|
||||
public:
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ FileSystem::CommandSupportType f2fs::m_UpdateUUID = FileSystem::cmdSupportNone;
|
|||
FileSystem::CommandSupportType f2fs::m_GetUUID = FileSystem::cmdSupportNone;
|
||||
bool f2fs::oldVersion = false; // 1.8.x or older
|
||||
|
||||
f2fs::f2fs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QList<FSFeature>& features) :
|
||||
f2fs::f2fs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features) :
|
||||
FileSystem(firstsector, lastsector, sectorsused, label, features, FileSystem::Type::F2fs)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ namespace FS
|
|||
class LIBKPMCORE_EXPORT f2fs : public FileSystem
|
||||
{
|
||||
public:
|
||||
f2fs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QList<FSFeature>& features = {});
|
||||
f2fs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {});
|
||||
|
||||
public:
|
||||
void init() override;
|
||||
|
|
|
@ -49,7 +49,7 @@ FileSystem::CommandSupportType fat12::m_Backup = FileSystem::cmdSupportNone;
|
|||
FileSystem::CommandSupportType fat12::m_UpdateUUID = FileSystem::cmdSupportNone;
|
||||
FileSystem::CommandSupportType fat12::m_GetUUID = FileSystem::cmdSupportNone;
|
||||
|
||||
fat12::fat12(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QList<FSFeature>& features, FileSystem::Type t) :
|
||||
fat12::fat12(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features, FileSystem::Type t) :
|
||||
FileSystem(firstsector, lastsector, sectorsused, label, features, t)
|
||||
{
|
||||
}
|
||||
|
@ -66,8 +66,8 @@ void fat12::init()
|
|||
m_GetUUID = cmdSupportCore;
|
||||
|
||||
if (m_Create == cmdSupportFileSystem) {
|
||||
addAvailableFeature(QStringLiteral("sector-size"), FSFeature::Type::Int);
|
||||
addAvailableFeature(QStringLiteral("sectors-per-cluster"), FSFeature::Type::Int);
|
||||
addAvailableFeature(QStringLiteral("sector-size"));
|
||||
addAvailableFeature(QStringLiteral("sectors-per-cluster"));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -169,17 +169,18 @@ bool fat12::createWithFatSize(Report &report, const QString& deviceNode, int fat
|
|||
if (fatSize != 12 && fatSize != 16 && fatSize != 32)
|
||||
return false;
|
||||
|
||||
for (auto f : this->features()) {
|
||||
if (f.name() == QStringLiteral("sector-size")) {
|
||||
quint32 sectorSize = f.iValue();
|
||||
for (const auto& k : this->features().keys()) {
|
||||
const auto& v = this->features().value(k);
|
||||
if (k == QStringLiteral("sector-size")) {
|
||||
quint32 sectorSize = v.toInt();
|
||||
|
||||
/* sectorSize has to be a power of 2 between 512 and 32768 */
|
||||
if (sectorSize >= 512 && sectorSize <= 32768 && sectorSize == qNextPowerOfTwo(sectorSize - 1))
|
||||
args << QStringLiteral("-S%1").arg(sectorSize);
|
||||
else
|
||||
qWarning() << QStringLiteral("FAT sector size %1 is invalid, using default").arg(sectorSize);
|
||||
} else if (f.name() == QStringLiteral("sectors-per-cluster")) {
|
||||
quint32 sectorsPerCluster = f.iValue();
|
||||
} else if (k == QStringLiteral("sectors-per-cluster")) {
|
||||
quint32 sectorsPerCluster = v.toInt();
|
||||
|
||||
/* sectorsPerCluster has to be a power of 2 between 2 and 128 */
|
||||
if (sectorsPerCluster <= 128 && sectorsPerCluster == qNextPowerOfTwo(sectorsPerCluster - 1))
|
||||
|
|
|
@ -37,7 +37,7 @@ namespace FS
|
|||
class LIBKPMCORE_EXPORT fat12 : public FileSystem
|
||||
{
|
||||
public:
|
||||
fat12(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QList<FSFeature>& features = {}, FileSystem::Type t = FileSystem::Type::Fat12);
|
||||
fat12(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {}, FileSystem::Type t = FileSystem::Type::Fat12);
|
||||
|
||||
public:
|
||||
void init() override;
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
|
||||
namespace FS
|
||||
{
|
||||
fat16::fat16(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QList<FSFeature>& features, FileSystem::Type type) :
|
||||
fat16::fat16(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features, FileSystem::Type type) :
|
||||
fat12(firstsector, lastsector, sectorsused, label, features, type)
|
||||
{
|
||||
}
|
||||
|
@ -50,8 +50,8 @@ void fat16::init()
|
|||
m_GetUUID = cmdSupportCore;
|
||||
|
||||
if (m_Create == cmdSupportFileSystem) {
|
||||
addAvailableFeature(QStringLiteral("sector-size"), FSFeature::Type::Int);
|
||||
addAvailableFeature(QStringLiteral("sectors-per-cluster"), FSFeature::Type::Int);
|
||||
addAvailableFeature(QStringLiteral("sector-size"));
|
||||
addAvailableFeature(QStringLiteral("sectors-per-cluster"));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ namespace FS
|
|||
class LIBKPMCORE_EXPORT fat16 : public fat12
|
||||
{
|
||||
public:
|
||||
fat16(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QList<FSFeature>& features = {}, FileSystem::Type type = FileSystem::Type::Fat16);
|
||||
fat16(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {}, FileSystem::Type type = FileSystem::Type::Fat16);
|
||||
|
||||
public:
|
||||
void init() override;
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
namespace FS
|
||||
{
|
||||
fat32::fat32(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QList<FSFeature>& features) :
|
||||
fat32::fat32(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features) :
|
||||
fat16(firstsector, lastsector, sectorsused, label, features, FileSystem::Type::Fat32)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ namespace FS
|
|||
class LIBKPMCORE_EXPORT fat32 : public fat16
|
||||
{
|
||||
public:
|
||||
fat32(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QList<FSFeature>& features = {});
|
||||
fat32(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {});
|
||||
|
||||
public:
|
||||
bool create(Report& report, const QString& deviceNode) override;
|
||||
|
|
|
@ -1,126 +0,0 @@
|
|||
/*************************************************************************
|
||||
* Copyright (C) 2019 by Collabora Ltd <arnaud.ferraris@collabora.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/>.*
|
||||
*************************************************************************/
|
||||
|
||||
#include "fs/filesystem.h"
|
||||
|
||||
struct FSFeaturePrivate {
|
||||
QString m_name;
|
||||
FSFeature::Type m_type;
|
||||
bool m_boolean;
|
||||
int m_integer;
|
||||
QString m_string;
|
||||
};
|
||||
|
||||
FSFeature::FSFeature(const QString& n, FSFeature::Type t) :
|
||||
d(std::make_unique<FSFeaturePrivate>())
|
||||
{
|
||||
d->m_name = n;
|
||||
d->m_type = t;
|
||||
}
|
||||
|
||||
FSFeature::FSFeature(const QString& n, bool b) :
|
||||
d(std::make_unique<FSFeaturePrivate>())
|
||||
{
|
||||
d->m_name = n;
|
||||
d->m_type = FSFeature::Type::Bool;
|
||||
d->m_boolean = b;
|
||||
}
|
||||
|
||||
FSFeature::FSFeature(const QString& n, int i) :
|
||||
d(std::make_unique<FSFeaturePrivate>())
|
||||
{
|
||||
d->m_name = n;
|
||||
d->m_type = FSFeature::Type::Int;
|
||||
d->m_integer = i;
|
||||
}
|
||||
|
||||
FSFeature::FSFeature(const QString& n, const QString& s) :
|
||||
d(std::make_unique<FSFeaturePrivate>())
|
||||
{
|
||||
d->m_name = n;
|
||||
d->m_type = FSFeature::Type::String;
|
||||
d->m_string = s;
|
||||
}
|
||||
|
||||
FSFeature::FSFeature(const FSFeature& other) :
|
||||
d(std::make_unique<FSFeaturePrivate>(*(other.d)))
|
||||
{
|
||||
}
|
||||
|
||||
FSFeature::~FSFeature()
|
||||
{
|
||||
}
|
||||
|
||||
FSFeature& FSFeature::operator=(const FSFeature& other)
|
||||
{
|
||||
if (&other != this)
|
||||
*d = *(other.d);
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
const QString& FSFeature::name()
|
||||
{
|
||||
return d->m_name;
|
||||
}
|
||||
|
||||
FSFeature::Type FSFeature::type()
|
||||
{
|
||||
return d->m_type;
|
||||
}
|
||||
|
||||
bool FSFeature::bValue()
|
||||
{
|
||||
return d->m_boolean;
|
||||
}
|
||||
|
||||
int FSFeature::iValue()
|
||||
{
|
||||
return d->m_integer;
|
||||
}
|
||||
|
||||
const QString& FSFeature::sValue()
|
||||
{
|
||||
return d->m_string;
|
||||
}
|
||||
|
||||
bool FSFeature::setValue(bool b)
|
||||
{
|
||||
if (d->m_type != FSFeature::Type::Bool)
|
||||
return false;
|
||||
|
||||
d->m_boolean = b;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool FSFeature::setValue(int i)
|
||||
{
|
||||
if (d->m_type != FSFeature::Type::Int)
|
||||
return false;
|
||||
|
||||
d->m_integer = i;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool FSFeature::setValue(const QString& s)
|
||||
{
|
||||
if (d->m_type != FSFeature::Type::String)
|
||||
return false;
|
||||
|
||||
d->m_string = s;
|
||||
return true;
|
||||
}
|
|
@ -1,77 +0,0 @@
|
|||
/*************************************************************************
|
||||
* Copyright (C) 2019 by Collabora Ltd <arnaud.ferraris@collabora.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/>.*
|
||||
*************************************************************************/
|
||||
|
||||
#ifndef KPMCORE_FSFEATURE_H
|
||||
#define KPMCORE_FSFEATURE_H
|
||||
|
||||
#include "util/libpartitionmanagerexport.h"
|
||||
|
||||
#include <QString>
|
||||
|
||||
#include <memory>
|
||||
|
||||
struct FSFeaturePrivate;
|
||||
|
||||
/**
|
||||
* Class for filesystem-specific features
|
||||
*
|
||||
* FSFeatures have a name, type (boolean, integer or string) and value.
|
||||
* This class can be used to describe specific features for any FileSystem, but it
|
||||
* is up to each FileSystem implementation to handle them as needed.
|
||||
*/
|
||||
class LIBKPMCORE_EXPORT FSFeature
|
||||
{
|
||||
public:
|
||||
enum Type : int {
|
||||
Bool,
|
||||
Int,
|
||||
String
|
||||
};
|
||||
|
||||
public:
|
||||
FSFeature(const QString& n, Type t = Type::Bool);
|
||||
FSFeature(const QString& n, bool b);
|
||||
FSFeature(const QString& n, int i);
|
||||
FSFeature(const QString& n, const QString& s);
|
||||
FSFeature(const FSFeature& f);
|
||||
~FSFeature();
|
||||
|
||||
FSFeature& operator=(const FSFeature& f);
|
||||
|
||||
Type type();
|
||||
const QString& name();
|
||||
|
||||
/**< @return the value of a boolean FSFeature ; feature type is NOT checked */
|
||||
bool bValue();
|
||||
/**< @return the value of an integer FSFeature ; feature type is NOT checked */
|
||||
int iValue();
|
||||
/**< @return the value of a string FSFeature ; feature type is NOT checked */
|
||||
const QString& sValue();
|
||||
|
||||
/**
|
||||
* Set feature value
|
||||
* @return false if the feature is of the wrong type
|
||||
*/
|
||||
bool setValue(bool b);
|
||||
bool setValue(int i);
|
||||
bool setValue(const QString& s);
|
||||
|
||||
private:
|
||||
std::unique_ptr<FSFeaturePrivate> d;
|
||||
};
|
||||
|
||||
#endif
|
|
@ -84,8 +84,8 @@ struct FileSystemPrivate {
|
|||
qint64 m_SectorsUsed;
|
||||
QString m_Label;
|
||||
QString m_UUID;
|
||||
QList<FSFeature> m_AvailableFeatures;
|
||||
QList<FSFeature> m_Features;
|
||||
QStringList m_AvailableFeatures;
|
||||
QVariantMap m_Features;
|
||||
};
|
||||
|
||||
/** Creates a new FileSystem object
|
||||
|
@ -114,7 +114,7 @@ FileSystem::FileSystem(qint64 firstsector, qint64 lastsector, qint64 sectorsused
|
|||
@param features the FileSystem features
|
||||
@param type the FileSystem type
|
||||
*/
|
||||
FileSystem::FileSystem(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QList<FSFeature>& features, FileSystem::Type type) :
|
||||
FileSystem::FileSystem(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features, FileSystem::Type type) :
|
||||
d(std::make_unique<FileSystemPrivate>())
|
||||
{
|
||||
d->m_Type = type;
|
||||
|
@ -604,24 +604,21 @@ bool FileSystem::findExternal(const QString& cmdName, const QStringList& args, i
|
|||
return cmd.exitCode() == 0 || cmd.exitCode() == expectedCode;
|
||||
}
|
||||
|
||||
void FileSystem::addAvailableFeature(const FSFeature& feature)
|
||||
void FileSystem::addAvailableFeature(const QString& name)
|
||||
{
|
||||
d->m_AvailableFeatures.append(feature);
|
||||
d->m_AvailableFeatures.append(name);
|
||||
}
|
||||
|
||||
void FileSystem::addAvailableFeature(const QString& name, FSFeature::Type type)
|
||||
void FileSystem::addFeature(const QString& name, const QVariant& value)
|
||||
{
|
||||
d->m_AvailableFeatures.append(FSFeature(name, type));
|
||||
d->m_Features.insert(name, value);
|
||||
}
|
||||
|
||||
void FileSystem::addFeature(const FSFeature& feature)
|
||||
void FileSystem::addFeatures(const QVariantMap& features)
|
||||
{
|
||||
d->m_Features.append(feature);
|
||||
}
|
||||
|
||||
void FileSystem::addFeatures(const QList<FSFeature>& features)
|
||||
{
|
||||
d->m_Features.append(features);
|
||||
for (const auto& k : features.keys()) {
|
||||
d->m_Features.insert(k, features.value(k));
|
||||
}
|
||||
}
|
||||
|
||||
bool FileSystem::supportToolFound() const
|
||||
|
@ -649,12 +646,12 @@ const QString& FileSystem::label() const
|
|||
return d->m_Label;
|
||||
}
|
||||
|
||||
const QList<FSFeature>& FileSystem::availableFeatures() const
|
||||
const QStringList& FileSystem::availableFeatures() const
|
||||
{
|
||||
return d->m_AvailableFeatures;
|
||||
}
|
||||
|
||||
const QList<FSFeature>& FileSystem::features() const
|
||||
const QVariantMap& FileSystem::features() const
|
||||
{
|
||||
return d->m_Features;
|
||||
}
|
||||
|
|
|
@ -23,8 +23,7 @@
|
|||
|
||||
#include "util/libpartitionmanagerexport.h"
|
||||
|
||||
#include "fs/feature.h"
|
||||
|
||||
#include <QVariant>
|
||||
#include <QList>
|
||||
#include <QStringList>
|
||||
#include <QString>
|
||||
|
@ -116,7 +115,7 @@ public:
|
|||
|
||||
protected:
|
||||
FileSystem(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, FileSystem::Type type);
|
||||
FileSystem(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QList<FSFeature>& features, FileSystem::Type type);
|
||||
FileSystem(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features, FileSystem::Type type);
|
||||
|
||||
public:
|
||||
virtual ~FileSystem();
|
||||
|
@ -271,16 +270,17 @@ public:
|
|||
const QString& label() const;
|
||||
|
||||
/**< @return the FileSystem's available features */
|
||||
const QList<FSFeature>& availableFeatures() const;
|
||||
const QStringList& availableFeatures() const;
|
||||
|
||||
/**< @return the FileSystem's features */
|
||||
const QList<FSFeature>& features() const;
|
||||
const QVariantMap& features() const;
|
||||
|
||||
/**< @param feature the feature to add to the FileSystem */
|
||||
void addFeature(const FSFeature& feature);
|
||||
/**< @param the feature's name to add to the FileSystem */
|
||||
/**< @param the feature's value to add to the FileSystem */
|
||||
void addFeature(const QString& name, const QVariant& value);
|
||||
|
||||
/**< @param features the list of features to add to the FileSystem */
|
||||
void addFeatures(const QList<FSFeature>& features);
|
||||
void addFeatures(const QVariantMap& features);
|
||||
|
||||
/**< @return the sector size in the underlying Device */
|
||||
qint64 sectorSize() const;
|
||||
|
@ -305,8 +305,7 @@ public:
|
|||
|
||||
protected:
|
||||
static bool findExternal(const QString& cmdName, const QStringList& args = QStringList(), int exptectedCode = 1);
|
||||
void addAvailableFeature(const FSFeature& feature);
|
||||
void addAvailableFeature(const QString& name, FSFeature::Type type = FSFeature::Type::Bool);
|
||||
void addAvailableFeature(const QString& name);
|
||||
|
||||
std::unique_ptr<FileSystemPrivate> d;
|
||||
};
|
||||
|
|
|
@ -116,7 +116,7 @@ void FileSystemFactory::init()
|
|||
@param label the FileSystem's label
|
||||
@return pointer to the newly created FileSystem object or nullptr if FileSystem could not be created
|
||||
*/
|
||||
FileSystem* FileSystemFactory::create(FileSystem::Type t, qint64 firstsector, qint64 lastsector, qint64 sectorSize, qint64 sectorsused, const QString& label, const QList<FSFeature>& features, const QString& uuid)
|
||||
FileSystem* FileSystemFactory::create(FileSystem::Type t, qint64 firstsector, qint64 lastsector, qint64 sectorSize, qint64 sectorsused, const QString& label, const QVariantMap& features, const QString& uuid)
|
||||
{
|
||||
FileSystem* fs = nullptr;
|
||||
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
#ifndef KPMCORE_FILESYSTEMFACTORY_H
|
||||
#define KPMCORE_FILESYSTEMFACTORY_H
|
||||
|
||||
#include "fs/feature.h"
|
||||
#include "fs/filesystem.h"
|
||||
|
||||
#include "util/libpartitionmanagerexport.h"
|
||||
|
@ -42,7 +41,7 @@ private:
|
|||
|
||||
public:
|
||||
static void init();
|
||||
static FileSystem* create(FileSystem::Type t, qint64 firstsector, qint64 lastsector, qint64 sectorSize, qint64 sectorsused = -1, const QString& label = QString(), const QList<FSFeature>& features = {}, const QString& uuid = QString());
|
||||
static FileSystem* create(FileSystem::Type t, qint64 firstsector, qint64 lastsector, qint64 sectorSize, qint64 sectorsused = -1, const QString& label = QString(), const QVariantMap& features = {}, const QString& uuid = QString());
|
||||
static FileSystem* create(const FileSystem& other);
|
||||
static FileSystem* cloneWithNewType(FileSystem::Type newType, const FileSystem& other);
|
||||
static const FileSystems& map();
|
||||
|
|
|
@ -34,7 +34,7 @@ FileSystem::CommandSupportType hfs::m_Check = FileSystem::cmdSupportNone;
|
|||
FileSystem::CommandSupportType hfs::m_Copy = FileSystem::cmdSupportNone;
|
||||
FileSystem::CommandSupportType hfs::m_Backup = FileSystem::cmdSupportNone;
|
||||
|
||||
hfs::hfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QList<FSFeature>& features) :
|
||||
hfs::hfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features) :
|
||||
FileSystem(firstsector, lastsector, sectorsused, label, features, FileSystem::Type::Hfs)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ namespace FS
|
|||
class LIBKPMCORE_EXPORT hfs : public FileSystem
|
||||
{
|
||||
public:
|
||||
hfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QList<FSFeature>& features = {});
|
||||
hfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {});
|
||||
|
||||
public:
|
||||
void init() override;
|
||||
|
|
|
@ -34,7 +34,7 @@ FileSystem::CommandSupportType hfsplus::m_Create = FileSystem::cmdSupportNone;
|
|||
FileSystem::CommandSupportType hfsplus::m_Copy = FileSystem::cmdSupportNone;
|
||||
FileSystem::CommandSupportType hfsplus::m_Backup = FileSystem::cmdSupportNone;
|
||||
|
||||
hfsplus::hfsplus(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QList<FSFeature>& features) :
|
||||
hfsplus::hfsplus(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features) :
|
||||
FileSystem(firstsector, lastsector, sectorsused, label, features, FileSystem::Type::HfsPlus)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ namespace FS
|
|||
class LIBKPMCORE_EXPORT hfsplus : public FileSystem
|
||||
{
|
||||
public:
|
||||
hfsplus(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QList<FSFeature>& features = {});
|
||||
hfsplus(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {});
|
||||
|
||||
public:
|
||||
void init() override;
|
||||
|
|
|
@ -36,7 +36,7 @@ FileSystem::CommandSupportType hpfs::m_SetLabel = FileSystem::cmdSupportNone;
|
|||
FileSystem::CommandSupportType hpfs::m_UpdateUUID = FileSystem::cmdSupportNone;
|
||||
FileSystem::CommandSupportType hpfs::m_GetUUID = FileSystem::cmdSupportNone;
|
||||
|
||||
hpfs::hpfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QList<FSFeature>& features) :
|
||||
hpfs::hpfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features) :
|
||||
FileSystem(firstsector, lastsector, sectorsused, label, features, FileSystem::Type::Hpfs)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ namespace FS
|
|||
class LIBKPMCORE_EXPORT hpfs : public FileSystem
|
||||
{
|
||||
public:
|
||||
hpfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QList<FSFeature>& features = {});
|
||||
hpfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {});
|
||||
|
||||
public:
|
||||
CommandSupportType supportGetUsed() const override {
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
namespace FS
|
||||
{
|
||||
|
||||
iso9660::iso9660(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QList<FSFeature>& features) :
|
||||
iso9660::iso9660(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features) :
|
||||
FileSystem(firstsector, lastsector, sectorsused, label, features, FileSystem::Type::Iso9660)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ namespace FS
|
|||
class LIBKPMCORE_EXPORT iso9660 : public FileSystem
|
||||
{
|
||||
public:
|
||||
iso9660(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QList<FSFeature>& features = {});
|
||||
iso9660(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {});
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ FileSystem::CommandSupportType jfs::m_Copy = FileSystem::cmdSupportNone;
|
|||
FileSystem::CommandSupportType jfs::m_Backup = FileSystem::cmdSupportNone;
|
||||
FileSystem::CommandSupportType jfs::m_SetLabel = FileSystem::cmdSupportNone;
|
||||
|
||||
jfs::jfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QList<FSFeature>& features) :
|
||||
jfs::jfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features) :
|
||||
FileSystem(firstsector, lastsector, sectorsused, label, features, FileSystem::Type::Jfs)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ namespace FS
|
|||
class LIBKPMCORE_EXPORT jfs : public FileSystem
|
||||
{
|
||||
public:
|
||||
jfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QList<FSFeature>& features = {});
|
||||
jfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {});
|
||||
|
||||
public:
|
||||
void init() override;
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
namespace FS
|
||||
{
|
||||
|
||||
linuxraidmember::linuxraidmember(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QList<FSFeature>& features) :
|
||||
linuxraidmember::linuxraidmember(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features) :
|
||||
FileSystem(firstsector, lastsector, sectorsused, label, features, FileSystem::Type::LinuxRaidMember)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ namespace FS
|
|||
class LIBKPMCORE_EXPORT linuxraidmember : public FileSystem
|
||||
{
|
||||
public:
|
||||
linuxraidmember(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QList<FSFeature>& features = {});
|
||||
linuxraidmember(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {});
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ FileSystem::CommandSupportType linuxswap::m_SetLabel = FileSystem::cmdSupportNon
|
|||
FileSystem::CommandSupportType linuxswap::m_GetUUID = FileSystem::cmdSupportNone;
|
||||
FileSystem::CommandSupportType linuxswap::m_UpdateUUID = FileSystem::cmdSupportNone;
|
||||
|
||||
linuxswap::linuxswap(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QList<FSFeature>& features) :
|
||||
linuxswap::linuxswap(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features) :
|
||||
FileSystem(firstsector, lastsector, sectorsused, label, features, FileSystem::Type::LinuxSwap)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ namespace FS
|
|||
class LIBKPMCORE_EXPORT linuxswap : public FileSystem
|
||||
{
|
||||
public:
|
||||
linuxswap(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QList<FSFeature>& features = {});
|
||||
linuxswap(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {});
|
||||
|
||||
public:
|
||||
void init() override;
|
||||
|
|
|
@ -63,7 +63,7 @@ luks::luks(qint64 firstsector,
|
|||
qint64 lastsector,
|
||||
qint64 sectorsused,
|
||||
const QString& label,
|
||||
const QList<FSFeature>& features,
|
||||
const QVariantMap& features,
|
||||
FileSystem::Type t)
|
||||
: FileSystem(firstsector, lastsector, sectorsused, label, features, t)
|
||||
, m_innerFs(nullptr)
|
||||
|
|
|
@ -39,7 +39,7 @@ namespace FS
|
|||
class LIBKPMCORE_EXPORT luks : public FileSystem
|
||||
{
|
||||
public:
|
||||
luks(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QList<FSFeature>& features = {}, FileSystem::Type t = FileSystem::Type::Luks);
|
||||
luks(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {}, FileSystem::Type t = FileSystem::Type::Luks);
|
||||
~luks() override;
|
||||
|
||||
enum class KeyLocation {
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
namespace FS
|
||||
{
|
||||
|
||||
luks2::luks2(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QList<FSFeature>& features)
|
||||
luks2::luks2(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features)
|
||||
: luks(firstsector, lastsector, sectorsused, label, features, FileSystem::Type::Luks2)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ namespace FS
|
|||
class LIBKPMCORE_EXPORT luks2 : public luks
|
||||
{
|
||||
public:
|
||||
luks2(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QList<FSFeature>& features = {});
|
||||
luks2(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {});
|
||||
~luks2() override;
|
||||
|
||||
bool create(Report& report, const QString& deviceNode) override;
|
||||
|
|
|
@ -42,7 +42,7 @@ FileSystem::CommandSupportType lvm2_pv::m_UpdateUUID = FileSystem::cmdSupportNon
|
|||
FileSystem::CommandSupportType lvm2_pv::m_GetUUID = FileSystem::cmdSupportNone;
|
||||
|
||||
lvm2_pv::lvm2_pv(qint64 firstsector, qint64 lastsector,
|
||||
qint64 sectorsused, const QString& label, const QList<FSFeature>& features)
|
||||
qint64 sectorsused, const QString& label, const QVariantMap& features)
|
||||
: FileSystem(firstsector, lastsector, sectorsused, label, features, FileSystem::Type::Lvm2_PV)
|
||||
, m_PESize(0)
|
||||
, m_TotalPE(0)
|
||||
|
|
|
@ -89,7 +89,7 @@ class LIBKPMCORE_EXPORT lvm2_pv : public FileSystem
|
|||
{
|
||||
|
||||
public:
|
||||
lvm2_pv(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QList<FSFeature>& features = {});
|
||||
lvm2_pv(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {});
|
||||
|
||||
public:
|
||||
void init() override;
|
||||
|
|
|
@ -33,7 +33,7 @@ FileSystem::CommandSupportType minix::m_Create = FileSystem::cmdSupportNone;
|
|||
FileSystem::CommandSupportType minix::m_Copy = FileSystem::cmdSupportNone;
|
||||
FileSystem::CommandSupportType minix::m_Backup = FileSystem::cmdSupportNone;
|
||||
|
||||
minix::minix(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QList<FSFeature>& features) :
|
||||
minix::minix(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features) :
|
||||
FileSystem(firstsector, lastsector, sectorsused, label, features, FileSystem::Type::Minix)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ namespace FS
|
|||
class LIBKPMCORE_EXPORT minix : public FileSystem
|
||||
{
|
||||
public:
|
||||
minix(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QList<FSFeature>& features = {});
|
||||
minix(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {});
|
||||
|
||||
void init() override;
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ FileSystem::CommandSupportType nilfs2::m_SetLabel = FileSystem::cmdSupportNone;
|
|||
FileSystem::CommandSupportType nilfs2::m_UpdateUUID = FileSystem::cmdSupportNone;
|
||||
FileSystem::CommandSupportType nilfs2::m_GetUUID = FileSystem::cmdSupportNone;
|
||||
|
||||
nilfs2::nilfs2(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QList<FSFeature>& features) :
|
||||
nilfs2::nilfs2(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features) :
|
||||
FileSystem(firstsector, lastsector, sectorsused, label, features, FileSystem::Type::Nilfs2)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ namespace FS
|
|||
class LIBKPMCORE_EXPORT nilfs2 : public FileSystem
|
||||
{
|
||||
public:
|
||||
nilfs2(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QList<FSFeature>& features = {});
|
||||
nilfs2(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {});
|
||||
|
||||
public:
|
||||
void init() override;
|
||||
|
|
|
@ -48,7 +48,7 @@ FileSystem::CommandSupportType ntfs::m_SetLabel = FileSystem::cmdSupportNone;
|
|||
FileSystem::CommandSupportType ntfs::m_UpdateUUID = FileSystem::cmdSupportNone;
|
||||
FileSystem::CommandSupportType ntfs::m_GetUUID = FileSystem::cmdSupportNone;
|
||||
|
||||
ntfs::ntfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QList<FSFeature>& features) :
|
||||
ntfs::ntfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features) :
|
||||
FileSystem(firstsector, lastsector, sectorsused, label, features, FileSystem::Type::Ntfs)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ namespace FS
|
|||
class LIBKPMCORE_EXPORT ntfs : public FileSystem
|
||||
{
|
||||
public:
|
||||
ntfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QList<FSFeature>& features = {});
|
||||
ntfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {});
|
||||
|
||||
public:
|
||||
void init() override;
|
||||
|
|
|
@ -39,7 +39,7 @@ FileSystem::CommandSupportType ocfs2::m_SetLabel = FileSystem::cmdSupportNone;
|
|||
FileSystem::CommandSupportType ocfs2::m_UpdateUUID = FileSystem::cmdSupportNone;
|
||||
FileSystem::CommandSupportType ocfs2::m_GetUUID = FileSystem::cmdSupportNone;
|
||||
|
||||
ocfs2::ocfs2(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QList<FSFeature>& features) :
|
||||
ocfs2::ocfs2(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features) :
|
||||
FileSystem(firstsector, lastsector, sectorsused, label, features, FileSystem::Type::Ocfs2)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ namespace FS
|
|||
class LIBKPMCORE_EXPORT ocfs2 : public FileSystem
|
||||
{
|
||||
public:
|
||||
ocfs2(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QList<FSFeature>& features = {});
|
||||
ocfs2(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {});
|
||||
|
||||
public:
|
||||
void init() override;
|
||||
|
|
|
@ -34,7 +34,7 @@ FileSystem::CommandSupportType reiser4::m_Check = FileSystem::cmdSupportNone;
|
|||
FileSystem::CommandSupportType reiser4::m_Copy = FileSystem::cmdSupportNone;
|
||||
FileSystem::CommandSupportType reiser4::m_Backup = FileSystem::cmdSupportNone;
|
||||
|
||||
reiser4::reiser4(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QList<FSFeature>& features) :
|
||||
reiser4::reiser4(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features) :
|
||||
FileSystem(firstsector, lastsector, sectorsused, label, features, FileSystem::Type::Reiser4)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ namespace FS
|
|||
class LIBKPMCORE_EXPORT reiser4 : public FileSystem
|
||||
{
|
||||
public:
|
||||
reiser4(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QList<FSFeature>& features = {});
|
||||
reiser4(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {});
|
||||
|
||||
public:
|
||||
void init() override;
|
||||
|
|
|
@ -41,7 +41,7 @@ FileSystem::CommandSupportType reiserfs::m_SetLabel = FileSystem::cmdSupportNone
|
|||
FileSystem::CommandSupportType reiserfs::m_UpdateUUID = FileSystem::cmdSupportNone;
|
||||
FileSystem::CommandSupportType reiserfs::m_GetUUID = FileSystem::cmdSupportNone;
|
||||
|
||||
reiserfs::reiserfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QList<FSFeature>& features) :
|
||||
reiserfs::reiserfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features) :
|
||||
FileSystem(firstsector, lastsector, sectorsused, label, features, FileSystem::Type::ReiserFS)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ namespace FS
|
|||
class LIBKPMCORE_EXPORT reiserfs : public FileSystem
|
||||
{
|
||||
public:
|
||||
reiserfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QList<FSFeature>& features = {});
|
||||
reiserfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {});
|
||||
|
||||
public:
|
||||
void init() override;
|
||||
|
|
|
@ -39,7 +39,7 @@ FileSystem::CommandSupportType udf::m_UpdateUUID = FileSystem::cmdSupportNone;
|
|||
FileSystem::CommandSupportType udf::m_Create = FileSystem::cmdSupportNone;
|
||||
bool udf::oldMkudffsVersion = false;
|
||||
|
||||
udf::udf(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QList<FSFeature>& features) :
|
||||
udf::udf(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features) :
|
||||
FileSystem(firstsector, lastsector, sectorsused, label, features, FileSystem::Type::Udf)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ namespace FS
|
|||
class LIBKPMCORE_EXPORT udf : public FileSystem
|
||||
{
|
||||
public:
|
||||
udf(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QList<FSFeature>& features = {});
|
||||
udf(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {});
|
||||
|
||||
public:
|
||||
void init() override;
|
||||
|
|
|
@ -23,7 +23,7 @@ FileSystem::CommandSupportType ufs::m_Move = FileSystem::cmdSupportCore;
|
|||
FileSystem::CommandSupportType ufs::m_Copy = FileSystem::cmdSupportCore;
|
||||
FileSystem::CommandSupportType ufs::m_Backup = FileSystem::cmdSupportCore;
|
||||
|
||||
ufs::ufs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QList<FSFeature>& features) :
|
||||
ufs::ufs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features) :
|
||||
FileSystem(firstsector, lastsector, sectorsused, label, features, FileSystem::Type::Ufs)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ namespace FS
|
|||
class LIBKPMCORE_EXPORT ufs : public FileSystem
|
||||
{
|
||||
public:
|
||||
ufs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QList<FSFeature>& features = {});
|
||||
ufs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {});
|
||||
|
||||
public:
|
||||
CommandSupportType supportMove() const override {
|
||||
|
|
|
@ -21,7 +21,7 @@ namespace FS
|
|||
{
|
||||
FileSystem::CommandSupportType unformatted::m_Create = FileSystem::cmdSupportFileSystem;
|
||||
|
||||
unformatted::unformatted(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QList<FSFeature>& features) :
|
||||
unformatted::unformatted(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features) :
|
||||
FileSystem(firstsector, lastsector, sectorsused, label, features, FileSystem::Type::Unformatted)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ namespace FS
|
|||
class LIBKPMCORE_EXPORT unformatted : public FileSystem
|
||||
{
|
||||
public:
|
||||
unformatted(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QList<FSFeature>& features = {});
|
||||
unformatted(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {});
|
||||
|
||||
public:
|
||||
bool create(Report&, const QString&) override;
|
||||
|
|
|
@ -22,7 +22,7 @@ namespace FS
|
|||
|
||||
FileSystem::CommandSupportType unknown::m_Move = FileSystem::cmdSupportNone;
|
||||
|
||||
unknown::unknown(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QList<FSFeature>& features) :
|
||||
unknown::unknown(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features) :
|
||||
FileSystem(firstsector, lastsector, sectorsused, label, features, FileSystem::Type::Unknown)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace FS
|
|||
class LIBKPMCORE_EXPORT unknown : public FileSystem
|
||||
{
|
||||
public:
|
||||
unknown(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QList<FSFeature>& features = {});
|
||||
unknown(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {});
|
||||
|
||||
public:
|
||||
bool supportToolFound() const override {
|
||||
|
|
|
@ -41,7 +41,7 @@ FileSystem::CommandSupportType xfs::m_Copy = FileSystem::cmdSupportNone;
|
|||
FileSystem::CommandSupportType xfs::m_Backup = FileSystem::cmdSupportNone;
|
||||
FileSystem::CommandSupportType xfs::m_SetLabel = FileSystem::cmdSupportNone;
|
||||
|
||||
xfs::xfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QList<FSFeature>& features) :
|
||||
xfs::xfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features) :
|
||||
FileSystem(firstsector, lastsector, sectorsused, label, features, FileSystem::Type::Xfs)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ namespace FS
|
|||
class LIBKPMCORE_EXPORT xfs : public FileSystem
|
||||
{
|
||||
public:
|
||||
xfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QList<FSFeature>& features = {});
|
||||
xfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {});
|
||||
|
||||
public:
|
||||
void init() override;
|
||||
|
|
|
@ -39,7 +39,7 @@ FileSystem::CommandSupportType zfs::m_SetLabel = FileSystem::cmdSupportNone;
|
|||
FileSystem::CommandSupportType zfs::m_UpdateUUID = FileSystem::cmdSupportNone;
|
||||
FileSystem::CommandSupportType zfs::m_GetUUID = FileSystem::cmdSupportNone;
|
||||
|
||||
zfs::zfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QList<FSFeature>& features) :
|
||||
zfs::zfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features) :
|
||||
FileSystem(firstsector, lastsector, sectorsused, label, features, FileSystem::Type::Zfs)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ namespace FS
|
|||
class LIBKPMCORE_EXPORT zfs : public FileSystem
|
||||
{
|
||||
public:
|
||||
zfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QList<FSFeature>& features = {});
|
||||
zfs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {});
|
||||
|
||||
public:
|
||||
void init() override;
|
||||
|
|
Loading…
Reference in New Issue