1 /*
2     SPDX-FileCopyrightText: 2016-2018 Andrius Štikonas <andrius@stikonas.eu>
3     SPDX-FileCopyrightText: 2020 Arnaud Ferraris <arnaud.ferraris@collabora.com>
4     SPDX-FileCopyrightText: 2020 Gaël PORTAY <gael.portay@collabora.com>
5 
6     SPDX-License-Identifier: GPL-3.0-or-later
7 */
8 
9 #ifndef KPMCORE_F2FS_H
10 #define KPMCORE_F2FS_H
11 
12 #include "util/libpartitionmanagerexport.h"
13 
14 #include "fs/filesystem.h"
15 
16 #include <QtGlobal>
17 
18 class Report;
19 
20 class QString;
21 
22 namespace FS
23 {
24 /** A f2fs file system.
25     @author Andrius Štikonas <andrius@stikonas.eu>
26 */
27 class LIBKPMCORE_EXPORT f2fs : public FileSystem
28 {
29 public:
30     f2fs(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {});
31 
32 public:
33     void init() override;
34 
35 //          qint64 readUsedCapacity(const QString& deviceNode) const override;
36     bool check(Report& report, const QString& deviceNode) const override;
37     bool create(Report& report, const QString& deviceNode) override;
38     bool createWithLabel(Report& report, const QString& deviceNode, const QString& label) override;
39 //     qint64 readUsedCapacity(const QString& deviceNode) const override;
40     bool resize(Report& report, const QString& deviceNode, qint64 length) const override;
41 //     bool writeLabel(Report& report, const QString& deviceNode, const QString& newLabel) override;
42 //     bool updateUUID(Report& report, const QString& deviceNode) const override;
43 
supportGetUsed()44     CommandSupportType supportGetUsed() const override {
45         return m_GetUsed;
46     }
supportGetLabel()47     CommandSupportType supportGetLabel() const override {
48         return m_GetLabel;
49     }
supportCreate()50     CommandSupportType supportCreate() const override {
51         return m_Create;
52     }
supportCreateWithLabel()53     CommandSupportType supportCreateWithLabel() const override {
54         return m_Create;
55     }
supportGrow()56     CommandSupportType supportGrow() const override {
57         return m_Grow;
58     }
supportShrink()59     CommandSupportType supportShrink() const override {
60         return m_Shrink;
61     }
supportMove()62     CommandSupportType supportMove() const override {
63         return m_Move;
64     }
supportCheck()65     CommandSupportType supportCheck() const override {
66         return m_Check;
67     }
supportCopy()68     CommandSupportType supportCopy() const override {
69         return m_Copy;
70     }
supportBackup()71     CommandSupportType supportBackup() const override {
72         return m_Backup;
73     }
supportSetLabel()74     CommandSupportType supportSetLabel() const override {
75         return m_SetLabel;
76     }
supportUpdateUUID()77     CommandSupportType supportUpdateUUID() const override {
78         return m_UpdateUUID;
79     }
supportGetUUID()80     CommandSupportType supportGetUUID() const override {
81         return m_GetUUID;
82     }
83 
84     qint64 minCapacity() const override;
85     qint64 maxCapacity() const override;
86     int maxLabelLength() const override;
87     SupportTool supportToolName() const override;
88     bool supportToolFound() const override;
89 
90 public:
91     static CommandSupportType m_GetUsed;
92     static CommandSupportType m_GetLabel;
93     static CommandSupportType m_Create;
94     static CommandSupportType m_Grow;
95     static CommandSupportType m_Shrink;
96     static CommandSupportType m_Move;
97     static CommandSupportType m_Check;
98     static CommandSupportType m_Copy;
99     static CommandSupportType m_Backup;
100     static CommandSupportType m_SetLabel;
101     static CommandSupportType m_UpdateUUID;
102     static CommandSupportType m_GetUUID;
103 
104 private:
105     static bool oldVersion;
106 
107 };
108 }
109 
110 #endif
111