[Patcher] Plugin Loader

Added a plugin loader which can be enabled with allow_plugins in the config.
This commit is contained in:
Adrian
2023-07-16 18:25:50 +01:00
committed by Radosław Gliński
parent 6e86eacf5a
commit 91f976e524
8 changed files with 355 additions and 11 deletions

View File

@@ -14,6 +14,7 @@
#include <charconv>
#include <cstddef>
#include <cstring>
#include <regex>
#include <string>
#include "third_party/fmt/include/fmt/format.h"
@@ -141,6 +142,20 @@ inline bool hex_string_to_array(std::vector<uint8_t>& output_array,
return true;
}
inline std::string BoolToString(bool value) { return value ? "true" : "false"; }
inline std::string ltrim(const std::string& value) {
return std::regex_replace(value, std::regex("^\\s+"), std::string(""));
}
inline std::string rtrim(const std::string& value) {
return std::regex_replace(value, std::regex("\\s+$"), std::string(""));
}
inline std::string trim(const std::string& value) {
return ltrim(rtrim(value));
}
inline std::string to_hex_string(uint32_t value) {
return fmt::format("{:08X}", value);
}