1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-08 06:47:34 +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

@ -71,7 +71,7 @@ void DiffViewer::paint_event(GUI::PaintEvent& event)
}
}
void DiffViewer::draw_line(GUI::Painter& painter, String const& line, size_t y_offset, LinePosition line_position, LineType line_type)
void DiffViewer::draw_line(GUI::Painter& painter, DeprecatedString const& line, size_t y_offset, LinePosition line_position, LineType line_type)
{
size_t line_width = font().width(line);
@ -131,7 +131,7 @@ Gfx::IntRect DiffViewer::separator_rect() const
frame_inner_rect().height() };
}
void DiffViewer::set_content(String const& original, String const& diff)
void DiffViewer::set_content(DeprecatedString const& original, DeprecatedString const& diff)
{
m_original_lines = split_to_lines(original);
m_hunks = Diff::parse_hunks(diff);
@ -147,7 +147,7 @@ DiffViewer::DiffViewer()
setup_properties();
}
DiffViewer::DiffViewer(String const& original, String const& diff)
DiffViewer::DiffViewer(DeprecatedString const& original, DeprecatedString const& diff)
: m_original_lines(split_to_lines(original))
, m_hunks(Diff::parse_hunks(diff))
{
@ -161,10 +161,10 @@ void DiffViewer::setup_properties()
set_foreground_role(ColorRole::BaseText);
}
Vector<String> DiffViewer::split_to_lines(String const& text)
Vector<DeprecatedString> DiffViewer::split_to_lines(DeprecatedString const& text)
{
// NOTE: This is slightly different than text.split('\n')
Vector<String> lines;
Vector<DeprecatedString> lines;
size_t next_line_start_index = 0;
for (size_t i = 0; i < text.length(); ++i) {
if (text[i] == '\n') {