mirror of
https://git.FreeBSD.org/ports.git
synced 2024-11-18 00:10:04 +00:00
abaf8dc39c
- Fix ssl=openssl build [1] - Fix permissions of backup/db directory. Now backup are generated without problems - Add support for get ports info - Add support for get processes info - Add a better way for get memory info - Add new decoders and rules files (https://github.com/alonsobsd/wazuh-freebsd) - Update FreeBSD sca files (https://github.com/alonsobsd/wazuh-freebsd) - Minor changes to SysInfo::getPackages function - Another minor modifications PR: 275008 Reported by: franco _at_ opnsense.org [1]
41 lines
1.2 KiB
C++
41 lines
1.2 KiB
C++
--- src/shared_modules/utils/stringHelper.h 2023-12-09 01:08:14.397366000 -0500
|
|
+++ src/shared_modules/utils/stringHelper.h 2023-12-09 12:07:52.155984000 -0500
|
|
@@ -210,6 +210,17 @@
|
|
return leftTrim(rightTrim(str, args), args);
|
|
}
|
|
|
|
+ static std::string trimToOneSpace(const std::string& str)
|
|
+ {
|
|
+ std::string str_output;
|
|
+
|
|
+ str_output.clear();
|
|
+ std::unique_copy (str.begin(), str.end(), std::back_insert_iterator<std::string>(str_output),
|
|
+ [](char a,char b){ return std::isspace(a) && std::isspace(b);});
|
|
+
|
|
+ return str_output;
|
|
+ }
|
|
+
|
|
static std::string toUpperCase(const std::string& str)
|
|
{
|
|
std::string temp{ str };
|
|
@@ -219,6 +230,19 @@
|
|
[](std::string::value_type character)
|
|
{
|
|
return std::toupper(character);
|
|
+ });
|
|
+ return temp;
|
|
+ }
|
|
+
|
|
+ static std::string toLowerCase(const std::string& str)
|
|
+ {
|
|
+ std::string temp{ str };
|
|
+ std::transform(std::begin(temp),
|
|
+ std::end(temp),
|
|
+ std::begin(temp),
|
|
+ [](std::string::value_type character)
|
|
+ {
|
|
+ return std::tolower(character);
|
|
});
|
|
return temp;
|
|
}
|