mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 05:27:41 -05:00
patterns: Added menu to Edit menu for placing types at current selection
This commit is contained in:
2
lib/external/pattern_language
vendored
2
lib/external/pattern_language
vendored
Submodule lib/external/pattern_language updated: 46f133bee5...2233e1ab6b
@@ -201,6 +201,7 @@ namespace hex {
|
||||
|
||||
std::vector<std::string> splitString(const std::string &string, const std::string &delimiter);
|
||||
std::string combineStrings(const std::vector<std::string> &strings, const std::string &delimiter = "");
|
||||
std::string replaceStrings(std::string string, const std::string &search, const std::string &replace);
|
||||
|
||||
std::string toEngineeringString(double value);
|
||||
|
||||
|
||||
@@ -232,6 +232,17 @@ namespace hex {
|
||||
return result.substr(0, result.length() - delimiter.length());
|
||||
}
|
||||
|
||||
std::string replaceStrings(std::string string, const std::string &search, const std::string &replace) {
|
||||
if (search.empty())
|
||||
return string;
|
||||
|
||||
std::size_t pos;
|
||||
while ((pos = string.find(search)) != std::string::npos)
|
||||
string.replace(pos, search.size(), replace);
|
||||
|
||||
return string;
|
||||
}
|
||||
|
||||
std::string toEngineeringString(double value) {
|
||||
constexpr static std::array Suffixes = { "a", "f", "p", "n", "u", "m", "", "k", "M", "G", "T", "P", "E" };
|
||||
|
||||
|
||||
Reference in New Issue
Block a user