File indexing completed on 2024-05-05 05:48:43

0001 /*
0002     SPDX-FileCopyrightText: 2012-2017 Andrius Štikonas <andrius@stikonas.eu>
0003     SPDX-FileCopyrightText: 2015 Chris Campbell <c.j.campbell@ed.ac.uk>
0004     SPDX-FileCopyrightText: 2020 Arnaud Ferraris <arnaud.ferraris@collabora.com>
0005     SPDX-FileCopyrightText: 2020 Gaël PORTAY <gael.portay@collabora.com>
0006 
0007     SPDX-License-Identifier: GPL-3.0-or-later
0008 */
0009 
0010 #ifndef KPMCORE_EXFAT_H
0011 #define KPMCORE_EXFAT_H
0012 
0013 #include "util/libpartitionmanagerexport.h"
0014 
0015 #include "fs/filesystem.h"
0016 
0017 #include <QtGlobal>
0018 
0019 class Report;
0020 
0021 class QString;
0022 
0023 namespace FS
0024 {
0025 /** An exfat file system.
0026     @author Andrius Štikonas <andrius@stikonas.eu>
0027 */
0028 class LIBKPMCORE_EXPORT exfat : public FileSystem
0029 {
0030 public:
0031     exfat(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {});
0032 
0033 public:
0034     void init() override;
0035 
0036 //          qint64 readUsedCapacity(const QString& deviceNode) const override;
0037     bool check(Report& report, const QString& deviceNode) const override;
0038     bool create(Report& report, const QString& deviceNode) override;
0039 //          bool resize(Report& report, const QString& deviceNode, qint64 length) const override;
0040     bool writeLabel(Report& report, const QString& deviceNode, const QString& newLabel) override;
0041     bool updateUUID(Report& report, const QString& deviceNode) const override;
0042 
0043     CommandSupportType supportGetUsed() const override {
0044         return m_GetUsed;
0045     }
0046     CommandSupportType supportGetLabel() const override {
0047         return m_GetLabel;
0048     }
0049     CommandSupportType supportCreate() const override {
0050         return m_Create;
0051     }
0052     CommandSupportType supportGrow() const override {
0053         return m_Grow;
0054     }
0055     CommandSupportType supportShrink() const override {
0056         return m_Shrink;
0057     }
0058     CommandSupportType supportMove() const override {
0059         return m_Move;
0060     }
0061     CommandSupportType supportCheck() const override {
0062         return m_Check;
0063     }
0064     CommandSupportType supportCopy() const override {
0065         return m_Copy;
0066     }
0067     CommandSupportType supportBackup() const override {
0068         return m_Backup;
0069     }
0070     CommandSupportType supportSetLabel() const override {
0071         return m_SetLabel;
0072     }
0073     CommandSupportType supportUpdateUUID() const override {
0074         return m_UpdateUUID;
0075     }
0076     CommandSupportType supportGetUUID() const override {
0077         return m_GetUUID;
0078     }
0079 
0080 //          qint64 minCapacity() const;
0081     qint64 maxCapacity() const override;
0082     int maxLabelLength() const override;
0083     SupportTool supportToolName() const override;
0084     bool supportToolFound() const override;
0085 
0086 public:
0087     static CommandSupportType m_GetUsed;
0088     static CommandSupportType m_GetLabel;
0089     static CommandSupportType m_Create;
0090     static CommandSupportType m_Grow;
0091     static CommandSupportType m_Shrink;
0092     static CommandSupportType m_Move;
0093     static CommandSupportType m_Check;
0094     static CommandSupportType m_Copy;
0095     static CommandSupportType m_Backup;
0096     static CommandSupportType m_SetLabel;
0097     static CommandSupportType m_UpdateUUID;
0098     static CommandSupportType m_GetUUID;
0099 
0100 private:
0101     static bool exfatUtils;
0102 };
0103 }
0104 
0105 #endif