pmt: fix some minor typo issues and including problems etc. (more)

This commit is contained in:
2025-08-03 21:37:02 +03:00
parent fe51bf1644
commit 25e3630a2b
10 changed files with 81 additions and 40 deletions

View File

@@ -81,7 +81,7 @@ void set(std::string_view name, std::string_view file);
void setProgramName(std::string_view name);
void setLogFile(std::string_view file);
void setPrinting(int state);
void setLoggingState(int state); // Disable/enable logginf
void setLoggingState(int state); // Disable/enable logging
void reset();
} // namespace LoggingProperties
@@ -196,4 +196,7 @@ std::string getLibVersion();
#define LOGNF_IF(name, file, level, condition) \
if (condition) Helper::Logger(level, __func__, file, name, __FILE__, __LINE__)
#define MKVERSION(name) \
"%s %s [%s %s]\nBuildType: %s\nCMakeVersion: %s\nCompilerVersion: %s\nBuildFlags: %s\n", name, BUILD_VERSION, BUILD_DATE, BUILD_TIME, BUILD_TYPE, BUILD_CMAKE_VERSION, BUILD_COMPILER_VERSION, BUILD_FLAGS
#endif // #ifndef LIBHELPER_LIB_HPP

View File

@@ -173,7 +173,7 @@ std::string pathDirname(const std::string_view entry)
std::string getLibVersion()
{
char vinfo[512];
sprintf(vinfo, "libhelper %s [%s %s]\nBuildType: %s\nCMakeVersion: %s\nCompilerVersion: %s\nBuildFlags: %s\n", BUILD_VERSION, BUILD_DATE, BUILD_TIME, BUILD_TYPE, BUILD_CMAKE_VERSION, BUILD_COMPILER_VERSION, BUILD_FLAGS);
sprintf(vinfo, MKVERSION("libhelper"));
return std::string(vinfo);
}

View File

@@ -38,6 +38,12 @@ struct _entry {
} props;
};
/**
* basic_partition_map
* -------------------
* The main type of the library. The Builder class is designed
* to be easily manipulated and modified only on this class.
*/
class basic_partition_map {
private:
void _resize_map();
@@ -139,16 +145,14 @@ public:
/**
* Secondary constructor
* ---------------------
* It has two arguments:
* It has one arguments:
* - Directory path to search
*/
basic_partition_map_builder(const std::string_view path);
/**
* getAll()
* ------
* WARNING: Learn about std::optional before using this function.
*
* --------
* Returns the current list content in Map_t type.
* If no list is created, returns std::nullopt.
*/
@@ -304,10 +308,17 @@ public:
/**
* ! operator
* ----------
* Returns true if the object creation failed (i.e., there's a problem),
* and false if the object is correctly created.
* Returns true if the object creation failed (i.e., there's a problem),
* and false if the object is correctly created.
*/
bool operator!() const;
bool operator!() const;
/**
* () operator
* -----------
* Build map with input path. Implementation of readDirectory().
*/
bool operator()(const std::string_view path);
};
using Error = Helper::Error;

View File

@@ -211,10 +211,16 @@ bool basic_partition_map_builder::operator!() const
return this->_any_generating_error;
}
bool basic_partition_map_builder::operator()(const std::string_view path)
{
LOGN(MAP, INFO) << "calling readDirectory() for building map with " << path << std::endl;
return readDirectory(path);
}
std::string getLibVersion()
{
char vinfo[512];
sprintf(vinfo, "libpartition_map %s [%s %s]\nBuildType: %s\nCMakeVersion: %s\nCompilerVersion: %s\nBuildFlags: %s\n", BUILD_VERSION, BUILD_DATE, BUILD_TIME, BUILD_TYPE, BUILD_CMAKE_VERSION, BUILD_COMPILER_VERSION, BUILD_FLAGS);
sprintf(vinfo, MKVERSION("libpartition_map"));
return std::string(vinfo);
}