[Patcher] Plugin Loader
Added a plugin loader which can be enabled with allow_plugins in the config.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user