pmt: Introduce, fixup

- Fix pstderr file pointer.
 - Improve and add more functions on libpartition_map.
 - Improve functions.
This commit is contained in:
2025-08-28 23:13:52 +03:00
parent d7bd11165d
commit 1a9b4ff5ad
10 changed files with 161 additions and 59 deletions

View File

@@ -19,6 +19,7 @@
#include <cstdint> // for uint64_t
#include <exception>
#include <functional>
#include <libhelper/lib.hpp>
#include <list>
#include <memory>
@@ -241,6 +242,31 @@ public:
*/
void clear();
/**
* Do input function (lambda) for all partitions.
*/
void doForAllPartitions(
const std::function<bool(std::string, Map_t::BasicInf)> &func) const;
/**
* Do input function (lambda) for physical partitions.
*/
void doForPhysicalPartitions(
const std::function<bool(std::string, Map_t::BasicInf)> &func) const;
/**
* Do input function (lambda) for logical partitions.
*/
void doForLogicalPartitions(
const std::function<bool(std::string, Map_t::BasicInf)> &func) const;
/**
* Do input function (lambda) for input partition list.
*/
void doForPartitionList(
const std::vector<std::string> &partitions,
const std::function<bool(std::string, Map_t::BasicInf)> &func) const;
/**
* The entered path is defined as the new search
* directory and the search is performed in the entered
@@ -303,6 +329,10 @@ public:
* Get Map_t object reference
*/
Map_t &operator*();
/**
* Get constant Map_t object reference
*/
const Map_t &operator*() const;
};