1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 04:17:35 +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

@ -237,7 +237,7 @@ Tokenizer::Tokenizer(StringView input, DeprecatedString const& encoding)
last_was_carriage_return = false;
}
});
return builder.to_string();
return builder.to_deprecated_string();
};
m_decoded_input = filter_code_points(input, encoding);
@ -367,7 +367,7 @@ Token Tokenizer::create_value_token(Token::Type type, u32 value)
// FIXME: Avoid temporary StringBuilder here
StringBuilder builder;
builder.append_code_point(value);
token.m_value = builder.to_string();
token.m_value = builder.to_deprecated_string();
return token;
}
@ -400,7 +400,7 @@ u32 Tokenizer::consume_escaped_code_point()
}
// Interpret the hex digits as a hexadecimal number.
auto unhexed = strtoul(builder.to_string().characters(), nullptr, 16);
auto unhexed = strtoul(builder.to_deprecated_string().characters(), nullptr, 16);
// If this number is zero, or is for a surrogate, or is greater than the maximum allowed
// code point, return U+FFFD REPLACEMENT CHARACTER (<28>).
if (unhexed == 0 || is_unicode_surrogate(unhexed) || is_greater_than_maximum_allowed_code_point(unhexed)) {
@ -617,7 +617,7 @@ DeprecatedString Tokenizer::consume_an_ident_sequence()
break;
}
return result.to_string();
return result.to_deprecated_string();
}
// https://www.w3.org/TR/css-syntax-3/#consume-url-token
@ -640,7 +640,7 @@ Token Tokenizer::consume_a_url_token()
consume_as_much_whitespace_as_possible();
auto make_token = [&]() {
token.m_value = builder.to_string();
token.m_value = builder.to_deprecated_string();
return token;
};
@ -931,7 +931,7 @@ Token Tokenizer::consume_string_token(u32 ending_code_point)
StringBuilder builder;
auto make_token = [&]() {
token.m_value = builder.to_string();
token.m_value = builder.to_deprecated_string();
return token;
};