1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 16:38:10 +00:00

LibELF: Add find_demangled_function

Also, added AK::String::index_of and fixed a bug in ELF::Loader::symbol_ptr
This commit is contained in:
Itamar 2020-04-13 19:23:19 +03:00 committed by Andreas Kling
parent 34f0d98e67
commit e207de8449
7 changed files with 71 additions and 24 deletions

View file

@ -317,6 +317,18 @@ bool String::contains(const String& needle) const
return strstr(characters(), needle.characters());
}
Optional<size_t> String::index_of(const String& needle) const
{
if (is_null() || needle.is_null())
return {};
const char* self_characters = characters();
const char* result = strstr(self_characters, needle.characters());
if (!result)
return {};
return Optional<size_t> { result - self_characters };
}
bool String::equals_ignoring_case(const StringView& other) const
{
return StringUtils::equals_ignoring_case(view(), other);