1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 17:37:37 +00:00

Everywhere: Rename to_{string => deprecated_string}() where applicable

This will make it easier to support both string types at the same time
while we convert code, and tracking down remaining uses.

One big exception is Value::to_string() in LibJS, where the name is
dictated by the ToString AO.
This commit is contained in:
Linus Groh 2022-12-06 01:12:49 +00:00 committed by Andreas Kling
parent 6e19ab2bbc
commit 57dc179b1f
597 changed files with 1973 additions and 1972 deletions

View file

@ -44,13 +44,13 @@ GridSize GridSize::make_auto()
return GridSize(CSS::Length::make_auto());
}
DeprecatedString GridSize::to_string() const
DeprecatedString GridSize::to_deprecated_string() const
{
switch (m_type) {
case Type::Length:
return m_length.to_string();
return m_length.to_deprecated_string();
case Type::Percentage:
return m_percentage.to_string();
return m_percentage.to_deprecated_string();
case Type::FlexibleLength:
return DeprecatedString::formatted("{}fr", m_flexible_length);
}
@ -68,15 +68,15 @@ GridMinMax::GridMinMax(GridSize min_grid_size, GridSize max_grid_size)
{
}
DeprecatedString GridMinMax::to_string() const
DeprecatedString GridMinMax::to_deprecated_string() const
{
StringBuilder builder;
builder.append("minmax("sv);
builder.appendff("{}", m_min_grid_size.to_string());
builder.appendff("{}", m_min_grid_size.to_deprecated_string());
builder.append(", "sv);
builder.appendff("{}", m_max_grid_size.to_string());
builder.appendff("{}", m_max_grid_size.to_deprecated_string());
builder.append(")"sv);
return builder.to_string();
return builder.to_deprecated_string();
}
GridRepeat::GridRepeat(GridTrackSizeList grid_track_size_list, int repeat_count)
@ -96,7 +96,7 @@ GridRepeat::GridRepeat()
{
}
DeprecatedString GridRepeat::to_string() const
DeprecatedString GridRepeat::to_deprecated_string() const
{
StringBuilder builder;
builder.append("repeat("sv);
@ -114,9 +114,9 @@ DeprecatedString GridRepeat::to_string() const
VERIFY_NOT_REACHED();
}
builder.append(", "sv);
builder.appendff("{}", m_grid_track_size_list.to_string());
builder.appendff("{}", m_grid_track_size_list.to_deprecated_string());
builder.append(")"sv);
return builder.to_string();
return builder.to_deprecated_string();
}
ExplicitGridTrack::ExplicitGridTrack(CSS::GridMinMax grid_minmax)
@ -137,15 +137,15 @@ ExplicitGridTrack::ExplicitGridTrack(CSS::GridSize grid_size)
{
}
DeprecatedString ExplicitGridTrack::to_string() const
DeprecatedString ExplicitGridTrack::to_deprecated_string() const
{
switch (m_type) {
case Type::MinMax:
return m_grid_minmax.to_string();
return m_grid_minmax.to_deprecated_string();
case Type::Repeat:
return m_grid_repeat.to_string();
return m_grid_repeat.to_deprecated_string();
case Type::Default:
return m_grid_size.to_string();
return m_grid_size.to_deprecated_string();
default:
VERIFY_NOT_REACHED();
}
@ -168,7 +168,7 @@ GridTrackSizeList GridTrackSizeList::make_auto()
return GridTrackSizeList();
}
DeprecatedString GridTrackSizeList::to_string() const
DeprecatedString GridTrackSizeList::to_deprecated_string() const
{
StringBuilder builder;
auto print_line_names = [&](size_t index) -> void {
@ -186,7 +186,7 @@ DeprecatedString GridTrackSizeList::to_string() const
print_line_names(i);
builder.append(" "sv);
}
builder.append(m_track_list[i].to_string());
builder.append(m_track_list[i].to_deprecated_string());
if (i < m_track_list.size() - 1)
builder.append(" "sv);
}
@ -194,7 +194,7 @@ DeprecatedString GridTrackSizeList::to_string() const
builder.append(" "sv);
print_line_names(m_track_list.size());
}
return builder.to_string();
return builder.to_deprecated_string();
}
}