patterns: Added parent keyword to access members of the parent struct

This commit is contained in:
WerWolv
2021-04-12 20:49:37 +02:00
parent 2d7dd36b0d
commit 907f25c231
9 changed files with 217 additions and 43 deletions

View File

@@ -127,10 +127,20 @@ namespace hex {
res.push_back(token);
}
res.push_back(std::string(string.substr(start)));
res.emplace_back(string.substr(start));
return res;
}
std::string combineStrings(const std::vector<std::string> &strings, std::string_view delimiter) {
std::string result;
for (const auto &string : strings) {
result += string;
result += delimiter;
}
return result.substr(0, result.length() - delimiter.length());
}
std::string toEngineeringString(double value) {
constexpr std::array Suffixes = { "a", "f", "p", "n", "u", "m", "", "k", "M", "G", "T", "P", "E" };