feat: Added various custom built-in types to the pattern language (#1991)

This commit is contained in:
Nik
2024-12-14 16:52:36 +01:00
committed by GitHub
parent 13e079d1b8
commit 040a606b39
14 changed files with 618 additions and 13 deletions

View File

@@ -285,13 +285,13 @@ namespace hex {
[[nodiscard]] float float16ToFloat32(u16 float16);
[[nodiscard]] inline bool equalsIgnoreCase(const std::string &left, const std::string &right) {
[[nodiscard]] inline bool equalsIgnoreCase(std::string_view left, std::string_view right) {
return std::equal(left.begin(), left.end(), right.begin(), right.end(), [](char a, char b) {
return tolower(a) == tolower(b);
});
}
[[nodiscard]] inline bool containsIgnoreCase(const std::string &a, const std::string &b) {
[[nodiscard]] inline bool containsIgnoreCase(std::string_view a, std::string_view b) {
auto iter = std::search(a.begin(), a.end(), b.begin(), b.end(), [](char ch1, char ch2) {
return std::toupper(ch1) == std::toupper(ch2);
});