pmt: New features and improvements

- Added type getter and reboot function
 - Writed a garbage collector, so manually freeing memory and closing file descriptors is removed
 - Some other improvements
This commit is contained in:
2025-08-09 12:48:04 +03:00
parent 8b3e886eee
commit 8e629d60d0
28 changed files with 1826 additions and 1265 deletions

View File

@@ -137,6 +137,36 @@ namespace PartitionManager {
[[nodiscard]] bool isUsed() const override;
[[nodiscard]] const char *name() const override;
};
class typeFunction final : public FunctionBase {
private:
std::vector<std::string> contents;
bool onlyCheckAndroidMagics = false, onlyCheckFileSystemMagics = false;
int bufferSize = 4096;
public:
CLI::App *cmd = nullptr;
bool init(CLI::App &_app) override;
bool run() override;
[[nodiscard]] bool isUsed() const override;
[[nodiscard]] const char *name() const override;
};
class rebootFunction final : public FunctionBase {
private:
std::string rebootTarget;
public:
CLI::App *cmd = nullptr;
bool init(CLI::App &_app) override;
bool run() override;
[[nodiscard]] bool isUsed() const override;
[[nodiscard]] const char *name() const override;
};
} // namespace PartitionManager
#endif // #ifndef FUNCTIONS_HPP