1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 08:04:57 +00:00

AK+Everywhere: Rename String to DeprecatedString

We have a new, improved string type coming up in AK (OOM aware, no null
state), and while it's going to use UTF-8, the name UTF8String is a
mouthful - so let's free up the String name by renaming the existing
class.
Making the old one have an annoying name will hopefully also help with
quick adoption :^)
This commit is contained in:
Linus Groh 2022-12-04 18:02:33 +00:00 committed by Andreas Kling
parent f74251606d
commit 6e19ab2bbc
2006 changed files with 11635 additions and 11636 deletions

View file

@ -14,14 +14,14 @@
#include <AK/Vector.h>
#ifndef KERNEL
# include <AK/DeprecatedString.h>
# include <AK/FlyString.h>
# include <AK/String.h>
#endif
namespace AK {
#ifndef KERNEL
StringView::StringView(String const& string)
StringView::StringView(DeprecatedString const& string)
: m_characters(string.characters())
, m_length(string.length())
{
@ -163,17 +163,17 @@ bool StringView::equals_ignoring_case(StringView other) const
}
#ifndef KERNEL
String StringView::to_lowercase_string() const
DeprecatedString StringView::to_lowercase_string() const
{
return StringImpl::create_lowercased(characters_without_null_termination(), length());
}
String StringView::to_uppercase_string() const
DeprecatedString StringView::to_uppercase_string() const
{
return StringImpl::create_uppercased(characters_without_null_termination(), length());
}
String StringView::to_titlecase_string() const
DeprecatedString StringView::to_titlecase_string() const
{
return StringUtils::to_titlecase(*this);
}
@ -246,14 +246,14 @@ Optional<float> StringView::to_float(TrimWhitespace trim_whitespace) const
return StringUtils::convert_to_floating_point<float>(*this, trim_whitespace);
}
bool StringView::operator==(String const& string) const
bool StringView::operator==(DeprecatedString const& string) const
{
return *this == string.view();
}
String StringView::to_string() const { return String { *this }; }
DeprecatedString StringView::to_string() const { return DeprecatedString { *this }; }
String StringView::replace(StringView needle, StringView replacement, ReplaceMode replace_mode) const
DeprecatedString StringView::replace(StringView needle, StringView replacement, ReplaceMode replace_mode) const
{
return StringUtils::replace(*this, needle, replacement, replace_mode);
}