1 /*
2     SPDX-FileCopyrightText: 2019 Shubham Jangra <aryan100jangid@gmail.com>
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_MINIX_H
10 #define KPMCORE_MINIX_H
11 
12 #include "fs/filesystem.h"
13 
14 #include "util/libpartitionmanagerexport.h"
15 
16 class Report;
17 
18 class QString;
19 
20 namespace FS
21 {
22 /** A minix(Mini Unix) file system.
23     @author Shubham <aryan100jangid@gmail.com>
24  */
25 class LIBKPMCORE_EXPORT minix : public FileSystem
26 {
27 public:
28     minix(qint64 firstsector, qint64 lastsector, qint64 sectorsused, const QString& label, const QVariantMap& features = {});
29 
30     void init() override;
31 
32     bool check(Report& report, const QString&deviceNode) const override;
33     bool create(Report& report, const QString&deviceNode) override;
34 
supportGetLabel()35     CommandSupportType supportGetLabel() const override {
36         return m_GetLabel;
37     }
38 
supportGetUsed()39     CommandSupportType supportGetUsed() const override {
40         return m_GetUsed;
41     }
42 
supportShrink()43     CommandSupportType supportShrink() const override {
44         return m_Shrink;
45     }
46 
supportMove()47     CommandSupportType supportMove() const override {
48         return m_Move;
49     }
50 
supportCheck()51     CommandSupportType supportCheck() const override {
52         return m_Check;
53     }
54 
supportCreate()55     CommandSupportType supportCreate() const override {
56         return m_Create;
57     }
58 
supportCopy()59     CommandSupportType supportCopy() const override {
60         return m_Copy;
61     }
62 
supportBackup()63     CommandSupportType supportBackup() const override {
64         return m_Backup;
65     }
66 
67     qint64 maxCapacity() const override;
68     int maxLabelLength() const override;
69     SupportTool supportToolName() const override;
70     bool supportToolFound() const override;
71 
72 public:
73     static CommandSupportType m_GetLabel;
74     static CommandSupportType m_GetUsed;
75     static CommandSupportType m_Shrink;
76     static CommandSupportType m_Move;
77     static CommandSupportType m_Create;
78     static CommandSupportType m_Check;
79     static CommandSupportType m_Copy;
80     static CommandSupportType m_Backup;
81 };
82 }
83 
84 #endif
85