1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 11:37:45 +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

@ -1498,14 +1498,14 @@ void Editor::refresh_display()
dbgln("Drawn Spans:");
for (auto& sentry : m_drawn_spans.m_spans_starting) {
for (auto& entry : sentry.value) {
dbgln("{}-{}: {}", sentry.key, entry.key, entry.value.to_string());
dbgln("{}-{}: {}", sentry.key, entry.key, entry.value.to_deprecated_string());
}
}
dbgln("==========================================================================");
dbgln("Current Spans:");
for (auto& sentry : m_current_spans.m_spans_starting) {
for (auto& entry : sentry.value) {
dbgln("{}-{}: {}", sentry.key, entry.key, entry.value.to_string());
dbgln("{}-{}: {}", sentry.key, entry.key, entry.value.to_deprecated_string());
}
}
}
@ -1680,7 +1680,7 @@ void Style::unify_with(Style const& other, bool prefer_other)
m_hyperlink = other.hyperlink();
}
DeprecatedString Style::to_string() const
DeprecatedString Style::to_deprecated_string() const
{
StringBuilder builder;
builder.append("Style { "sv);
@ -2277,11 +2277,11 @@ bool Editor::Spans::contains_up_to_offset(Spans const& other, size_t offset) con
if constexpr (LINE_EDITOR_DEBUG) {
dbgln("Compare for {}-{} failed, no entry", entry.key, left_entry.key);
for (auto& x : entry.value)
dbgln("Have: {}-{} = {}", entry.key, x.key, x.value.to_string());
dbgln("Have: {}-{} = {}", entry.key, x.key, x.value.to_deprecated_string());
}
return false;
} else if (value_it->value != left_entry.value) {
dbgln_if(LINE_EDITOR_DEBUG, "Compare for {}-{} failed, different values: {} != {}", entry.key, left_entry.key, value_it->value.to_string(), left_entry.value.to_string());
dbgln_if(LINE_EDITOR_DEBUG, "Compare for {}-{} failed, different values: {} != {}", entry.key, left_entry.key, value_it->value.to_deprecated_string(), left_entry.value.to_deprecated_string());
return false;
}
}

View file

@ -38,7 +38,7 @@ void Editor::search_forwards()
ScopedValueRollback inline_search_cursor_rollback { m_inline_search_cursor };
StringBuilder builder;
builder.append(Utf32View { m_buffer.data(), m_inline_search_cursor });
DeprecatedString search_phrase = builder.to_string();
DeprecatedString search_phrase = builder.to_deprecated_string();
if (m_search_offset_state == SearchOffsetState::Backwards)
--m_search_offset;
if (m_search_offset > 0) {
@ -65,7 +65,7 @@ void Editor::search_backwards()
ScopedValueRollback inline_search_cursor_rollback { m_inline_search_cursor };
StringBuilder builder;
builder.append(Utf32View { m_buffer.data(), m_inline_search_cursor });
DeprecatedString search_phrase = builder.to_string();
DeprecatedString search_phrase = builder.to_deprecated_string();
if (m_search_offset_state == SearchOffsetState::Forwards)
++m_search_offset;
if (search(search_phrase, true)) {

View file

@ -180,7 +180,7 @@ public:
bool is_anchored() const { return m_is_anchored; }
bool is_empty() const { return m_is_empty; }
DeprecatedString to_string() const;
DeprecatedString to_deprecated_string() const;
private:
bool m_underline { false };