diff --git a/AK/Base64.cpp b/AK/Base64.cpp index 7cdc01c343f..0093481a67a 100644 --- a/AK/Base64.cpp +++ b/AK/Base64.cpp @@ -137,7 +137,7 @@ DeprecatedString encode_base64(ReadonlyBytes input) output.append(out3); } - return output.to_string(); + return output.to_deprecated_string(); } } diff --git a/AK/Demangle.h b/AK/Demangle.h index b74481cc599..0d6484298ba 100644 --- a/AK/Demangle.h +++ b/AK/Demangle.h @@ -17,7 +17,7 @@ namespace AK { inline DeprecatedString demangle(StringView name) { int status = 0; - auto* demangled_name = abi::__cxa_demangle(name.to_string().characters(), nullptr, nullptr, &status); + auto* demangled_name = abi::__cxa_demangle(name.to_deprecated_string().characters(), nullptr, nullptr, &status); auto string = DeprecatedString(status == 0 ? StringView { demangled_name, strlen(demangled_name) } : name); if (status == 0) free(demangled_name); diff --git a/AK/DeprecatedString.cpp b/AK/DeprecatedString.cpp index 9bc645be8ac..f30fbae61f4 100644 --- a/AK/DeprecatedString.cpp +++ b/AK/DeprecatedString.cpp @@ -320,7 +320,7 @@ DeprecatedString DeprecatedString::roman_number_from(size_t value) } } - return builder.to_string(); + return builder.to_deprecated_string(); } bool DeprecatedString::matches(StringView mask, Vector& mask_spans, CaseSensitivity case_sensitivity) const @@ -354,7 +354,7 @@ DeprecatedString DeprecatedString::reverse() const for (size_t i = length(); i-- > 0;) { reversed_string.append(characters()[i]); } - return reversed_string.to_string(); + return reversed_string.to_deprecated_string(); } DeprecatedString escape_html_entities(StringView html) @@ -372,7 +372,7 @@ DeprecatedString escape_html_entities(StringView html) else builder.append(html[i]); } - return builder.to_string(); + return builder.to_deprecated_string(); } DeprecatedString::DeprecatedString(FlyString const& string) @@ -431,7 +431,7 @@ InputStream& operator>>(InputStream& stream, DeprecatedString& string) if (next_char) { builder.append(next_char); } else { - string = builder.to_string(); + string = builder.to_deprecated_string(); return stream; } } @@ -441,7 +441,7 @@ DeprecatedString DeprecatedString::vformatted(StringView fmtstr, TypeErasedForma { StringBuilder builder; MUST(vformat(builder, fmtstr, params)); - return builder.to_string(); + return builder.to_deprecated_string(); } Vector DeprecatedString::find_all(StringView needle) const diff --git a/AK/DeprecatedString.h b/AK/DeprecatedString.h index 86934fb5256..280eda6d7c7 100644 --- a/AK/DeprecatedString.h +++ b/AK/DeprecatedString.h @@ -35,7 +35,7 @@ namespace AK { // StringBuilder builder; // builder.append("abc"); // builder.append("123"); -// s = builder.to_string(); +// s = builder.to_deprecated_string(); class DeprecatedString { public: diff --git a/AK/FlyString.cpp b/AK/FlyString.cpp index fdbb2cf937c..5dcd6ea9284 100644 --- a/AK/FlyString.cpp +++ b/AK/FlyString.cpp @@ -63,7 +63,7 @@ FlyString::FlyString(StringView string) return string == candidate; }); if (it == fly_impls().end()) { - auto new_string = string.to_string(); + auto new_string = string.to_deprecated_string(); fly_impls().set(new_string.impl()); new_string.impl()->set_fly({}, true); m_impl = new_string.impl(); diff --git a/AK/GenericLexer.cpp b/AK/GenericLexer.cpp index 16faba67902..40dc0caaf7f 100644 --- a/AK/GenericLexer.cpp +++ b/AK/GenericLexer.cpp @@ -138,7 +138,7 @@ DeprecatedString GenericLexer::consume_and_unescape_string(char escape_char) StringBuilder builder; for (size_t i = 0; i < view.length(); ++i) builder.append(consume_escaped_character(escape_char)); - return builder.to_string(); + return builder.to_deprecated_string(); } auto GenericLexer::consume_escaped_code_point(bool combine_surrogate_pairs) -> Result diff --git a/AK/IPv4Address.h b/AK/IPv4Address.h index 1b1461045c0..4977f7cf1fc 100644 --- a/AK/IPv4Address.h +++ b/AK/IPv4Address.h @@ -65,7 +65,7 @@ public: octet(SubnetClass::D)); } #else - DeprecatedString to_string() const + DeprecatedString to_deprecated_string() const { return DeprecatedString::formatted("{}.{}.{}.{}", octet(SubnetClass::A), @@ -74,7 +74,7 @@ public: octet(SubnetClass::D)); } - DeprecatedString to_string_reversed() const + DeprecatedString to_deprecated_string_reversed() const { return DeprecatedString::formatted("{}.{}.{}.{}", octet(SubnetClass::D), @@ -169,7 +169,7 @@ template<> struct Formatter : Formatter { ErrorOr format(FormatBuilder& builder, IPv4Address value) { - return Formatter::format(builder, value.to_string()); + return Formatter::format(builder, value.to_deprecated_string()); } }; #endif diff --git a/AK/IPv6Address.h b/AK/IPv6Address.h index 5616ca3c1f4..c7d006a5151 100644 --- a/AK/IPv6Address.h +++ b/AK/IPv6Address.h @@ -51,7 +51,7 @@ public: #ifdef KERNEL ErrorOr> to_string() const #else - DeprecatedString to_string() const + DeprecatedString to_deprecated_string() const #endif { if (is_zero()) { @@ -292,7 +292,7 @@ template<> struct Formatter : Formatter { ErrorOr format(FormatBuilder& builder, IPv6Address const& value) { - return Formatter::format(builder, value.to_string()); + return Formatter::format(builder, value.to_deprecated_string()); } }; #endif diff --git a/AK/JsonArray.h b/AK/JsonArray.h index 9cf205a138a..585a7be077e 100644 --- a/AK/JsonArray.h +++ b/AK/JsonArray.h @@ -71,7 +71,7 @@ public: template void serialize(Builder&) const; - [[nodiscard]] DeprecatedString to_string() const { return serialized(); } + [[nodiscard]] DeprecatedString to_deprecated_string() const { return serialized(); } template void for_each(Callback callback) const diff --git a/AK/JsonObject.h b/AK/JsonObject.h index 47772ad66fd..a6cf4883dd3 100644 --- a/AK/JsonObject.h +++ b/AK/JsonObject.h @@ -166,7 +166,7 @@ public: template void serialize(Builder&) const; - [[nodiscard]] DeprecatedString to_string() const { return serialized(); } + [[nodiscard]] DeprecatedString to_deprecated_string() const { return serialized(); } private: OrderedHashMap m_members; diff --git a/AK/JsonParser.cpp b/AK/JsonParser.cpp index a04de23eaca..bde540a634f 100644 --- a/AK/JsonParser.cpp +++ b/AK/JsonParser.cpp @@ -118,7 +118,7 @@ ErrorOr JsonParser::consume_and_unescape_string() if (!consume_specific('"')) return Error::from_string_literal("JsonParser: Expected '\"'"); - return final_sb.to_string(); + return final_sb.to_deprecated_string(); } ErrorOr JsonParser::parse_object() diff --git a/AK/JsonPath.cpp b/AK/JsonPath.cpp index ad0e0897279..6668f22622d 100644 --- a/AK/JsonPath.cpp +++ b/AK/JsonPath.cpp @@ -31,16 +31,16 @@ JsonValue JsonPath::resolve(JsonValue const& top_root) const return root; } -DeprecatedString JsonPath::to_string() const +DeprecatedString JsonPath::to_deprecated_string() const { StringBuilder builder; builder.append("{ ."sv); for (auto const& el : *this) { builder.append("sv > "sv); - builder.append(el.to_string()); + builder.append(el.to_deprecated_string()); } builder.append("sv }"sv); - return builder.to_string(); + return builder.to_deprecated_string(); } } diff --git a/AK/JsonPath.h b/AK/JsonPath.h index 7733a27aa83..9b8364cdb03 100644 --- a/AK/JsonPath.h +++ b/AK/JsonPath.h @@ -46,7 +46,7 @@ public: return m_index; } - DeprecatedString to_string() const + DeprecatedString to_deprecated_string() const { switch (m_kind) { case Kind::Key: @@ -90,7 +90,7 @@ private: class JsonPath : public Vector { public: JsonValue resolve(JsonValue const&) const; - DeprecatedString to_string() const; + DeprecatedString to_deprecated_string() const; }; } diff --git a/AK/JsonValue.cpp b/AK/JsonValue.cpp index d7b04ec8f00..d3438e2dee6 100644 --- a/AK/JsonValue.cpp +++ b/AK/JsonValue.cpp @@ -186,7 +186,7 @@ JsonValue::JsonValue(DeprecatedString const& value) } JsonValue::JsonValue(StringView value) - : JsonValue(value.to_string()) + : JsonValue(value.to_deprecated_string()) { } diff --git a/AK/JsonValue.h b/AK/JsonValue.h index c09b5d07838..8f5dd904ad3 100644 --- a/AK/JsonValue.h +++ b/AK/JsonValue.h @@ -84,7 +84,7 @@ public: return alternative; } - DeprecatedString to_string() const + DeprecatedString to_deprecated_string() const { if (is_string()) return as_string(); @@ -283,7 +283,7 @@ template<> struct Formatter : Formatter { ErrorOr format(FormatBuilder& builder, JsonValue const& value) { - return Formatter::format(builder, value.to_string()); + return Formatter::format(builder, value.to_deprecated_string()); } }; #endif diff --git a/AK/LexicalPath.cpp b/AK/LexicalPath.cpp index 412d26f49aa..77e09f7abe2 100644 --- a/AK/LexicalPath.cpp +++ b/AK/LexicalPath.cpp @@ -118,7 +118,7 @@ DeprecatedString LexicalPath::canonicalized_path(DeprecatedString path) if (is_absolute) builder.append('/'); builder.join('/', canonical_parts); - return builder.to_string(); + return builder.to_deprecated_string(); } DeprecatedString LexicalPath::absolute_path(DeprecatedString dir_path, DeprecatedString target) diff --git a/AK/LexicalPath.h b/AK/LexicalPath.h index f5e0ec71f94..1001cb2d3ff 100644 --- a/AK/LexicalPath.h +++ b/AK/LexicalPath.h @@ -49,7 +49,7 @@ public: builder.append(first); ((builder.append('/'), builder.append(forward(rest))), ...); - return LexicalPath { builder.to_string() }; + return LexicalPath { builder.to_deprecated_string() }; } [[nodiscard]] static DeprecatedString dirname(DeprecatedString path) diff --git a/AK/MACAddress.h b/AK/MACAddress.h index 3a969748fd4..d347bc97264 100644 --- a/AK/MACAddress.h +++ b/AK/MACAddress.h @@ -64,7 +64,7 @@ public: return Kernel::KString::formatted("{:02x}:{:02x}:{:02x}:{:02x}:{:02x}:{:02x}", m_data[0], m_data[1], m_data[2], m_data[3], m_data[4], m_data[5]); } #else - DeprecatedString to_string() const + DeprecatedString to_deprecated_string() const { return DeprecatedString::formatted("{:02x}:{:02x}:{:02x}:{:02x}:{:02x}:{:02x}", m_data[0], m_data[1], m_data[2], m_data[3], m_data[4], m_data[5]); } diff --git a/AK/NumberFormat.h b/AK/NumberFormat.h index 3267d6af225..db9a4dcda83 100644 --- a/AK/NumberFormat.h +++ b/AK/NumberFormat.h @@ -60,7 +60,7 @@ static inline DeprecatedString human_readable_time(i64 time_in_seconds) builder.appendff("{} second{}", time_in_seconds, time_in_seconds == 1 ? "" : "s"); - return builder.to_string(); + return builder.to_deprecated_string(); } static inline DeprecatedString human_readable_digital_time(i64 time_in_seconds) @@ -78,7 +78,7 @@ static inline DeprecatedString human_readable_digital_time(i64 time_in_seconds) builder.appendff("{:02}:", minutes); builder.appendff("{:02}", time_in_seconds); - return builder.to_string(); + return builder.to_deprecated_string(); } } diff --git a/AK/ScopeLogger.h b/AK/ScopeLogger.h index 3161e5b4089..92b3699d5dc 100644 --- a/AK/ScopeLogger.h +++ b/AK/ScopeLogger.h @@ -24,9 +24,9 @@ public: for (auto indent = m_depth++; indent > 0; indent--) sb.append(' '); if (m_extra.is_empty()) - dbgln("\033[1;{}m{}entering {}\033[0m", m_depth % 8 + 30, sb.to_string(), m_location); + dbgln("\033[1;{}m{}entering {}\033[0m", m_depth % 8 + 30, sb.to_deprecated_string(), m_location); else - dbgln("\033[1;{}m{}entering {}\033[0m ({})", m_depth % 8 + 30, sb.to_string(), m_location, m_extra); + dbgln("\033[1;{}m{}entering {}\033[0m ({})", m_depth % 8 + 30, sb.to_deprecated_string(), m_location, m_extra); } ScopeLogger(SourceLocation location = SourceLocation::current()) @@ -42,9 +42,9 @@ public: for (auto indent = --m_depth; indent > 0; indent--) sb.append(' '); if (m_extra.is_empty()) - dbgln("\033[1;{}m{}leaving {}\033[0m", depth % 8 + 30, sb.to_string(), m_location); + dbgln("\033[1;{}m{}leaving {}\033[0m", depth % 8 + 30, sb.to_deprecated_string(), m_location); else - dbgln("\033[1;{}m{}leaving {}\033[0m ({})", depth % 8 + 30, sb.to_string(), m_location, m_extra); + dbgln("\033[1;{}m{}leaving {}\033[0m ({})", depth % 8 + 30, sb.to_deprecated_string(), m_location, m_extra); } private: diff --git a/AK/StringBuilder.cpp b/AK/StringBuilder.cpp index b0c0e95edd5..9db7c9f23ef 100644 --- a/AK/StringBuilder.cpp +++ b/AK/StringBuilder.cpp @@ -104,7 +104,7 @@ ByteBuffer StringBuilder::to_byte_buffer() const } #ifndef KERNEL -DeprecatedString StringBuilder::to_string() const +DeprecatedString StringBuilder::to_deprecated_string() const { if (is_empty()) return DeprecatedString::empty(); @@ -113,7 +113,7 @@ DeprecatedString StringBuilder::to_string() const DeprecatedString StringBuilder::build() const { - return to_string(); + return to_deprecated_string(); } #endif diff --git a/AK/StringBuilder.h b/AK/StringBuilder.h index 73e86a68156..e5c62cb4d0f 100644 --- a/AK/StringBuilder.h +++ b/AK/StringBuilder.h @@ -61,7 +61,7 @@ public: #ifndef KERNEL [[nodiscard]] DeprecatedString build() const; - [[nodiscard]] DeprecatedString to_string() const; + [[nodiscard]] DeprecatedString to_deprecated_string() const; #endif [[nodiscard]] ByteBuffer to_byte_buffer() const; diff --git a/AK/StringUtils.cpp b/AK/StringUtils.cpp index fea26be6b61..f72d3ec6eae 100644 --- a/AK/StringUtils.cpp +++ b/AK/StringUtils.cpp @@ -473,7 +473,7 @@ DeprecatedString to_snakecase(StringView str) builder.append('_'); builder.append_as_lowercase(ch); } - return builder.to_string(); + return builder.to_deprecated_string(); } DeprecatedString to_titlecase(StringView str) @@ -489,7 +489,7 @@ DeprecatedString to_titlecase(StringView str) next_is_upper = ch == ' '; } - return builder.to_string(); + return builder.to_deprecated_string(); } DeprecatedString invert_case(StringView str) @@ -503,7 +503,7 @@ DeprecatedString invert_case(StringView str) builder.append(to_ascii_lowercase(ch)); } - return builder.to_string(); + return builder.to_deprecated_string(); } DeprecatedString replace(StringView str, StringView needle, StringView replacement, ReplaceMode replace_mode) diff --git a/AK/StringView.cpp b/AK/StringView.cpp index d7bf7e41d96..f6b6c3648d3 100644 --- a/AK/StringView.cpp +++ b/AK/StringView.cpp @@ -251,7 +251,7 @@ bool StringView::operator==(DeprecatedString const& string) const return *this == string.view(); } -DeprecatedString StringView::to_string() const { return DeprecatedString { *this }; } +DeprecatedString StringView::to_deprecated_string() const { return DeprecatedString { *this }; } DeprecatedString StringView::replace(StringView needle, StringView replacement, ReplaceMode replace_mode) const { diff --git a/AK/StringView.h b/AK/StringView.h index dfd07d01434..d846e2eb084 100644 --- a/AK/StringView.h +++ b/AK/StringView.h @@ -288,7 +288,7 @@ public: constexpr bool operator>=(StringView other) const { return compare(other) >= 0; } #ifndef KERNEL - [[nodiscard]] DeprecatedString to_string() const; + [[nodiscard]] DeprecatedString to_deprecated_string() const; #endif [[nodiscard]] bool is_whitespace() const diff --git a/AK/URL.cpp b/AK/URL.cpp index 115a5914cb9..3be7dda54e0 100644 --- a/AK/URL.cpp +++ b/AK/URL.cpp @@ -36,7 +36,7 @@ DeprecatedString URL::path() const builder.append('/'); builder.append(path); } - return builder.to_string(); + return builder.to_deprecated_string(); } URL URL::complete_url(DeprecatedString const& string) const @@ -226,7 +226,7 @@ DeprecatedString URL::serialize_data_url() const // NOTE: The specification does not say anything about encoding this, but we should encode at least control and non-ASCII // characters (since this is also a valid representation of the same data URL). builder.append(URL::percent_encode(m_data_payload, PercentEncodeSet::C0Control)); - return builder.to_string(); + return builder.to_deprecated_string(); } // https://url.spec.whatwg.org/#concept-url-serializer @@ -276,7 +276,7 @@ DeprecatedString URL::serialize(ExcludeFragment exclude_fragment) const builder.append(percent_encode(m_fragment, PercentEncodeSet::Fragment)); } - return builder.to_string(); + return builder.to_deprecated_string(); } // https://url.spec.whatwg.org/#url-rendering @@ -320,7 +320,7 @@ DeprecatedString URL::serialize_for_display() const builder.append(percent_encode(m_fragment, PercentEncodeSet::Fragment)); } - return builder.to_string(); + return builder.to_deprecated_string(); } // https://html.spec.whatwg.org/multipage/origin.html#ascii-serialisation-of-an-origin @@ -429,7 +429,7 @@ DeprecatedString URL::percent_encode(StringView input, URL::PercentEncodeSet set else append_percent_encoded_if_necessary(builder, code_point, set); } - return builder.to_string(); + return builder.to_deprecated_string(); } DeprecatedString URL::percent_decode(StringView input) @@ -451,7 +451,7 @@ DeprecatedString URL::percent_decode(StringView input) builder.append(byte); } } - return builder.to_string(); + return builder.to_deprecated_string(); } } diff --git a/AK/URL.h b/AK/URL.h index 31a069809b4..ef98d869e40 100644 --- a/AK/URL.h +++ b/AK/URL.h @@ -81,7 +81,7 @@ public: DeprecatedString serialize(ExcludeFragment = ExcludeFragment::No) const; DeprecatedString serialize_for_display() const; - DeprecatedString to_string() const { return serialize(); } + DeprecatedString to_deprecated_string() const { return serialize(); } // HTML origin DeprecatedString serialize_origin() const; @@ -160,7 +160,7 @@ struct Formatter : Formatter { template<> struct Traits : public GenericTraits { - static unsigned hash(URL const& url) { return url.to_string().hash(); } + static unsigned hash(URL const& url) { return url.to_deprecated_string().hash(); } }; } diff --git a/AK/URLParser.cpp b/AK/URLParser.cpp index f618f322556..5fcbb9209b2 100644 --- a/AK/URLParser.cpp +++ b/AK/URLParser.cpp @@ -148,7 +148,7 @@ static DeprecatedString percent_encode_after_encoding(StringView input, URL::Per } // 6. Return output. - return output.to_string(); + return output.to_deprecated_string(); } // https://fetch.spec.whatwg.org/#data-urls @@ -293,7 +293,7 @@ URL URLParser::parse(StringView raw_input, URL const* base_url, Optional ur if (is_ascii_alphanumeric(code_point) || code_point == '+' || code_point == '-' || code_point == '.') { buffer.append_as_lowercase(code_point); } else if (code_point == ':') { - url->m_scheme = buffer.to_string(); + url->m_scheme = buffer.to_deprecated_string(); buffer.clear(); if (url->scheme() == "file") { if (!get_remaining().starts_with("//"sv)) { @@ -425,7 +425,7 @@ URL URLParser::parse(StringView raw_input, URL const* base_url, Optional ur if (code_point == '@') { report_validation_error(); if (at_sign_seen) { - auto content = buffer.to_string(); + auto content = buffer.to_deprecated_string(); buffer.clear(); buffer.append("%40"sv); buffer.append(content); diff --git a/AK/UUID.cpp b/AK/UUID.cpp index 7394b797fe0..0c406b4d1e9 100644 --- a/AK/UUID.cpp +++ b/AK/UUID.cpp @@ -97,7 +97,7 @@ ErrorOr> UUID::to_string() const return Kernel::KString::try_create(builder.string_view()); } #else -DeprecatedString UUID::to_string() const +DeprecatedString UUID::to_deprecated_string() const { StringBuilder builder(36); builder.append(encode_hex(m_uuid_buffer.span().trim(4)).view()); @@ -109,7 +109,7 @@ DeprecatedString UUID::to_string() const builder.append(encode_hex(m_uuid_buffer.span().slice(8).trim(2)).view()); builder.append('-'); builder.append(encode_hex(m_uuid_buffer.span().slice(10).trim(6)).view()); - return builder.to_string(); + return builder.to_deprecated_string(); } #endif diff --git a/AK/UUID.h b/AK/UUID.h index bd863fcb5ce..89135b30075 100644 --- a/AK/UUID.h +++ b/AK/UUID.h @@ -36,7 +36,7 @@ public: #ifdef KERNEL ErrorOr> to_string() const; #else - DeprecatedString to_string() const; + DeprecatedString to_deprecated_string() const; #endif bool is_zero() const; diff --git a/Documentation/Patterns.md b/Documentation/Patterns.md index e2d28cc9634..6b9323e332a 100644 --- a/Documentation/Patterns.md +++ b/Documentation/Patterns.md @@ -75,7 +75,7 @@ void log_that_can_not_fail(StringView fmtstr, TypeErasedFormatParams& params) { StringBuilder builder; MUST(vformat(builder, fmtstr, params)); - return builder.to_string(); + return builder.to_deprecated_string(); } ``` diff --git a/Meta/Lagom/TestJson.cpp b/Meta/Lagom/TestJson.cpp index 132daeea034..94c75c019a3 100644 --- a/Meta/Lagom/TestJson.cpp +++ b/Meta/Lagom/TestJson.cpp @@ -11,7 +11,7 @@ int main(int, char**) { auto value = JsonValue::from_string("{\"property\": \"value\"}"sv).release_value_but_fixme_should_propagate_errors(); - printf("parsed: _%s_\n", value.to_string().characters()); - printf("object.property = '%s'\n", value.as_object().get("property"sv).to_string().characters()); + printf("parsed: _%s_\n", value.to_deprecated_string().characters()); + printf("object.property = '%s'\n", value.as_object().get("property"sv).to_deprecated_string().characters()); return 0; } diff --git a/Meta/Lagom/Tools/CodeGenerators/IPCCompiler/main.cpp b/Meta/Lagom/Tools/CodeGenerators/IPCCompiler/main.cpp index 32fb7b5c70c..3fc82c036b5 100644 --- a/Meta/Lagom/Tools/CodeGenerators/IPCCompiler/main.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/IPCCompiler/main.cpp @@ -36,7 +36,7 @@ static DeprecatedString pascal_case(DeprecatedString const& identifier) } else builder.append(ch); } - return builder.to_string(); + return builder.to_deprecated_string(); } struct Message { @@ -50,7 +50,7 @@ struct Message { StringBuilder builder; builder.append(pascal_case(name)); builder.append("Response"sv); - return builder.to_string(); + return builder.to_deprecated_string(); } }; @@ -75,7 +75,7 @@ static DeprecatedString message_name(DeprecatedString const& endpoint, Deprecate builder.append(pascal_case(message)); if (is_response) builder.append("Response"sv); - return builder.to_string(); + return builder.to_deprecated_string(); } Vector parse(ByteBuffer const& file_contents) @@ -262,7 +262,7 @@ DeprecatedString constructor_for_message(DeprecatedString const& name, Vector const& parameters, DeprecatedString const& response_type = {}) @@ -683,7 +683,7 @@ public: message_generator.set("message.pascal_name", pascal_case(name)); message_generator.set("message.response_type", pascal_case(message.response_name())); message_generator.set("handler_name", name); - message_generator.set("arguments", argument_generator.to_string()); + message_generator.set("arguments", argument_generator.to_deprecated_string()); message_generator.appendln(R"~~~( case (int)Messages::@endpoint.name@::MessageID::@message.pascal_name@: {)~~~"); if (returns_something) { @@ -740,7 +740,7 @@ public: if (const_ref) builder.append(" const&"sv); - return builder.to_string(); + return builder.to_deprecated_string(); }; for (size_t i = 0; i < parameters.size(); ++i) { diff --git a/Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateUnicodeData.cpp b/Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateUnicodeData.cpp index 82cb41784d1..eff1b35cc78 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateUnicodeData.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateUnicodeData.cpp @@ -174,7 +174,7 @@ static DeprecatedString sanitize_entry(DeprecatedString const& entry) next_is_upper = ch == '_'; } - return builder.to_string(); + return builder.to_deprecated_string(); } static Vector parse_code_point_list(StringView list) @@ -451,7 +451,7 @@ static ErrorOr parse_normalization_props(Core::Stream::BufferedFile& file, VERIFY((segments.size() == 2) || (segments.size() == 3)); auto code_point_range = parse_code_point_range(segments[0].trim_whitespace()); - auto property = segments[1].trim_whitespace().to_string(); + auto property = segments[1].trim_whitespace().to_deprecated_string(); Vector value; QuickCheck quick_check = QuickCheck::Yes; diff --git a/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp b/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp index 5ceab3934df..3c0c35836e0 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp @@ -89,7 +89,7 @@ static DeprecatedString union_type_to_variant(UnionType const& union_type, Inter builder.append(", Empty"sv); builder.append('>'); - return builder.to_string(); + return builder.to_deprecated_string(); } CppType idl_type_name_to_cpp_type(Type const& type, Interface const& interface) @@ -174,7 +174,7 @@ static DeprecatedString make_input_acceptable_cpp(DeprecatedString const& input) StringBuilder builder; builder.append(input); builder.append('_'); - return builder.to_string(); + return builder.to_deprecated_string(); } return input.replace("-"sv, "_"sv, ReplaceMode::All); @@ -893,7 +893,7 @@ static void generate_to_cpp(SourceGenerator& generator, ParameterType& parameter if (dictionary_type) to_variant_captures.append(DeprecatedString::formatted(", &{}{}_to_dictionary", js_name, js_suffix)); - union_generator.set("to_variant_captures", to_variant_captures.to_string()); + union_generator.set("to_variant_captures", to_variant_captures.to_deprecated_string()); union_generator.append(R"~~~( auto @js_name@@js_suffix@_to_variant = [@to_variant_captures@](JS::Value @js_name@@js_suffix@) -> JS::ThrowCompletionOr<@union_type@> { @@ -1527,7 +1527,7 @@ static void generate_wrap_statement(SourceGenerator& generator, DeprecatedString )~~~"); } else if (interface.enumerations.contains(type.name())) { scoped_generator.append(R"~~~( - @result_expression@ JS::js_string(vm, Bindings::idl_enum_to_string(@value@)); + @result_expression@ JS::js_string(vm, Bindings::idl_enum_to_deprecated_string(@value@)); )~~~"); } else if (interface.callback_functions.contains(type.name())) { // https://webidl.spec.whatwg.org/#es-callback-function @@ -1837,7 +1837,7 @@ static DeprecatedString generate_constructor_for_idl_type(Type const& type) builder.appendff("make_ref_counted(\"{}\", {}, NonnullRefPtrVector {{", type.name(), type.is_nullable()); append_type_list(builder, parameterized_type.parameters()); builder.append("})"sv); - return builder.to_string(); + return builder.to_deprecated_string(); } case Type::Kind::Union: { auto const& union_type = type.as_union(); @@ -1845,7 +1845,7 @@ static DeprecatedString generate_constructor_for_idl_type(Type const& type) builder.appendff("make_ref_counted(\"{}\", {}, NonnullRefPtrVector {{", type.name(), type.is_nullable()); append_type_list(builder, union_type.member_types()); builder.append("})"sv); - return builder.to_string(); + return builder.to_deprecated_string(); } } @@ -1931,8 +1931,8 @@ JS_DEFINE_NATIVE_FUNCTION(@class_name@::@function.name:snakecase@) optionality_builder.append("}"sv); function_generator.set("overload.callable_id", DeprecatedString::number(overload.callable_id)); - function_generator.set("overload.types", types_builder.to_string()); - function_generator.set("overload.optionality_values", optionality_builder.to_string()); + function_generator.set("overload.types", types_builder.to_deprecated_string()); + function_generator.set("overload.optionality_values", optionality_builder.to_deprecated_string()); function_generator.appendln(" overloads.empend(@overload.callable_id@, @overload.types@, @overload.optionality_values@);"); } @@ -2326,7 +2326,7 @@ enum class @enum.type.name@ { enum_generator.append(R"~~~( }; -inline DeprecatedString idl_enum_to_string(@enum.type.name@ value) { +inline DeprecatedString idl_enum_to_deprecated_string(@enum.type.name@ value) { switch(value) { )~~~"); for (auto& entry : it.value.translated_cpp_names) { @@ -2730,7 +2730,7 @@ JS_DEFINE_NATIVE_FUNCTION(@class_name@::to_string) )~~~"); } else { stringifier_generator.append(R"~~~( - auto retval = TRY(throw_dom_exception_if_needed(vm, [&] { return impl->to_string(); })); + auto retval = TRY(throw_dom_exception_if_needed(vm, [&] { return impl->to_deprecated_string(); })); )~~~"); } stringifier_generator.append(R"~~~( diff --git a/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/main.cpp b/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/main.cpp index 7e461591586..e332d3a3912 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/main.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/main.cpp @@ -104,7 +104,7 @@ int main(int argc, char** argv) builder.append(namespace_); builder.append("::"sv); builder.append(interface.name); - interface.fully_qualified_name = builder.to_string(); + interface.fully_qualified_name = builder.to_deprecated_string(); } else { interface.fully_qualified_name = interface.name; } diff --git a/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSEnums.cpp b/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSEnums.cpp index bb31170488e..891d43f0bcc 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSEnums.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSEnums.cpp @@ -77,7 +77,7 @@ enum class ValueID; enum_generator.appendln("enum class @name:titlecase@ : @enum_type@ {"); for (auto& member : members.values()) { - auto member_name = member.to_string(); + auto member_name = member.to_deprecated_string(); // Don't include aliases in the enum. if (member_name.contains('=')) continue; @@ -126,7 +126,7 @@ Optional<@name:titlecase@> value_id_to_@name:snakecase@(ValueID value_id) for (auto& member : members.values()) { auto member_generator = enum_generator.fork(); - auto member_name = member.to_string(); + auto member_name = member.to_deprecated_string(); if (member_name.contains('=')) { auto parts = member_name.split_view('='); member_generator.set("valueid:titlecase", title_casify(parts[0])); @@ -154,7 +154,7 @@ ValueID to_value_id(@name:titlecase@ @name:snakecase@_value) for (auto& member : members.values()) { auto member_generator = enum_generator.fork(); - auto member_name = member.to_string(); + auto member_name = member.to_deprecated_string(); if (member_name.contains('=')) continue; member_generator.set("member:titlecase", title_casify(member_name)); @@ -178,7 +178,7 @@ StringView to_string(@name:titlecase@ value) for (auto& member : members.values()) { auto member_generator = enum_generator.fork(); - auto member_name = member.to_string(); + auto member_name = member.to_deprecated_string(); if (member_name.contains('=')) continue; member_generator.set("member:css", member_name); diff --git a/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSPropertyID.cpp b/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSPropertyID.cpp index acfbfe9c4b4..acad46baeb4 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSPropertyID.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSPropertyID.cpp @@ -585,7 +585,7 @@ size_t property_maximum_value_count(PropertyID property_id) VERIFY(max_values.is_number() && !max_values.is_double()); auto property_generator = generator.fork(); property_generator.set("name:titlecase", title_casify(name)); - property_generator.set("max_values", max_values.to_string()); + property_generator.set("max_values", max_values.to_deprecated_string()); property_generator.append(R"~~~( case PropertyID::@name:titlecase@: return @max_values@; diff --git a/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSTransformFunctions.cpp b/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSTransformFunctions.cpp index 8976edacf36..fb81e03399c 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSTransformFunctions.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSTransformFunctions.cpp @@ -45,7 +45,7 @@ static DeprecatedString title_casify_transform_function(StringView input) StringBuilder builder; builder.append(toupper(input[0])); builder.append(input.substring_view(1)); - return builder.to_string(); + return builder.to_deprecated_string(); } ErrorOr generate_header_file(JsonObject& transforms_data, Core::Stream::File& file) @@ -189,7 +189,7 @@ TransformFunctionMetadata transform_function_metadata(TransformFunction transfor member_generator.append(first ? " "sv : ", "sv); first = false; - member_generator.append(DeprecatedString::formatted("{{ TransformFunctionParameterType::{}, {}}}", parameter_type, value.as_object().get("required"sv).to_string())); + member_generator.append(DeprecatedString::formatted("{{ TransformFunctionParameterType::{}, {}}}", parameter_type, value.as_object().get("required"sv).to_deprecated_string())); }); member_generator.append(R"~~~( } diff --git a/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSValueID.cpp b/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSValueID.cpp index 29a30fea72d..07870208408 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSValueID.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSValueID.cpp @@ -57,7 +57,7 @@ enum class ValueID { identifier_data.for_each([&](auto& name) { auto member_generator = generator.fork(); - member_generator.set("name:titlecase", title_casify(name.to_string())); + member_generator.set("name:titlecase", title_casify(name.to_deprecated_string())); member_generator.append(R"~~~( @name:titlecase@, @@ -95,8 +95,8 @@ ValueID value_id_from_string(StringView string) identifier_data.for_each([&](auto& name) { auto member_generator = generator.fork(); - member_generator.set("name", name.to_string()); - member_generator.set("name:titlecase", title_casify(name.to_string())); + member_generator.set("name", name.to_deprecated_string()); + member_generator.set("name:titlecase", title_casify(name.to_deprecated_string())); member_generator.append(R"~~~( if (string.equals_ignoring_case("@name@"sv)) return ValueID::@name:titlecase@; @@ -113,8 +113,8 @@ const char* string_from_value_id(ValueID value_id) { identifier_data.for_each([&](auto& name) { auto member_generator = generator.fork(); - member_generator.set("name", name.to_string()); - member_generator.set("name:titlecase", title_casify(name.to_string())); + member_generator.set("name", name.to_deprecated_string()); + member_generator.set("name:titlecase", title_casify(name.to_deprecated_string())); member_generator.append(R"~~~( case ValueID::@name:titlecase@: return "@name@"; diff --git a/Meta/Lagom/Tools/CodeGenerators/LibWeb/GeneratorUtil.h b/Meta/Lagom/Tools/CodeGenerators/LibWeb/GeneratorUtil.h index e86d7c9451e..517543a135a 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibWeb/GeneratorUtil.h +++ b/Meta/Lagom/Tools/CodeGenerators/LibWeb/GeneratorUtil.h @@ -25,7 +25,7 @@ DeprecatedString title_casify(DeprecatedString const& dashy_name) continue; builder.append(part.substring_view(1, part.length() - 1)); } - return builder.to_string(); + return builder.to_deprecated_string(); } DeprecatedString camel_casify(StringView dashy_name) @@ -46,7 +46,7 @@ DeprecatedString camel_casify(StringView dashy_name) continue; builder.append(part.substring_view(1, part.length() - 1)); } - return builder.to_string(); + return builder.to_deprecated_string(); } DeprecatedString snake_casify(DeprecatedString const& dashy_name) diff --git a/Meta/Lagom/Tools/CodeGenerators/StateMachineGenerator/main.cpp b/Meta/Lagom/Tools/CodeGenerators/StateMachineGenerator/main.cpp index aff038ba598..8f6ab7de8cd 100644 --- a/Meta/Lagom/Tools/CodeGenerators/StateMachineGenerator/main.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/StateMachineGenerator/main.cpp @@ -159,7 +159,7 @@ parse_state_machine(StringView input) consume_whitespace(); state.exit_action = consume_identifier(); } else if (lexer.next_is('@')) { - auto directive = consume_identifier().to_string(); + auto directive = consume_identifier().to_deprecated_string(); fprintf(stderr, "Unimplemented @ directive %s\n", directive.characters()); exit(1); } else { @@ -189,7 +189,7 @@ parse_state_machine(StringView input) lexer.consume_specific('@'); state_machine->anywhere = consume_state_description(); } else if (lexer.consume_specific('@')) { - auto directive = consume_identifier().to_string(); + auto directive = consume_identifier().to_deprecated_string(); fprintf(stderr, "Unimplemented @ directive %s\n", directive.characters()); exit(1); } else { diff --git a/Meta/Lagom/Tools/ConfigureComponents/main.cpp b/Meta/Lagom/Tools/ConfigureComponents/main.cpp index c499ceff2f3..4a15234c61a 100644 --- a/Meta/Lagom/Tools/ConfigureComponents/main.cpp +++ b/Meta/Lagom/Tools/ConfigureComponents/main.cpp @@ -290,7 +290,7 @@ int main() } // NOTE: Required components will always be preselected. - WhiptailOption option { component.name, component.name, description_builder.to_string(), is_required }; + WhiptailOption option { component.name, component.name, description_builder.to_deprecated_string(), is_required }; if (build_type == "REQUIRED") { // noop } else if (build_type == "RECOMMENDED") { diff --git a/Meta/Lagom/Wasm/js_repl.cpp b/Meta/Lagom/Wasm/js_repl.cpp index 316279f1868..232df58c7ea 100644 --- a/Meta/Lagom/Wasm/js_repl.cpp +++ b/Meta/Lagom/Wasm/js_repl.cpp @@ -125,7 +125,7 @@ static bool parse_and_run(JS::Interpreter& interpreter, StringView source, Strin if (JS::Bytecode::g_dump_bytecode || s_run_bytecode) { auto executable_result = JS::Bytecode::Generator::generate(script_or_module->parse_node()); if (executable_result.is_error()) { - result = g_vm->throw_completion(executable_result.error().to_string()); + result = g_vm->throw_completion(executable_result.error().to_deprecated_string()); return ReturnEarly::No; } @@ -163,8 +163,8 @@ static bool parse_and_run(JS::Interpreter& interpreter, StringView source, Strin auto hint = error.source_location_hint(source); if (!hint.is_empty()) displayln("{}", hint); - displayln("{}", error.to_string()); - result = interpreter.vm().throw_completion(error.to_string()); + displayln("{}", error.to_deprecated_string()); + result = interpreter.vm().throw_completion(error.to_deprecated_string()); } else { auto return_early = run_script_or_module(script_or_error.value()); if (return_early == ReturnEarly::Yes) @@ -177,8 +177,8 @@ static bool parse_and_run(JS::Interpreter& interpreter, StringView source, Strin auto hint = error.source_location_hint(source); if (!hint.is_empty()) displayln("{}", hint); - displayln(error.to_string()); - result = interpreter.vm().throw_completion(error.to_string()); + displayln(error.to_deprecated_string()); + result = interpreter.vm().throw_completion(error.to_deprecated_string()); } else { auto return_early = run_script_or_module(module_or_error.value()); if (return_early == ReturnEarly::Yes) diff --git a/Tests/AK/TestDeprecatedString.cpp b/Tests/AK/TestDeprecatedString.cpp index 6da18196c18..0502df68385 100644 --- a/Tests/AK/TestDeprecatedString.cpp +++ b/Tests/AK/TestDeprecatedString.cpp @@ -156,7 +156,7 @@ TEST_CASE(flystring) StringBuilder builder; builder.append('f'); builder.append("oo"sv); - FlyString c = builder.to_string(); + FlyString c = builder.to_deprecated_string(); EXPECT_EQ(a.impl(), b.impl()); EXPECT_EQ(a.impl(), c.impl()); } diff --git a/Tests/AK/TestFormat.cpp b/Tests/AK/TestFormat.cpp index 46dd4800dda..f5245e2d4a3 100644 --- a/Tests/AK/TestFormat.cpp +++ b/Tests/AK/TestFormat.cpp @@ -64,7 +64,7 @@ TEST_CASE(string_builder) builder.appendff(" {} ", 42); builder.appendff("{1}{0} ", 1, 2); - EXPECT_EQ(builder.to_string(), " 42 21 "); + EXPECT_EQ(builder.to_deprecated_string(), " 42 21 "); } TEST_CASE(format_without_arguments) diff --git a/Tests/AK/TestIPv4Address.cpp b/Tests/AK/TestIPv4Address.cpp index 48c27ee811c..aaac975daa3 100644 --- a/Tests/AK/TestIPv4Address.cpp +++ b/Tests/AK/TestIPv4Address.cpp @@ -61,7 +61,7 @@ TEST_CASE(should_convert_to_string) { constexpr IPv4Address addr(1, 25, 39, 42); - EXPECT_EQ("1.25.39.42", addr.to_string()); + EXPECT_EQ("1.25.39.42", addr.to_deprecated_string()); } TEST_CASE(should_make_ipv4_address_from_string) diff --git a/Tests/AK/TestIPv6Address.cpp b/Tests/AK/TestIPv6Address.cpp index a8cfb1f33bd..1ee50f8b0cb 100644 --- a/Tests/AK/TestIPv6Address.cpp +++ b/Tests/AK/TestIPv6Address.cpp @@ -55,14 +55,14 @@ TEST_CASE(should_get_groups_by_index) TEST_CASE(should_convert_to_string) { - EXPECT_EQ("102:304:506:708:90a:b0c:d0e:f10"sv, IPv6Address({ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }).to_string()); - EXPECT_EQ("::"sv, IPv6Address().to_string()); - EXPECT_EQ("::1"sv, IPv6Address({ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 }).to_string()); - EXPECT_EQ("1::"sv, IPv6Address({ 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }).to_string()); - EXPECT_EQ("102:0:506:708:900::10"sv, IPv6Address({ 1, 2, 0, 0, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 0, 16 }).to_string()); - EXPECT_EQ("102:0:506:708:900::"sv, IPv6Address({ 1, 2, 0, 0, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 0, 0 }).to_string()); - EXPECT_EQ("::304:506:708:90a:b0c:d0e:f10"sv, IPv6Address({ 0, 0, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }).to_string()); - EXPECT_EQ("102:304::708:90a:b0c:d0e:f10"sv, IPv6Address({ 1, 2, 3, 4, 0, 0, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }).to_string()); + EXPECT_EQ("102:304:506:708:90a:b0c:d0e:f10"sv, IPv6Address({ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }).to_deprecated_string()); + EXPECT_EQ("::"sv, IPv6Address().to_deprecated_string()); + EXPECT_EQ("::1"sv, IPv6Address({ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 }).to_deprecated_string()); + EXPECT_EQ("1::"sv, IPv6Address({ 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }).to_deprecated_string()); + EXPECT_EQ("102:0:506:708:900::10"sv, IPv6Address({ 1, 2, 0, 0, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 0, 16 }).to_deprecated_string()); + EXPECT_EQ("102:0:506:708:900::"sv, IPv6Address({ 1, 2, 0, 0, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 0, 0 }).to_deprecated_string()); + EXPECT_EQ("::304:506:708:90a:b0c:d0e:f10"sv, IPv6Address({ 0, 0, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }).to_deprecated_string()); + EXPECT_EQ("102:304::708:90a:b0c:d0e:f10"sv, IPv6Address({ 1, 2, 3, 4, 0, 0, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }).to_deprecated_string()); } TEST_CASE(should_make_ipv6_address_from_string) @@ -86,7 +86,7 @@ TEST_CASE(ipv4_mapped_ipv6) IPv6Address mapped_address(ipv4_address_to_map); EXPECT(mapped_address.is_ipv4_mapped()); EXPECT_EQ(ipv4_address_to_map, mapped_address.ipv4_mapped_address().value()); - EXPECT_EQ("::ffff:192.168.0.1"sv, mapped_address.to_string()); + EXPECT_EQ("::ffff:192.168.0.1"sv, mapped_address.to_deprecated_string()); EXPECT_EQ(IPv4Address(192, 168, 1, 9), IPv6Address::from_string("::FFFF:192.168.1.9"sv).value().ipv4_mapped_address().value()); EXPECT(!IPv6Address::from_string("::abcd:192.168.1.9"sv).has_value()); } diff --git a/Tests/AK/TestJSON.cpp b/Tests/AK/TestJSON.cpp index efae3144465..a04c3bcf929 100644 --- a/Tests/AK/TestJSON.cpp +++ b/Tests/AK/TestJSON.cpp @@ -40,7 +40,7 @@ TEST_CASE(load_form) EXPECT(form_json.is_object()); - auto name = form_json.as_object().get("name"sv).to_string(); + auto name = form_json.as_object().get("name"sv).to_deprecated_string(); EXPECT_EQ(name, "Form1"); @@ -111,13 +111,13 @@ TEST_CASE(json_duplicate_keys) json.set("test", "foo"); json.set("test", "bar"); json.set("test", "baz"); - EXPECT_EQ(json.to_string(), "{\"test\":\"baz\"}"); + EXPECT_EQ(json.to_deprecated_string(), "{\"test\":\"baz\"}"); } TEST_CASE(json_u64_roundtrip) { auto big_value = 0xffffffffffffffffull; - auto json = JsonValue(big_value).to_string(); + auto json = JsonValue(big_value).to_deprecated_string(); auto value = JsonValue::from_string(json); EXPECT_EQ_FORCE(value.is_error(), false); EXPECT_EQ(value.value().as_u64(), big_value); diff --git a/Tests/AK/TestMACAddress.cpp b/Tests/AK/TestMACAddress.cpp index eac35bb97ab..04e0a72282d 100644 --- a/Tests/AK/TestMACAddress.cpp +++ b/Tests/AK/TestMACAddress.cpp @@ -80,7 +80,7 @@ TEST_CASE(should_equality_compare) TEST_CASE(should_string_format) { MACAddress sut(1, 2, 3, 4, 5, 6); - EXPECT_EQ("01:02:03:04:05:06", sut.to_string()); + EXPECT_EQ("01:02:03:04:05:06", sut.to_deprecated_string()); } TEST_CASE(should_make_mac_address_from_string_numbers) diff --git a/Tests/AK/TestURL.cpp b/Tests/AK/TestURL.cpp index 66569e9a7e4..1042ac37559 100644 --- a/Tests/AK/TestURL.cpp +++ b/Tests/AK/TestURL.cpp @@ -367,21 +367,21 @@ TEST_CASE(leading_whitespace) { URL url { " https://foo.com/"sv }; EXPECT(url.is_valid()); - EXPECT_EQ(url.to_string(), "https://foo.com/"); + EXPECT_EQ(url.to_deprecated_string(), "https://foo.com/"); } TEST_CASE(trailing_whitespace) { URL url { "https://foo.com/ "sv }; EXPECT(url.is_valid()); - EXPECT_EQ(url.to_string(), "https://foo.com/"); + EXPECT_EQ(url.to_deprecated_string(), "https://foo.com/"); } TEST_CASE(leading_and_trailing_whitespace) { URL url { " https://foo.com/ "sv }; EXPECT(url.is_valid()); - EXPECT_EQ(url.to_string(), "https://foo.com/"); + EXPECT_EQ(url.to_deprecated_string(), "https://foo.com/"); } TEST_CASE(unicode) diff --git a/Tests/LibCpp/test-cpp-preprocessor.cpp b/Tests/LibCpp/test-cpp-preprocessor.cpp index 8ee7822636e..ba684dd0ba4 100644 --- a/Tests/LibCpp/test-cpp-preprocessor.cpp +++ b/Tests/LibCpp/test-cpp-preprocessor.cpp @@ -48,7 +48,7 @@ TEST_CASE(test_regression) EXPECT_EQ(tokens.size(), target_lines.size()); for (size_t i = 0; i < tokens.size(); ++i) { - EXPECT_EQ(tokens[i].to_string(), target_lines[i]); + EXPECT_EQ(tokens[i].to_deprecated_string(), target_lines[i]); } } } diff --git a/Tests/LibIMAP/TestQuotedPrintable.cpp b/Tests/LibIMAP/TestQuotedPrintable.cpp index a279818cf26..13b2aa1e15f 100644 --- a/Tests/LibIMAP/TestQuotedPrintable.cpp +++ b/Tests/LibIMAP/TestQuotedPrintable.cpp @@ -44,6 +44,6 @@ TEST_CASE(test_decode) illegal_character_builder.append(byte); } - auto illegal_character_decode = IMAP::decode_quoted_printable(illegal_character_builder.to_string()); + auto illegal_character_decode = IMAP::decode_quoted_printable(illegal_character_builder.to_deprecated_string()); EXPECT(illegal_character_decode.is_empty()); } diff --git a/Tests/LibJS/test-js.cpp b/Tests/LibJS/test-js.cpp index 8ab1cc6bf4e..719217318c0 100644 --- a/Tests/LibJS/test-js.cpp +++ b/Tests/LibJS/test-js.cpp @@ -62,14 +62,14 @@ TESTJS_GLOBAL_FUNCTION(mark_as_garbage, markAsGarbage) return execution_context->lexical_environment != nullptr; }); if (!outer_environment.has_value()) - return vm.throw_completion(JS::ErrorType::UnknownIdentifier, variable_name.string()); + return vm.throw_completion(JS::ErrorType::UnknownIdentifier, variable_name.deprecated_string()); - auto reference = TRY(vm.resolve_binding(variable_name.string(), outer_environment.value()->lexical_environment)); + auto reference = TRY(vm.resolve_binding(variable_name.deprecated_string(), outer_environment.value()->lexical_environment)); auto value = TRY(reference.get_value(vm)); if (!can_be_held_weakly(value)) - return vm.throw_completion(JS::ErrorType::CannotBeHeldWeakly, DeprecatedString::formatted("Variable with name {}", variable_name.string())); + return vm.throw_completion(JS::ErrorType::CannotBeHeldWeakly, DeprecatedString::formatted("Variable with name {}", variable_name.deprecated_string())); vm.heap().uproot_cell(&value.as_cell()); TRY(reference.delete_(vm)); diff --git a/Tests/LibJS/test-test262.cpp b/Tests/LibJS/test-test262.cpp index 89e425368b9..4b35d3683be 100644 --- a/Tests/LibJS/test-test262.cpp +++ b/Tests/LibJS/test-test262.cpp @@ -427,7 +427,7 @@ void write_per_file(HashMap const& result_map, Vectorwrite_or_error(complete_results.to_string().bytes())) + if (!file->write_or_error(complete_results.to_deprecated_string().bytes())) warnln("Failed to write per-file"); file->close(); } diff --git a/Tests/LibJS/test262-runner.cpp b/Tests/LibJS/test262-runner.cpp index e0a065cbd67..32b8aa2e60a 100644 --- a/Tests/LibJS/test262-runner.cpp +++ b/Tests/LibJS/test262-runner.cpp @@ -62,7 +62,7 @@ static Result parse_program(JS::Realm& realm, return TestError { NegativePhase::ParseOrEarly, "SyntaxError", - script_or_error.error()[0].to_string(), + script_or_error.error()[0].to_deprecated_string(), "" }; } @@ -93,7 +93,7 @@ static Result run_program(InterpreterT& interpreter, ScriptOrMo auto unit_result = JS::Bytecode::Generator::generate(program_node); if (unit_result.is_error()) { - result = JS::throw_completion(JS::InternalError::create(interpreter.realm(), DeprecatedString::formatted("TODO({})", unit_result.error().to_string()))); + result = JS::throw_completion(JS::InternalError::create(interpreter.realm(), DeprecatedString::formatted("TODO({})", unit_result.error().to_deprecated_string()))); } else { auto unit = unit_result.release_value(); auto optimization_level = s_enable_bytecode_optimizations ? JS::Bytecode::Interpreter::OptimizationLevel::Optimize : JS::Bytecode::Interpreter::OptimizationLevel::Default; @@ -160,7 +160,7 @@ static Result read_harness_file(StringView harness_file) } StringView contents_view = contents_or_error.value(); - s_cached_harness_files.set(harness_file, contents_view.to_string()); + s_cached_harness_files.set(harness_file, contents_view.to_deprecated_string()); cache = s_cached_harness_files.find(harness_file); VERIFY(cache != s_cached_harness_files.end()); } @@ -219,7 +219,7 @@ static Result run_test(StringView source, StringView filepath, return TestError { NegativePhase::ParseOrEarly, "SyntaxError", - parser.errors()[0].to_string(), + parser.errors()[0].to_deprecated_string(), "" }; } @@ -483,7 +483,7 @@ static bool verify_test(Result& result, TestMetadata const& met JsonObject expected_error_object; expected_error_object.set("phase", phase_to_string(metadata.phase)); - expected_error_object.set("type", metadata.type.to_string()); + expected_error_object.set("type", metadata.type.to_deprecated_string()); expected_error = expected_error_object; @@ -548,7 +548,7 @@ static bool g_in_assert = false; assert_fail_result.set("assert_fail", true); assert_fail_result.set("result", "assert_fail"); assert_fail_result.set("output", assert_failed_message); - outln(saved_stdout_fd, "RESULT {}{}", assert_fail_result.to_string(), '\0'); + outln(saved_stdout_fd, "RESULT {}{}", assert_fail_result.to_deprecated_string(), '\0'); // (Attempt to) Ensure that messages are written before quitting. fflush(saved_stdout_fd); fflush(stderr); @@ -728,7 +728,7 @@ int main(int argc, char** argv) StringBuilder builder { contents.size() + strict_length }; builder.append(use_strict); builder.append(contents); - source_with_strict = builder.to_string(); + source_with_strict = builder.to_deprecated_string(); } StringView with_strict = source_with_strict.view(); @@ -738,7 +738,7 @@ int main(int argc, char** argv) result_object.set("test", path); ScopeGuard output_guard = [&] { - outln(saved_stdout_fd, "RESULT {}{}", result_object.to_string(), '\0'); + outln(saved_stdout_fd, "RESULT {}{}", result_object.to_deprecated_string(), '\0'); fflush(saved_stdout_fd); }; diff --git a/Tests/LibRegex/Regex.cpp b/Tests/LibRegex/Regex.cpp index 8abf62dd7ff..7c48e74a0cb 100644 --- a/Tests/LibRegex/Regex.cpp +++ b/Tests/LibRegex/Regex.cpp @@ -377,7 +377,7 @@ TEST_CASE(ini_file_entries) if constexpr (REGEX_DEBUG) { for (auto& v : result.matches) - fprintf(stderr, "%s\n", v.view.to_string().characters()); + fprintf(stderr, "%s\n", v.view.to_deprecated_string().characters()); } EXPECT_EQ(result.matches.at(0).view, "[Window]"); @@ -1084,7 +1084,7 @@ TEST_CASE(single_match_flag) auto result = re.match("ABC"sv); EXPECT_EQ(result.success, true); EXPECT_EQ(result.matches.size(), 1u); - EXPECT_EQ(result.matches.first().view.to_string(), "A"sv); + EXPECT_EQ(result.matches.first().view.to_deprecated_string(), "A"sv); } } @@ -1097,7 +1097,7 @@ TEST_CASE(inversion_state_in_char_class) auto result = re.match("hello"sv); EXPECT_EQ(result.success, true); EXPECT_EQ(result.matches.size(), 1u); - EXPECT_EQ(result.matches.first().view.to_string(), "h"sv); + EXPECT_EQ(result.matches.first().view.to_deprecated_string(), "h"sv); } { Regex re("^(?:([^\\s!\"#%-,\\./;->@\\[-\\^`\\{-~]+(?=([=~}\\s/.)|]))))"sv, ECMAScriptFlags::Global); @@ -1105,8 +1105,8 @@ TEST_CASE(inversion_state_in_char_class) auto result = re.match("slideNumbers}}"sv); EXPECT_EQ(result.success, true); EXPECT_EQ(result.matches.size(), 1u); - EXPECT_EQ(result.matches.first().view.to_string(), "slideNumbers"sv); - EXPECT_EQ(result.capture_group_matches.first()[0].view.to_string(), "slideNumbers"sv); - EXPECT_EQ(result.capture_group_matches.first()[1].view.to_string(), "}"sv); + EXPECT_EQ(result.matches.first().view.to_deprecated_string(), "slideNumbers"sv); + EXPECT_EQ(result.capture_group_matches.first()[0].view.to_deprecated_string(), "slideNumbers"sv); + EXPECT_EQ(result.capture_group_matches.first()[1].view.to_deprecated_string(), "}"sv); } } diff --git a/Tests/LibRegex/RegexLibC.cpp b/Tests/LibRegex/RegexLibC.cpp index 3e68b96e7a7..1ff52499ef2 100644 --- a/Tests/LibRegex/RegexLibC.cpp +++ b/Tests/LibRegex/RegexLibC.cpp @@ -204,7 +204,7 @@ TEST_CASE(character_class2) fprintf(stderr, "Matches[%i].rm_so: %li, .rm_eo: %li .rm_cnt: %li: ", i, matches[i].rm_so, matches[i].rm_eo, matches[i].rm_cnt); fprintf(stderr, "haystack length: %lu\n", haystack.length()); if (matches[i].rm_so != -1) - fprintf(stderr, "%s\n", haystack.substring_view(matches[i].rm_so, matches[i].rm_eo - matches[i].rm_so).to_string().characters()); + fprintf(stderr, "%s\n", haystack.substring_view(matches[i].rm_so, matches[i].rm_eo - matches[i].rm_so).to_deprecated_string().characters()); } #endif diff --git a/Tests/LibSQL/TestSqlDatabase.cpp b/Tests/LibSQL/TestSqlDatabase.cpp index 021b43a74b9..a266706c482 100644 --- a/Tests/LibSQL/TestSqlDatabase.cpp +++ b/Tests/LibSQL/TestSqlDatabase.cpp @@ -69,7 +69,7 @@ void verify_table_contents(SQL::Database& db, int expected_count) for (auto& row : rows_or_error.value()) { StringBuilder builder; builder.appendff("Test{}", row["IntColumn"].to_int().value()); - EXPECT_EQ(row["TextColumn"].to_string(), builder.build()); + EXPECT_EQ(row["TextColumn"].to_deprecated_string(), builder.build()); count++; sum += row["IntColumn"].to_int().value(); } diff --git a/Tests/LibSQL/TestSqlExpressionParser.cpp b/Tests/LibSQL/TestSqlExpressionParser.cpp index e2468700691..ada10d993fa 100644 --- a/Tests/LibSQL/TestSqlExpressionParser.cpp +++ b/Tests/LibSQL/TestSqlExpressionParser.cpp @@ -39,7 +39,7 @@ ParseResult parse(StringView sql) auto expression = parser.parse(); if (parser.has_errors()) { - return parser.errors()[0].to_string(); + return parser.errors()[0].to_deprecated_string(); } return expression; diff --git a/Tests/LibSQL/TestSqlStatementExecution.cpp b/Tests/LibSQL/TestSqlStatementExecution.cpp index e87567c79c2..dadcb8d100d 100644 --- a/Tests/LibSQL/TestSqlStatementExecution.cpp +++ b/Tests/LibSQL/TestSqlStatementExecution.cpp @@ -27,7 +27,7 @@ SQL::ResultOr try_execute(NonnullRefPtr database, auto statement = parser.next_statement(); EXPECT(!parser.has_errors()); if (parser.has_errors()) - outln("{}", parser.errors()[0].to_string()); + outln("{}", parser.errors()[0].to_deprecated_string()); return statement->execute(move(database)); } @@ -98,7 +98,7 @@ TEST_CASE(insert_into_table) auto rows_or_error = database->select_all(*table); EXPECT(!rows_or_error.is_error()); for (auto& row : rows_or_error.value()) { - EXPECT_EQ(row["TEXTCOLUMN"].to_string(), "Test"); + EXPECT_EQ(row["TEXTCOLUMN"].to_deprecated_string(), "Test"); EXPECT_EQ(row["INTCOLUMN"].to_int().value(), 42); count++; } @@ -325,8 +325,8 @@ TEST_CASE(select_inner_join) EXPECT_EQ(result.size(), 1u); EXPECT_EQ(result[0].row.size(), 3u); EXPECT_EQ(result[0].row[0].to_int().value(), 42); - EXPECT_EQ(result[0].row[1].to_string(), "Test_1"); - EXPECT_EQ(result[0].row[2].to_string(), "Test_12"); + EXPECT_EQ(result[0].row[1].to_deprecated_string(), "Test_1"); + EXPECT_EQ(result[0].row[2].to_deprecated_string(), "Test_12"); } TEST_CASE(select_with_like) @@ -412,11 +412,11 @@ TEST_CASE(select_with_order) result = execute(database, "SELECT TextColumn, IntColumn FROM TestSchema.TestTable ORDER BY TextColumn;"); EXPECT_EQ(result.size(), 5u); - EXPECT_EQ(result[0].row[0].to_string(), "Test_1"); - EXPECT_EQ(result[1].row[0].to_string(), "Test_2"); - EXPECT_EQ(result[2].row[0].to_string(), "Test_3"); - EXPECT_EQ(result[3].row[0].to_string(), "Test_4"); - EXPECT_EQ(result[4].row[0].to_string(), "Test_5"); + EXPECT_EQ(result[0].row[0].to_deprecated_string(), "Test_1"); + EXPECT_EQ(result[1].row[0].to_deprecated_string(), "Test_2"); + EXPECT_EQ(result[2].row[0].to_deprecated_string(), "Test_3"); + EXPECT_EQ(result[3].row[0].to_deprecated_string(), "Test_4"); + EXPECT_EQ(result[4].row[0].to_deprecated_string(), "Test_5"); } TEST_CASE(select_with_regexp) @@ -487,15 +487,15 @@ TEST_CASE(select_with_order_two_columns) result = execute(database, "SELECT TextColumn, IntColumn FROM TestSchema.TestTable ORDER BY TextColumn, IntColumn;"); EXPECT_EQ(result.size(), 5u); - EXPECT_EQ(result[0].row[0].to_string(), "Test_1"); + EXPECT_EQ(result[0].row[0].to_deprecated_string(), "Test_1"); EXPECT_EQ(result[0].row[1].to_int().value(), 47); - EXPECT_EQ(result[1].row[0].to_string(), "Test_2"); + EXPECT_EQ(result[1].row[0].to_deprecated_string(), "Test_2"); EXPECT_EQ(result[1].row[1].to_int().value(), 40); - EXPECT_EQ(result[2].row[0].to_string(), "Test_2"); + EXPECT_EQ(result[2].row[0].to_deprecated_string(), "Test_2"); EXPECT_EQ(result[2].row[1].to_int().value(), 42); - EXPECT_EQ(result[3].row[0].to_string(), "Test_4"); + EXPECT_EQ(result[3].row[0].to_deprecated_string(), "Test_4"); EXPECT_EQ(result[3].row[1].to_int().value(), 41); - EXPECT_EQ(result[4].row[0].to_string(), "Test_5"); + EXPECT_EQ(result[4].row[0].to_deprecated_string(), "Test_5"); EXPECT_EQ(result[4].row[1].to_int().value(), 44); } @@ -516,11 +516,11 @@ TEST_CASE(select_with_order_by_column_not_in_result) result = execute(database, "SELECT TextColumn FROM TestSchema.TestTable ORDER BY IntColumn;"); EXPECT_EQ(result.size(), 5u); - EXPECT_EQ(result[0].row[0].to_string(), "Test_3"); - EXPECT_EQ(result[1].row[0].to_string(), "Test_4"); - EXPECT_EQ(result[2].row[0].to_string(), "Test_2"); - EXPECT_EQ(result[3].row[0].to_string(), "Test_5"); - EXPECT_EQ(result[4].row[0].to_string(), "Test_1"); + EXPECT_EQ(result[0].row[0].to_deprecated_string(), "Test_3"); + EXPECT_EQ(result[1].row[0].to_deprecated_string(), "Test_4"); + EXPECT_EQ(result[2].row[0].to_deprecated_string(), "Test_2"); + EXPECT_EQ(result[3].row[0].to_deprecated_string(), "Test_5"); + EXPECT_EQ(result[4].row[0].to_deprecated_string(), "Test_1"); } TEST_CASE(select_with_limit) @@ -618,11 +618,11 @@ TEST_CASE(describe_table) auto result = execute(database, "DESCRIBE TABLE TestSchema.TestTable;"); EXPECT_EQ(result.size(), 2u); - EXPECT_EQ(result[0].row[0].to_string(), "TEXTCOLUMN"); - EXPECT_EQ(result[0].row[1].to_string(), "text"); + EXPECT_EQ(result[0].row[0].to_deprecated_string(), "TEXTCOLUMN"); + EXPECT_EQ(result[0].row[1].to_deprecated_string(), "text"); - EXPECT_EQ(result[1].row[0].to_string(), "INTCOLUMN"); - EXPECT_EQ(result[1].row[1].to_string(), "int"); + EXPECT_EQ(result[1].row[0].to_deprecated_string(), "INTCOLUMN"); + EXPECT_EQ(result[1].row[1].to_deprecated_string(), "int"); } TEST_CASE(binary_operator_execution) diff --git a/Tests/LibSQL/TestSqlStatementParser.cpp b/Tests/LibSQL/TestSqlStatementParser.cpp index 1f59cabc3a2..11ff1242cfd 100644 --- a/Tests/LibSQL/TestSqlStatementParser.cpp +++ b/Tests/LibSQL/TestSqlStatementParser.cpp @@ -27,7 +27,7 @@ ParseResult parse(StringView sql) auto statement = parser.next_statement(); if (parser.has_errors()) { - return parser.errors()[0].to_string(); + return parser.errors()[0].to_deprecated_string(); } return statement; diff --git a/Tests/LibSQL/TestSqlValueAndTuple.cpp b/Tests/LibSQL/TestSqlValueAndTuple.cpp index 69de82a4376..fdcf7451675 100644 --- a/Tests/LibSQL/TestSqlValueAndTuple.cpp +++ b/Tests/LibSQL/TestSqlValueAndTuple.cpp @@ -17,7 +17,7 @@ TEST_CASE(null_value) { SQL::Value v(SQL::SQLType::Null); EXPECT_EQ(v.type(), SQL::SQLType::Null); - EXPECT_EQ(v.to_string(), "(null)"sv); + EXPECT_EQ(v.to_deprecated_string(), "(null)"sv); EXPECT(!v.to_bool().has_value()); EXPECT(!v.to_int().has_value()); EXPECT(!v.to_u32().has_value()); @@ -44,25 +44,25 @@ TEST_CASE(text_value) v = "Test"sv; EXPECT_EQ(v.type(), SQL::SQLType::Text); - EXPECT_EQ(v.to_string(), "Test"sv); + EXPECT_EQ(v.to_deprecated_string(), "Test"sv); } { SQL::Value v(DeprecatedString("String Test"sv)); EXPECT_EQ(v.type(), SQL::SQLType::Text); - EXPECT_EQ(v.to_string(), "String Test"sv); + EXPECT_EQ(v.to_deprecated_string(), "String Test"sv); v = DeprecatedString("String Test 2"sv); EXPECT_EQ(v.type(), SQL::SQLType::Text); - EXPECT_EQ(v.to_string(), "String Test 2"sv); + EXPECT_EQ(v.to_deprecated_string(), "String Test 2"sv); } { SQL::Value v("const char * Test"); EXPECT_EQ(v.type(), SQL::SQLType::Text); - EXPECT_EQ(v.to_string(), "const char * Test"sv); + EXPECT_EQ(v.to_deprecated_string(), "const char * Test"sv); v = "const char * Test 2"; EXPECT_EQ(v.type(), SQL::SQLType::Text); - EXPECT_EQ(v.to_string(), "const char * Test 2"sv); + EXPECT_EQ(v.to_deprecated_string(), "const char * Test 2"sv); } } @@ -149,7 +149,7 @@ TEST_CASE(integer_value) EXPECT(v.to_int().has_value()); EXPECT_EQ(v.to_int().value(), 42); - EXPECT_EQ(v.to_string(), "42"sv); + EXPECT_EQ(v.to_deprecated_string(), "42"sv); EXPECT(v.to_double().has_value()); EXPECT((v.to_double().value() - 42.0) < NumericLimits().epsilon()); @@ -215,7 +215,7 @@ TEST_CASE(float_value) EXPECT(v.to_int().has_value()); EXPECT_EQ(v.to_int().value(), 3); - EXPECT_EQ(v.to_string(), "3.14"); + EXPECT_EQ(v.to_deprecated_string(), "3.14"); EXPECT(v.to_bool().has_value()); EXPECT(v.to_bool().value()); @@ -228,7 +228,7 @@ TEST_CASE(float_value) EXPECT(v.to_int().has_value()); EXPECT_EQ(v.to_int().value(), 0); - EXPECT_EQ(v.to_string(), "0"sv); + EXPECT_EQ(v.to_deprecated_string(), "0"sv); EXPECT(v.to_bool().has_value()); EXPECT(!v.to_bool().value()); @@ -307,7 +307,7 @@ TEST_CASE(bool_value) EXPECT(v.to_int().has_value()); EXPECT_EQ(v.to_int().value(), 1); - EXPECT_EQ(v.to_string(), "true"sv); + EXPECT_EQ(v.to_deprecated_string(), "true"sv); EXPECT(v.to_double().has_value()); EXPECT((v.to_double().value() - 1.0) < NumericLimits().epsilon()); @@ -321,7 +321,7 @@ TEST_CASE(bool_value) EXPECT(v.to_int().has_value()); EXPECT_EQ(v.to_int().value(), 0); - EXPECT_EQ(v.to_string(), "false"sv); + EXPECT_EQ(v.to_deprecated_string(), "false"sv); EXPECT(v.to_double().has_value()); EXPECT(v.to_double().value() < NumericLimits().epsilon()); @@ -335,7 +335,7 @@ TEST_CASE(bool_value) EXPECT(v.to_int().has_value()); EXPECT_EQ(v.to_int().value(), 1); - EXPECT_EQ(v.to_string(), "true"sv); + EXPECT_EQ(v.to_deprecated_string(), "true"sv); EXPECT(v.to_double().has_value()); EXPECT((v.to_double().value() - 1.0) < NumericLimits().epsilon()); diff --git a/Tests/LibWasm/test-wasm.cpp b/Tests/LibWasm/test-wasm.cpp index c6419c6748c..22b510c1e1b 100644 --- a/Tests/LibWasm/test-wasm.cpp +++ b/Tests/LibWasm/test-wasm.cpp @@ -113,7 +113,7 @@ TESTJS_GLOBAL_FUNCTION(parse_webassembly_module, parseWebAssemblyModule) }; auto result = Wasm::Module::parse(stream); if (result.is_error()) - return vm.throw_completion(Wasm::parse_error_to_string(result.error())); + return vm.throw_completion(Wasm::parse_error_to_deprecated_string(result.error())); if (stream.handle_any_error()) return vm.throw_completion("Binary stream contained errors"); diff --git a/Tests/LibWeb/TestHTMLTokenizer.cpp b/Tests/LibWeb/TestHTMLTokenizer.cpp index ab36adb14ad..385fc690c2b 100644 --- a/Tests/LibWeb/TestHTMLTokenizer.cpp +++ b/Tests/LibWeb/TestHTMLTokenizer.cpp @@ -81,7 +81,7 @@ static u32 hash_tokens(Vector const& tokens) { StringBuilder builder; for (auto& token : tokens) - builder.append(token.to_string()); + builder.append(token.to_deprecated_string()); return (u32)builder.string_view().hash(); } diff --git a/Tests/Spreadsheet/test-spreadsheet.cpp b/Tests/Spreadsheet/test-spreadsheet.cpp index f179ffa68ae..88d3296a3bd 100644 --- a/Tests/Spreadsheet/test-spreadsheet.cpp +++ b/Tests/Spreadsheet/test-spreadsheet.cpp @@ -21,7 +21,7 @@ TESTJS_RUN_FILE_FUNCTION(DeprecatedString const&, JS::Interpreter& interpreter, auto result = Test::JS::parse_script(name, interpreter.realm()); if (result.is_error()) { warnln("Unable to parse {}", name); - warnln("{}", result.error().error.to_string()); + warnln("{}", result.error().error.to_deprecated_string()); warnln("{}", result.error().hint); Test::cleanup_and_exit(); } diff --git a/Userland/Applets/ClipboardHistory/ClipboardHistoryModel.cpp b/Userland/Applets/ClipboardHistory/ClipboardHistoryModel.cpp index 9ef14357e16..61477cc7616 100644 --- a/Userland/Applets/ClipboardHistory/ClipboardHistoryModel.cpp +++ b/Userland/Applets/ClipboardHistory/ClipboardHistoryModel.cpp @@ -81,7 +81,7 @@ GUI::Variant ClipboardHistoryModel::data(const GUI::ModelIndex& index, GUI::Mode builder.append(bpp_for_format_resilient(data_and_type.metadata.get("format").value_or("0"))); builder.append(']'); builder.append(" bitmap"sv); - return builder.to_string(); + return builder.to_deprecated_string(); } if (data_and_type.mime_type.starts_with("glyph/"sv)) { StringBuilder builder; @@ -96,7 +96,7 @@ GUI::Variant ClipboardHistoryModel::data(const GUI::ModelIndex& index, GUI::Mode builder.append_code_point(start); builder.appendff(") [{}x{}]", width, height); } - return builder.to_string(); + return builder.to_deprecated_string(); } return "<...>"; case Column::Type: @@ -104,7 +104,7 @@ GUI::Variant ClipboardHistoryModel::data(const GUI::ModelIndex& index, GUI::Mode case Column::Size: return AK::human_readable_size(data_and_type.data.size()); case Column::Time: - return time.to_string(); + return time.to_deprecated_string(); default: VERIFY_NOT_REACHED(); } diff --git a/Userland/Applets/Network/main.cpp b/Userland/Applets/Network/main.cpp index 1f62eb7d4ed..758644bd966 100644 --- a/Userland/Applets/Network/main.cpp +++ b/Userland/Applets/Network/main.cpp @@ -122,13 +122,13 @@ private: auto json = JsonValue::from_string(file_contents_or_error.value()); if (json.is_error()) - return adapter_info.to_string(); + return adapter_info.to_deprecated_string(); int connected_adapters = 0; json.value().as_array().for_each([&adapter_info, &connected_adapters](auto& value) { auto& if_object = value.as_object(); auto ip_address = if_object.get("ipv4_address"sv).as_string_or("no IP"); - auto ifname = if_object.get("name"sv).to_string(); + auto ifname = if_object.get("name"sv).to_deprecated_string(); auto link_up = if_object.get("link_up"sv).as_bool(); auto link_speed = if_object.get("link_speed"sv).to_i32(); @@ -151,7 +151,7 @@ private: // show connected icon so long as at least one adapter is connected connected_adapters ? set_connected(true) : set_connected(false); - return adapter_info.to_string(); + return adapter_info.to_deprecated_string(); } DeprecatedString m_adapter_info; diff --git a/Userland/Applications/AnalogClock/AnalogClock.cpp b/Userland/Applications/AnalogClock/AnalogClock.cpp index b5d95fb33b1..ebee8c719c6 100644 --- a/Userland/Applications/AnalogClock/AnalogClock.cpp +++ b/Userland/Applications/AnalogClock/AnalogClock.cpp @@ -130,7 +130,7 @@ void AnalogClock::paint_event(GUI::PaintEvent& event) void AnalogClock::update_title_date() { - window()->set_title(Core::DateTime::now().to_string("%Y-%m-%d"sv)); + window()->set_title(Core::DateTime::now().to_deprecated_string("%Y-%m-%d"sv)); } void AnalogClock::context_menu_event(GUI::ContextMenuEvent& event) diff --git a/Userland/Applications/AnalogClock/main.cpp b/Userland/Applications/AnalogClock/main.cpp index 118d056d322..a4cdf5ab932 100644 --- a/Userland/Applications/AnalogClock/main.cpp +++ b/Userland/Applications/AnalogClock/main.cpp @@ -26,7 +26,7 @@ ErrorOr serenity_main(Main::Arguments arguments) auto app_icon = TRY(GUI::Icon::try_create_default_icon("app-analog-clock"sv)); auto window = TRY(GUI::Window::try_create()); - window->set_title(Core::DateTime::now().to_string("%Y-%m-%d"sv)); + window->set_title(Core::DateTime::now().to_deprecated_string("%Y-%m-%d"sv)); window->set_icon(app_icon.bitmap_for_size(16)); window->resize(170, 170); window->set_resizable(false); diff --git a/Userland/Applications/Assistant/Providers.h b/Userland/Applications/Assistant/Providers.h index ba8759ea701..4525403ba77 100644 --- a/Userland/Applications/Assistant/Providers.h +++ b/Userland/Applications/Assistant/Providers.h @@ -115,7 +115,7 @@ private: class URLResult final : public Result { public: explicit URLResult(const URL& url) - : Result(url.to_string(), "Open URL in Browser"sv, 50) + : Result(url.to_deprecated_string(), "Open URL in Browser"sv, 50) , m_bitmap(GUI::Icon::default_icon("app-browser"sv).bitmap_for_size(16)) { } diff --git a/Userland/Applications/Browser/BookmarksBarWidget.cpp b/Userland/Applications/Browser/BookmarksBarWidget.cpp index 1357fda2470..3d9a0756ee3 100644 --- a/Userland/Applications/Browser/BookmarksBarWidget.cpp +++ b/Userland/Applications/Browser/BookmarksBarWidget.cpp @@ -186,8 +186,8 @@ void BookmarksBarWidget::model_did_update(unsigned) int width = 0; for (int item_index = 0; item_index < model()->row_count(); ++item_index) { - auto title = model()->index(item_index, 0).data().to_string(); - auto url = model()->index(item_index, 1).data().to_string(); + auto title = model()->index(item_index, 0).data().to_deprecated_string(); + auto url = model()->index(item_index, 1).data().to_deprecated_string(); Gfx::IntRect rect { width, 0, font().width(title) + 32, height() }; @@ -263,8 +263,8 @@ bool BookmarksBarWidget::contains_bookmark(DeprecatedString const& url) { for (int item_index = 0; item_index < model()->row_count(); ++item_index) { - auto item_title = model()->index(item_index, 0).data().to_string(); - auto item_url = model()->index(item_index, 1).data().to_string(); + auto item_title = model()->index(item_index, 0).data().to_deprecated_string(); + auto item_url = model()->index(item_index, 1).data().to_deprecated_string(); if (item_url == url) { return true; } @@ -276,8 +276,8 @@ bool BookmarksBarWidget::remove_bookmark(DeprecatedString const& url) { for (int item_index = 0; item_index < model()->row_count(); ++item_index) { - auto item_title = model()->index(item_index, 0).data().to_string(); - auto item_url = model()->index(item_index, 1).data().to_string(); + auto item_title = model()->index(item_index, 0).data().to_deprecated_string(); + auto item_url = model()->index(item_index, 1).data().to_deprecated_string(); if (item_url == url) { auto& json_model = *static_cast(model()); @@ -309,8 +309,8 @@ bool BookmarksBarWidget::add_bookmark(DeprecatedString const& url, DeprecatedStr bool BookmarksBarWidget::edit_bookmark(DeprecatedString const& url) { for (int item_index = 0; item_index < model()->row_count(); ++item_index) { - auto item_title = model()->index(item_index, 0).data().to_string(); - auto item_url = model()->index(item_index, 1).data().to_string(); + auto item_title = model()->index(item_index, 0).data().to_deprecated_string(); + auto item_url = model()->index(item_index, 1).data().to_deprecated_string(); if (item_url == url) { auto values = BookmarkEditor::edit_bookmark(window(), item_title, item_url); diff --git a/Userland/Applications/Browser/BrowserWindow.cpp b/Userland/Applications/Browser/BrowserWindow.cpp index bc5b2c6d5f1..d8e1852d9a2 100644 --- a/Userland/Applications/Browser/BrowserWindow.cpp +++ b/Userland/Applications/Browser/BrowserWindow.cpp @@ -51,7 +51,7 @@ static DeprecatedString bookmarks_file_path() StringBuilder builder; builder.append(Core::StandardPaths::config_directory()); builder.append("/bookmarks.json"sv); - return builder.to_string(); + return builder.to_deprecated_string(); } static DeprecatedString search_engines_file_path() @@ -59,7 +59,7 @@ static DeprecatedString search_engines_file_path() StringBuilder builder; builder.append(Core::StandardPaths::config_directory()); builder.append("/SearchEngines.json"sv); - return builder.to_string(); + return builder.to_deprecated_string(); } BrowserWindow::BrowserWindow(CookieJar& cookie_jar, URL url) @@ -479,8 +479,8 @@ ErrorOr BrowserWindow::load_search_engines(GUI::Menu& settings_menu) if (!json_item.is_object()) continue; auto search_engine = json_item.as_object(); - auto name = search_engine.get("title"sv).to_string(); - auto url_format = search_engine.get("url_format"sv).to_string(); + auto name = search_engine.get("title"sv).to_deprecated_string(); + auto url_format = search_engine.get("url_format"sv).to_deprecated_string(); auto action = GUI::Action::create_checkable( name, [&, url_format](auto&) { @@ -543,7 +543,7 @@ void BrowserWindow::set_window_title_for_tab(Tab const& tab) { auto& title = tab.title(); auto url = tab.url(); - set_title(DeprecatedString::formatted("{} - Browser", title.is_empty() ? url.to_string() : title)); + set_title(DeprecatedString::formatted("{} - Browser", title.is_empty() ? url.to_deprecated_string() : title)); } void BrowserWindow::create_new_tab(URL url, bool activate) @@ -742,7 +742,7 @@ ErrorOr BrowserWindow::take_screenshot(ScreenshotType type) return Error::from_string_view("Failed to take a screenshot of the current tab"sv); LexicalPath path { Core::StandardPaths::downloads_directory() }; - path = path.append(Core::DateTime::now().to_string("screenshot-%Y-%m-%d-%H-%M-%S.png"sv)); + path = path.append(Core::DateTime::now().to_deprecated_string("screenshot-%Y-%m-%d-%H-%M-%S.png"sv)); auto encoded = Gfx::PNGWriter::encode(*bitmap.bitmap()); diff --git a/Userland/Applications/Browser/CookieJar.cpp b/Userland/Applications/Browser/CookieJar.cpp index 2acd18d50b3..434ea18708e 100644 --- a/Userland/Applications/Browser/CookieJar.cpp +++ b/Userland/Applications/Browser/CookieJar.cpp @@ -92,9 +92,9 @@ void CookieJar::dump_cookies() const builder.appendff("{}{}{}\n", key_color, cookie.key.path, no_color); builder.appendff("\t{}Value{} = {}\n", attribute_color, no_color, cookie.value.value); - builder.appendff("\t{}CreationTime{} = {}\n", attribute_color, no_color, cookie.value.creation_time.to_string()); - builder.appendff("\t{}LastAccessTime{} = {}\n", attribute_color, no_color, cookie.value.last_access_time.to_string()); - builder.appendff("\t{}ExpiryTime{} = {}\n", attribute_color, no_color, cookie.value.expiry_time.to_string()); + builder.appendff("\t{}CreationTime{} = {}\n", attribute_color, no_color, cookie.value.creation_time.to_deprecated_string()); + builder.appendff("\t{}LastAccessTime{} = {}\n", attribute_color, no_color, cookie.value.last_access_time.to_deprecated_string()); + builder.appendff("\t{}ExpiryTime{} = {}\n", attribute_color, no_color, cookie.value.expiry_time.to_deprecated_string()); builder.appendff("\t{}Secure{} = {:s}\n", attribute_color, no_color, cookie.value.secure); builder.appendff("\t{}HttpOnly{} = {:s}\n", attribute_color, no_color, cookie.value.http_only); builder.appendff("\t{}HostOnly{} = {:s}\n", attribute_color, no_color, cookie.value.host_only); diff --git a/Userland/Applications/Browser/CookiesModel.cpp b/Userland/Applications/Browser/CookiesModel.cpp index 717736c730e..50df78a2439 100644 --- a/Userland/Applications/Browser/CookiesModel.cpp +++ b/Userland/Applications/Browser/CookiesModel.cpp @@ -80,7 +80,7 @@ GUI::Variant CookiesModel::data(GUI::ModelIndex const& index, GUI::ModelRole rol case Column::Value: return cookie.value; case Column::ExpiryTime: - return cookie.expiry_time.to_string(); + return cookie.expiry_time.to_deprecated_string(); case Column::SameSite: return Web::Cookie::same_site_to_string(cookie.same_site); } diff --git a/Userland/Applications/Browser/DownloadWidget.cpp b/Userland/Applications/Browser/DownloadWidget.cpp index 605169d471f..05c548721f1 100644 --- a/Userland/Applications/Browser/DownloadWidget.cpp +++ b/Userland/Applications/Browser/DownloadWidget.cpp @@ -34,7 +34,7 @@ DownloadWidget::DownloadWidget(const URL& url) builder.append(Core::StandardPaths::downloads_directory()); builder.append('/'); builder.append(m_url.basename()); - m_destination_path = builder.to_string(); + m_destination_path = builder.to_deprecated_string(); } auto close_on_finish = Config::read_bool("Browser"sv, "Preferences"sv, "CloseDownloadWidgetOnFinish"sv, false); @@ -129,7 +129,7 @@ void DownloadWidget::did_progress(Optional total_size, u32 downloaded_size) builder.append("Downloaded "sv); builder.append(human_readable_size(downloaded_size)); builder.appendff(" in {} sec", m_elapsed_timer.elapsed() / 1000); - m_progress_label->set_text(builder.to_string()); + m_progress_label->set_text(builder.to_deprecated_string()); } { @@ -142,7 +142,7 @@ void DownloadWidget::did_progress(Optional total_size, u32 downloaded_size) } builder.append(" of "sv); builder.append(m_url.basename()); - window()->set_title(builder.to_string()); + window()->set_title(builder.to_deprecated_string()); } } diff --git a/Userland/Applications/Browser/InspectorWidget.cpp b/Userland/Applications/Browser/InspectorWidget.cpp index 2a74f90c088..d18d42a58dc 100644 --- a/Userland/Applications/Browser/InspectorWidget.cpp +++ b/Userland/Applications/Browser/InspectorWidget.cpp @@ -32,7 +32,7 @@ void InspectorWidget::set_selection(Selection selection) auto* model = verify_cast(m_dom_tree_view->model()); auto index = model->index_for_node(selection.dom_node_id, selection.pseudo_element); if (!index.is_valid()) { - dbgln("InspectorWidget told to inspect non-existent node: {}", selection.to_string()); + dbgln("InspectorWidget told to inspect non-existent node: {}", selection.to_deprecated_string()); return; } @@ -151,7 +151,7 @@ void InspectorWidget::clear_dom_json() void InspectorWidget::set_dom_node_properties_json(Selection selection, DeprecatedString specified_values_json, DeprecatedString computed_values_json, DeprecatedString custom_properties_json, DeprecatedString node_box_sizing_json) { if (selection != m_selection) { - dbgln("Got data for the wrong node id! Wanted ({}), got ({})", m_selection.to_string(), selection.to_string()); + dbgln("Got data for the wrong node id! Wanted ({}), got ({})", m_selection.to_deprecated_string(), selection.to_deprecated_string()); return; } diff --git a/Userland/Applications/Browser/InspectorWidget.h b/Userland/Applications/Browser/InspectorWidget.h index f28059d6fac..cc7fe8a7c03 100644 --- a/Userland/Applications/Browser/InspectorWidget.h +++ b/Userland/Applications/Browser/InspectorWidget.h @@ -29,7 +29,7 @@ public: return dom_node_id == other.dom_node_id && pseudo_element == other.pseudo_element; } - DeprecatedString to_string() const + DeprecatedString to_deprecated_string() const { if (pseudo_element.has_value()) return DeprecatedString::formatted("id: {}, pseudo: {}", dom_node_id, Web::CSS::pseudo_element_name(pseudo_element.value())); diff --git a/Userland/Applications/Browser/Tab.cpp b/Userland/Applications/Browser/Tab.cpp index fe1d05a8c21..7033e4955b7 100644 --- a/Userland/Applications/Browser/Tab.cpp +++ b/Userland/Applications/Browser/Tab.cpp @@ -77,7 +77,7 @@ void Tab::view_source(const URL& url, DeprecatedString const& source) editor.set_syntax_highlighter(make()); editor.set_ruler_visible(true); window->resize(640, 480); - window->set_title(url.to_string()); + window->set_title(url.to_deprecated_string()); window->set_icon(g_icon_bag.filetype_text); window->set_window_mode(GUI::WindowMode::Modeless); window->show(); @@ -137,7 +137,7 @@ Tab::Tab(BrowserWindow& window) m_go_back_context_menu = GUI::Menu::construct(); for (auto& url : m_history.get_back_title_history()) { i++; - m_go_back_context_menu->add_action(GUI::Action::create(url.to_string(), g_icon_bag.filetype_html, [this, i](auto&) { go_back(i); })); + m_go_back_context_menu->add_action(GUI::Action::create(url.to_deprecated_string(), g_icon_bag.filetype_html, [this, i](auto&) { go_back(i); })); } m_go_back_context_menu->popup(go_back_button.screen_relative_rect().bottom_left()); }; @@ -150,7 +150,7 @@ Tab::Tab(BrowserWindow& window) m_go_forward_context_menu = GUI::Menu::construct(); for (auto& url : m_history.get_forward_title_history()) { i++; - m_go_forward_context_menu->add_action(GUI::Action::create(url.to_string(), g_icon_bag.filetype_html, [this, i](auto&) { go_forward(i); })); + m_go_forward_context_menu->add_action(GUI::Action::create(url.to_deprecated_string(), g_icon_bag.filetype_html, [this, i](auto&) { go_forward(i); })); } m_go_forward_context_menu->popup(go_forward_button.screen_relative_rect().bottom_left()); }; @@ -215,7 +215,7 @@ Tab::Tab(BrowserWindow& window) update_status(); m_location_box->set_icon(nullptr); - m_location_box->set_text(url.to_string()); + m_location_box->set_text(url.to_deprecated_string()); // don't add to history if back or forward is pressed if (!m_is_history_navigation) @@ -223,7 +223,7 @@ Tab::Tab(BrowserWindow& window) m_is_history_navigation = false; update_actions(); - update_bookmark_button(url.to_string()); + update_bookmark_button(url.to_deprecated_string()); if (m_dom_inspector_widget) m_dom_inspector_widget->clear_dom_json(); @@ -309,7 +309,7 @@ Tab::Tab(BrowserWindow& window) })); m_link_context_menu->add_separator(); m_link_context_menu->add_action(GUI::Action::create("&Copy URL", g_icon_bag.copy, [this](auto&) { - GUI::Clipboard::the().set_plain_text(m_link_context_menu_url.to_string()); + GUI::Clipboard::the().set_plain_text(m_link_context_menu_url.to_deprecated_string()); })); m_link_context_menu->add_separator(); m_link_context_menu->add_action(GUI::Action::create("&Download", g_icon_bag.download, [this](auto&) { @@ -336,7 +336,7 @@ Tab::Tab(BrowserWindow& window) GUI::Clipboard::the().set_bitmap(*m_image_context_menu_bitmap.bitmap()); })); m_image_context_menu->add_action(GUI::Action::create("Copy Image &URL", g_icon_bag.copy, [this](auto&) { - GUI::Clipboard::the().set_plain_text(m_image_context_menu_url.to_string()); + GUI::Clipboard::the().set_plain_text(m_image_context_menu_url.to_deprecated_string()); })); m_image_context_menu->add_separator(); m_image_context_menu->add_action(GUI::Action::create("&Download", g_icon_bag.download, [this](auto&) { @@ -357,8 +357,8 @@ Tab::Tab(BrowserWindow& window) view().on_title_change = [this](auto& title) { if (title.is_null()) { - m_history.update_title(url().to_string()); - m_title = url().to_string(); + m_history.update_title(url().to_deprecated_string()); + m_title = url().to_deprecated_string(); } else { m_history.update_title(title); m_title = title; @@ -436,7 +436,7 @@ Tab::Tab(BrowserWindow& window) view().on_link_hover = [this](auto& url) { if (url.is_valid()) - update_status(url.to_string()); + update_status(url.to_deprecated_string()); else update_status(); }; @@ -495,7 +495,7 @@ Optional Tab::url_from_location_bar(MayAppendTLD may_append_tld) builder.append(".com"sv); } } - DeprecatedString final_text = builder.to_string(); + DeprecatedString final_text = builder.to_deprecated_string(); auto url = url_from_user_input(final_text); return url; @@ -543,7 +543,7 @@ void Tab::update_actions() void Tab::bookmark_current_url() { - auto url = this->url().to_string(); + auto url = this->url().to_deprecated_string(); if (BookmarksBarWidget::the().contains_bookmark(url)) { BookmarksBarWidget::the().remove_bookmark(url); } else { diff --git a/Userland/Applications/BrowserSettings/BrowserSettingsWidget.cpp b/Userland/Applications/BrowserSettings/BrowserSettingsWidget.cpp index 8e12b500872..ae5709c63e5 100644 --- a/Userland/Applications/BrowserSettings/BrowserSettingsWidget.cpp +++ b/Userland/Applications/BrowserSettings/BrowserSettingsWidget.cpp @@ -106,7 +106,7 @@ BrowserSettingsWidget::BrowserSettingsWidget() m_search_engine_combobox->set_model(move(search_engines_model)); m_search_engine_combobox->set_only_allow_values_from_model(true); m_search_engine_combobox->on_change = [this](AK::DeprecatedString const&, GUI::ModelIndex const& cursor_index) { - auto url_format = m_search_engine_combobox->model()->index(cursor_index.row(), 1).data().to_string(); + auto url_format = m_search_engine_combobox->model()->index(cursor_index.row(), 1).data().to_deprecated_string(); m_is_custom_search_engine = url_format.is_empty(); m_custom_search_engine_group->set_enabled(m_is_custom_search_engine); set_modified(true); @@ -122,7 +122,7 @@ void BrowserSettingsWidget::set_color_scheme(StringView color_scheme) { bool found_color_scheme = false; for (int item_index = 0; item_index < m_color_scheme_combobox->model()->row_count(); ++item_index) { - auto scheme = m_color_scheme_combobox->model()->index(item_index, 1).data().to_string(); + auto scheme = m_color_scheme_combobox->model()->index(item_index, 1).data().to_deprecated_string(); if (scheme == color_scheme) { m_color_scheme_combobox->set_selected_index(item_index, GUI::AllowCallback::No); found_color_scheme = true; @@ -146,7 +146,7 @@ void BrowserSettingsWidget::set_search_engine_url(StringView url) bool found_url = false; for (int item_index = 0; item_index < m_search_engine_combobox->model()->row_count(); ++item_index) { - auto url_format = m_search_engine_combobox->model()->index(item_index, 1).data().to_string(); + auto url_format = m_search_engine_combobox->model()->index(item_index, 1).data().to_deprecated_string(); if (url_format == url) { m_search_engine_combobox->set_selected_index(item_index, GUI::AllowCallback::No); found_url = true; @@ -189,7 +189,7 @@ void BrowserSettingsWidget::apply_settings() Config::write_bool("Browser"sv, "Preferences"sv, "ShowBookmarksBar"sv, m_show_bookmarks_bar_checkbox->is_checked()); auto color_scheme_index = m_color_scheme_combobox->selected_index(); - auto color_scheme = m_color_scheme_combobox->model()->index(color_scheme_index, 1).data().to_string(); + auto color_scheme = m_color_scheme_combobox->model()->index(color_scheme_index, 1).data().to_deprecated_string(); Config::write_string("Browser"sv, "Preferences"sv, "ColorScheme"sv, color_scheme); if (!m_enable_search_engine_checkbox->is_checked()) { @@ -198,7 +198,7 @@ void BrowserSettingsWidget::apply_settings() Config::write_string("Browser"sv, "Preferences"sv, "SearchEngine"sv, m_custom_search_engine_textbox->text()); } else { auto selected_index = m_search_engine_combobox->selected_index(); - auto url = m_search_engine_combobox->model()->index(selected_index, 1).data().to_string(); + auto url = m_search_engine_combobox->model()->index(selected_index, 1).data().to_deprecated_string(); Config::write_string("Browser"sv, "Preferences"sv, "SearchEngine"sv, url); } diff --git a/Userland/Applications/Calculator/CalculatorWidget.cpp b/Userland/Applications/Calculator/CalculatorWidget.cpp index 0964eca72a2..6f2cc8b5ab3 100644 --- a/Userland/Applications/Calculator/CalculatorWidget.cpp +++ b/Userland/Applications/Calculator/CalculatorWidget.cpp @@ -146,7 +146,7 @@ void CalculatorWidget::mimic_pressed_button(RefPtr button) void CalculatorWidget::update_display() { - m_entry->set_text(m_keypad.to_string()); + m_entry->set_text(m_keypad.to_deprecated_string()); if (m_calculator.has_error()) m_label->set_text("E"); else diff --git a/Userland/Applications/Calculator/Keypad.cpp b/Userland/Applications/Calculator/Keypad.cpp index 63b89432c76..b89e0f5d2ea 100644 --- a/Userland/Applications/Calculator/Keypad.cpp +++ b/Userland/Applications/Calculator/Keypad.cpp @@ -112,10 +112,10 @@ void Keypad::set_to_0() m_state = State::External; } -DeprecatedString Keypad::to_string() const +DeprecatedString Keypad::to_deprecated_string() const { if (m_state == State::External) - return m_internal_value.to_string(m_displayed_fraction_length); + return m_internal_value.to_deprecated_string(m_displayed_fraction_length); StringBuilder builder; @@ -133,7 +133,7 @@ DeprecatedString Keypad::to_string() const builder.append(frac_value); } - return builder.to_string(); + return builder.to_deprecated_string(); } void Keypad::set_rounding_length(unsigned rounding_threshold) diff --git a/Userland/Applications/Calculator/Keypad.h b/Userland/Applications/Calculator/Keypad.h index 7fb97993788..0106eb88c91 100644 --- a/Userland/Applications/Calculator/Keypad.h +++ b/Userland/Applications/Calculator/Keypad.h @@ -33,7 +33,7 @@ public: void set_rounding_length(unsigned); unsigned rounding_length() const; - DeprecatedString to_string() const; + DeprecatedString to_deprecated_string() const; private: // Internal representation of the current decimal value. diff --git a/Userland/Applications/CharacterMap/CharacterMapWidget.cpp b/Userland/Applications/CharacterMap/CharacterMapWidget.cpp index 1d8ba5f0a8f..d9569b55689 100644 --- a/Userland/Applications/CharacterMap/CharacterMapWidget.cpp +++ b/Userland/Applications/CharacterMap/CharacterMapWidget.cpp @@ -54,7 +54,7 @@ CharacterMapWidget::CharacterMapWidget() continue; builder.append_code_point(code_point); } - GUI::Clipboard::the().set_plain_text(builder.to_string()); + GUI::Clipboard::the().set_plain_text(builder.to_deprecated_string()); }); m_copy_selection_action->set_status_tip("Copy the highlighted characters to the clipboard"); @@ -179,5 +179,5 @@ void CharacterMapWidget::update_statusbar() builder.appendff("U+{:04X}", code_point); if (auto display_name = Unicode::code_point_display_name(code_point); display_name.has_value()) builder.appendff(" - {}", display_name.value()); - m_statusbar->set_text(builder.to_string()); + m_statusbar->set_text(builder.to_deprecated_string()); } diff --git a/Userland/Applications/ClockSettings/ClockSettingsWidget.cpp b/Userland/Applications/ClockSettings/ClockSettingsWidget.cpp index f16c70f6bdc..b5869c89403 100644 --- a/Userland/Applications/ClockSettings/ClockSettingsWidget.cpp +++ b/Userland/Applications/ClockSettings/ClockSettingsWidget.cpp @@ -119,5 +119,5 @@ void ClockSettingsWidget::update_time_format_string() void ClockSettingsWidget::update_clock_preview() { - m_clock_preview->set_text(Core::DateTime::now().to_string(m_time_format)); + m_clock_preview->set_text(Core::DateTime::now().to_deprecated_string(m_time_format)); } diff --git a/Userland/Applications/CrashReporter/main.cpp b/Userland/Applications/CrashReporter/main.cpp index edeed4a9fa6..1a4ecbfd637 100644 --- a/Userland/Applications/CrashReporter/main.cpp +++ b/Userland/Applications/CrashReporter/main.cpp @@ -90,12 +90,12 @@ static TitleAndText build_backtrace(Coredump::Reader const& coredump, ELF::Core: first_entry = false; else builder.append('\n'); - builder.append(entry.to_string()); + builder.append(entry.to_deprecated_string()); } dbgln("--- Backtrace for thread #{} (TID {}) ---", thread_index, thread_info.tid); for (auto& entry : backtrace.entries()) { - dbgln("{}", entry.to_string(true)); + dbgln("{}", entry.to_deprecated_string(true)); } return { @@ -290,7 +290,7 @@ ErrorOr serenity_main(Main::Arguments arguments) return; auto file = file_or_error.value(); - if (!file->write(full_backtrace.to_string())) + if (!file->write(full_backtrace.to_deprecated_string())) GUI::MessageBox::show(window, DeprecatedString::formatted("Couldn't save file: {}.", file_or_error.error()), "Saving backtrace failed"sv, GUI::MessageBox::Type::Error); }; diff --git a/Userland/Applications/Debugger/main.cpp b/Userland/Applications/Debugger/main.cpp index 47c511f57e2..eab199ca953 100644 --- a/Userland/Applications/Debugger/main.cpp +++ b/Userland/Applications/Debugger/main.cpp @@ -89,7 +89,7 @@ static bool handle_disassemble_command(DeprecatedString const& command, FlatPtr if (!insn.has_value()) break; - outln(" {:p} <+{}>:\t{}", offset + first_instruction, offset, insn.value().to_string(offset)); + outln(" {:p} <+{}>:\t{}", offset + first_instruction, offset, insn.value().to_deprecated_string(offset)); } return true; diff --git a/Userland/Applications/DisplaySettings/BackgroundSettingsWidget.cpp b/Userland/Applications/DisplaySettings/BackgroundSettingsWidget.cpp index 339fb73a135..0c87be98f2c 100644 --- a/Userland/Applications/DisplaySettings/BackgroundSettingsWidget.cpp +++ b/Userland/Applications/DisplaySettings/BackgroundSettingsWidget.cpp @@ -72,7 +72,7 @@ void BackgroundSettingsWidget::create_frame() m_context_menu->add_separator(); m_copy_action = GUI::CommonActions::make_copy_action( [this](auto&) { - auto url = URL::create_with_file_scheme(m_monitor_widget->wallpaper()).to_string(); + auto url = URL::create_with_file_scheme(m_monitor_widget->wallpaper()).to_deprecated_string(); GUI::Clipboard::the().set_data(url.bytes(), "text/uri-list"); }, this); diff --git a/Userland/Applications/DisplaySettings/MonitorWidget.cpp b/Userland/Applications/DisplaySettings/MonitorWidget.cpp index 692a95f430a..837b8fdcdb7 100644 --- a/Userland/Applications/DisplaySettings/MonitorWidget.cpp +++ b/Userland/Applications/DisplaySettings/MonitorWidget.cpp @@ -148,7 +148,7 @@ void MonitorWidget::paint_event(GUI::PaintEvent& event) #if 0 if (!m_desktop_resolution.is_null()) { - auto displayed_resolution_string = Gfx::IntSize { m_desktop_resolution.width(), m_desktop_resolution.height() }.to_string(); + auto displayed_resolution_string = Gfx::IntSize { m_desktop_resolution.width(), m_desktop_resolution.height() }.to_deprecated_string(); // Render text label scaled with scale factor to hint at its effect. // FIXME: Once bitmaps have intrinsic scale factors, we could create a bitmap with an intrinsic scale factor of m_desktop_scale_factor diff --git a/Userland/Applications/FileManager/DirectoryView.cpp b/Userland/Applications/FileManager/DirectoryView.cpp index a4ed76d6495..e212d562ae5 100644 --- a/Userland/Applications/FileManager/DirectoryView.cpp +++ b/Userland/Applications/FileManager/DirectoryView.cpp @@ -533,7 +533,7 @@ Vector DirectoryView::selected_file_paths() const view.selection().for_each_index([&](GUI::ModelIndex const& index) { auto parent_index = model.parent_index(index); auto name_index = model.index(index.row(), GUI::FileSystemModel::Column::Name, parent_index); - auto path = name_index.data(GUI::ModelRole::Custom).to_string(); + auto path = name_index.data(GUI::ModelRole::Custom).to_deprecated_string(); paths.append(path); }); return paths; diff --git a/Userland/Applications/FileManager/main.cpp b/Userland/Applications/FileManager/main.cpp index db2b22c36ea..9c8433d000c 100644 --- a/Userland/Applications/FileManager/main.cpp +++ b/Userland/Applications/FileManager/main.cpp @@ -1312,7 +1312,7 @@ ErrorOr run_in_windowed_mode(DeprecatedString const& initial_location, Depr continue; if (auto result = Core::File::copy_file_or_directory(url_to_copy.path(), new_path); result.is_error()) { - auto error_message = DeprecatedString::formatted("Could not copy {} into {}:\n {}", url_to_copy.to_string(), new_path, static_cast(result.error())); + auto error_message = DeprecatedString::formatted("Could not copy {} into {}:\n {}", url_to_copy.to_deprecated_string(), new_path, static_cast(result.error())); GUI::MessageBox::show(window, error_message, "File Manager"sv, GUI::MessageBox::Type::Error); } else { had_accepted_copy = true; diff --git a/Userland/Applications/FontEditor/MainWidget.cpp b/Userland/Applications/FontEditor/MainWidget.cpp index 00b9153c534..e1572b741b5 100644 --- a/Userland/Applications/FontEditor/MainWidget.cpp +++ b/Userland/Applications/FontEditor/MainWidget.cpp @@ -325,7 +325,7 @@ ErrorOr MainWidget::create_actions() continue; builder.append_code_point(code_point); } - GUI::Clipboard::the().set_plain_text(builder.to_string()); + GUI::Clipboard::the().set_plain_text(builder.to_deprecated_string()); }); m_copy_text_action->set_status_tip("Copy to clipboard as text"); @@ -879,7 +879,7 @@ void MainWidget::update_title() else title.append(m_path); title.append("[*] - Font Editor"sv); - window()->set_title(title.to_string()); + window()->set_title(title.to_deprecated_string()); } void MainWidget::did_modify_font() @@ -920,7 +920,7 @@ void MainWidget::update_statusbar() builder.appendff(" [{}x{}]", m_edited_font->raw_glyph_width(glyph), m_edited_font->glyph_height()); else if (Gfx::Emoji::emoji_for_code_point(glyph)) builder.appendff(" [emoji]"); - m_statusbar->set_text(builder.to_string()); + m_statusbar->set_text(builder.to_deprecated_string()); } void MainWidget::update_preview() diff --git a/Userland/Applications/Help/MainWidget.cpp b/Userland/Applications/Help/MainWidget.cpp index 2d1d6faa68f..655b2026a3b 100644 --- a/Userland/Applications/Help/MainWidget.cpp +++ b/Userland/Applications/Help/MainWidget.cpp @@ -131,7 +131,7 @@ MainWidget::MainWidget() }; m_web_view->on_link_hover = [this](URL const& url) { if (url.is_valid()) - m_statusbar->set_text(url.to_string()); + m_statusbar->set_text(url.to_deprecated_string()); else m_statusbar->set_text({}); }; diff --git a/Userland/Applications/HexEditor/HexEditor.cpp b/Userland/Applications/HexEditor/HexEditor.cpp index 55ee1b2c8de..e1b23a73700 100644 --- a/Userland/Applications/HexEditor/HexEditor.cpp +++ b/Userland/Applications/HexEditor/HexEditor.cpp @@ -172,7 +172,7 @@ bool HexEditor::copy_selected_hex_to_clipboard() for (size_t i = m_selection_start; i < m_selection_end; i++) output_string_builder.appendff("{:02X} ", m_document->get(i).value); - GUI::Clipboard::the().set_plain_text(output_string_builder.to_string()); + GUI::Clipboard::the().set_plain_text(output_string_builder.to_deprecated_string()); return true; } @@ -185,7 +185,7 @@ bool HexEditor::copy_selected_text_to_clipboard() for (size_t i = m_selection_start; i < m_selection_end; i++) output_string_builder.append(isprint(m_document->get(i).value) ? m_document->get(i).value : '.'); - GUI::Clipboard::the().set_plain_text(output_string_builder.to_string()); + GUI::Clipboard::the().set_plain_text(output_string_builder.to_deprecated_string()); return true; } @@ -208,7 +208,7 @@ bool HexEditor::copy_selected_hex_to_clipboard_as_c_code() } output_string_builder.append("\n};\n"sv); - GUI::Clipboard::the().set_plain_text(output_string_builder.to_string()); + GUI::Clipboard::the().set_plain_text(output_string_builder.to_deprecated_string()); return true; } @@ -768,7 +768,7 @@ Vector HexEditor::find_all(ByteBuffer& needle, size_t start) } } if (found) { - matches.append({ i, DeprecatedString::formatted("{}", StringView { needle }.to_string().characters()) }); + matches.append({ i, DeprecatedString::formatted("{}", StringView { needle }.to_deprecated_string().characters()) }); i += needle.size() - 1; } } @@ -803,7 +803,7 @@ Vector HexEditor::find_all_strings(size_t min_length) builder.append(c); } else { if (builder.length() >= min_length) - matches.append({ offset, builder.to_string() }); + matches.append({ offset, builder.to_deprecated_string() }); builder.clear(); found_string = false; } diff --git a/Userland/Applications/HexEditor/HexEditorWidget.cpp b/Userland/Applications/HexEditor/HexEditorWidget.cpp index 097d14745a4..9ab336836e3 100644 --- a/Userland/Applications/HexEditor/HexEditorWidget.cpp +++ b/Userland/Applications/HexEditor/HexEditorWidget.cpp @@ -520,7 +520,7 @@ void HexEditorWidget::update_title() else builder.append(m_path); builder.append("[*] - Hex Editor"sv); - window()->set_title(builder.to_string()); + window()->set_title(builder.to_deprecated_string()); } void HexEditorWidget::open_file(NonnullRefPtr file) diff --git a/Userland/Applications/HexEditor/ValueInspectorModel.h b/Userland/Applications/HexEditor/ValueInspectorModel.h index 7acf4a66456..3f5a239a520 100644 --- a/Userland/Applications/HexEditor/ValueInspectorModel.h +++ b/Userland/Applications/HexEditor/ValueInspectorModel.h @@ -71,7 +71,7 @@ public: VERIFY_NOT_REACHED(); } - DeprecatedString inspector_value_type_to_string(ValueType type) const + DeprecatedString inspector_value_type_to_deprecated_string(ValueType type) const { switch (type) { case SignedByte: @@ -112,7 +112,7 @@ public: if (role == GUI::ModelRole::Display) { switch (index.column()) { case Column::Type: - return inspector_value_type_to_string(static_cast(index.row())); + return inspector_value_type_to_deprecated_string(static_cast(index.row())); case Column::Value: return m_values.at(index.row()); } diff --git a/Userland/Applications/ImageViewer/main.cpp b/Userland/Applications/ImageViewer/main.cpp index 1a37a3ac4f4..ffa3e6493ec 100644 --- a/Userland/Applications/ImageViewer/main.cpp +++ b/Userland/Applications/ImageViewer/main.cpp @@ -74,7 +74,7 @@ ErrorOr serenity_main(Main::Arguments arguments) return; } - window->set_title(DeprecatedString::formatted("{} {} {}% - Image Viewer", widget->path(), widget->bitmap()->size().to_string(), (int)(scale * 100))); + window->set_title(DeprecatedString::formatted("{} {} {}% - Image Viewer", widget->path(), widget->bitmap()->size().to_deprecated_string(), (int)(scale * 100))); if (!widget->scaled_for_first_image()) { widget->set_scaled_for_first_image(true); diff --git a/Userland/Applications/KeyboardMapper/KeyboardMapperWidget.cpp b/Userland/Applications/KeyboardMapper/KeyboardMapperWidget.cpp index c8c32eb5eb3..099d3179d78 100644 --- a/Userland/Applications/KeyboardMapper/KeyboardMapperWidget.cpp +++ b/Userland/Applications/KeyboardMapper/KeyboardMapperWidget.cpp @@ -178,7 +178,7 @@ ErrorOr KeyboardMapperWidget::save_to_file(StringView filename) if (values[i]) sb.append_code_point(values[i]); - JsonValue val(sb.to_string()); + JsonValue val(sb.to_deprecated_string()); items.append(move(val)); } map_json.set(name, move(items)); @@ -191,7 +191,7 @@ ErrorOr KeyboardMapperWidget::save_to_file(StringView filename) add_array("shift_altgr_map", m_character_map.shift_altgr_map); // Write to file. - DeprecatedString file_content = map_json.to_string(); + DeprecatedString file_content = map_json.to_deprecated_string(); auto file = TRY(Core::Stream::File::open(filename, Core::Stream::OpenMode::Write)); TRY(file->write(file_content.bytes())); file->close(); @@ -249,7 +249,7 @@ void KeyboardMapperWidget::set_current_map(const DeprecatedString current_map) StringBuilder sb; sb.append_code_point(map[index]); - m_keys.at(k)->set_text(sb.to_string()); + m_keys.at(k)->set_text(sb.to_deprecated_string()); } this->update(); @@ -261,7 +261,7 @@ void KeyboardMapperWidget::update_window_title() sb.append(m_filename); sb.append("[*] - Keyboard Mapper"sv); - window()->set_title(sb.to_string()); + window()->set_title(sb.to_deprecated_string()); } void KeyboardMapperWidget::show_error_to_user(Error error) diff --git a/Userland/Applications/KeyboardSettings/KeyboardSettingsWidget.cpp b/Userland/Applications/KeyboardSettings/KeyboardSettingsWidget.cpp index c8c89699585..e87952cad5c 100644 --- a/Userland/Applications/KeyboardSettings/KeyboardSettingsWidget.cpp +++ b/Userland/Applications/KeyboardSettings/KeyboardSettingsWidget.cpp @@ -161,7 +161,7 @@ KeyboardSettingsWidget::KeyboardSettingsWidget() auto json = JsonValue::from_string(proc_keymap->read_all()).release_value_but_fixme_should_propagate_errors(); auto const& keymap_object = json.as_object(); VERIFY(keymap_object.has("keymap"sv)); - m_initial_active_keymap = keymap_object.get("keymap"sv).to_string(); + m_initial_active_keymap = keymap_object.get("keymap"sv).to_deprecated_string(); dbgln("KeyboardSettings thinks the current keymap is: {}", m_initial_active_keymap); auto mapper_config(Core::ConfigFile::open("/etc/Keyboard.ini").release_value_but_fixme_should_propagate_errors()); diff --git a/Userland/Applications/Mail/MailWidget.cpp b/Userland/Applications/Mail/MailWidget.cpp index 0d80634b175..cecfbfe9dbb 100644 --- a/Userland/Applications/Mail/MailWidget.cpp +++ b/Userland/Applications/Mail/MailWidget.cpp @@ -55,7 +55,7 @@ MailWidget::MailWidget() m_web_view->on_link_hover = [this](auto& url) { if (url.is_valid()) - m_statusbar->set_text(url.to_string()); + m_statusbar->set_text(url.to_deprecated_string()); else m_statusbar->set_text(""); }; @@ -68,7 +68,7 @@ MailWidget::MailWidget() m_link_context_menu_default_action = link_default_action; m_link_context_menu->add_separator(); m_link_context_menu->add_action(GUI::Action::create("&Copy URL", [this](auto&) { - GUI::Clipboard::the().set_plain_text(m_link_context_menu_url.to_string()); + GUI::Clipboard::the().set_plain_text(m_link_context_menu_url.to_deprecated_string()); })); m_web_view->on_link_context_menu_request = [this](auto& url, auto& screen_position) { @@ -82,7 +82,7 @@ MailWidget::MailWidget() GUI::Clipboard::the().set_bitmap(*m_image_context_menu_bitmap.bitmap()); })); m_image_context_menu->add_action(GUI::Action::create("Copy Image &URL", [this](auto&) { - GUI::Clipboard::the().set_plain_text(m_image_context_menu_url.to_string()); + GUI::Clipboard::the().set_plain_text(m_image_context_menu_url.to_deprecated_string()); })); m_image_context_menu->add_separator(); m_image_context_menu->add_action(GUI::Action::create("&Open Image in Browser", [this](auto&) { @@ -347,7 +347,7 @@ void MailWidget::selected_mailbox() break; } - return builder.to_string(); + return builder.to_deprecated_string(); }; auto& subject_iterator_value = subject_iterator->get<1>().value(); diff --git a/Userland/Applications/NetworkSettings/NetworkSettingsWidget.cpp b/Userland/Applications/NetworkSettings/NetworkSettingsWidget.cpp index ba6d9884bdd..851c8ad91f3 100644 --- a/Userland/Applications/NetworkSettings/NetworkSettingsWidget.cpp +++ b/Userland/Applications/NetworkSettings/NetworkSettingsWidget.cpp @@ -78,7 +78,7 @@ NetworkSettingsWidget::NetworkSettingsWidget() size_t index = 0; proc_net_adapters_json.as_array().for_each([&](auto& value) { auto& if_object = value.as_object(); - auto adapter_name = if_object.get("name"sv).to_string(); + auto adapter_name = if_object.get("name"sv).to_deprecated_string(); if (adapter_name == "loop") return; @@ -137,7 +137,7 @@ void NetworkSettingsWidget::apply_settings() { auto config_file = Core::ConfigFile::open_for_system("Network", Core::ConfigFile::AllowWriting::Yes).release_value_but_fixme_should_propagate_errors(); for (auto const& adapter_data : m_network_adapters) { - auto netmask = IPv4Address::netmask_from_cidr(adapter_data.value.cidr).to_string(); + auto netmask = IPv4Address::netmask_from_cidr(adapter_data.value.cidr).to_deprecated_string(); config_file->write_bool_entry(adapter_data.key, "Enabled", adapter_data.value.enabled); config_file->write_bool_entry(adapter_data.key, "DHCP", adapter_data.value.dhcp); if (adapter_data.value.enabled && !adapter_data.value.dhcp) { diff --git a/Userland/Applications/PDFViewer/NumericInput.cpp b/Userland/Applications/PDFViewer/NumericInput.cpp index b5290e36c3a..5c0c2e14f1e 100644 --- a/Userland/Applications/PDFViewer/NumericInput.cpp +++ b/Userland/Applications/PDFViewer/NumericInput.cpp @@ -26,7 +26,7 @@ NumericInput::NumericInput() first = false; } - auto new_number_opt = builder.to_string().to_int(); + auto new_number_opt = builder.to_deprecated_string().to_int(); if (!new_number_opt.has_value()) { m_needs_text_reset = true; return; @@ -34,7 +34,7 @@ NumericInput::NumericInput() m_needs_text_reset = false; } - set_text(builder.to_string()); + set_text(builder.to_deprecated_string()); set_current_number(new_number_opt.value(), GUI::AllowCallback::No); }; diff --git a/Userland/Applications/PixelPaint/MainWidget.cpp b/Userland/Applications/PixelPaint/MainWidget.cpp index a6961c23349..4999ddeb442 100644 --- a/Userland/Applications/PixelPaint/MainWidget.cpp +++ b/Userland/Applications/PixelPaint/MainWidget.cpp @@ -130,7 +130,7 @@ void MainWidget::image_editor_did_update_undo_stack() builder.append(' '); builder.append(suffix.value()); } - return builder.to_string(); + return builder.to_deprecated_string(); }; auto& undo_stack = image_editor->undo_stack(); @@ -1080,7 +1080,7 @@ ImageEditor& MainWidget::create_new_editor(NonnullRefPtr image) auto const& image_size = current_image_editor()->image().size(); auto image_rectangle = Gfx::IntRect { 0, 0, image_size.width(), image_size.height() }; if (image_rectangle.contains(mouse_position)) { - m_statusbar->set_override_text(mouse_position.to_string()); + m_statusbar->set_override_text(mouse_position.to_deprecated_string()); m_histogram_widget->set_color_at_mouseposition(current_image_editor()->image().color_at(mouse_position)); m_vectorscope_widget->set_color_at_mouseposition(current_image_editor()->image().color_at(mouse_position)); } else { diff --git a/Userland/Applications/PixelPaint/PaletteWidget.cpp b/Userland/Applications/PixelPaint/PaletteWidget.cpp index f2cb94573f5..f40e16c96c0 100644 --- a/Userland/Applications/PixelPaint/PaletteWidget.cpp +++ b/Userland/Applications/PixelPaint/PaletteWidget.cpp @@ -263,7 +263,7 @@ Result, DeprecatedString> PaletteWidget::load_palette_path(Depreca Result PaletteWidget::save_palette_file(Vector palette, Core::File& file) { for (auto& color : palette) { - file.write(color.to_string_without_alpha()); + file.write(color.to_deprecated_string_without_alpha()); file.write("\n"sv); } return {}; diff --git a/Userland/Applications/Presenter/Presentation.cpp b/Userland/Applications/Presenter/Presentation.cpp index 18570427bb5..b58944184b0 100644 --- a/Userland/Applications/Presenter/Presentation.cpp +++ b/Userland/Applications/Presenter/Presentation.cpp @@ -112,7 +112,7 @@ HashMap Presentation::parse_metadata(JsonObj HashMap metadata; metadata_object.for_each_member([&](auto const& key, auto const& value) { - metadata.set(key, value.to_string()); + metadata.set(key, value.to_deprecated_string()); }); return metadata; diff --git a/Userland/Applications/Presenter/SlideObject.cpp b/Userland/Applications/Presenter/SlideObject.cpp index 0cfb0afdb04..108d5cea9a6 100644 --- a/Userland/Applications/Presenter/SlideObject.cpp +++ b/Userland/Applications/Presenter/SlideObject.cpp @@ -62,9 +62,9 @@ Gfx::IntRect SlideObject::transformed_bounding_box(Gfx::IntRect clip_rect, Gfx:: GraphicsObject::GraphicsObject() { register_property( - "color", [this]() { return this->color().to_string(); }, + "color", [this]() { return this->color().to_deprecated_string(); }, [this](auto& value) { - auto color = Color::from_string(value.to_string()); + auto color = Color::from_string(value.to_deprecated_string()); if (color.has_value()) { this->set_color(color.value()); return true; diff --git a/Userland/Applications/SpaceAnalyzer/main.cpp b/Userland/Applications/SpaceAnalyzer/main.cpp index ef0259f8e27..59d47aa72b2 100644 --- a/Userland/Applications/SpaceAnalyzer/main.cpp +++ b/Userland/Applications/SpaceAnalyzer/main.cpp @@ -91,7 +91,7 @@ static void fill_mounts(Vector& output) json.as_array().for_each([&output](JsonValue const& value) { auto& filesystem_object = value.as_object(); MountInfo mount_info; - mount_info.mount_point = filesystem_object.get("mount_point"sv).to_string(); + mount_info.mount_point = filesystem_object.get("mount_point"sv).to_deprecated_string(); mount_info.source = filesystem_object.get("source"sv).as_string_or("none"sv); output.append(mount_info); }); @@ -178,7 +178,7 @@ static void populate_filesize_tree(TreeNode& root, Vector& mounts, Ha StringBuilder builder = StringBuilder(); builder.append(root.m_name); builder.append('/'); - MountInfo* root_mount_info = find_mount_for_path(builder.to_string(), mounts); + MountInfo* root_mount_info = find_mount_for_path(builder.to_deprecated_string(), mounts); if (!root_mount_info) { return; } @@ -189,12 +189,12 @@ static void populate_filesize_tree(TreeNode& root, Vector& mounts, Ha builder.append(queue_entry.path); builder.append('/'); - MountInfo* mount_info = find_mount_for_path(builder.to_string(), mounts); + MountInfo* mount_info = find_mount_for_path(builder.to_deprecated_string(), mounts); if (!mount_info || (mount_info != root_mount_info && mount_info->source != root_mount_info->source)) { continue; } - Core::DirIterator dir_iterator(builder.to_string(), Core::DirIterator::SkipParentAndBaseDir); + Core::DirIterator dir_iterator(builder.to_deprecated_string(), Core::DirIterator::SkipParentAndBaseDir); if (dir_iterator.has_error()) { int error_sum = error_accumulator.get(dir_iterator.error()).value_or(0); error_accumulator.set(dir_iterator.error(), error_sum + 1); @@ -218,7 +218,7 @@ static void populate_filesize_tree(TreeNode& root, Vector& mounts, Ha error_accumulator.set(errno, error_sum + 1); } else { if (S_ISDIR(st.st_mode)) { - queue.enqueue(QueueEntry(builder.to_string(), &child)); + queue.enqueue(QueueEntry(builder.to_deprecated_string(), &child)); } else { child.m_area = st.st_size; } @@ -272,7 +272,7 @@ static void analyze(RefPtr tree, SpaceAnalyzer::TreeMapWidget& treemapwidg builder.append(')'); first = false; } - statusbar.set_text(builder.to_string()); + statusbar.set_text(builder.to_deprecated_string()); } else { statusbar.set_text("No errors"); } diff --git a/Userland/Applications/Spreadsheet/Cell.cpp b/Userland/Applications/Spreadsheet/Cell.cpp index eb51a6626f7..dea260bb97b 100644 --- a/Userland/Applications/Spreadsheet/Cell.cpp +++ b/Userland/Applications/Spreadsheet/Cell.cpp @@ -162,7 +162,7 @@ DeprecatedString Cell::source() const if (m_kind == Formula) builder.append('='); builder.append(m_data); - return builder.to_string(); + return builder.to_deprecated_string(); } // FIXME: Find a better way to figure out dependencies diff --git a/Userland/Applications/Spreadsheet/CellType/Date.cpp b/Userland/Applications/Spreadsheet/CellType/Date.cpp index 77d4f3fd44d..9dfda3cea16 100644 --- a/Userland/Applications/Spreadsheet/CellType/Date.cpp +++ b/Userland/Applications/Spreadsheet/CellType/Date.cpp @@ -22,7 +22,7 @@ JS::ThrowCompletionOr DateCell::display(Cell& cell, CellTypeMe return propagate_failure(cell, [&]() -> JS::ThrowCompletionOr { auto& vm = cell.sheet().global_object().vm(); auto timestamp = TRY(js_value(cell, metadata)); - auto string = Core::DateTime::from_timestamp(TRY(timestamp.to_i32(vm))).to_string(metadata.format.is_empty() ? "%Y-%m-%d %H:%M:%S"sv : metadata.format.view()); + auto string = Core::DateTime::from_timestamp(TRY(timestamp.to_i32(vm))).to_deprecated_string(metadata.format.is_empty() ? "%Y-%m-%d %H:%M:%S"sv : metadata.format.view()); if (metadata.length >= 0) return string.substring(0, metadata.length); diff --git a/Userland/Applications/Spreadsheet/ExportDialog.cpp b/Userland/Applications/Spreadsheet/ExportDialog.cpp index 7b30aaa5366..ae934d10e4f 100644 --- a/Userland/Applications/Spreadsheet/ExportDialog.cpp +++ b/Userland/Applications/Spreadsheet/ExportDialog.cpp @@ -276,7 +276,7 @@ Result ExportDialog::make_and_run_for(StringView mime, C for (auto& sheet : workbook.sheets()) array.append(sheet.to_json()); - auto file_content = array.to_string(); + auto file_content = array.to_deprecated_string(); bool result = file.write(file_content); if (!result) { int error_number = errno; @@ -286,7 +286,7 @@ Result ExportDialog::make_and_run_for(StringView mime, C sb.append("Unable to save file. Error: "sv); sb.append({ error, strlen(error) }); - return sb.to_string(); + return sb.to_deprecated_string(); } return {}; diff --git a/Userland/Applications/Spreadsheet/HelpWindow.cpp b/Userland/Applications/Spreadsheet/HelpWindow.cpp index 899684c6908..eafe74c65e5 100644 --- a/Userland/Applications/Spreadsheet/HelpWindow.cpp +++ b/Userland/Applications/Spreadsheet/HelpWindow.cpp @@ -142,12 +142,12 @@ DeprecatedString HelpWindow::render(StringView key) VERIFY(m_docs.has_object(key)); auto& doc = m_docs.get(key).as_object(); - auto name = doc.get("name"sv).to_string(); + auto name = doc.get("name"sv).to_deprecated_string(); auto argc = doc.get("argc"sv).to_u32(0); VERIFY(doc.has_array("argnames"sv)); auto& argnames = doc.get("argnames"sv).as_array(); - auto docstring = doc.get("doc"sv).to_string(); + auto docstring = doc.get("doc"sv).to_deprecated_string(); StringBuilder markdown_builder; @@ -162,7 +162,7 @@ DeprecatedString HelpWindow::render(StringView key) markdown_builder.append("No required arguments.\n"sv); for (size_t i = 0; i < argc; ++i) - markdown_builder.appendff("- `{}`\n", argnames.at(i).to_string()); + markdown_builder.appendff("- `{}`\n", argnames.at(i).to_deprecated_string()); if (argc > 0) markdown_builder.append("\n"sv); @@ -171,7 +171,7 @@ DeprecatedString HelpWindow::render(StringView key) auto opt_count = argnames.size() - argc; markdown_builder.appendff("{} optional argument(s):\n", opt_count); for (size_t i = argc; i < (size_t)argnames.size(); ++i) - markdown_builder.appendff("- `{}`\n", argnames.at(i).to_string()); + markdown_builder.appendff("- `{}`\n", argnames.at(i).to_deprecated_string()); markdown_builder.append("\n"sv); } @@ -184,8 +184,8 @@ DeprecatedString HelpWindow::render(StringView key) VERIFY(examples.is_object()); markdown_builder.append("# EXAMPLES\n"sv); examples.as_object().for_each_member([&](auto& text, auto& description_value) { - dbgln("```js\n{}\n```\n\n- {}\n", text, description_value.to_string()); - markdown_builder.appendff("```js\n{}\n```\n\n- {}\n", text, description_value.to_string()); + dbgln("```js\n{}\n```\n\n- {}\n", text, description_value.to_deprecated_string()); + markdown_builder.appendff("```js\n{}\n```\n\n- {}\n", text, description_value.to_deprecated_string()); }); } diff --git a/Userland/Applications/Spreadsheet/ImportDialog.cpp b/Userland/Applications/Spreadsheet/ImportDialog.cpp index e5000fa931b..788c38ec0d7 100644 --- a/Userland/Applications/Spreadsheet/ImportDialog.cpp +++ b/Userland/Applications/Spreadsheet/ImportDialog.cpp @@ -215,7 +215,7 @@ Result, DeprecatedString> ImportDialog::make_and_run_ sb.append("Failed to parse "sv); sb.append(file.filename()); - return sb.to_string(); + return sb.to_deprecated_string(); } auto& json_value = json_value_option.value(); @@ -224,7 +224,7 @@ Result, DeprecatedString> ImportDialog::make_and_run_ sb.append("Did not find a spreadsheet in "sv); sb.append(file.filename()); - return sb.to_string(); + return sb.to_deprecated_string(); } NonnullRefPtrVector sheets; diff --git a/Userland/Applications/Spreadsheet/JSIntegration.cpp b/Userland/Applications/Spreadsheet/JSIntegration.cpp index 4fad61a8dd4..68f9a087f3b 100644 --- a/Userland/Applications/Spreadsheet/JSIntegration.cpp +++ b/Userland/Applications/Spreadsheet/JSIntegration.cpp @@ -196,7 +196,7 @@ JS_DEFINE_NATIVE_FUNCTION(SheetGlobalObject::get_real_cell_contents) auto name_value = vm.argument(0); if (!name_value.is_string()) return vm.throw_completion("Expected a String argument to get_real_cell_contents()"); - auto position = sheet_object->m_sheet.parse_cell_name(name_value.as_string().string()); + auto position = sheet_object->m_sheet.parse_cell_name(name_value.as_string().deprecated_string()); if (!position.has_value()) return vm.throw_completion("Invalid cell name"); @@ -225,7 +225,7 @@ JS_DEFINE_NATIVE_FUNCTION(SheetGlobalObject::set_real_cell_contents) auto name_value = vm.argument(0); if (!name_value.is_string()) return vm.throw_completion("Expected the first argument of set_real_cell_contents() to be a String"); - auto position = sheet_object->m_sheet.parse_cell_name(name_value.as_string().string()); + auto position = sheet_object->m_sheet.parse_cell_name(name_value.as_string().deprecated_string()); if (!position.has_value()) return vm.throw_completion("Invalid cell name"); @@ -234,7 +234,7 @@ JS_DEFINE_NATIVE_FUNCTION(SheetGlobalObject::set_real_cell_contents) return vm.throw_completion("Expected the second argument of set_real_cell_contents() to be a String"); auto& cell = sheet_object->m_sheet.ensure(position.value()); - auto& new_contents = new_contents_value.as_string().string(); + auto& new_contents = new_contents_value.as_string().deprecated_string(); cell.set_data(new_contents); return JS::js_null(); } @@ -255,7 +255,7 @@ JS_DEFINE_NATIVE_FUNCTION(SheetGlobalObject::parse_cell_name) auto name_value = vm.argument(0); if (!name_value.is_string()) return vm.throw_completion("Expected a String argument to parse_cell_name()"); - auto position = sheet_object->m_sheet.parse_cell_name(name_value.as_string().string()); + auto position = sheet_object->m_sheet.parse_cell_name(name_value.as_string().deprecated_string()); if (!position.has_value()) return JS::js_undefined(); @@ -301,7 +301,7 @@ JS_DEFINE_NATIVE_FUNCTION(SheetGlobalObject::column_index) if (!column_name.is_string()) return vm.throw_completion(JS::ErrorType::NotAnObjectOfType, "String"); - auto& column_name_str = column_name.as_string().string(); + auto& column_name_str = column_name.as_string().deprecated_string(); auto* this_object = TRY(vm.this_value().to_object(vm)); @@ -326,7 +326,7 @@ JS_DEFINE_NATIVE_FUNCTION(SheetGlobalObject::column_arithmetic) if (!column_name.is_string()) return vm.throw_completion(JS::ErrorType::NotAnObjectOfType, "String"); - auto& column_name_str = column_name.as_string().string(); + auto& column_name_str = column_name.as_string().deprecated_string(); auto offset = TRY(vm.argument(1).to_number(vm)); auto offset_number = static_cast(offset.as_double()); @@ -354,7 +354,7 @@ JS_DEFINE_NATIVE_FUNCTION(SheetGlobalObject::get_column_bound) if (!column_name.is_string()) return vm.throw_completion(JS::ErrorType::NotAnObjectOfType, "String"); - auto& column_name_str = column_name.as_string().string(); + auto& column_name_str = column_name.as_string().deprecated_string(); auto* this_object = TRY(vm.this_value().to_object(vm)); if (!is(this_object)) @@ -405,7 +405,7 @@ JS_DEFINE_NATIVE_FUNCTION(WorkbookObject::sheet) auto& workbook = static_cast(this_object)->m_workbook; if (name_value.is_string()) { - auto& name = name_value.as_string().string(); + auto& name = name_value.as_string().deprecated_string(); for (auto& sheet : workbook.sheets()) { if (sheet.name() == name) return JS::Value(&sheet.global_object()); diff --git a/Userland/Applications/Spreadsheet/Readers/XSV.cpp b/Userland/Applications/Spreadsheet/Readers/XSV.cpp index 8943fc9eee5..92e692f654f 100644 --- a/Userland/Applications/Spreadsheet/Readers/XSV.cpp +++ b/Userland/Applications/Spreadsheet/Readers/XSV.cpp @@ -240,7 +240,7 @@ XSV::Field XSV::read_one_quoted_field() set_error(ReadError::QuoteFailure); if (is_copy) - return { {}, builder.to_string(), false }; + return { {}, builder.to_deprecated_string(), false }; return { m_source.substring_view(start, end - start), {}, true }; } diff --git a/Userland/Applications/Spreadsheet/Spreadsheet.cpp b/Userland/Applications/Spreadsheet/Spreadsheet.cpp index f70ab032a85..8dd11ea9fcf 100644 --- a/Userland/Applications/Spreadsheet/Spreadsheet.cpp +++ b/Userland/Applications/Spreadsheet/Spreadsheet.cpp @@ -57,7 +57,7 @@ Sheet::Sheet(Workbook& workbook) warnln("Spreadsheet: Failed to parse runtime code"); for (auto& error : script_or_error.error()) { // FIXME: This doesn't print hints anymore - warnln("SyntaxError: {}", error.to_string()); + warnln("SyntaxError: {}", error.to_deprecated_string()); } } else { auto result = interpreter().run(script_or_error.value()); @@ -172,7 +172,7 @@ JS::ThrowCompletionOr Sheet::evaluate(StringView source, Cell* on_beh name); if (script_or_error.is_error()) - return interpreter().vm().throw_completion(script_or_error.error().first().to_string()); + return interpreter().vm().throw_completion(script_or_error.error().first().to_deprecated_string()); return interpreter().run(script_or_error.value()); } @@ -260,12 +260,12 @@ Cell* Sheet::from_url(const URL& url) Optional Sheet::position_from_url(const URL& url) const { if (!url.is_valid()) { - dbgln("Invalid url: {}", url.to_string()); + dbgln("Invalid url: {}", url.to_deprecated_string()); return {}; } if (url.scheme() != "spreadsheet" || url.host() != "cell") { - dbgln("Bad url: {}", url.to_string()); + dbgln("Bad url: {}", url.to_deprecated_string()); return {}; } @@ -422,7 +422,7 @@ RefPtr Sheet::from_json(JsonObject const& object, Workbook& workbook) OwnPtr cell; switch (kind) { case Cell::LiteralString: - cell = make(obj.get("value"sv).to_string(), position, *sheet); + cell = make(obj.get("value"sv).to_deprecated_string(), position, *sheet); break; case Cell::Formula: { auto& vm = sheet->interpreter().vm(); @@ -431,12 +431,12 @@ RefPtr Sheet::from_json(JsonObject const& object, Workbook& workbook) warnln("Failed to load previous value for cell {}, leaving as undefined", position.to_cell_identifier(sheet)); value_or_error = JS::js_undefined(); } - cell = make(obj.get("source"sv).to_string(), value_or_error.release_value(), position, *sheet); + cell = make(obj.get("source"sv).to_deprecated_string(), value_or_error.release_value(), position, *sheet); break; } } - auto type_name = obj.has("type"sv) ? obj.get("type"sv).to_string() : "Numeric"; + auto type_name = obj.has("type"sv) ? obj.get("type"sv).to_deprecated_string() : "Numeric"; cell->set_type(type_name); auto type_meta = obj.get("type_metadata"sv); @@ -465,7 +465,7 @@ RefPtr Sheet::from_json(JsonObject const& object, Workbook& workbook) return IterationDecision::Continue; auto& fmt_obj = fmt_val.as_object(); - auto fmt_cond = fmt_obj.get("condition"sv).to_string(); + auto fmt_cond = fmt_obj.get("condition"sv).to_deprecated_string(); if (fmt_cond.is_empty()) return IterationDecision::Continue; @@ -532,9 +532,9 @@ JsonObject Sheet::to_json() const auto save_format = [](auto const& format, auto& obj) { if (format.foreground_color.has_value()) - obj.set("foreground_color", format.foreground_color.value().to_string()); + obj.set("foreground_color", format.foreground_color.value().to_deprecated_string()); if (format.background_color.has_value()) - obj.set("background_color", format.background_color.value().to_string()); + obj.set("background_color", format.background_color.value().to_deprecated_string()); }; auto bottom_right = written_data_bounds(); @@ -552,7 +552,7 @@ JsonObject Sheet::to_json() const StringBuilder builder; builder.append(column(it.key.column)); builder.appendff("{}", it.key.row); - auto key = builder.to_string(); + auto key = builder.to_deprecated_string(); JsonObject data; data.set("kind", it.value->kind() == Cell::Kind::Formula ? "Formula" : "LiteralString"); @@ -737,7 +737,7 @@ DeprecatedString Sheet::generate_inline_documentation_for(StringView function, s builder.append('<'); else if (i >= argc) builder.append('['); - builder.append(argnames[i].to_string()); + builder.append(argnames[i].to_deprecated_string()); if (i == argument_index) builder.append('>'); else if (i >= argc) diff --git a/Userland/Applications/Spreadsheet/SpreadsheetModel.cpp b/Userland/Applications/Spreadsheet/SpreadsheetModel.cpp index 321b85b2241..3adb40c9e6c 100644 --- a/Userland/Applications/Spreadsheet/SpreadsheetModel.cpp +++ b/Userland/Applications/Spreadsheet/SpreadsheetModel.cpp @@ -23,7 +23,7 @@ GUI::Variant SheetModel::data(const GUI::ModelIndex& index, GUI::ModelRole role) if (!cell) return DeprecatedString::empty(); - Function to_string_as_exception = [&](JS::Value value) { + Function to_deprecated_string_as_exception = [&](JS::Value value) { auto& vm = cell->sheet().global_object().vm(); StringBuilder builder; builder.append("Error: "sv); @@ -36,32 +36,32 @@ GUI::Variant SheetModel::data(const GUI::ModelIndex& index, GUI::ModelRole role) builder.append(message.to_string_without_side_effects()); else builder.append(error.release_value()); - return builder.to_string(); + return builder.to_deprecated_string(); } } auto error_message = value.to_string(vm); if (error_message.is_throw_completion()) - return to_string_as_exception(*error_message.release_error().value()); + return to_deprecated_string_as_exception(*error_message.release_error().value()); builder.append(error_message.release_value()); - return builder.to_string(); + return builder.to_deprecated_string(); }; if (cell->kind() == Spreadsheet::Cell::Formula) { if (auto opt_throw_value = cell->thrown_value(); opt_throw_value.has_value()) - return to_string_as_exception(*opt_throw_value); + return to_deprecated_string_as_exception(*opt_throw_value); } auto display = cell->typed_display(); if (display.is_error()) - return to_string_as_exception(*display.release_error().value()); + return to_deprecated_string_as_exception(*display.release_error().value()); return display.release_value(); } if (role == GUI::ModelRole::MimeData) - return Position { (size_t)index.column(), (size_t)index.row() }.to_url(m_sheet).to_string(); + return Position { (size_t)index.column(), (size_t)index.row() }.to_url(m_sheet).to_deprecated_string(); if (role == GUI::ModelRole::TextAlignment) { auto const* cell = m_sheet->at({ (size_t)index.column(), (size_t)index.row() }); @@ -131,7 +131,7 @@ GUI::Variant SheetModel::data(const GUI::ModelIndex& index, GUI::ModelRole role) builder.appendff(" in cell '{}', at line {}, column {}\n", frame.source_range.filename().substring_view(5), frame.source_range.start.line, frame.source_range.start.column); } } - return builder.to_string(); + return builder.to_deprecated_string(); } return {}; @@ -155,7 +155,7 @@ RefPtr SheetModel::mime_data(const GUI::ModelSelection& selectio Position cursor_position { (size_t)cursor->column(), (size_t)cursor->row() }; auto mime_data_buffer = mime_data->data("text/x-spreadsheet-data"); auto new_data = DeprecatedString::formatted("{}\n{}", - cursor_position.to_url(m_sheet).to_string(), + cursor_position.to_url(m_sheet).to_deprecated_string(), StringView(mime_data_buffer)); mime_data->set_data("text/x-spreadsheet-data", new_data.to_byte_buffer()); @@ -185,7 +185,7 @@ void SheetModel::set_data(const GUI::ModelIndex& index, const GUI::Variant& valu auto& cell = m_sheet->ensure({ (size_t)index.column(), (size_t)index.row() }); auto previous_data = cell.data(); - cell.set_data(value.to_string()); + cell.set_data(value.to_deprecated_string()); if (on_cell_data_change) on_cell_data_change(cell, previous_data); did_update(UpdateFlag::DontInvalidateIndices); diff --git a/Userland/Applications/Spreadsheet/SpreadsheetView.cpp b/Userland/Applications/Spreadsheet/SpreadsheetView.cpp index e5b7ab34a5b..0dc712e119d 100644 --- a/Userland/Applications/Spreadsheet/SpreadsheetView.cpp +++ b/Userland/Applications/Spreadsheet/SpreadsheetView.cpp @@ -495,7 +495,7 @@ void SpreadsheetView::TableCellPainter::paint(GUI::Painter& painter, Gfx::IntRec auto text_color = index.data(GUI::ModelRole::ForegroundColor).to_color(palette.color(m_table_view.foreground_role())); auto data = index.data(); auto text_alignment = index.data(GUI::ModelRole::TextAlignment).to_text_alignment(Gfx::TextAlignment::CenterRight); - painter.draw_text(rect, data.to_string(), m_table_view.font_for_index(index), text_alignment, text_color, Gfx::TextElision::Right); + painter.draw_text(rect, data.to_deprecated_string(), m_table_view.font_for_index(index), text_alignment, text_color, Gfx::TextElision::Right); } } diff --git a/Userland/Applications/Spreadsheet/SpreadsheetWidget.cpp b/Userland/Applications/Spreadsheet/SpreadsheetWidget.cpp index b9f781c6852..f4061093ec6 100644 --- a/Userland/Applications/Spreadsheet/SpreadsheetWidget.cpp +++ b/Userland/Applications/Spreadsheet/SpreadsheetWidget.cpp @@ -594,7 +594,7 @@ void SpreadsheetWidget::update_window_title() builder.append(current_filename()); builder.append("[*] - Spreadsheet"sv); - window()->set_title(builder.to_string()); + window()->set_title(builder.to_deprecated_string()); } void SpreadsheetWidget::clipboard_action(bool is_cut) @@ -617,17 +617,17 @@ void SpreadsheetWidget::clipboard_action(bool is_cut) auto cursor = current_selection_cursor(); if (cursor) { Spreadsheet::Position position { (size_t)cursor->column(), (size_t)cursor->row() }; - url_builder.append(position.to_url(worksheet).to_string()); + url_builder.append(position.to_url(worksheet).to_deprecated_string()); url_builder.append('\n'); } for (auto& cell : cells) { if (first && !cursor) { - url_builder.append(cell.to_url(worksheet).to_string()); + url_builder.append(cell.to_url(worksheet).to_deprecated_string()); url_builder.append('\n'); } - url_builder.append(cell.to_url(worksheet).to_string()); + url_builder.append(cell.to_url(worksheet).to_deprecated_string()); url_builder.append('\n'); auto cell_data = worksheet.at(cell); @@ -638,8 +638,8 @@ void SpreadsheetWidget::clipboard_action(bool is_cut) first = false; } HashMap metadata; - metadata.set("text/x-spreadsheet-data", url_builder.to_string()); - dbgln(url_builder.to_string()); + metadata.set("text/x-spreadsheet-data", url_builder.to_deprecated_string()); + dbgln(url_builder.to_deprecated_string()); GUI::Clipboard::the().set_data(text_builder.string_view().bytes(), "text/plain", move(metadata)); } diff --git a/Userland/Applications/SystemMonitor/ProcessMemoryMapWidget.cpp b/Userland/Applications/SystemMonitor/ProcessMemoryMapWidget.cpp index 25ab4759ddd..495ad362cf4 100644 --- a/Userland/Applications/SystemMonitor/ProcessMemoryMapWidget.cpp +++ b/Userland/Applications/SystemMonitor/ProcessMemoryMapWidget.cpp @@ -25,7 +25,7 @@ public: virtual void paint(GUI::Painter& painter, Gfx::IntRect const& a_rect, Gfx::Palette const&, const GUI::ModelIndex& index) override { auto rect = a_rect.shrunken(2, 2); - auto pagemap = index.data(GUI::ModelRole::Custom).to_string(); + auto pagemap = index.data(GUI::ModelRole::Custom).to_deprecated_string(); float scale_factor = (float)pagemap.length() / (float)rect.width(); @@ -76,10 +76,10 @@ ProcessMemoryMapWidget::ProcessMemoryMapWidget() builder.append('C'); if (object.get("stack"sv).to_bool()) builder.append('T'); - return builder.to_string(); + return builder.to_deprecated_string(); }); pid_vm_fields.empend("VMObject type", Gfx::TextAlignment::CenterLeft, [](auto& object) { - auto type = object.get("vmobject"sv).to_string(); + auto type = object.get("vmobject"sv).to_deprecated_string(); if (type.ends_with("VMObject"sv)) type = type.substring(0, type.length() - 8); return type; diff --git a/Userland/Applications/SystemMonitor/main.cpp b/Userland/Applications/SystemMonitor/main.cpp index a91dfe1f510..64b9febe979 100644 --- a/Userland/Applications/SystemMonitor/main.cpp +++ b/Userland/Applications/SystemMonitor/main.cpp @@ -132,7 +132,7 @@ public: size_builder.append(' '); size_builder.append(human_readable_size(object.get("total_block_count"sv).to_u64() * object.get("block_size"sv).to_u64())); size_builder.append(' '); - return size_builder.to_string(); + return size_builder.to_deprecated_string(); }, [](const JsonObject& object) { return object.get("total_block_count"sv).to_u64() * object.get("block_size"sv).to_u64(); @@ -194,7 +194,7 @@ public: check(MS_NOREGULAR, "noregular"sv); if (builder.string_view().is_empty()) return DeprecatedString("defaults"); - return builder.to_string(); + return builder.to_deprecated_string(); }); df_fields.empend("free_block_count", "Free blocks", Gfx::TextAlignment::CenterRight); df_fields.empend("total_block_count", "Total blocks", Gfx::TextAlignment::CenterRight); @@ -339,7 +339,7 @@ ErrorOr serenity_main(Main::Arguments arguments) if (process_table_view.selection().is_empty()) return {}; auto pid_index = process_table_view.model()->index(process_table_view.selection().first().row(), column, process_table_view.selection().first().parent()); - return pid_index.data().to_string(); + return pid_index.data().to_deprecated_string(); }; auto kill_action = GUI::Action::create( @@ -528,7 +528,7 @@ ErrorOr> build_process_window(pid_t pid) main_widget->find_descendant_of_type_named("icon_label")->set_icon(icon_data.as_icon().bitmap_for_size(32)); } - main_widget->find_descendant_of_type_named("process_name")->set_text(DeprecatedString::formatted("{} (PID {})", process_index.sibling_at_column(ProcessModel::Column::Name).data().to_string(), pid)); + main_widget->find_descendant_of_type_named("process_name")->set_text(DeprecatedString::formatted("{} (PID {})", process_index.sibling_at_column(ProcessModel::Column::Name).data().to_deprecated_string(), pid)); main_widget->find_descendant_of_type_named("process_state")->set_pid(pid); main_widget->find_descendant_of_type_named("open_files")->set_pid(pid); diff --git a/Userland/Applications/TextEditor/FileArgument.cpp b/Userland/Applications/TextEditor/FileArgument.cpp index fbbc58bb6e3..590c7fc985a 100644 --- a/Userland/Applications/TextEditor/FileArgument.cpp +++ b/Userland/Applications/TextEditor/FileArgument.cpp @@ -26,9 +26,9 @@ FileArgument::FileArgument(DeprecatedString file_argument) // Match 0 group 2: column number if (groups.size() > 2) { // Both a line and column number were specified. - auto filename = groups.at(0).view.to_string(); - auto initial_line_number = groups.at(1).view.to_string().to_int(); - auto initial_column_number = groups.at(2).view.to_string().to_int(); + auto filename = groups.at(0).view.to_deprecated_string(); + auto initial_line_number = groups.at(1).view.to_deprecated_string().to_int(); + auto initial_column_number = groups.at(2).view.to_deprecated_string().to_int(); m_filename = filename; if (initial_line_number.has_value() && initial_line_number.value() > 0) @@ -37,15 +37,15 @@ FileArgument::FileArgument(DeprecatedString file_argument) m_column = initial_column_number.value(); } else if (groups.size() == 2) { // Only a line number was specified. - auto filename = groups.at(0).view.to_string(); - auto initial_line_number = groups.at(1).view.to_string().to_int(); + auto filename = groups.at(0).view.to_deprecated_string(); + auto initial_line_number = groups.at(1).view.to_deprecated_string().to_int(); m_filename = filename; if (initial_line_number.has_value() && initial_line_number.value() > 0) m_line = initial_line_number.value(); } else { // A colon was found at the end of the file name but no values were found after it. - m_filename = groups.at(0).view.to_string(); + m_filename = groups.at(0).view.to_deprecated_string(); } } } diff --git a/Userland/Applications/TextEditor/MainWidget.cpp b/Userland/Applications/TextEditor/MainWidget.cpp index 3bdbfdaaabf..ab5da4c957e 100644 --- a/Userland/Applications/TextEditor/MainWidget.cpp +++ b/Userland/Applications/TextEditor/MainWidget.cpp @@ -331,7 +331,7 @@ WebView::OutOfProcessWebView& MainWidget::ensure_web_view() m_page_view = web_view_container.add(); m_page_view->on_link_hover = [this](auto& url) { if (url.is_valid()) - m_statusbar->set_text(url.to_string()); + m_statusbar->set_text(url.to_deprecated_string()); else update_statusbar(); }; @@ -711,7 +711,7 @@ void MainWidget::update_title() else builder.append(m_path); builder.append("[*] - Text Editor"sv); - window()->set_title(builder.to_string()); + window()->set_title(builder.to_deprecated_string()); } bool MainWidget::read_file(Core::File& file) @@ -855,7 +855,7 @@ void MainWidget::update_statusbar() auto word_count = m_editor->number_of_words(); builder.appendff("{} {} ({} {})", text.length(), text.length() == 1 ? "character" : "characters", word_count, word_count != 1 ? "words" : "word"); } - m_statusbar->set_text(0, builder.to_string()); + m_statusbar->set_text(0, builder.to_deprecated_string()); if (m_editor && m_editor->syntax_highlighter()) { auto language = m_editor->syntax_highlighter()->language(); diff --git a/Userland/Applications/ThemeEditor/MainWidget.cpp b/Userland/Applications/ThemeEditor/MainWidget.cpp index 86f888f3ac4..2ac9815f346 100644 --- a/Userland/Applications/ThemeEditor/MainWidget.cpp +++ b/Userland/Applications/ThemeEditor/MainWidget.cpp @@ -286,7 +286,7 @@ void MainWidget::save_to_file(Core::File& file) ENUMERATE_ALIGNMENT_ROLES(__ENUMERATE_ALIGNMENT_ROLE) #undef __ENUMERATE_ALIGNMENT_ROLE -#define __ENUMERATE_COLOR_ROLE(role) theme->write_entry("Colors", to_string(Gfx::ColorRole::role), m_current_palette.color(Gfx::ColorRole::role).to_string()); +#define __ENUMERATE_COLOR_ROLE(role) theme->write_entry("Colors", to_string(Gfx::ColorRole::role), m_current_palette.color(Gfx::ColorRole::role).to_deprecated_string()); ENUMERATE_COLOR_ROLES(__ENUMERATE_COLOR_ROLE) #undef __ENUMERATE_COLOR_ROLE diff --git a/Userland/Applications/VideoPlayer/VideoPlayerWidget.cpp b/Userland/Applications/VideoPlayer/VideoPlayerWidget.cpp index 01018b8e1fc..72d78abf64f 100644 --- a/Userland/Applications/VideoPlayer/VideoPlayerWidget.cpp +++ b/Userland/Applications/VideoPlayer/VideoPlayerWidget.cpp @@ -261,7 +261,7 @@ void VideoPlayerWidget::update_title() } string_builder.append("[*] - Video Player"sv); - window()->set_title(string_builder.to_string()); + window()->set_title(string_builder.to_deprecated_string()); } Video::PlaybackManager::SeekMode VideoPlayerWidget::seek_mode() diff --git a/Userland/Demos/WidgetGallery/GalleryWidget.cpp b/Userland/Demos/WidgetGallery/GalleryWidget.cpp index 35a1035d5af..0136712bcbb 100644 --- a/Userland/Demos/WidgetGallery/GalleryWidget.cpp +++ b/Userland/Demos/WidgetGallery/GalleryWidget.cpp @@ -275,7 +275,7 @@ GalleryWidget::GalleryWidget() StringBuilder sb; sb.append(m_wizard_output->get_text()); sb.append("\nWizard started."sv); - m_wizard_output->set_text(sb.to_string()); + m_wizard_output->set_text(sb.to_deprecated_string()); auto wizard = DemoWizardDialog::try_create(window()).release_value_but_fixme_should_propagate_errors(); auto result = wizard->exec(); diff --git a/Userland/DevTools/GMLPlayground/main.cpp b/Userland/DevTools/GMLPlayground/main.cpp index 1a5514fc900..9152c12329b 100644 --- a/Userland/DevTools/GMLPlayground/main.cpp +++ b/Userland/DevTools/GMLPlayground/main.cpp @@ -49,7 +49,7 @@ UnregisteredWidget::UnregisteredWidget(DeprecatedString const& class_name) StringBuilder builder; builder.append(class_name); builder.append("\nnot registered"sv); - m_text = builder.to_string(); + m_text = builder.to_deprecated_string(); } void UnregisteredWidget::paint_event(GUI::PaintEvent& event) @@ -116,7 +116,7 @@ ErrorOr serenity_main(Main::Arguments arguments) builder.append("[*]"sv); builder.append(" - GML Playground"sv); - window->set_title(builder.to_string()); + window->set_title(builder.to_deprecated_string()); }; editor->on_change = [&] { diff --git a/Userland/DevTools/HackStudio/Debugger/DisassemblyModel.cpp b/Userland/DevTools/HackStudio/Debugger/DisassemblyModel.cpp index 81fd38c063c..5a76c8e265c 100644 --- a/Userland/DevTools/HackStudio/Debugger/DisassemblyModel.cpp +++ b/Userland/DevTools/HackStudio/Debugger/DisassemblyModel.cpp @@ -60,7 +60,7 @@ DisassemblyModel::DisassemblyModel(Debug::DebugSession const& debug_session, Ptr if (!insn.has_value()) break; FlatPtr address_in_profiled_program = symbol.value().value() + offset_into_symbol; - auto disassembly = insn.value().to_string(address_in_profiled_program, &symbol_provider); + auto disassembly = insn.value().to_deprecated_string(address_in_profiled_program, &symbol_provider); StringView instruction_bytes = view.substring_view(offset_into_symbol, insn.value().length()); m_instructions.append({ insn.value(), disassembly, instruction_bytes, address_in_profiled_program }); @@ -99,7 +99,7 @@ GUI::Variant DisassemblyModel::data(const GUI::ModelIndex& index, GUI::ModelRole StringBuilder builder; for (auto ch : insn.bytes) builder.appendff("{:02x} ", static_cast(ch)); - return builder.to_string(); + return builder.to_deprecated_string(); } if (index.column() == Column::Disassembly) return insn.disassembly; diff --git a/Userland/DevTools/HackStudio/EditorWrapper.cpp b/Userland/DevTools/HackStudio/EditorWrapper.cpp index 7512896bb95..bb407f64465 100644 --- a/Userland/DevTools/HackStudio/EditorWrapper.cpp +++ b/Userland/DevTools/HackStudio/EditorWrapper.cpp @@ -117,7 +117,7 @@ void EditorWrapper::update_title() if (editor().document().is_modified()) title.append(" (*)"sv); - m_filename_title = title.to_string(); + m_filename_title = title.to_deprecated_string(); } void EditorWrapper::set_debug_mode(bool enabled) diff --git a/Userland/DevTools/HackStudio/FindInFilesWidget.cpp b/Userland/DevTools/HackStudio/FindInFilesWidget.cpp index a53ac64a74a..fe5be0354c9 100644 --- a/Userland/DevTools/HackStudio/FindInFilesWidget.cpp +++ b/Userland/DevTools/HackStudio/FindInFilesWidget.cpp @@ -105,7 +105,7 @@ static RefPtr find_in_files(StringView text) builder.append(file.document().text_in_range(range)); builder.append(0x02); builder.append(right_part); - matches.append({ file.name(), range, builder.to_string() }); + matches.append({ file.name(), range, builder.to_deprecated_string() }); } }); diff --git a/Userland/DevTools/HackStudio/Git/GitFilesView.cpp b/Userland/DevTools/HackStudio/Git/GitFilesView.cpp index 917ed783d21..f7f913c8f4e 100644 --- a/Userland/DevTools/HackStudio/Git/GitFilesView.cpp +++ b/Userland/DevTools/HackStudio/Git/GitFilesView.cpp @@ -54,7 +54,7 @@ void GitFilesView::mousedown_event(GUI::MouseEvent& event) auto data = model()->index(item_index, model_column()).data(); VERIFY(data.is_string()); - m_action_callback(data.to_string()); + m_action_callback(data.to_deprecated_string()); } }; diff --git a/Userland/DevTools/HackStudio/HackStudioWidget.cpp b/Userland/DevTools/HackStudio/HackStudioWidget.cpp index 360ed38e2a7..64c35b62286 100644 --- a/Userland/DevTools/HackStudio/HackStudioWidget.cpp +++ b/Userland/DevTools/HackStudio/HackStudioWidget.cpp @@ -279,7 +279,7 @@ void HackStudioWidget::open_project(DeprecatedString const& root_path) if (recent_projects.size() > recent_projects_history_size) recent_projects.shrink(recent_projects_history_size); - Config::write_string("HackStudio"sv, "Global"sv, "RecentProjects"sv, JsonArray(recent_projects).to_string()); + Config::write_string("HackStudio"sv, "Global"sv, "RecentProjects"sv, JsonArray(recent_projects).to_deprecated_string()); update_recent_projects_submenu(); } @@ -1088,7 +1088,7 @@ DeprecatedString HackStudioWidget::get_full_path_of_serenity_source(DeprecatedSt relative_path_builder.join('/', path_parts); constexpr char SERENITY_LIBS_PREFIX[] = "/usr/src/serenity"; LexicalPath serenity_sources_base(SERENITY_LIBS_PREFIX); - return DeprecatedString::formatted("{}/{}", serenity_sources_base, relative_path_builder.to_string()); + return DeprecatedString::formatted("{}/{}", serenity_sources_base, relative_path_builder.to_deprecated_string()); } DeprecatedString HackStudioWidget::get_absolute_path(DeprecatedString const& path) const @@ -1246,7 +1246,7 @@ void HackStudioWidget::create_open_files_view(GUI::Widget& parent) m_open_files_view->set_model(open_files_model); m_open_files_view->on_activation = [this](auto& index) { - open_file(index.data().to_string()); + open_file(index.data().to_deprecated_string()); }; } @@ -1559,7 +1559,7 @@ void HackStudioWidget::update_statusbar() builder.appendff("Selected: {} {} ({} {})", selected_text.length(), selected_text.length() == 1 ? "character" : "characters", word_count, word_count != 1 ? "words" : "word"); } - m_statusbar->set_text(0, builder.to_string()); + m_statusbar->set_text(0, builder.to_deprecated_string()); m_statusbar->set_text(1, current_editor_wrapper().editor().code_document().language_name()); m_statusbar->set_text(2, DeprecatedString::formatted("Ln {}, Col {}", current_editor().cursor().line() + 1, current_editor().cursor().column())); } diff --git a/Userland/DevTools/HackStudio/ProjectBuilder.cpp b/Userland/DevTools/HackStudio/ProjectBuilder.cpp index 04e9b6621e5..33656198193 100644 --- a/Userland/DevTools/HackStudio/ProjectBuilder.cpp +++ b/Userland/DevTools/HackStudio/ProjectBuilder.cpp @@ -176,7 +176,7 @@ DeprecatedString ProjectBuilder::generate_cmake_file_content() const builder.appendff("target_link_libraries({} INTERFACE {})\n", library.key, DeprecatedString::join(' ', library.value->dependencies)); } - return builder.to_string(); + return builder.to_deprecated_string(); } HashMap> ProjectBuilder::get_defined_libraries() diff --git a/Userland/DevTools/HackStudio/main.cpp b/Userland/DevTools/HackStudio/main.cpp index c237cec69a9..99b44e6d34c 100644 --- a/Userland/DevTools/HackStudio/main.cpp +++ b/Userland/DevTools/HackStudio/main.cpp @@ -129,7 +129,7 @@ static void update_path_environment_variable() if (path.length()) path.append(':'); path.append(DEFAULT_PATH_SV); - setenv("PATH", path.to_string().characters(), true); + setenv("PATH", path.to_deprecated_string().characters(), true); } static Optional last_opened_project_path() diff --git a/Userland/DevTools/Inspector/RemoteObjectPropertyModel.cpp b/Userland/DevTools/Inspector/RemoteObjectPropertyModel.cpp index 44b25823cc7..e5503b849cb 100644 --- a/Userland/DevTools/Inspector/RemoteObjectPropertyModel.cpp +++ b/Userland/DevTools/Inspector/RemoteObjectPropertyModel.cpp @@ -53,7 +53,7 @@ GUI::Variant RemoteObjectPropertyModel::data(const GUI::ModelIndex& index, GUI:: if (role == GUI::ModelRole::Display) { switch (index.column()) { case Column::Name: - return path->last().to_string(); + return path->last().to_deprecated_string(); case Column::Value: { auto data = path->resolve(m_object.json); if (data.is_array()) @@ -77,7 +77,7 @@ void RemoteObjectPropertyModel::set_data(const GUI::ModelIndex& index, const GUI return; FlatPtr address = m_object.address; - RemoteProcess::the().set_property(address, path->first().to_string(), new_value.to_string()); + RemoteProcess::the().set_property(address, path->first().to_deprecated_string(), new_value.to_deprecated_string()); did_update(); } @@ -164,7 +164,7 @@ GUI::ModelIndex RemoteObjectPropertyModel::parent_index(const GUI::ModelIndex& i return create_index(index_in_parent, 0, cpath); } - dbgln("No cached path found for path {}", path.to_string()); + dbgln("No cached path found for path {}", path.to_deprecated_string()); return {}; } diff --git a/Userland/DevTools/Inspector/RemoteProcess.cpp b/Userland/DevTools/Inspector/RemoteProcess.cpp index 1f2f96c49d0..d3787130de7 100644 --- a/Userland/DevTools/Inspector/RemoteProcess.cpp +++ b/Userland/DevTools/Inspector/RemoteProcess.cpp @@ -53,8 +53,8 @@ void RemoteProcess::handle_get_all_objects_response(JsonObject const& response) auto remote_object = make(); remote_object->address = object.get("address"sv).to_number(); remote_object->parent_address = object.get("parent"sv).to_number(); - remote_object->name = object.get("name"sv).to_string(); - remote_object->class_name = object.get("class_name"sv).to_string(); + remote_object->name = object.get("name"sv).to_deprecated_string(); + remote_object->class_name = object.get("class_name"sv).to_deprecated_string(); remote_object->json = object; objects_by_address.set(remote_object->address, remote_object); remote_objects.append(move(remote_object)); @@ -84,7 +84,7 @@ void RemoteProcess::set_inspected_object(FlatPtr address) void RemoteProcess::set_property(FlatPtr object, StringView name, JsonValue const& value) { - m_client->async_set_object_property(m_pid, object, name, value.to_string()); + m_client->async_set_object_property(m_pid, object, name, value.to_deprecated_string()); } bool RemoteProcess::is_inspectable() diff --git a/Userland/DevTools/Inspector/main.cpp b/Userland/DevTools/Inspector/main.cpp index 9bea0ab93d5..69979d4bd4e 100644 --- a/Userland/DevTools/Inspector/main.cpp +++ b/Userland/DevTools/Inspector/main.cpp @@ -132,10 +132,10 @@ ErrorOr serenity_main(Main::Arguments arguments) auto copy_bitmap = Gfx::Bitmap::try_load_from_file("/res/icons/16x16/edit-copy.png"sv).release_value_but_fixme_should_propagate_errors(); auto copy_property_name_action = GUI::Action::create("Copy Property Name", copy_bitmap, [&](auto&) { - GUI::Clipboard::the().set_plain_text(properties_tree_view.selection().first().data().to_string()); + GUI::Clipboard::the().set_plain_text(properties_tree_view.selection().first().data().to_deprecated_string()); }); auto copy_property_value_action = GUI::Action::create("Copy Property Value", copy_bitmap, [&](auto&) { - GUI::Clipboard::the().set_plain_text(properties_tree_view.selection().first().sibling_at_column(1).data().to_string()); + GUI::Clipboard::the().set_plain_text(properties_tree_view.selection().first().sibling_at_column(1).data().to_deprecated_string()); }); properties_tree_view_context_menu->add_action(copy_property_name_action); diff --git a/Userland/DevTools/Profiler/DisassemblyModel.cpp b/Userland/DevTools/Profiler/DisassemblyModel.cpp index 564d5d0ff08..0501224ac15 100644 --- a/Userland/DevTools/Profiler/DisassemblyModel.cpp +++ b/Userland/DevTools/Profiler/DisassemblyModel.cpp @@ -111,7 +111,7 @@ DisassemblyModel::DisassemblyModel(Profile& profile, ProfileNode& node) break; FlatPtr address_in_profiled_program = node.address() + offset_into_symbol; - auto disassembly = insn.value().to_string(address_in_profiled_program, &symbol_provider); + auto disassembly = insn.value().to_deprecated_string(address_in_profiled_program, &symbol_provider); StringView instruction_bytes = view.substring_view(offset_into_symbol, insn.value().length()); u32 samples_at_this_instruction = m_node.events_per_address().get(address_in_profiled_program).value_or(0); @@ -199,7 +199,7 @@ GUI::Variant DisassemblyModel::data(GUI::ModelIndex const& index, GUI::ModelRole for (auto ch : insn.bytes) { builder.appendff("{:02x} ", (u8)ch); } - return builder.to_string(); + return builder.to_deprecated_string(); } if (index.column() == Column::Disassembly) diff --git a/Userland/DevTools/Profiler/FilesystemEventModel.cpp b/Userland/DevTools/Profiler/FilesystemEventModel.cpp index 246fbff744e..e952dee06a4 100644 --- a/Userland/DevTools/Profiler/FilesystemEventModel.cpp +++ b/Userland/DevTools/Profiler/FilesystemEventModel.cpp @@ -36,7 +36,7 @@ FileEventNode& FileEventNode::find_or_create_node(DeprecatedString const& search StringBuilder sb; sb.join('/', parts); - auto new_s = sb.to_string(); + auto new_s = sb.to_deprecated_string(); for (auto& child : m_children) { if (child->m_path == current) { @@ -77,7 +77,7 @@ FileEventNode& FileEventNode::create_recursively(DeprecatedString new_path) StringBuilder sb; sb.join('/', parts); - return new_node->create_recursively(sb.to_string()); + return new_node->create_recursively(sb.to_deprecated_string()); } } diff --git a/Userland/DevTools/Profiler/FlameGraphView.cpp b/Userland/DevTools/Profiler/FlameGraphView.cpp index e151c593a91..84749c25260 100644 --- a/Userland/DevTools/Profiler/FlameGraphView.cpp +++ b/Userland/DevTools/Profiler/FlameGraphView.cpp @@ -180,7 +180,7 @@ DeprecatedString FlameGraphView::bar_label(StackBar const& bar) const auto label_index = bar.index.sibling_at_column(m_text_column); DeprecatedString label = "All"; if (label_index.is_valid()) { - label = m_model.data(label_index).to_string(); + label = m_model.data(label_index).to_deprecated_string(); } return label; } diff --git a/Userland/DevTools/Profiler/Process.cpp b/Userland/DevTools/Profiler/Process.cpp index 6dc67b33d2e..a2c592e783e 100644 --- a/Userland/DevTools/Profiler/Process.cpp +++ b/Userland/DevTools/Profiler/Process.cpp @@ -89,7 +89,7 @@ void LibraryMetadata::handle_mmap(FlatPtr base, size_t size, DeprecatedString co entry.base = min(entry.base, base); entry.size = max(entry.size + size, base - entry.base + size); } else { - DeprecatedString path_string = path.to_string(); + DeprecatedString path_string = path.to_deprecated_string(); DeprecatedString full_path; if (path_string.starts_with('/')) full_path = path_string; diff --git a/Userland/DevTools/Profiler/Profile.cpp b/Userland/DevTools/Profiler/Profile.cpp index d1170f3b11f..656f159ae61 100644 --- a/Userland/DevTools/Profiler/Profile.cpp +++ b/Userland/DevTools/Profiler/Profile.cpp @@ -260,7 +260,7 @@ ErrorOr> Profile::load_from_perfcore_file(StringView path HashMap profile_strings; for (FlatPtr string_id = 0; string_id < strings_value->as_array().size(); ++string_id) { auto const& value = strings_value->as_array().at(string_id); - profile_strings.set(string_id, value.to_string()); + profile_strings.set(string_id, value.to_deprecated_string()); } auto const* events_value = object.get_ptr("events"sv); @@ -286,7 +286,7 @@ ErrorOr> Profile::load_from_perfcore_file(StringView path event.pid = perf_event.get("pid"sv).to_i32(); event.tid = perf_event.get("tid"sv).to_i32(); - auto type_string = perf_event.get("type"sv).to_string(); + auto type_string = perf_event.get("type"sv).to_deprecated_string(); if (type_string == "sample"sv) { event.data = Event::SampleData {}; @@ -308,7 +308,7 @@ ErrorOr> Profile::load_from_perfcore_file(StringView path } else if (type_string == "mmap"sv) { auto ptr = perf_event.get("ptr"sv).to_number(); auto size = perf_event.get("size"sv).to_number(); - auto name = perf_event.get("name"sv).to_string(); + auto name = perf_event.get("name"sv).to_deprecated_string(); event.data = Event::MmapData { .ptr = ptr, @@ -328,7 +328,7 @@ ErrorOr> Profile::load_from_perfcore_file(StringView path continue; } else if (type_string == "process_create"sv) { auto parent_pid = perf_event.get("parent_pid"sv).to_number(); - auto executable = perf_event.get("executable"sv).to_string(); + auto executable = perf_event.get("executable"sv).to_deprecated_string(); event.data = Event::ProcessCreateData { .parent_pid = parent_pid, .executable = executable, @@ -346,7 +346,7 @@ ErrorOr> Profile::load_from_perfcore_file(StringView path all_processes.append(move(sampled_process)); continue; } else if (type_string == "process_exec"sv) { - auto executable = perf_event.get("executable"sv).to_string(); + auto executable = perf_event.get("executable"sv).to_deprecated_string(); event.data = Event::ProcessExecData { .executable = executable, }; diff --git a/Userland/DevTools/Profiler/main.cpp b/Userland/DevTools/Profiler/main.cpp index 2c398582cb7..c06a6057dc8 100644 --- a/Userland/DevTools/Profiler/main.cpp +++ b/Userland/DevTools/Profiler/main.cpp @@ -237,7 +237,7 @@ ErrorOr serenity_main(Main::Arguments arguments) auto flamegraph_hovered_index = flamegraph_view->hovered_index(); if (flamegraph_hovered_index.is_valid()) { - auto stack = profile->model().data(flamegraph_hovered_index.sibling_at_column(ProfileModel::Column::StackFrame)).to_string(); + auto stack = profile->model().data(flamegraph_hovered_index.sibling_at_column(ProfileModel::Column::StackFrame)).to_deprecated_string(); auto sample_count = profile->model().data(flamegraph_hovered_index.sibling_at_column(ProfileModel::Column::SampleCount)); auto self_count = profile->model().data(flamegraph_hovered_index.sibling_at_column(ProfileModel::Column::SelfCount)); builder.appendff("{}, ", stack); @@ -255,7 +255,7 @@ ErrorOr serenity_main(Main::Arguments arguments) builder.appendff(", Duration: {} ms", end - start); } } - statusbar->set_text(builder.to_string()); + statusbar->set_text(builder.to_deprecated_string()); }; timeline_view->on_selection_change = [&] { statusbar_update(); }; flamegraph_view->on_hover_change = [&] { statusbar_update(); }; diff --git a/Userland/DevTools/SQLStudio/MainWidget.cpp b/Userland/DevTools/SQLStudio/MainWidget.cpp index 4bc1adbd11b..2547e724a49 100644 --- a/Userland/DevTools/SQLStudio/MainWidget.cpp +++ b/Userland/DevTools/SQLStudio/MainWidget.cpp @@ -478,10 +478,10 @@ DeprecatedString MainWidget::read_next_sql_statement_of_editor() m_editor_line_level = last_token_ended_statement ? 0 : (m_editor_line_level > 0 ? m_editor_line_level : 1); } while ((m_editor_line_level > 0) || piece.is_empty()); - auto statement_id = m_sql_client->prepare_statement(m_connection_id, piece.to_string()); + auto statement_id = m_sql_client->prepare_statement(m_connection_id, piece.to_deprecated_string()); m_sql_client->async_execute_statement(statement_id); - return piece.to_string(); + return piece.to_deprecated_string(); } Optional MainWidget::read_next_line_of_editor() diff --git a/Userland/DevTools/UserspaceEmulator/Emulator.cpp b/Userland/DevTools/UserspaceEmulator/Emulator.cpp index 641ce3d4c41..4c60a12c5ae 100644 --- a/Userland/DevTools/UserspaceEmulator/Emulator.cpp +++ b/Userland/DevTools/UserspaceEmulator/Emulator.cpp @@ -237,7 +237,7 @@ int Emulator::exec() auto insn = X86::Instruction::from_stream(*m_cpu, X86::OperandSize::Size32, X86::AddressSize::Size32); // Exec cycle if constexpr (trace) { - outln("{:p} \033[33;1m{}\033[0m", m_cpu->base_eip(), insn.to_string(m_cpu->base_eip(), symbol_provider)); + outln("{:p} \033[33;1m{}\033[0m", m_cpu->base_eip(), insn.to_deprecated_string(m_cpu->base_eip(), symbol_provider)); } (m_cpu->*insn.handler())(insn); @@ -529,9 +529,9 @@ DeprecatedString Emulator::create_instruction_line(FlatPtr address, X86::Instruc { auto symbol = symbol_at(address); if (!symbol.has_value() || !symbol->source_position.has_value()) - return DeprecatedString::formatted("{:p}: {}", address, insn.to_string(address)); + return DeprecatedString::formatted("{:p}: {}", address, insn.to_deprecated_string(address)); - return DeprecatedString::formatted("{:p}: {} \e[34;1m{}\e[0m:{}", address, insn.to_string(address), LexicalPath::basename(symbol->source_position->file_path), symbol->source_position.value().line_number); + return DeprecatedString::formatted("{:p}: {} \e[34;1m{}\e[0m:{}", address, insn.to_deprecated_string(address), LexicalPath::basename(symbol->source_position->file_path), symbol->source_position.value().line_number); } static void emulator_signal_handler(int signum, siginfo_t* signal_info, void* context) diff --git a/Userland/DevTools/UserspaceEmulator/main.cpp b/Userland/DevTools/UserspaceEmulator/main.cpp index 430afeae0a9..f62b1f2b2a1 100644 --- a/Userland/DevTools/UserspaceEmulator/main.cpp +++ b/Userland/DevTools/UserspaceEmulator/main.cpp @@ -104,7 +104,7 @@ int main(int argc, char** argv, char** env) perror("set_process_name"); return 1; } - int rc = pthread_setname_np(pthread_self(), builder.to_string().characters()); + int rc = pthread_setname_np(pthread_self(), builder.to_deprecated_string().characters()); if (rc != 0) { reportln("pthread_setname_np: {}"sv, strerror(rc)); return 1; diff --git a/Userland/Games/BrickGame/BrickGame.cpp b/Userland/Games/BrickGame/BrickGame.cpp index d969ca61d14..4de5bb8c156 100644 --- a/Userland/Games/BrickGame/BrickGame.cpp +++ b/Userland/Games/BrickGame/BrickGame.cpp @@ -582,7 +582,7 @@ void BrickGame::game_over() Config::write_i32(m_app_name, m_app_name, "HighScore"sv, int(m_high_score = current_score)); } GUI::MessageBox::show(window(), - text.to_string(), + text.to_deprecated_string(), "Game Over"sv, GUI::MessageBox::Type::Information); diff --git a/Userland/Games/Chess/ChessWidget.cpp b/Userland/Games/Chess/ChessWidget.cpp index c02fdfd5e80..13dde5e3122 100644 --- a/Userland/Games/Chess/ChessWidget.cpp +++ b/Userland/Games/Chess/ChessWidget.cpp @@ -550,7 +550,7 @@ void ChessWidget::import_pgn(Core::File& file) DeprecatedString movetext; for (size_t j = i; j < lines.size(); j++) - movetext = DeprecatedString::formatted("{}{}", movetext, lines.at(i).to_string()); + movetext = DeprecatedString::formatted("{}{}", movetext, lines.at(i).to_deprecated_string()); for (auto token : movetext.split(' ')) { token = token.trim_whitespace(); @@ -626,7 +626,7 @@ void ChessWidget::export_pgn(Core::File& file) const // Tag Pair Section file.write("[Event \"Casual Game\"]\n"sv); file.write("[Site \"SerenityOS Chess\"]\n"sv); - file.write(DeprecatedString::formatted("[Date \"{}\"]\n", Core::DateTime::now().to_string("%Y.%m.%d"sv))); + file.write(DeprecatedString::formatted("[Date \"{}\"]\n", Core::DateTime::now().to_deprecated_string("%Y.%m.%d"sv))); file.write("[Round \"1\"]\n"sv); DeprecatedString username(getlogin()); @@ -635,7 +635,7 @@ void ChessWidget::export_pgn(Core::File& file) const file.write(DeprecatedString::formatted("[White \"{}\"]\n", m_side == Chess::Color::White ? player1 : player2)); file.write(DeprecatedString::formatted("[Black \"{}\"]\n", m_side == Chess::Color::Black ? player1 : player2)); - file.write(DeprecatedString::formatted("[Result \"{}\"]\n", Chess::Board::result_to_points(m_board.game_result(), m_board.turn()))); + file.write(DeprecatedString::formatted("[Result \"{}\"]\n", Chess::Board::result_to_points_deprecated_string(m_board.game_result(), m_board.turn()))); file.write("[WhiteElo \"?\"]\n"sv); file.write("[BlackElo \"?\"]\n"sv); file.write("[Variant \"Standard\"]\n"sv); @@ -656,9 +656,9 @@ void ChessWidget::export_pgn(Core::File& file) const } file.write("{ "sv); - file.write(Chess::Board::result_to_string(m_board.game_result(), m_board.turn())); + file.write(Chess::Board::result_to_deprecated_string(m_board.game_result(), m_board.turn())); file.write(" } "sv); - file.write(Chess::Board::result_to_points(m_board.game_result(), m_board.turn())); + file.write(Chess::Board::result_to_points_deprecated_string(m_board.game_result(), m_board.turn())); file.write("\n"sv); } @@ -688,7 +688,7 @@ int ChessWidget::resign() set_drag_enabled(false); update(); - const DeprecatedString msg = Chess::Board::result_to_string(m_board.game_result(), m_board.turn()); + const DeprecatedString msg = Chess::Board::result_to_deprecated_string(m_board.game_result(), m_board.turn()); GUI::MessageBox::show(window(), msg, "Game Over"sv, GUI::MessageBox::Type::Information); return 0; diff --git a/Userland/Games/GameOfLife/Pattern.cpp b/Userland/Games/GameOfLife/Pattern.cpp index e2a2c32d6fd..10b4f8f88eb 100644 --- a/Userland/Games/GameOfLife/Pattern.cpp +++ b/Userland/Games/GameOfLife/Pattern.cpp @@ -30,7 +30,7 @@ void Pattern::rotate_clockwise() for (int j = m_pattern.size() - 1; j >= 0; j--) { builder.append(m_pattern.at(j).substring(i, 1)); } - rotated.append(builder.to_string()); + rotated.append(builder.to_deprecated_string()); } m_pattern = move(rotated); } diff --git a/Userland/Games/Hearts/Game.cpp b/Userland/Games/Hearts/Game.cpp index 58ec70bdcbd..451c982cb5d 100644 --- a/Userland/Games/Hearts/Game.cpp +++ b/Userland/Games/Hearts/Game.cpp @@ -149,7 +149,7 @@ void Game::show_score_card(bool game_over) title_builder.append("Score Card"sv); if (game_over) title_builder.append(" - Game Over"sv); - score_dialog->set_title(title_builder.to_string()); + score_dialog->set_title(title_builder.to_deprecated_string()); RefPtr close_timer; if (!m_players[0].is_human) { diff --git a/Userland/Games/Snake/SnakeGame.cpp b/Userland/Games/Snake/SnakeGame.cpp index f826081aadd..5600c08c1c6 100644 --- a/Userland/Games/Snake/SnakeGame.cpp +++ b/Userland/Games/Snake/SnakeGame.cpp @@ -250,7 +250,7 @@ void SnakeGame::game_over() text.append("\nThat's a new high score!"sv); } GUI::MessageBox::show(window(), - text.to_string(), + text.to_deprecated_string(), "Game Over"sv, GUI::MessageBox::Type::Information); diff --git a/Userland/Libraries/LibC/arpa/inet.cpp b/Userland/Libraries/LibC/arpa/inet.cpp index 542fde74821..b404bd968d6 100644 --- a/Userland/Libraries/LibC/arpa/inet.cpp +++ b/Userland/Libraries/LibC/arpa/inet.cpp @@ -27,7 +27,7 @@ char const* inet_ntop(int af, void const* src, char* dst, socklen_t len) errno = ENOSPC; return nullptr; } - auto str = IPv6Address(((in6_addr const*)src)->s6_addr).to_string(); + auto str = IPv6Address(((in6_addr const*)src)->s6_addr).to_deprecated_string(); if (!str.copy_characters_to_buffer(dst, len)) { errno = ENOSPC; return nullptr; diff --git a/Userland/Libraries/LibC/netdb.cpp b/Userland/Libraries/LibC/netdb.cpp index 82042e1d16c..20ba73f0ae9 100644 --- a/Userland/Libraries/LibC/netdb.cpp +++ b/Userland/Libraries/LibC/netdb.cpp @@ -98,7 +98,7 @@ hostent* gethostbyname(char const* name) auto ipv4_address = IPv4Address::from_string({ name, strlen(name) }); if (ipv4_address.has_value()) { - gethostbyname_name_buffer = ipv4_address.value().to_string(); + gethostbyname_name_buffer = ipv4_address.value().to_deprecated_string(); __gethostbyname_buffer.h_name = const_cast(gethostbyname_name_buffer.characters()); __gethostbyname_alias_list_buffer[0] = nullptr; __gethostbyname_buffer.h_aliases = __gethostbyname_alias_list_buffer; diff --git a/Userland/Libraries/LibC/stdio.cpp b/Userland/Libraries/LibC/stdio.cpp index f95fb2aab1c..e73c64c8564 100644 --- a/Userland/Libraries/LibC/stdio.cpp +++ b/Userland/Libraries/LibC/stdio.cpp @@ -930,7 +930,7 @@ int vasprintf(char** strp, char const* fmt, va_list ap) builder.appendvf(fmt, ap); VERIFY(builder.length() <= NumericLimits::max()); int length = builder.length(); - *strp = strdup(builder.to_string().characters()); + *strp = strdup(builder.to_deprecated_string().characters()); return length; } @@ -944,7 +944,7 @@ int asprintf(char** strp, char const* fmt, ...) va_end(ap); VERIFY(builder.length() <= NumericLimits::max()); int length = builder.length(); - *strp = strdup(builder.to_string().characters()); + *strp = strdup(builder.to_deprecated_string().characters()); return length; } diff --git a/Userland/Libraries/LibChess/Chess.cpp b/Userland/Libraries/LibChess/Chess.cpp index d7a5edf4b33..53aeee25010 100644 --- a/Userland/Libraries/LibChess/Chess.cpp +++ b/Userland/Libraries/LibChess/Chess.cpp @@ -333,7 +333,7 @@ DeprecatedString Board::to_fen() const // 6. Fullmove number builder.append(DeprecatedString::number(1 + m_moves.size() / 2)); - return builder.to_string(); + return builder.to_deprecated_string(); } Piece Board::get_piece(Square const& square) const @@ -886,7 +886,7 @@ void Board::set_resigned(Chess::Color c) m_resigned = c; } -DeprecatedString Board::result_to_string(Result result, Color turn) +DeprecatedString Board::result_to_deprecated_string(Result result, Color turn) { switch (result) { case Result::CheckMate: @@ -915,7 +915,7 @@ DeprecatedString Board::result_to_string(Result result, Color turn) } } -DeprecatedString Board::result_to_points(Result result, Color turn) +DeprecatedString Board::result_to_points_deprecated_string(Result result, Color turn) { switch (result) { case Result::CheckMate: diff --git a/Userland/Libraries/LibChess/Chess.h b/Userland/Libraries/LibChess/Chess.h index fd9501e156b..abff2180f9d 100644 --- a/Userland/Libraries/LibChess/Chess.h +++ b/Userland/Libraries/LibChess/Chess.h @@ -145,8 +145,8 @@ public: NotFinished, }; - static DeprecatedString result_to_string(Result, Color turn); - static DeprecatedString result_to_points(Result, Color turn); + static DeprecatedString result_to_deprecated_string(Result, Color turn); + static DeprecatedString result_to_points_deprecated_string(Result, Color turn); template void generate_moves(Callback callback, Color color = Color::None) const; diff --git a/Userland/Libraries/LibChess/UCICommand.cpp b/Userland/Libraries/LibChess/UCICommand.cpp index 7cad448658d..3553ca3b69a 100644 --- a/Userland/Libraries/LibChess/UCICommand.cpp +++ b/Userland/Libraries/LibChess/UCICommand.cpp @@ -17,7 +17,7 @@ UCICommand UCICommand::from_string(StringView command) return UCICommand(); } -DeprecatedString UCICommand::to_string() const +DeprecatedString UCICommand::to_deprecated_string() const { return "uci\n"; } @@ -35,7 +35,7 @@ DebugCommand DebugCommand::from_string(StringView command) VERIFY_NOT_REACHED(); } -DeprecatedString DebugCommand::to_string() const +DeprecatedString DebugCommand::to_deprecated_string() const { if (flag() == Flag::On) { return "debug on\n"; @@ -52,7 +52,7 @@ IsReadyCommand IsReadyCommand::from_string(StringView command) return IsReadyCommand(); } -DeprecatedString IsReadyCommand::to_string() const +DeprecatedString IsReadyCommand::to_deprecated_string() const { return "isready\n"; } @@ -92,10 +92,10 @@ SetOptionCommand SetOptionCommand::from_string(StringView command) VERIFY(!name.is_empty()); - return SetOptionCommand(name.to_string().trim_whitespace(), value.to_string().trim_whitespace()); + return SetOptionCommand(name.to_deprecated_string().trim_whitespace(), value.to_deprecated_string().trim_whitespace()); } -DeprecatedString SetOptionCommand::to_string() const +DeprecatedString SetOptionCommand::to_deprecated_string() const { StringBuilder builder; builder.append("setoption name "sv); @@ -126,7 +126,7 @@ PositionCommand PositionCommand::from_string(StringView command) return PositionCommand(fen, moves); } -DeprecatedString PositionCommand::to_string() const +DeprecatedString PositionCommand::to_deprecated_string() const { StringBuilder builder; builder.append("position "sv); @@ -190,7 +190,7 @@ GoCommand GoCommand::from_string(StringView command) return go_command; } -DeprecatedString GoCommand::to_string() const +DeprecatedString GoCommand::to_deprecated_string() const { StringBuilder builder; builder.append("go"sv); @@ -238,7 +238,7 @@ StopCommand StopCommand::from_string(StringView command) return StopCommand(); } -DeprecatedString StopCommand::to_string() const +DeprecatedString StopCommand::to_deprecated_string() const { return "stop\n"; } @@ -263,7 +263,7 @@ IdCommand IdCommand::from_string(StringView command) VERIFY_NOT_REACHED(); } -DeprecatedString IdCommand::to_string() const +DeprecatedString IdCommand::to_deprecated_string() const { StringBuilder builder; builder.append("id "sv); @@ -285,7 +285,7 @@ UCIOkCommand UCIOkCommand::from_string(StringView command) return UCIOkCommand(); } -DeprecatedString UCIOkCommand::to_string() const +DeprecatedString UCIOkCommand::to_deprecated_string() const { return "uciok\n"; } @@ -298,7 +298,7 @@ ReadyOkCommand ReadyOkCommand::from_string(StringView command) return ReadyOkCommand(); } -DeprecatedString ReadyOkCommand::to_string() const +DeprecatedString ReadyOkCommand::to_deprecated_string() const { return "readyok\n"; } @@ -311,7 +311,7 @@ BestMoveCommand BestMoveCommand::from_string(StringView command) return BestMoveCommand(Move(tokens[1])); } -DeprecatedString BestMoveCommand::to_string() const +DeprecatedString BestMoveCommand::to_deprecated_string() const { StringBuilder builder; builder.append("bestmove "sv); @@ -326,7 +326,7 @@ InfoCommand InfoCommand::from_string([[maybe_unused]] StringView command) VERIFY_NOT_REACHED(); } -DeprecatedString InfoCommand::to_string() const +DeprecatedString InfoCommand::to_deprecated_string() const { // FIXME: Implement this. VERIFY_NOT_REACHED(); diff --git a/Userland/Libraries/LibChess/UCICommand.h b/Userland/Libraries/LibChess/UCICommand.h index ef2f8f0e5e6..f75d22308c8 100644 --- a/Userland/Libraries/LibChess/UCICommand.h +++ b/Userland/Libraries/LibChess/UCICommand.h @@ -44,7 +44,7 @@ public: { } - virtual DeprecatedString to_string() const = 0; + virtual DeprecatedString to_deprecated_string() const = 0; virtual ~Command() = default; }; @@ -58,7 +58,7 @@ public: static UCICommand from_string(StringView command); - virtual DeprecatedString to_string() const override; + virtual DeprecatedString to_deprecated_string() const override; }; class DebugCommand : public Command { @@ -76,7 +76,7 @@ public: static DebugCommand from_string(StringView command); - virtual DeprecatedString to_string() const override; + virtual DeprecatedString to_deprecated_string() const override; Flag flag() const { return m_flag; } @@ -93,7 +93,7 @@ public: static IsReadyCommand from_string(StringView command); - virtual DeprecatedString to_string() const override; + virtual DeprecatedString to_deprecated_string() const override; }; class SetOptionCommand : public Command { @@ -107,7 +107,7 @@ public: static SetOptionCommand from_string(StringView command); - virtual DeprecatedString to_string() const override; + virtual DeprecatedString to_deprecated_string() const override; DeprecatedString const& name() const { return m_name; } Optional const& value() const { return m_value; } @@ -128,7 +128,7 @@ public: static PositionCommand from_string(StringView command); - virtual DeprecatedString to_string() const override; + virtual DeprecatedString to_deprecated_string() const override; Optional const& fen() const { return m_fen; } Vector const& moves() const { return m_moves; } @@ -147,7 +147,7 @@ public: static GoCommand from_string(StringView command); - virtual DeprecatedString to_string() const override; + virtual DeprecatedString to_deprecated_string() const override; Optional> searchmoves; bool ponder { false }; @@ -172,7 +172,7 @@ public: static StopCommand from_string(StringView command); - virtual DeprecatedString to_string() const override; + virtual DeprecatedString to_deprecated_string() const override; }; class IdCommand : public Command { @@ -191,7 +191,7 @@ public: static IdCommand from_string(StringView command); - virtual DeprecatedString to_string() const override; + virtual DeprecatedString to_deprecated_string() const override; Type field_type() const { return m_field_type; } DeprecatedString const& value() const { return m_value; } @@ -210,7 +210,7 @@ public: static UCIOkCommand from_string(StringView command); - virtual DeprecatedString to_string() const override; + virtual DeprecatedString to_deprecated_string() const override; }; class ReadyOkCommand : public Command { @@ -222,7 +222,7 @@ public: static ReadyOkCommand from_string(StringView command); - virtual DeprecatedString to_string() const override; + virtual DeprecatedString to_deprecated_string() const override; }; class BestMoveCommand : public Command { @@ -235,7 +235,7 @@ public: static BestMoveCommand from_string(StringView command); - virtual DeprecatedString to_string() const override; + virtual DeprecatedString to_deprecated_string() const override; Chess::Move move() const { return m_move; } @@ -252,7 +252,7 @@ public: static InfoCommand from_string(StringView command); - virtual DeprecatedString to_string() const override; + virtual DeprecatedString to_deprecated_string() const override; Optional depth; Optional seldepth; diff --git a/Userland/Libraries/LibChess/UCIEndpoint.cpp b/Userland/Libraries/LibChess/UCIEndpoint.cpp index 832290403ac..286adaa4094 100644 --- a/Userland/Libraries/LibChess/UCIEndpoint.cpp +++ b/Userland/Libraries/LibChess/UCIEndpoint.cpp @@ -23,8 +23,8 @@ Endpoint::Endpoint(NonnullRefPtr in, NonnullRefPtrwrite(command.to_string()); + dbgln_if(UCI_DEBUG, "{} Sent UCI Command: {}", class_name(), DeprecatedString(command.to_deprecated_string().characters(), Chomp)); + m_out->write(command.to_deprecated_string()); } void Endpoint::event(Core::Event& event) diff --git a/Userland/Libraries/LibCodeComprehension/Cpp/CppComprehensionEngine.cpp b/Userland/Libraries/LibCodeComprehension/Cpp/CppComprehensionEngine.cpp index df04444f352..53d6bed7e93 100644 --- a/Userland/Libraries/LibCodeComprehension/Cpp/CppComprehensionEngine.cpp +++ b/Userland/Libraries/LibCodeComprehension/Cpp/CppComprehensionEngine.cpp @@ -774,7 +774,7 @@ DeprecatedString CppComprehensionEngine::SymbolName::scope_as_string() const builder.appendff("{}::", scope[i]); } builder.append(scope.last()); - return builder.to_string(); + return builder.to_deprecated_string(); } CppComprehensionEngine::SymbolName CppComprehensionEngine::SymbolName::create(StringView name, Vector&& scope) @@ -790,7 +790,7 @@ CppComprehensionEngine::SymbolName CppComprehensionEngine::SymbolName::create(St return SymbolName::create(name, move(parts)); } -DeprecatedString CppComprehensionEngine::SymbolName::to_string() const +DeprecatedString CppComprehensionEngine::SymbolName::to_deprecated_string() const { if (scope.is_empty()) return name; diff --git a/Userland/Libraries/LibCodeComprehension/Cpp/CppComprehensionEngine.h b/Userland/Libraries/LibCodeComprehension/Cpp/CppComprehensionEngine.h index 042bb19c27e..8605540f079 100644 --- a/Userland/Libraries/LibCodeComprehension/Cpp/CppComprehensionEngine.h +++ b/Userland/Libraries/LibCodeComprehension/Cpp/CppComprehensionEngine.h @@ -40,7 +40,7 @@ private: static SymbolName create(StringView, Vector&&); static SymbolName create(StringView); DeprecatedString scope_as_string() const; - DeprecatedString to_string() const; + DeprecatedString to_deprecated_string() const; bool operator==(SymbolName const&) const = default; }; diff --git a/Userland/Libraries/LibCompress/Gzip.cpp b/Userland/Libraries/LibCompress/Gzip.cpp index 0e0e5893766..8c07562b17c 100644 --- a/Userland/Libraries/LibCompress/Gzip.cpp +++ b/Userland/Libraries/LibCompress/Gzip.cpp @@ -164,7 +164,7 @@ Optional GzipDecompressor::describe_header(ReadonlyBytes bytes return {}; LittleEndian original_size = *reinterpret_cast(bytes.offset(bytes.size() - sizeof(u32))); - return DeprecatedString::formatted("last modified: {}, original size {}", Core::DateTime::from_timestamp(header.modification_time).to_string(), (u32)original_size); + return DeprecatedString::formatted("last modified: {}, original size {}", Core::DateTime::from_timestamp(header.modification_time).to_deprecated_string(), (u32)original_size); } bool GzipDecompressor::read_or_error(Bytes bytes) diff --git a/Userland/Libraries/LibCore/Account.cpp b/Userland/Libraries/LibCore/Account.cpp index 8115bd8dcc5..e48a67541a6 100644 --- a/Userland/Libraries/LibCore/Account.cpp +++ b/Userland/Libraries/LibCore/Account.cpp @@ -252,7 +252,7 @@ ErrorOr Account::generate_passwd_file() const if (errno) return Error::from_errno(errno); - return builder.to_string(); + return builder.to_deprecated_string(); } #ifndef AK_OS_BSD_GENERIC @@ -293,7 +293,7 @@ ErrorOr Account::generate_shadow_file() const if (errno) return Error::from_errno(errno); - return builder.to_string(); + return builder.to_deprecated_string(); } #endif diff --git a/Userland/Libraries/LibCore/ArgsParser.cpp b/Userland/Libraries/LibCore/ArgsParser.cpp index 59d3a17cf0e..72d226c579e 100644 --- a/Userland/Libraries/LibCore/ArgsParser.cpp +++ b/Userland/Libraries/LibCore/ArgsParser.cpp @@ -818,7 +818,7 @@ void ArgsParser::autocomplete(FILE* file, StringView program_name, Span ConfigFile::reparse() builder.append(line[i]); ++i; } - current_group = &m_groups.ensure(builder.to_string()); + current_group = &m_groups.ensure(builder.to_deprecated_string()); break; } default: { // Start of key @@ -132,8 +132,8 @@ ErrorOr ConfigFile::reparse() // We're not in a group yet, create one with the name ""... current_group = &m_groups.ensure(""); } - auto value_string = value_builder.to_string(); - current_group->set(key_builder.to_string(), value_string.trim_whitespace(TrimMode::Right)); + auto value_string = value_builder.to_deprecated_string(); + current_group->set(key_builder.to_deprecated_string(), value_string.trim_whitespace(TrimMode::Right)); } } } diff --git a/Userland/Libraries/LibCore/DateTime.cpp b/Userland/Libraries/LibCore/DateTime.cpp index bbc9056555b..25df6ca1cfe 100644 --- a/Userland/Libraries/LibCore/DateTime.cpp +++ b/Userland/Libraries/LibCore/DateTime.cpp @@ -84,7 +84,7 @@ void DateTime::set_time(int year, int month, int day, int hour, int minute, int m_second = tm.tm_sec; } -DeprecatedString DateTime::to_string(StringView format) const +DeprecatedString DateTime::to_deprecated_string(StringView format) const { struct tm tm; localtime_r(&m_timestamp, &tm); diff --git a/Userland/Libraries/LibCore/DateTime.h b/Userland/Libraries/LibCore/DateTime.h index 76fe34a68d3..fe050a2df36 100644 --- a/Userland/Libraries/LibCore/DateTime.h +++ b/Userland/Libraries/LibCore/DateTime.h @@ -31,7 +31,7 @@ public: bool is_leap_year() const; void set_time(int year, int month = 1, int day = 1, int hour = 0, int minute = 0, int second = 0); - DeprecatedString to_string(StringView format = "%Y-%m-%d %H:%M:%S"sv) const; + DeprecatedString to_deprecated_string(StringView format = "%Y-%m-%d %H:%M:%S"sv) const; static DateTime create(int year, int month = 1, int day = 1, int hour = 0, int minute = 0, int second = 0); static DateTime now(); diff --git a/Userland/Libraries/LibCore/DirIterator.cpp b/Userland/Libraries/LibCore/DirIterator.cpp index f4871a80514..fb17a82f055 100644 --- a/Userland/Libraries/LibCore/DirIterator.cpp +++ b/Userland/Libraries/LibCore/DirIterator.cpp @@ -92,7 +92,7 @@ DeprecatedString DirIterator::next_full_path() if (!m_path.ends_with('/')) builder.append('/'); builder.append(next_path()); - return builder.to_string(); + return builder.to_deprecated_string(); } int DirIterator::fd() const diff --git a/Userland/Libraries/LibCore/EventLoop.cpp b/Userland/Libraries/LibCore/EventLoop.cpp index e30fd3eb38a..c4cf6f229a7 100644 --- a/Userland/Libraries/LibCore/EventLoop.cpp +++ b/Userland/Libraries/LibCore/EventLoop.cpp @@ -211,7 +211,7 @@ private: public: void send_response(JsonObject const& response) { - auto serialized = response.to_string(); + auto serialized = response.to_deprecated_string(); auto bytes_to_send = serialized.bytes(); u32 length = bytes_to_send.size(); // FIXME: Propagate errors @@ -280,7 +280,7 @@ public: auto address = request.get("address"sv).to_number(); for (auto& object : Object::all_objects()) { if ((FlatPtr)&object == address) { - bool success = object.set_property(request.get("name"sv).to_string(), request.get("value"sv)); + bool success = object.set_property(request.get("name"sv).to_deprecated_string(), request.get("value"sv)); JsonObject response; response.set("type", "SetProperty"); response.set("success", success); diff --git a/Userland/Libraries/LibCore/Group.cpp b/Userland/Libraries/LibCore/Group.cpp index 8eff79cabd1..3ebc090fe32 100644 --- a/Userland/Libraries/LibCore/Group.cpp +++ b/Userland/Libraries/LibCore/Group.cpp @@ -45,7 +45,7 @@ ErrorOr Group::generate_group_file() const if (errno) return Error::from_errno(errno); - return builder.to_string(); + return builder.to_deprecated_string(); } ErrorOr Group::sync() diff --git a/Userland/Libraries/LibCore/MimeData.cpp b/Userland/Libraries/LibCore/MimeData.cpp index 54595a1ea57..750b02fe257 100644 --- a/Userland/Libraries/LibCore/MimeData.cpp +++ b/Userland/Libraries/LibCore/MimeData.cpp @@ -35,7 +35,7 @@ void MimeData::set_urls(Vector const& urls) { StringBuilder builder; for (auto& url : urls) { - builder.append(url.to_string()); + builder.append(url.to_deprecated_string()); builder.append('\n'); } set_data("text/uri-list", builder.to_byte_buffer()); diff --git a/Userland/Libraries/LibCore/Object.h b/Userland/Libraries/LibCore/Object.h index 9ce1cb548bf..050204af655 100644 --- a/Userland/Libraries/LibCore/Object.h +++ b/Userland/Libraries/LibCore/Object.h @@ -301,7 +301,7 @@ requires IsBaseOf property_name, \ [this] { return this->getter(); }, \ [this](auto& value) { \ - this->setter(value.to_string()); \ + this->setter(value.to_deprecated_string()); \ return true; \ }); diff --git a/Userland/Libraries/LibCore/ProcessStatisticsReader.cpp b/Userland/Libraries/LibCore/ProcessStatisticsReader.cpp index 4cb19be547e..c5f79f6d2e3 100644 --- a/Userland/Libraries/LibCore/ProcessStatisticsReader.cpp +++ b/Userland/Libraries/LibCore/ProcessStatisticsReader.cpp @@ -53,11 +53,11 @@ Optional ProcessStatisticsReader::get_all(RefPtr ProcessStatisticsReader::get_all(RefPtr struct AK::Formatter : Formatter { ErrorOr format(FormatBuilder& builder, Core::SocketAddress const& value) { - return Formatter::format(builder, value.to_string()); + return Formatter::format(builder, value.to_deprecated_string()); } }; diff --git a/Userland/Libraries/LibCore/StandardPaths.cpp b/Userland/Libraries/LibCore/StandardPaths.cpp index 51e1e4c1086..f0d4fc7b2c6 100644 --- a/Userland/Libraries/LibCore/StandardPaths.cpp +++ b/Userland/Libraries/LibCore/StandardPaths.cpp @@ -30,7 +30,7 @@ DeprecatedString StandardPaths::desktop_directory() StringBuilder builder; builder.append(home_directory()); builder.append("/Desktop"sv); - return LexicalPath::canonicalized_path(builder.to_string()); + return LexicalPath::canonicalized_path(builder.to_deprecated_string()); } DeprecatedString StandardPaths::documents_directory() @@ -38,7 +38,7 @@ DeprecatedString StandardPaths::documents_directory() StringBuilder builder; builder.append(home_directory()); builder.append("/Documents"sv); - return LexicalPath::canonicalized_path(builder.to_string()); + return LexicalPath::canonicalized_path(builder.to_deprecated_string()); } DeprecatedString StandardPaths::downloads_directory() @@ -46,7 +46,7 @@ DeprecatedString StandardPaths::downloads_directory() StringBuilder builder; builder.append(home_directory()); builder.append("/Downloads"sv); - return LexicalPath::canonicalized_path(builder.to_string()); + return LexicalPath::canonicalized_path(builder.to_deprecated_string()); } DeprecatedString StandardPaths::config_directory() @@ -54,7 +54,7 @@ DeprecatedString StandardPaths::config_directory() StringBuilder builder; builder.append(home_directory()); builder.append("/.config"sv); - return LexicalPath::canonicalized_path(builder.to_string()); + return LexicalPath::canonicalized_path(builder.to_deprecated_string()); } DeprecatedString StandardPaths::tempfile_directory() diff --git a/Userland/Libraries/LibCore/System.cpp b/Userland/Libraries/LibCore/System.cpp index 6ce57141037..2970c23dfec 100644 --- a/Userland/Libraries/LibCore/System.cpp +++ b/Userland/Libraries/LibCore/System.cpp @@ -702,7 +702,7 @@ ErrorOr clock_settime(clockid_t clock_id, struct timespec* ts) static ALWAYS_INLINE ErrorOr posix_spawn_wrapper(StringView path, posix_spawn_file_actions_t const* file_actions, posix_spawnattr_t const* attr, char* const arguments[], char* const envp[], StringView function_name, decltype(::posix_spawn) spawn_function) { pid_t child_pid; - if ((errno = spawn_function(&child_pid, path.to_string().characters(), file_actions, attr, arguments, envp))) + if ((errno = spawn_function(&child_pid, path.to_deprecated_string().characters(), file_actions, attr, arguments, envp))) return Error::from_syscall(function_name, -errno); return child_pid; } @@ -1082,7 +1082,7 @@ ErrorOr exec(StringView filename, Span arguments, SearchInPath exec_filename = maybe_executable.release_value(); } else { - exec_filename = filename.to_string(); + exec_filename = filename.to_deprecated_string(); } params.path = { exec_filename.characters(), exec_filename.length() }; @@ -1094,7 +1094,7 @@ ErrorOr exec(StringView filename, Span arguments, SearchInPath auto argument_strings = TRY(FixedArray::try_create(arguments.size())); auto argv = TRY(FixedArray::try_create(arguments.size() + 1)); for (size_t i = 0; i < arguments.size(); ++i) { - argument_strings[i] = arguments[i].to_string(); + argument_strings[i] = arguments[i].to_deprecated_string(); argv[i] = const_cast(argument_strings[i].characters()); } argv[arguments.size()] = nullptr; @@ -1104,7 +1104,7 @@ ErrorOr exec(StringView filename, Span arguments, SearchInPath auto environment_strings = TRY(FixedArray::try_create(environment->size())); auto envp = TRY(FixedArray::try_create(environment->size() + 1)); for (size_t i = 0; i < environment->size(); ++i) { - environment_strings[i] = environment->at(i).to_string(); + environment_strings[i] = environment->at(i).to_deprecated_string(); envp[i] = const_cast(environment_strings[i].characters()); } envp[environment->size()] = nullptr; diff --git a/Userland/Libraries/LibCore/SystemServerTakeover.cpp b/Userland/Libraries/LibCore/SystemServerTakeover.cpp index 92075a3b75b..d5f32e98544 100644 --- a/Userland/Libraries/LibCore/SystemServerTakeover.cpp +++ b/Userland/Libraries/LibCore/SystemServerTakeover.cpp @@ -25,7 +25,7 @@ static void parse_sockets_from_system_server() for (auto& socket : StringView { sockets, strlen(sockets) }.split_view(' ')) { auto params = socket.split_view(':'); - s_overtaken_sockets.set(params[0].to_string(), strtol(params[1].to_string().characters(), nullptr, 10)); + s_overtaken_sockets.set(params[0].to_deprecated_string(), strtol(params[1].to_deprecated_string().characters(), nullptr, 10)); } s_overtaken_sockets_parsed = true; diff --git a/Userland/Libraries/LibCoredump/Backtrace.cpp b/Userland/Libraries/LibCoredump/Backtrace.cpp index 068305c3b6f..e147732fd13 100644 --- a/Userland/Libraries/LibCoredump/Backtrace.cpp +++ b/Userland/Libraries/LibCoredump/Backtrace.cpp @@ -128,7 +128,7 @@ void Backtrace::add_entry(Reader const& coredump, FlatPtr ip) m_entries.append({ ip, object_name, function_name, source_position }); } -DeprecatedString Backtrace::Entry::to_string(bool color) const +DeprecatedString Backtrace::Entry::to_deprecated_string(bool color) const { StringBuilder builder; builder.appendff("{:p}: ", eip); diff --git a/Userland/Libraries/LibCoredump/Backtrace.h b/Userland/Libraries/LibCoredump/Backtrace.h index fab31304732..9ce037f3c5f 100644 --- a/Userland/Libraries/LibCoredump/Backtrace.h +++ b/Userland/Libraries/LibCoredump/Backtrace.h @@ -35,7 +35,7 @@ public: DeprecatedString function_name; Debug::DebugInfo::SourcePositionWithInlines source_position_with_inlines; - DeprecatedString to_string(bool color = false) const; + DeprecatedString to_deprecated_string(bool color = false) const; }; Backtrace(Reader const&, const ELF::Core::ThreadInfo&, Function on_progress = {}); diff --git a/Userland/Libraries/LibCpp/AST.cpp b/Userland/Libraries/LibCpp/AST.cpp index 7ac8a12aa73..21419bd8895 100644 --- a/Userland/Libraries/LibCpp/AST.cpp +++ b/Userland/Libraries/LibCpp/AST.cpp @@ -72,10 +72,10 @@ void Type::dump(FILE* output, size_t indent) const { ASTNode::dump(output, indent); print_indent(output, indent + 1); - outln(output, "{}", to_string()); + outln(output, "{}", to_deprecated_string()); } -DeprecatedString NamedType::to_string() const +DeprecatedString NamedType::to_deprecated_string() const { DeprecatedString qualifiers_string; if (!qualifiers().is_empty()) @@ -90,33 +90,33 @@ DeprecatedString NamedType::to_string() const return DeprecatedString::formatted("{}{}", qualifiers_string, name); } -DeprecatedString Pointer::to_string() const +DeprecatedString Pointer::to_deprecated_string() const { if (!m_pointee) return {}; StringBuilder builder; - builder.append(m_pointee->to_string()); + builder.append(m_pointee->to_deprecated_string()); builder.append('*'); - return builder.to_string(); + return builder.to_deprecated_string(); } -DeprecatedString Reference::to_string() const +DeprecatedString Reference::to_deprecated_string() const { if (!m_referenced_type) return {}; StringBuilder builder; - builder.append(m_referenced_type->to_string()); + builder.append(m_referenced_type->to_deprecated_string()); if (m_kind == Kind::Lvalue) builder.append('&'); else builder.append("&&"sv); - return builder.to_string(); + return builder.to_deprecated_string(); } -DeprecatedString FunctionType::to_string() const +DeprecatedString FunctionType::to_deprecated_string() const { StringBuilder builder; - builder.append(m_return_type->to_string()); + builder.append(m_return_type->to_deprecated_string()); builder.append('('); bool first = true; for (auto& parameter : m_parameters) { @@ -125,14 +125,14 @@ DeprecatedString FunctionType::to_string() const else builder.append(", "sv); if (parameter.type()) - builder.append(parameter.type()->to_string()); + builder.append(parameter.type()->to_deprecated_string()); if (parameter.name() && !parameter.full_name().is_empty()) { builder.append(' '); builder.append(parameter.full_name()); } } builder.append(')'); - return builder.to_string(); + return builder.to_deprecated_string(); } void Parameter::dump(FILE* output, size_t indent) const @@ -552,7 +552,7 @@ StringView Name::full_name() const builder.appendff("{}::", scope.name()); } } - m_full_name = DeprecatedString::formatted("{}{}", builder.to_string(), m_name.is_null() ? ""sv : m_name->name()); + m_full_name = DeprecatedString::formatted("{}{}", builder.to_deprecated_string(), m_name.is_null() ? ""sv : m_name->name()); return *m_full_name; } @@ -565,10 +565,10 @@ StringView TemplatizedName::full_name() const name.append(Name::full_name()); name.append('<'); for (auto& type : m_template_arguments) { - name.append(type.to_string()); + name.append(type.to_deprecated_string()); } name.append('>'); - m_full_name = name.to_string(); + m_full_name = name.to_deprecated_string(); return *m_full_name; } diff --git a/Userland/Libraries/LibCpp/AST.h b/Userland/Libraries/LibCpp/AST.h index 7d4f48b0a2e..095306e585c 100644 --- a/Userland/Libraries/LibCpp/AST.h +++ b/Userland/Libraries/LibCpp/AST.h @@ -228,7 +228,7 @@ public: virtual bool is_type() const override { return true; } virtual bool is_templatized() const { return false; } virtual bool is_named_type() const { return false; } - virtual DeprecatedString to_string() const = 0; + virtual DeprecatedString to_deprecated_string() const = 0; virtual void dump(FILE* = stdout, size_t indent = 0) const override; bool is_auto() const { return m_is_auto; } @@ -251,7 +251,7 @@ class NamedType : public Type { public: virtual ~NamedType() override = default; virtual StringView class_name() const override { return "NamedType"sv; } - virtual DeprecatedString to_string() const override; + virtual DeprecatedString to_deprecated_string() const override; virtual bool is_named_type() const override { return true; } NamedType(ASTNode* parent, Optional start, Optional end, DeprecatedString const& filename) @@ -271,7 +271,7 @@ public: virtual ~Pointer() override = default; virtual StringView class_name() const override { return "Pointer"sv; } virtual void dump(FILE* = stdout, size_t indent = 0) const override; - virtual DeprecatedString to_string() const override; + virtual DeprecatedString to_deprecated_string() const override; Pointer(ASTNode* parent, Optional start, Optional end, DeprecatedString const& filename) : Type(parent, start, end, filename) @@ -290,7 +290,7 @@ public: virtual ~Reference() override = default; virtual StringView class_name() const override { return "Reference"sv; } virtual void dump(FILE* = stdout, size_t indent = 0) const override; - virtual DeprecatedString to_string() const override; + virtual DeprecatedString to_deprecated_string() const override; enum class Kind { Lvalue, @@ -317,7 +317,7 @@ public: virtual ~FunctionType() override = default; virtual StringView class_name() const override { return "FunctionType"sv; } virtual void dump(FILE* = stdout, size_t indent = 0) const override; - virtual DeprecatedString to_string() const override; + virtual DeprecatedString to_deprecated_string() const override; FunctionType(ASTNode* parent, Optional start, Optional end, DeprecatedString const& filename) : Type(parent, start, end, filename) diff --git a/Userland/Libraries/LibCpp/Parser.cpp b/Userland/Libraries/LibCpp/Parser.cpp index b6a2a6ffa79..9976c73ac71 100644 --- a/Userland/Libraries/LibCpp/Parser.cpp +++ b/Userland/Libraries/LibCpp/Parser.cpp @@ -11,7 +11,7 @@ #include #include -#define LOG_SCOPE() ScopeLogger logger(DeprecatedString::formatted("'{}' - {} ({})", peek().text(), peek().type_as_string(), m_state.token_index)) +#define LOG_SCOPE() ScopeLogger logger(DeprecatedString::formatted("'{}' - {} ({})", peek().text(), peek().type_as_deprecated_string(), m_state.token_index)) namespace Cpp { @@ -22,7 +22,7 @@ Parser::Parser(Vector tokens, DeprecatedString const& filename) if constexpr (CPP_DEBUG) { dbgln("Tokens:"); for (size_t i = 0; i < m_tokens.size(); ++i) { - dbgln("{}- {}", i, m_tokens[i].to_string()); + dbgln("{}- {}", i, m_tokens[i].to_deprecated_string()); } } } @@ -579,7 +579,7 @@ NonnullRefPtr Parser::parse_secondary_expression(ASTNode& parent, No return func; } default: { - error(DeprecatedString::formatted("unexpected operator for expression. operator: {}", peek().to_string())); + error(DeprecatedString::formatted("unexpected operator for expression. operator: {}", peek().to_deprecated_string())); auto token = consume(); return create_ast_node(parent, token.start(), token.end()); } @@ -880,7 +880,7 @@ DeprecatedString Parser::text_in_range(Position start, Position end) const for (auto token : tokens_in_range(start, end)) { builder.append(token.text()); } - return builder.to_string(); + return builder.to_deprecated_string(); } Vector Parser::tokens_in_range(Position start, Position end) const @@ -1008,7 +1008,7 @@ Optional Parser::index_of_token_at(Position pos) const void Parser::print_tokens() const { for (auto& token : m_tokens) { - outln("{}", token.to_string()); + outln("{}", token.to_deprecated_string()); } } @@ -1110,7 +1110,7 @@ Token Parser::consume_keyword(DeprecatedString const& keyword) { auto token = consume(); if (token.type() != Token::Type::Keyword) { - error(DeprecatedString::formatted("unexpected token: {}, expected Keyword", token.to_string())); + error(DeprecatedString::formatted("unexpected token: {}, expected Keyword", token.to_deprecated_string())); return token; } if (text_of_token(token) != keyword) { diff --git a/Userland/Libraries/LibCpp/Preprocessor.cpp b/Userland/Libraries/LibCpp/Preprocessor.cpp index efd78d11bae..a5b3815e565 100644 --- a/Userland/Libraries/LibCpp/Preprocessor.cpp +++ b/Userland/Libraries/LibCpp/Preprocessor.cpp @@ -371,7 +371,7 @@ DeprecatedString Preprocessor::remove_escaped_newlines(StringView value) processed_value.append(lexer.consume_until(escaped_newline)); lexer.ignore(escaped_newline.length()); } - return processed_value.to_string(); + return processed_value.to_deprecated_string(); } DeprecatedString Preprocessor::evaluate_macro_call(MacroCall const& macro_call, Definition const& definition) @@ -401,7 +401,7 @@ DeprecatedString Preprocessor::evaluate_macro_call(MacroCall const& macro_call, } }); - return processed_value.to_string(); + return processed_value.to_deprecated_string(); } }; diff --git a/Userland/Libraries/LibCpp/SemanticSyntaxHighlighter.cpp b/Userland/Libraries/LibCpp/SemanticSyntaxHighlighter.cpp index f477fdb917a..27a7e47ee06 100644 --- a/Userland/Libraries/LibCpp/SemanticSyntaxHighlighter.cpp +++ b/Userland/Libraries/LibCpp/SemanticSyntaxHighlighter.cpp @@ -27,10 +27,10 @@ void SemanticSyntaxHighlighter::rehighlight(Palette const& palette) StringBuilder previous_tokens_as_lines; for (auto& token : current_tokens) - current_tokens_as_lines.appendff("{}\n", token.type_as_string()); + current_tokens_as_lines.appendff("{}\n", token.type_as_deprecated_string()); for (Cpp::Token const& token : m_saved_tokens) - previous_tokens_as_lines.appendff("{}\n", token.type_as_string()); + previous_tokens_as_lines.appendff("{}\n", token.type_as_deprecated_string()); auto previous = previous_tokens_as_lines.build(); auto current = current_tokens_as_lines.build(); diff --git a/Userland/Libraries/LibCpp/SyntaxHighlighter.cpp b/Userland/Libraries/LibCpp/SyntaxHighlighter.cpp index b62c3c33b88..9e56602987a 100644 --- a/Userland/Libraries/LibCpp/SyntaxHighlighter.cpp +++ b/Userland/Libraries/LibCpp/SyntaxHighlighter.cpp @@ -63,7 +63,7 @@ void SyntaxHighlighter::rehighlight(Palette const& palette) Vector spans; lexer.lex_iterable([&](auto token) { // FIXME: The +1 for the token end column is a quick hack due to not wanting to modify the lexer (which is also used by the parser). Maybe there's a better way to do this. - dbgln_if(SYNTAX_HIGHLIGHTING_DEBUG, "{} @ {}:{} - {}:{}", token.type_as_string(), token.start().line, token.start().column, token.end().line, token.end().column + 1); + dbgln_if(SYNTAX_HIGHLIGHTING_DEBUG, "{} @ {}:{} - {}:{}", token.type_as_deprecated_string(), token.start().line, token.start().column, token.end().line, token.end().column + 1); GUI::TextDocumentSpan span; span.range.set_start({ token.start().line, token.start().column }); span.range.set_end({ token.end().line, token.end().column + 1 }); diff --git a/Userland/Libraries/LibCpp/Token.cpp b/Userland/Libraries/LibCpp/Token.cpp index 5d6d96b736a..60b5a1fb8af 100644 --- a/Userland/Libraries/LibCpp/Token.cpp +++ b/Userland/Libraries/LibCpp/Token.cpp @@ -26,12 +26,12 @@ bool Position::operator<=(Position const& other) const return !(*this > other); } -DeprecatedString Token::to_string() const +DeprecatedString Token::to_deprecated_string() const { return DeprecatedString::formatted("{} {}:{}-{}:{} ({})", type_to_string(m_type), start().line, start().column, end().line, end().column, text()); } -DeprecatedString Token::type_as_string() const +DeprecatedString Token::type_as_deprecated_string() const { return type_to_string(m_type); } diff --git a/Userland/Libraries/LibCpp/Token.h b/Userland/Libraries/LibCpp/Token.h index 42916b9bd4a..7986aaa9c82 100644 --- a/Userland/Libraries/LibCpp/Token.h +++ b/Userland/Libraries/LibCpp/Token.h @@ -116,8 +116,8 @@ struct Token { VERIFY_NOT_REACHED(); } - DeprecatedString to_string() const; - DeprecatedString type_as_string() const; + DeprecatedString to_deprecated_string() const; + DeprecatedString type_as_deprecated_string() const; Position const& start() const { return m_start; } Position const& end() const { return m_end; } diff --git a/Userland/Libraries/LibCrypto/BigFraction/BigFraction.cpp b/Userland/Libraries/LibCrypto/BigFraction/BigFraction.cpp index 67e1700ce53..ce851347920 100644 --- a/Userland/Libraries/LibCrypto/BigFraction/BigFraction.cpp +++ b/Userland/Libraries/LibCrypto/BigFraction/BigFraction.cpp @@ -184,7 +184,7 @@ void BigFraction::reduce() m_denominator = denominator_divide.quotient; } -DeprecatedString BigFraction::to_string(unsigned rounding_threshold) const +DeprecatedString BigFraction::to_deprecated_string(unsigned rounding_threshold) const { StringBuilder builder; if (m_numerator.is_negative() && m_numerator != "0"_bigint) @@ -239,7 +239,7 @@ DeprecatedString BigFraction::to_string(unsigned rounding_threshold) const builder.append(fractional_value); } - return builder.to_string(); + return builder.to_deprecated_string(); } BigFraction BigFraction::sqrt() const diff --git a/Userland/Libraries/LibCrypto/BigFraction/BigFraction.h b/Userland/Libraries/LibCrypto/BigFraction/BigFraction.h index 4da35620d6d..25a8352ad9d 100644 --- a/Userland/Libraries/LibCrypto/BigFraction/BigFraction.h +++ b/Userland/Libraries/LibCrypto/BigFraction/BigFraction.h @@ -54,7 +54,7 @@ public: // - m_denominator = 10000 BigFraction rounded(unsigned rounding_threshold) const; - DeprecatedString to_string(unsigned rounding_threshold) const; + DeprecatedString to_deprecated_string(unsigned rounding_threshold) const; double to_double() const; private: diff --git a/Userland/Libraries/LibCrypto/BigInt/SignedBigInteger.cpp b/Userland/Libraries/LibCrypto/BigInt/SignedBigInteger.cpp index ac764cdd1d0..020ce8b6f32 100644 --- a/Userland/Libraries/LibCrypto/BigInt/SignedBigInteger.cpp +++ b/Userland/Libraries/LibCrypto/BigInt/SignedBigInteger.cpp @@ -60,7 +60,7 @@ DeprecatedString SignedBigInteger::to_base(u16 N) const builder.append(m_unsigned_data.to_base(N)); - return builder.to_string(); + return builder.to_deprecated_string(); } u64 SignedBigInteger::to_u64() const diff --git a/Userland/Libraries/LibCrypto/BigInt/UnsignedBigInteger.cpp b/Userland/Libraries/LibCrypto/BigInt/UnsignedBigInteger.cpp index a9cf9a2b478..003b40e27b9 100644 --- a/Userland/Libraries/LibCrypto/BigInt/UnsignedBigInteger.cpp +++ b/Userland/Libraries/LibCrypto/BigInt/UnsignedBigInteger.cpp @@ -164,7 +164,7 @@ DeprecatedString UnsignedBigInteger::to_base(u16 N) const temp.set_to(quotient); } - return builder.to_string().reverse(); + return builder.to_deprecated_string().reverse(); } u64 UnsignedBigInteger::to_u64() const diff --git a/Userland/Libraries/LibCrypto/Cipher/AES.cpp b/Userland/Libraries/LibCrypto/Cipher/AES.cpp index c7d58b7a205..084ca4f659a 100644 --- a/Userland/Libraries/LibCrypto/Cipher/AES.cpp +++ b/Userland/Libraries/LibCrypto/Cipher/AES.cpp @@ -25,7 +25,7 @@ constexpr void swap_keys(u32* keys, size_t i, size_t j) } #ifndef KERNEL -DeprecatedString AESCipherBlock::to_string() const +DeprecatedString AESCipherBlock::to_deprecated_string() const { StringBuilder builder; for (auto value : m_data) @@ -33,7 +33,7 @@ DeprecatedString AESCipherBlock::to_string() const return builder.build(); } -DeprecatedString AESCipherKey::to_string() const +DeprecatedString AESCipherKey::to_deprecated_string() const { StringBuilder builder; for (size_t i = 0; i < (rounds() + 1) * 4; ++i) diff --git a/Userland/Libraries/LibCrypto/Cipher/AES.h b/Userland/Libraries/LibCrypto/Cipher/AES.h index 28788186af0..24b6c33f72f 100644 --- a/Userland/Libraries/LibCrypto/Cipher/AES.h +++ b/Userland/Libraries/LibCrypto/Cipher/AES.h @@ -49,7 +49,7 @@ public: } #ifndef KERNEL - DeprecatedString to_string() const; + DeprecatedString to_deprecated_string() const; #endif private: @@ -65,7 +65,7 @@ struct AESCipherKey : public CipherKey { static bool is_valid_key_size(size_t bits) { return bits == 128 || bits == 192 || bits == 256; }; #ifndef KERNEL - DeprecatedString to_string() const; + DeprecatedString to_deprecated_string() const; #endif u32 const* round_keys() const diff --git a/Userland/Libraries/LibDNS/Name.cpp b/Userland/Libraries/LibDNS/Name.cpp index 111a1d15291..fcc0c41ff06 100644 --- a/Userland/Libraries/LibDNS/Name.cpp +++ b/Userland/Libraries/LibDNS/Name.cpp @@ -32,7 +32,7 @@ Name Name::parse(u8 const* data, size_t& offset, size_t max_offset, size_t recur u8 b = data[offset++]; if (b == '\0') { // This terminates the name. - return builder.to_string(); + return builder.to_deprecated_string(); } else if ((b & 0xc0) == 0xc0) { // The two bytes tell us the offset when to continue from. if (offset >= max_offset) @@ -40,7 +40,7 @@ Name Name::parse(u8 const* data, size_t& offset, size_t max_offset, size_t recur size_t dummy = (b & 0x3f) << 8 | data[offset++]; auto rest_of_name = parse(data, dummy, max_offset, recursion_level + 1); builder.append(rest_of_name.as_string()); - return builder.to_string(); + return builder.to_deprecated_string(); } else { // This is the length of a part. if (offset + b >= max_offset) @@ -72,7 +72,7 @@ void Name::randomize_case() } builder.append(c); } - m_name = builder.to_string(); + m_name = builder.to_deprecated_string(); } OutputStream& operator<<(OutputStream& stream, Name const& name) diff --git a/Userland/Libraries/LibDebug/DebugInfo.cpp b/Userland/Libraries/LibDebug/DebugInfo.cpp index 290974b822c..57f1ad4830b 100644 --- a/Userland/Libraries/LibDebug/DebugInfo.cpp +++ b/Userland/Libraries/LibDebug/DebugInfo.cpp @@ -334,7 +334,7 @@ void DebugInfo::add_type_info_to_variable(Dwarf::DIE const& type_die, PtraceRegi array_type_name.append(DeprecatedString::formatted("{:d}", array_size)); array_type_name.append(']'); } - parent_variable->type_name = array_type_name.to_string(); + parent_variable->type_name = array_type_name.to_deprecated_string(); } parent_variable->type = move(type_info); parent_variable->type->type_tag = type_die.tag(); diff --git a/Userland/Libraries/LibDebug/DebugSession.cpp b/Userland/Libraries/LibDebug/DebugSession.cpp index efb0fe5d0de..c195673b6ba 100644 --- a/Userland/Libraries/LibDebug/DebugSession.cpp +++ b/Userland/Libraries/LibDebug/DebugSession.cpp @@ -447,7 +447,7 @@ void DebugSession::update_loaded_libs() auto rc = segment_name_re.search(vm_name, result); if (!rc) return {}; - auto lib_name = result.capture_group_matches.at(0).at(0).view.string_view().to_string(); + auto lib_name = result.capture_group_matches.at(0).at(0).view.string_view().to_deprecated_string(); if (lib_name.starts_with('/')) return lib_name; return DeprecatedString::formatted("/usr/lib/{}", lib_name); diff --git a/Userland/Libraries/LibDesktop/Launcher.cpp b/Userland/Libraries/LibDesktop/Launcher.cpp index cdd71ea6dd1..eaa253cb555 100644 --- a/Userland/Libraries/LibDesktop/Launcher.cpp +++ b/Userland/Libraries/LibDesktop/Launcher.cpp @@ -19,10 +19,10 @@ auto Launcher::Details::from_details_str(DeprecatedString const& details_str) -> auto details = adopt_ref(*new Details); auto json = JsonValue::from_string(details_str).release_value_but_fixme_should_propagate_errors(); auto const& obj = json.as_object(); - details->executable = obj.get("executable"sv).to_string(); - details->name = obj.get("name"sv).to_string(); + details->executable = obj.get("executable"sv).to_deprecated_string(); + details->name = obj.get("name"sv).to_deprecated_string(); if (auto type_value = obj.get_ptr("type"sv)) { - auto type_str = type_value->to_string(); + auto type_str = type_value->to_deprecated_string(); if (type_str == "app") details->launcher_type = LauncherType::Application; else if (type_str == "userpreferred") @@ -100,12 +100,12 @@ bool Launcher::open(const URL& url, Details const& details) Vector Launcher::get_handlers_for_url(const URL& url) { - return connection().get_handlers_for_url(url.to_string()); + return connection().get_handlers_for_url(url.to_deprecated_string()); } auto Launcher::get_handlers_with_details_for_url(const URL& url) -> NonnullRefPtrVector
{ - auto details = connection().get_handlers_with_details_for_url(url.to_string()); + auto details = connection().get_handlers_with_details_for_url(url.to_deprecated_string()); NonnullRefPtrVector
handlers_with_details; for (auto& value : details) { handlers_with_details.append(Details::from_details_str(value)); diff --git a/Userland/Libraries/LibDiff/Format.cpp b/Userland/Libraries/LibDiff/Format.cpp index dd08aece36b..7956777325b 100644 --- a/Userland/Libraries/LibDiff/Format.cpp +++ b/Userland/Libraries/LibDiff/Format.cpp @@ -18,6 +18,6 @@ DeprecatedString generate_only_additions(DeprecatedString const& text) for (auto const& line : lines) { builder.appendff("+{}\n", line); } - return builder.to_string(); + return builder.to_deprecated_string(); } }; diff --git a/Userland/Libraries/LibELF/Core.h b/Userland/Libraries/LibELF/Core.h index d7f98f906a5..ca9a36db77c 100644 --- a/Userland/Libraries/LibELF/Core.h +++ b/Userland/Libraries/LibELF/Core.h @@ -67,7 +67,7 @@ struct [[gnu::packed]] MemoryRegionInfo { auto maybe_colon_index = memory_region_name.find(':'); if (!maybe_colon_index.has_value()) return {}; - return memory_region_name.substring_view(0, *maybe_colon_index).to_string(); + return memory_region_name.substring_view(0, *maybe_colon_index).to_deprecated_string(); } #endif }; diff --git a/Userland/Libraries/LibELF/DynamicLoader.cpp b/Userland/Libraries/LibELF/DynamicLoader.cpp index 1a836f5f002..5b19b22ec97 100644 --- a/Userland/Libraries/LibELF/DynamicLoader.cpp +++ b/Userland/Libraries/LibELF/DynamicLoader.cpp @@ -408,7 +408,7 @@ void DynamicLoader::load_program_headers() MAP_FILE | MAP_SHARED | MAP_FIXED, m_image_fd, VirtualAddress { region.offset() }.page_base().get(), - builder.to_string().characters()); + builder.to_deprecated_string().characters()); if (segment_base == MAP_FAILED) { perror("mmap non-writable"); diff --git a/Userland/Libraries/LibGUI/AbstractTableView.cpp b/Userland/Libraries/LibGUI/AbstractTableView.cpp index 99007318fcf..9fd946c3bd9 100644 --- a/Userland/Libraries/LibGUI/AbstractTableView.cpp +++ b/Userland/Libraries/LibGUI/AbstractTableView.cpp @@ -72,7 +72,7 @@ void AbstractTableView::auto_resize_column(int column) } else if (cell_data.is_bitmap()) { cell_width = cell_data.as_bitmap().width(); } else if (cell_data.is_valid()) { - cell_width = font().width(cell_data.to_string()); + cell_width = font().width(cell_data.to_deprecated_string()); } if (is_empty && cell_width > 0) is_empty = false; @@ -110,7 +110,7 @@ void AbstractTableView::update_column_sizes() } else if (cell_data.is_bitmap()) { cell_width = cell_data.as_bitmap().width(); } else if (cell_data.is_valid()) { - cell_width = font().width(cell_data.to_string()); + cell_width = font().width(cell_data.to_deprecated_string()); } column_width = max(column_width, cell_width); } diff --git a/Userland/Libraries/LibGUI/AbstractView.cpp b/Userland/Libraries/LibGUI/AbstractView.cpp index 7ca950a281f..384bb084eb6 100644 --- a/Userland/Libraries/LibGUI/AbstractView.cpp +++ b/Userland/Libraries/LibGUI/AbstractView.cpp @@ -605,7 +605,7 @@ void AbstractView::keydown_event(KeyEvent& event) } auto index = find_next_search_match(sb.string_view()); if (index.is_valid()) { - m_highlighted_search = sb.to_string(); + m_highlighted_search = sb.to_deprecated_string(); highlight_search(index); start_highlighted_search_timer(); } @@ -630,7 +630,7 @@ void AbstractView::keydown_event(KeyEvent& event) auto index = find_next_search_match(sb.string_view()); if (index.is_valid()) { - m_highlighted_search = sb.to_string(); + m_highlighted_search = sb.to_deprecated_string(); highlight_search(index); start_highlighted_search_timer(); set_cursor(index, SelectionUpdate::None, true); diff --git a/Userland/Libraries/LibGUI/AutocompleteProvider.cpp b/Userland/Libraries/LibGUI/AutocompleteProvider.cpp index 0be4c90c5f1..b71fb4fc1bc 100644 --- a/Userland/Libraries/LibGUI/AutocompleteProvider.cpp +++ b/Userland/Libraries/LibGUI/AutocompleteProvider.cpp @@ -183,7 +183,7 @@ CodeComprehension::AutocompleteResultEntry::HideAutocompleteAfterApplying Autoco return hide_when_done; auto suggestion_index = m_suggestion_view->model()->index(selected_index.row()); - auto completion = suggestion_index.data((GUI::ModelRole)AutocompleteSuggestionModel::InternalRole::Completion).to_string(); + auto completion = suggestion_index.data((GUI::ModelRole)AutocompleteSuggestionModel::InternalRole::Completion).to_deprecated_string(); size_t partial_length = suggestion_index.data((GUI::ModelRole)AutocompleteSuggestionModel::InternalRole::PartialInputLength).to_i64(); auto hide_after_applying = suggestion_index.data((GUI::ModelRole)AutocompleteSuggestionModel::InternalRole::HideAutocompleteAfterApplying).to_bool(); diff --git a/Userland/Libraries/LibGUI/ColorInput.cpp b/Userland/Libraries/LibGUI/ColorInput.cpp index 3af27a0d8d4..c537bbb51c1 100644 --- a/Userland/Libraries/LibGUI/ColorInput.cpp +++ b/Userland/Libraries/LibGUI/ColorInput.cpp @@ -43,7 +43,7 @@ void ColorInput::set_color_internal(Color color, AllowCallback allow_callback, b return; m_color = color; if (change_text) - set_text(m_color_has_alpha_channel ? color.to_string() : color.to_string_without_alpha(), AllowCallback::No); + set_text(m_color_has_alpha_channel ? color.to_deprecated_string() : color.to_deprecated_string_without_alpha(), AllowCallback::No); update(); if (allow_callback == AllowCallback::Yes && on_change) on_change(); diff --git a/Userland/Libraries/LibGUI/ColorPicker.cpp b/Userland/Libraries/LibGUI/ColorPicker.cpp index 1b3bb5bc018..f7fde0e42ea 100644 --- a/Userland/Libraries/LibGUI/ColorPicker.cpp +++ b/Userland/Libraries/LibGUI/ColorPicker.cpp @@ -320,7 +320,7 @@ void ColorPicker::build_ui_custom(Widget& root_container) html_label.set_text("HTML:"); m_html_text = html_container.add(); - m_html_text->set_text(m_color_has_alpha_channel ? m_color.to_string() : m_color.to_string_without_alpha()); + m_html_text->set_text(m_color_has_alpha_channel ? m_color.to_deprecated_string() : m_color.to_deprecated_string_without_alpha()); m_html_text->on_change = [this]() { auto color_name = m_html_text->text(); auto optional_color = Color::from_string(color_name); @@ -416,7 +416,7 @@ void ColorPicker::update_color_widgets() { m_preview_widget->set_color(m_color); - m_html_text->set_text(m_color_has_alpha_channel ? m_color.to_string() : m_color.to_string_without_alpha()); + m_html_text->set_text(m_color_has_alpha_channel ? m_color.to_deprecated_string() : m_color.to_deprecated_string_without_alpha()); m_red_spinbox->set_value(m_color.red()); m_green_spinbox->set_value(m_color.green()); diff --git a/Userland/Libraries/LibGUI/ColumnsView.cpp b/Userland/Libraries/LibGUI/ColumnsView.cpp index 6ba2000d90e..4bd374f5c55 100644 --- a/Userland/Libraries/LibGUI/ColumnsView.cpp +++ b/Userland/Libraries/LibGUI/ColumnsView.cpp @@ -158,7 +158,7 @@ void ColumnsView::paint_event(PaintEvent& event) icon_rect.right() + 1 + icon_spacing(), row * item_height(), column.width - icon_spacing() - icon_size() - icon_spacing() - icon_spacing() - static_cast(s_arrow_bitmap.width()) - icon_spacing(), item_height() }; - draw_item_text(painter, index, is_selected_row, text_rect, index.data().to_string(), font_for_index(index), Gfx::TextAlignment::CenterLeft, Gfx::TextElision::None); + draw_item_text(painter, index, is_selected_row, text_rect, index.data().to_deprecated_string(), font_for_index(index), Gfx::TextAlignment::CenterLeft, Gfx::TextElision::None); if (is_focused() && index == cursor_index()) { painter.draw_rect(row_rect, palette().color(background_role())); @@ -227,7 +227,7 @@ void ColumnsView::update_column_sizes() for (int row = 0; row < row_count; row++) { ModelIndex index = model()->index(row, m_model_column, column.parent_index); VERIFY(index.is_valid()); - auto text = index.data().to_string(); + auto text = index.data().to_deprecated_string(); int row_width = icon_spacing() + icon_size() + icon_spacing() + font().width(text) + icon_spacing() + s_arrow_bitmap.width() + icon_spacing(); if (row_width > column.width) column.width = row_width; diff --git a/Userland/Libraries/LibGUI/ComboBox.cpp b/Userland/Libraries/LibGUI/ComboBox.cpp index 30468e4b28b..7d95f2e26bf 100644 --- a/Userland/Libraries/LibGUI/ComboBox.cpp +++ b/Userland/Libraries/LibGUI/ComboBox.cpp @@ -182,7 +182,7 @@ void ComboBox::selection_updated(ModelIndex const& index) m_selected_index = index; else m_selected_index.clear(); - auto new_value = index.data().to_string(); + auto new_value = index.data().to_deprecated_string(); m_editor->set_text(new_value); if (!m_only_allow_values_from_model) m_editor->select_all(); diff --git a/Userland/Libraries/LibGUI/CommandPalette.cpp b/Userland/Libraries/LibGUI/CommandPalette.cpp index 4d714d4c589..52a4501d693 100644 --- a/Userland/Libraries/LibGUI/CommandPalette.cpp +++ b/Userland/Libraries/LibGUI/CommandPalette.cpp @@ -129,7 +129,7 @@ public: case Column::Shortcut: if (!action.shortcut().is_valid()) return ""; - return action.shortcut().to_string(); + return action.shortcut().to_deprecated_string(); } VERIFY_NOT_REACHED(); diff --git a/Userland/Libraries/LibGUI/CommonLocationsProvider.cpp b/Userland/Libraries/LibGUI/CommonLocationsProvider.cpp index 373f75d53a3..132b4286368 100644 --- a/Userland/Libraries/LibGUI/CommonLocationsProvider.cpp +++ b/Userland/Libraries/LibGUI/CommonLocationsProvider.cpp @@ -61,8 +61,8 @@ void CommonLocationsProvider::load_from_json(DeprecatedString const& json_path) if (!entry_value.is_object()) continue; auto entry = entry_value.as_object(); - auto name = entry.get("name"sv).to_string(); - auto path = entry.get("path"sv).to_string(); + auto name = entry.get("name"sv).to_deprecated_string(); + auto path = entry.get("path"sv).to_deprecated_string(); s_common_locations.append({ name, path }); } diff --git a/Userland/Libraries/LibGUI/ConnectionToWindowServer.cpp b/Userland/Libraries/LibGUI/ConnectionToWindowServer.cpp index 09a7cf9b5d9..89a08fc0fa4 100644 --- a/Userland/Libraries/LibGUI/ConnectionToWindowServer.cpp +++ b/Userland/Libraries/LibGUI/ConnectionToWindowServer.cpp @@ -155,24 +155,24 @@ static Action* action_for_shortcut(Window& window, Shortcut const& shortcut) if (!shortcut.is_valid()) return nullptr; - dbgln_if(KEYBOARD_SHORTCUTS_DEBUG, "Looking up action for {}", shortcut.to_string()); + dbgln_if(KEYBOARD_SHORTCUTS_DEBUG, "Looking up action for {}", shortcut.to_deprecated_string()); for (auto* widget = window.focused_widget(); widget; widget = widget->parent_widget()) { if (auto* action = widget->action_for_shortcut(shortcut)) { - dbgln_if(KEYBOARD_SHORTCUTS_DEBUG, " > Focused widget {} gave action: {} {} (enabled: {}, shortcut: {}, alt-shortcut: {})", *widget, action, action->text(), action->is_enabled(), action->shortcut().to_string(), action->alternate_shortcut().to_string()); + dbgln_if(KEYBOARD_SHORTCUTS_DEBUG, " > Focused widget {} gave action: {} {} (enabled: {}, shortcut: {}, alt-shortcut: {})", *widget, action, action->text(), action->is_enabled(), action->shortcut().to_deprecated_string(), action->alternate_shortcut().to_deprecated_string()); return action; } } if (auto* action = window.action_for_shortcut(shortcut)) { - dbgln_if(KEYBOARD_SHORTCUTS_DEBUG, " > Asked window {}, got action: {} {} (enabled: {}, shortcut: {}, alt-shortcut: {})", window, action, action->text(), action->is_enabled(), action->shortcut().to_string(), action->alternate_shortcut().to_string()); + dbgln_if(KEYBOARD_SHORTCUTS_DEBUG, " > Asked window {}, got action: {} {} (enabled: {}, shortcut: {}, alt-shortcut: {})", window, action, action->text(), action->is_enabled(), action->shortcut().to_deprecated_string(), action->alternate_shortcut().to_deprecated_string()); return action; } // NOTE: Application-global shortcuts are ignored while a blocking modal window is up. if (!window.is_blocking() && !window.is_popup()) { if (auto* action = Application::the()->action_for_shortcut(shortcut)) { - dbgln_if(KEYBOARD_SHORTCUTS_DEBUG, " > Asked application, got action: {} {} (enabled: {}, shortcut: {}, alt-shortcut: {})", action, action->text(), action->is_enabled(), action->shortcut().to_string(), action->alternate_shortcut().to_string()); + dbgln_if(KEYBOARD_SHORTCUTS_DEBUG, " > Asked application, got action: {} {} (enabled: {}, shortcut: {}, alt-shortcut: {})", action, action->text(), action->is_enabled(), action->shortcut().to_deprecated_string(), action->alternate_shortcut().to_deprecated_string()); return action; } } diff --git a/Userland/Libraries/LibGUI/EmojiInputDialog.cpp b/Userland/Libraries/LibGUI/EmojiInputDialog.cpp index 849177ce4ae..d7fb5dd912b 100644 --- a/Userland/Libraries/LibGUI/EmojiInputDialog.cpp +++ b/Userland/Libraries/LibGUI/EmojiInputDialog.cpp @@ -174,7 +174,7 @@ auto EmojiInputDialog::supported_emoji() -> Vector builder.append_code_point(*code_point); code_points.append(*code_point); }); - auto text = builder.to_string(); + auto text = builder.to_deprecated_string(); auto emoji = Unicode::find_emoji_for_code_points(code_points); if (!emoji.has_value()) { diff --git a/Userland/Libraries/LibGUI/Event.cpp b/Userland/Libraries/LibGUI/Event.cpp index be7d390e29e..b24b6986609 100644 --- a/Userland/Libraries/LibGUI/Event.cpp +++ b/Userland/Libraries/LibGUI/Event.cpp @@ -20,7 +20,7 @@ DropEvent::DropEvent(Gfx::IntPoint const& position, DeprecatedString const& text { } -DeprecatedString KeyEvent::to_string() const +DeprecatedString KeyEvent::to_deprecated_string() const { Vector parts; @@ -44,7 +44,7 @@ DeprecatedString KeyEvent::to_string() const if (i != parts.size() - 1) builder.append('+'); } - return builder.to_string(); + return builder.to_deprecated_string(); } ActionEvent::ActionEvent(Type type, Action& action) diff --git a/Userland/Libraries/LibGUI/Event.h b/Userland/Libraries/LibGUI/Event.h index 721243c8dc2..0f4c6f56201 100644 --- a/Userland/Libraries/LibGUI/Event.h +++ b/Userland/Libraries/LibGUI/Event.h @@ -390,11 +390,11 @@ public: { StringBuilder sb; sb.append_code_point(m_code_point); - return sb.to_string(); + return sb.to_deprecated_string(); } u32 scancode() const { return m_scancode; } - DeprecatedString to_string() const; + DeprecatedString to_deprecated_string() const; bool is_arrow_key() const { diff --git a/Userland/Libraries/LibGUI/FileSystemModel.cpp b/Userland/Libraries/LibGUI/FileSystemModel.cpp index 1ec1fe93c48..cf37edac5bd 100644 --- a/Userland/Libraries/LibGUI/FileSystemModel.cpp +++ b/Userland/Libraries/LibGUI/FileSystemModel.cpp @@ -194,7 +194,7 @@ DeprecatedString FileSystemModel::Node::full_path() const } builder.append('/'); builder.append(name); - return LexicalPath::canonicalized_path(builder.to_string()); + return LexicalPath::canonicalized_path(builder.to_deprecated_string()); } ModelIndex FileSystemModel::index(DeprecatedString path, int column) const @@ -325,7 +325,7 @@ static DeprecatedString permission_string(mode_t mode) builder.append('t'); else builder.append(mode & S_IXOTH ? 'x' : '-'); - return builder.to_string(); + return builder.to_deprecated_string(); } void FileSystemModel::Node::set_selected(bool selected) @@ -761,7 +761,7 @@ void FileSystemModel::set_data(ModelIndex const& index, Variant const& data) VERIFY(is_editable(index)); Node& node = const_cast(this->node(index)); auto dirname = LexicalPath::dirname(node.full_path()); - auto new_full_path = DeprecatedString::formatted("{}/{}", dirname, data.to_string()); + auto new_full_path = DeprecatedString::formatted("{}/{}", dirname, data.to_deprecated_string()); int rc = rename(node.full_path().characters(), new_full_path.characters()); if (rc < 0) { if (on_rename_error) diff --git a/Userland/Libraries/LibGUI/FileSystemModel.h b/Userland/Libraries/LibGUI/FileSystemModel.h index 210e8e755cb..085d0644f2e 100644 --- a/Userland/Libraries/LibGUI/FileSystemModel.h +++ b/Userland/Libraries/LibGUI/FileSystemModel.h @@ -140,7 +140,7 @@ public: static DeprecatedString timestamp_string(time_t timestamp) { - return Core::DateTime::from_timestamp(timestamp).to_string(); + return Core::DateTime::from_timestamp(timestamp).to_deprecated_string(); } bool should_show_dotfiles() const { return m_should_show_dotfiles; } diff --git a/Userland/Libraries/LibGUI/FontPicker.cpp b/Userland/Libraries/LibGUI/FontPicker.cpp index 3092a35d2df..78479bba223 100644 --- a/Userland/Libraries/LibGUI/FontPicker.cpp +++ b/Userland/Libraries/LibGUI/FontPicker.cpp @@ -58,7 +58,7 @@ FontPicker::FontPicker(Window* parent_window, Gfx::Font const* current_font, boo m_family_list_view->on_selection_change = [this] { const auto& index = m_family_list_view->selection().first(); - m_family = index.data().to_string(); + m_family = index.data().to_deprecated_string(); m_variants.clear(); Gfx::FontDatabase::the().for_each_typeface([&](auto& typeface) { if (m_fixed_width_only && !typeface.is_fixed_width()) @@ -79,7 +79,7 @@ FontPicker::FontPicker(Window* parent_window, Gfx::Font const* current_font, boo m_variant_list_view->on_selection_change = [this] { const auto& index = m_variant_list_view->selection().first(); bool font_is_fixed_size = false; - m_variant = index.data().to_string(); + m_variant = index.data().to_deprecated_string(); m_sizes.clear(); Gfx::FontDatabase::the().for_each_typeface([&](auto& typeface) { if (m_fixed_width_only && !typeface.is_fixed_width()) diff --git a/Userland/Libraries/LibGUI/GML/AST.h b/Userland/Libraries/LibGUI/GML/AST.h index 0d899b8538b..f5c0104f802 100644 --- a/Userland/Libraries/LibGUI/GML/AST.h +++ b/Userland/Libraries/LibGUI/GML/AST.h @@ -37,11 +37,11 @@ public: return try_make_ref_counted(token.m_view); } - DeprecatedString to_string() const + DeprecatedString to_deprecated_string() const { StringBuilder builder; format(builder, 0, false); - return builder.to_string(); + return builder.to_deprecated_string(); } // Format this AST node with the builder at the given indentation level. diff --git a/Userland/Libraries/LibGUI/GML/Formatter.h b/Userland/Libraries/LibGUI/GML/Formatter.h index 91d4b9defed..beb3123d0c5 100644 --- a/Userland/Libraries/LibGUI/GML/Formatter.h +++ b/Userland/Libraries/LibGUI/GML/Formatter.h @@ -15,7 +15,7 @@ namespace GUI::GML { inline ErrorOr format_gml(StringView string) { - return TRY(parse_gml(string))->to_string(); + return TRY(parse_gml(string))->to_deprecated_string(); } } diff --git a/Userland/Libraries/LibGUI/IconView.cpp b/Userland/Libraries/LibGUI/IconView.cpp index 6b05fcdff21..493cf4a7369 100644 --- a/Userland/Libraries/LibGUI/IconView.cpp +++ b/Userland/Libraries/LibGUI/IconView.cpp @@ -100,7 +100,7 @@ auto IconView::get_item_data(int item_index) const -> ItemData& return item_data; item_data.index = model()->index(item_index, model_column()); - item_data.text = item_data.index.data().to_string(); + item_data.text = item_data.index.data().to_deprecated_string(); get_item_rects(item_index, item_data, font_for_index(item_data.index)); item_data.valid = true; return item_data; diff --git a/Userland/Libraries/LibGUI/ItemListModel.h b/Userland/Libraries/LibGUI/ItemListModel.h index 644d2134192..224ec72fe49 100644 --- a/Userland/Libraries/LibGUI/ItemListModel.h +++ b/Userland/Libraries/LibGUI/ItemListModel.h @@ -96,7 +96,7 @@ public: for (auto it = m_data.begin(); it != m_data.end(); ++it) { for (auto it2d = (*it).begin(); it2d != (*it).end(); ++it2d) { GUI::ModelIndex index = this->index(it.index(), it2d.index()); - if (!string_matches(data(index, ModelRole::Display).to_string(), searching, flags)) + if (!string_matches(data(index, ModelRole::Display).to_deprecated_string(), searching, flags)) continue; found_indices.append(index); @@ -107,7 +107,7 @@ public: } else { for (auto it = m_data.begin(); it != m_data.end(); ++it) { GUI::ModelIndex index = this->index(it.index()); - if (!string_matches(data(index, ModelRole::Display).to_string(), searching, flags)) + if (!string_matches(data(index, ModelRole::Display).to_deprecated_string(), searching, flags)) continue; found_indices.append(index); diff --git a/Userland/Libraries/LibGUI/JsonArrayModel.cpp b/Userland/Libraries/LibGUI/JsonArrayModel.cpp index 063715e45d3..5a647b1a0a6 100644 --- a/Userland/Libraries/LibGUI/JsonArrayModel.cpp +++ b/Userland/Libraries/LibGUI/JsonArrayModel.cpp @@ -54,7 +54,7 @@ bool JsonArrayModel::store() return false; } - file->write(m_array.to_string()); + file->write(m_array.to_deprecated_string()); file->close(); return true; } @@ -124,7 +124,7 @@ Variant JsonArrayModel::data(ModelIndex const& index, ModelRole role) const return field_spec.massage_for_display(object); if (data.is_number()) return data; - return object.get(json_field_name).to_string(); + return object.get(json_field_name).to_deprecated_string(); } if (role == ModelRole::Sort) { diff --git a/Userland/Libraries/LibGUI/ListView.cpp b/Userland/Libraries/LibGUI/ListView.cpp index cf0f4ec514c..d20f8ef5d46 100644 --- a/Userland/Libraries/LibGUI/ListView.cpp +++ b/Userland/Libraries/LibGUI/ListView.cpp @@ -42,7 +42,7 @@ void ListView::update_content_size() int content_width = 0; for (int row = 0, row_count = model()->row_count(); row < row_count; ++row) { auto text = model()->index(row, m_model_column).data(); - content_width = max(content_width, font().width(text.to_string()) + horizontal_padding() * 2); + content_width = max(content_width, font().width(text.to_deprecated_string()) + horizontal_padding() * 2); } m_max_item_width = content_width; content_width = max(content_width, widget_inner_rect().width()); @@ -133,7 +133,7 @@ void ListView::paint_list_item(Painter& painter, int row_index, int painted_item text_rect.translate_by(horizontal_padding(), 0); text_rect.set_width(text_rect.width() - horizontal_padding() * 2); auto text_alignment = index.data(ModelRole::TextAlignment).to_text_alignment(Gfx::TextAlignment::CenterLeft); - draw_item_text(painter, index, is_selected_row, text_rect, data.to_string(), font, text_alignment, Gfx::TextElision::None); + draw_item_text(painter, index, is_selected_row, text_rect, data.to_deprecated_string(), font, text_alignment, Gfx::TextElision::None); } } diff --git a/Userland/Libraries/LibGUI/Menu.cpp b/Userland/Libraries/LibGUI/Menu.cpp index f35bf01016f..87a88481746 100644 --- a/Userland/Libraries/LibGUI/Menu.cpp +++ b/Userland/Libraries/LibGUI/Menu.cpp @@ -197,7 +197,7 @@ void Menu::realize_menu_item(MenuItem& item, int item_id) break; case MenuItem::Type::Action: { auto& action = *item.action(); - auto shortcut_text = action.shortcut().is_valid() ? action.shortcut().to_string() : DeprecatedString(); + auto shortcut_text = action.shortcut().is_valid() ? action.shortcut().to_deprecated_string() : DeprecatedString(); bool exclusive = action.group() && action.group()->is_exclusive() && action.is_checkable(); bool is_default = (m_current_default_action.ptr() == &action); auto icon = action.icon() ? action.icon()->to_shareable_bitmap() : Gfx::ShareableBitmap(); diff --git a/Userland/Libraries/LibGUI/MenuItem.cpp b/Userland/Libraries/LibGUI/MenuItem.cpp index ba81b72486c..426c5492eba 100644 --- a/Userland/Libraries/LibGUI/MenuItem.cpp +++ b/Userland/Libraries/LibGUI/MenuItem.cpp @@ -73,7 +73,7 @@ void MenuItem::update_window_server() if (m_menu_id < 0) return; auto& action = *m_action; - auto shortcut_text = action.shortcut().is_valid() ? action.shortcut().to_string() : DeprecatedString(); + auto shortcut_text = action.shortcut().is_valid() ? action.shortcut().to_deprecated_string() : DeprecatedString(); auto icon = action.icon() ? action.icon()->to_shareable_bitmap() : Gfx::ShareableBitmap(); ConnectionToWindowServer::the().async_update_menu_item(m_menu_id, m_identifier, -1, action.text(), action.is_enabled(), action.is_checkable(), action.is_checkable() ? action.is_checked() : false, m_default, shortcut_text, icon); } diff --git a/Userland/Libraries/LibGUI/Model.cpp b/Userland/Libraries/LibGUI/Model.cpp index fae2a6be6ba..af17ebc9ec7 100644 --- a/Userland/Libraries/LibGUI/Model.cpp +++ b/Userland/Libraries/LibGUI/Model.cpp @@ -109,12 +109,12 @@ RefPtr Model::mime_data(ModelSelection const& selection) const auto text_data = index.data(); if (!first) text_builder.append(", "sv); - text_builder.append(text_data.to_string()); + text_builder.append(text_data.to_deprecated_string()); if (!first) data_builder.append('\n'); auto data = index.data(ModelRole::MimeData); - data_builder.append(data.to_string()); + data_builder.append(data.to_deprecated_string()); first = false; @@ -126,7 +126,7 @@ RefPtr Model::mime_data(ModelSelection const& selection) const }); mime_data->set_data(drag_data_type(), data_builder.to_byte_buffer()); - mime_data->set_text(text_builder.to_string()); + mime_data->set_text(text_builder.to_deprecated_string()); if (bitmap) mime_data->set_data("image/x-raw-bitmap", bitmap->serialize_to_byte_buffer()); diff --git a/Userland/Libraries/LibGUI/ModelEditingDelegate.h b/Userland/Libraries/LibGUI/ModelEditingDelegate.h index 56a1ee53071..71a9ca2c702 100644 --- a/Userland/Libraries/LibGUI/ModelEditingDelegate.h +++ b/Userland/Libraries/LibGUI/ModelEditingDelegate.h @@ -96,7 +96,7 @@ public: virtual void set_value(Variant const& value, SelectionBehavior selection_behavior) override { auto& textbox = static_cast(*widget()); - textbox.set_text(value.to_string()); + textbox.set_text(value.to_deprecated_string()); if (selection_behavior == SelectionBehavior::SelectAll) textbox.select_all(); } diff --git a/Userland/Libraries/LibGUI/Progressbar.cpp b/Userland/Libraries/LibGUI/Progressbar.cpp index 765ab93c7d0..f54b9fdf452 100644 --- a/Userland/Libraries/LibGUI/Progressbar.cpp +++ b/Userland/Libraries/LibGUI/Progressbar.cpp @@ -67,7 +67,7 @@ void Progressbar::paint_event(PaintEvent& event) } else if (m_format == Format::ValueSlashMax) { builder.appendff("{}/{}", m_value, m_max); } - progress_text = builder.to_string(); + progress_text = builder.to_deprecated_string(); } Gfx::StylePainter::paint_progressbar(painter, rect, palette(), m_min, m_max, m_value, progress_text, m_orientation); diff --git a/Userland/Libraries/LibGUI/Shortcut.cpp b/Userland/Libraries/LibGUI/Shortcut.cpp index 4f2f4c61f7e..086e7734594 100644 --- a/Userland/Libraries/LibGUI/Shortcut.cpp +++ b/Userland/Libraries/LibGUI/Shortcut.cpp @@ -12,7 +12,7 @@ namespace GUI { -DeprecatedString Shortcut::to_string() const +DeprecatedString Shortcut::to_deprecated_string() const { Vector parts; @@ -41,7 +41,7 @@ DeprecatedString Shortcut::to_string() const StringBuilder builder; builder.join('+', parts); - return builder.to_string(); + return builder.to_deprecated_string(); } } diff --git a/Userland/Libraries/LibGUI/Shortcut.h b/Userland/Libraries/LibGUI/Shortcut.h index 1954bf7b76a..835d626bfcb 100644 --- a/Userland/Libraries/LibGUI/Shortcut.h +++ b/Userland/Libraries/LibGUI/Shortcut.h @@ -46,7 +46,7 @@ public: Mouse, }; - DeprecatedString to_string() const; + DeprecatedString to_deprecated_string() const; Type type() const { return m_type; } bool is_valid() const { return m_type == Type::Keyboard ? (m_keyboard_key != Key_Invalid) : (m_mouse_button != MouseButton::None); } u8 modifiers() const { return m_modifiers; } diff --git a/Userland/Libraries/LibGUI/TabWidget.cpp b/Userland/Libraries/LibGUI/TabWidget.cpp index 0fd059cb2ca..9daaac68d6f 100644 --- a/Userland/Libraries/LibGUI/TabWidget.cpp +++ b/Userland/Libraries/LibGUI/TabWidget.cpp @@ -42,7 +42,7 @@ TabWidget::TabWidget() "text_alignment", [this] { return Gfx::to_string(text_alignment()); }, [this](auto& value) { - auto alignment = Gfx::text_alignment_from_string(value.to_string()); + auto alignment = Gfx::text_alignment_from_string(value.to_deprecated_string()); if (alignment.has_value()) { set_text_alignment(alignment.value()); return true; diff --git a/Userland/Libraries/LibGUI/TableView.cpp b/Userland/Libraries/LibGUI/TableView.cpp index 9e4b4a0fdcb..d4abd6cd92d 100644 --- a/Userland/Libraries/LibGUI/TableView.cpp +++ b/Userland/Libraries/LibGUI/TableView.cpp @@ -131,7 +131,7 @@ void TableView::paint_event(PaintEvent& event) } auto text_alignment = cell_index.data(ModelRole::TextAlignment).to_text_alignment(Gfx::TextAlignment::CenterLeft); - draw_item_text(painter, cell_index, is_selected_row, cell_rect, data.to_string(), font_for_index(cell_index), text_alignment, Gfx::TextElision::Right); + draw_item_text(painter, cell_index, is_selected_row, cell_rect, data.to_deprecated_string(), font_for_index(cell_index), text_alignment, Gfx::TextElision::Right); } } diff --git a/Userland/Libraries/LibGUI/TextDocument.cpp b/Userland/Libraries/LibGUI/TextDocument.cpp index bdd61758627..abe9f2b33e1 100644 --- a/Userland/Libraries/LibGUI/TextDocument.cpp +++ b/Userland/Libraries/LibGUI/TextDocument.cpp @@ -152,7 +152,7 @@ DeprecatedString TextDocumentLine::to_utf8() const { StringBuilder builder; builder.append(view()); - return builder.to_string(); + return builder.to_deprecated_string(); } TextDocumentLine::TextDocumentLine(TextDocument& document) @@ -353,7 +353,7 @@ DeprecatedString TextDocument::text() const if (i != line_count() - 1) builder.append('\n'); } - return builder.to_string(); + return builder.to_deprecated_string(); } DeprecatedString TextDocument::text_in_range(TextRange const& a_range) const @@ -379,7 +379,7 @@ DeprecatedString TextDocument::text_in_range(TextRange const& a_range) const builder.append('\n'); } - return builder.to_string(); + return builder.to_deprecated_string(); } u32 TextDocument::code_point_at(TextPosition const& position) const @@ -800,7 +800,7 @@ bool InsertTextCommand::merge_with(GUI::Command const& other) StringBuilder builder(m_text.length() + typed_other.m_text.length()); builder.append(m_text); builder.append(typed_other.m_text); - m_text = builder.to_string(); + m_text = builder.to_deprecated_string(); m_range.set_end(typed_other.m_range.end()); m_timestamp = Time::now_monotonic(); @@ -900,7 +900,7 @@ bool RemoveTextCommand::merge_with(GUI::Command const& other) StringBuilder builder(m_text.length() + typed_other.m_text.length()); builder.append(typed_other.m_text); builder.append(m_text); - m_text = builder.to_string(); + m_text = builder.to_deprecated_string(); m_range.set_start(typed_other.m_range.start()); m_timestamp = Time::now_monotonic(); diff --git a/Userland/Libraries/LibGUI/TextEditor.cpp b/Userland/Libraries/LibGUI/TextEditor.cpp index a1f102f14d0..c447c8245d9 100644 --- a/Userland/Libraries/LibGUI/TextEditor.cpp +++ b/Userland/Libraries/LibGUI/TextEditor.cpp @@ -1189,7 +1189,7 @@ void TextEditor::add_code_point(u32 code_point) else m_autocomplete_timer->start(); } - insert_at_cursor_or_replace_selection(sb.to_string()); + insert_at_cursor_or_replace_selection(sb.to_deprecated_string()); }; void TextEditor::reset_cursor_blink() @@ -2047,7 +2047,7 @@ void TextEditor::document_did_update_undo_stack() builder.append(' '); builder.append(suffix.value()); } - return builder.to_string(); + return builder.to_deprecated_string(); }; m_undo_action->set_enabled(can_undo() && !text_is_secret()); diff --git a/Userland/Libraries/LibGUI/Toolbar.cpp b/Userland/Libraries/LibGUI/Toolbar.cpp index 91e5ed20bdc..27b8d387e8c 100644 --- a/Userland/Libraries/LibGUI/Toolbar.cpp +++ b/Userland/Libraries/LibGUI/Toolbar.cpp @@ -76,10 +76,10 @@ private: builder.append(action.text()); if (action.shortcut().is_valid()) { builder.append(" ("sv); - builder.append(action.shortcut().to_string()); + builder.append(action.shortcut().to_deprecated_string()); builder.append(')'); } - return builder.to_string(); + return builder.to_deprecated_string(); } virtual void enter_event(Core::Event& event) override diff --git a/Userland/Libraries/LibGUI/TreeView.cpp b/Userland/Libraries/LibGUI/TreeView.cpp index a92df5cc9e3..5108dfc37cb 100644 --- a/Userland/Libraries/LibGUI/TreeView.cpp +++ b/Userland/Libraries/LibGUI/TreeView.cpp @@ -185,7 +185,7 @@ void TreeView::traverse_in_paint_order(Callback callback) const if (index.is_valid()) { auto& metadata = ensure_metadata_for_index(index); int x_offset = tree_column_x_offset + horizontal_padding() + indent_level * indent_width_in_pixels(); - auto node_text = index.data().to_string(); + auto node_text = index.data().to_deprecated_string(); Gfx::IntRect rect = { x_offset, y_offset, icon_size() + icon_spacing() + text_padding() + font_for_index(index)->width(node_text) + text_padding(), row_height() @@ -317,7 +317,7 @@ void TreeView::paint_event(PaintEvent& event) } } else { auto text_alignment = cell_index.data(ModelRole::TextAlignment).to_text_alignment(Gfx::TextAlignment::CenterLeft); - draw_item_text(painter, cell_index, is_selected_row, cell_rect, data.to_string(), font_for_index(cell_index), text_alignment, Gfx::TextElision::Right); + draw_item_text(painter, cell_index, is_selected_row, cell_rect, data.to_deprecated_string(), font_for_index(cell_index), text_alignment, Gfx::TextElision::Right); } } } else { @@ -346,7 +346,7 @@ void TreeView::paint_event(PaintEvent& event) } auto display_data = index.data(); if (display_data.is_string() || display_data.is_u32() || display_data.is_i32() || display_data.is_u64() || display_data.is_i64() || display_data.is_bool() || display_data.is_float()) - draw_item_text(painter, index, is_selected_row, text_rect, display_data.to_string(), font_for_index(index), Gfx::TextAlignment::CenterLeft, Gfx::TextElision::Right); + draw_item_text(painter, index, is_selected_row, text_rect, display_data.to_deprecated_string(), font_for_index(index), Gfx::TextAlignment::CenterLeft, Gfx::TextElision::Right); if (selection_behavior() == SelectionBehavior::SelectItems && is_focused() && index == cursor_index()) { painter.draw_rect(background_rect, palette().color(background_role())); @@ -683,7 +683,7 @@ void TreeView::auto_resize_column(int column) } else if (cell_data.is_bitmap()) { cell_width = cell_data.as_bitmap().width(); } else if (cell_data.is_valid()) { - cell_width = font().width(cell_data.to_string()); + cell_width = font().width(cell_data.to_deprecated_string()); } if (is_empty && cell_width > 0) is_empty = false; @@ -726,7 +726,7 @@ void TreeView::update_column_sizes() } else if (cell_data.is_bitmap()) { cell_width = cell_data.as_bitmap().width(); } else if (cell_data.is_valid()) { - cell_width = font().width(cell_data.to_string()); + cell_width = font().width(cell_data.to_deprecated_string()); } column_width = max(column_width, cell_width); return IterationDecision::Continue; @@ -743,7 +743,7 @@ void TreeView::update_column_sizes() auto cell_data = model.index(index.row(), tree_column, index.parent()).data(); int cell_width = 0; if (cell_data.is_valid()) { - cell_width = font().width(cell_data.to_string()); + cell_width = font().width(cell_data.to_deprecated_string()); cell_width += horizontal_padding() * 2 + indent_level * indent_width_in_pixels() + icon_size() / 2 + text_padding() * 2; } tree_column_width = max(tree_column_width, cell_width); diff --git a/Userland/Libraries/LibGUI/Variant.cpp b/Userland/Libraries/LibGUI/Variant.cpp index c257c1b4321..d7b94f2455f 100644 --- a/Userland/Libraries/LibGUI/Variant.cpp +++ b/Userland/Libraries/LibGUI/Variant.cpp @@ -66,11 +66,11 @@ bool Variant::operator==(Variant const& other) const return &own_value.impl() == &other_value.impl(); // FIXME: Figure out if this silly behaviour is actually used anywhere, then get rid of it. else - return to_string() == other.to_string(); + return to_deprecated_string() == other.to_deprecated_string(); }, [&](auto const&) { // FIXME: Figure out if this silly behaviour is actually used anywhere, then get rid of it. - return to_string() == other.to_string(); + return to_deprecated_string() == other.to_deprecated_string(); }); }); } @@ -92,10 +92,10 @@ bool Variant::operator<(Variant const& other) const return own_value < other_value; // FIXME: Figure out if this silly behaviour is actually used anywhere, then get rid of it. else - return to_string() < other.to_string(); + return to_deprecated_string() < other.to_deprecated_string(); }, [&](auto const&) -> bool { - return to_string() < other.to_string(); // FIXME: Figure out if this silly behaviour is actually used anywhere, then get rid of it. + return to_deprecated_string() < other.to_deprecated_string(); // FIXME: Figure out if this silly behaviour is actually used anywhere, then get rid of it. }); }); } diff --git a/Userland/Libraries/LibGUI/Variant.h b/Userland/Libraries/LibGUI/Variant.h index 1a9b97c5633..57ad3a5094e 100644 --- a/Userland/Libraries/LibGUI/Variant.h +++ b/Userland/Libraries/LibGUI/Variant.h @@ -199,7 +199,7 @@ public: return default_value; } - DeprecatedString to_string() const + DeprecatedString to_deprecated_string() const { return visit( [](Empty) -> DeprecatedString { return "[null]"; }, diff --git a/Userland/Libraries/LibGUI/VimEditingEngine.cpp b/Userland/Libraries/LibGUI/VimEditingEngine.cpp index 7a52ef10c0c..be69a72cc82 100644 --- a/Userland/Libraries/LibGUI/VimEditingEngine.cpp +++ b/Userland/Libraries/LibGUI/VimEditingEngine.cpp @@ -1489,14 +1489,14 @@ void VimEditingEngine::put_before() sb.append(m_yank_buffer); sb.append_code_point(0x0A); } - m_editor->insert_at_cursor_or_replace_selection(sb.to_string()); + m_editor->insert_at_cursor_or_replace_selection(sb.to_deprecated_string()); m_editor->set_cursor({ m_editor->cursor().line(), m_editor->current_line().first_non_whitespace_column() }); } else { StringBuilder sb = StringBuilder(m_yank_buffer.length() * amount); for (auto i = 0; i < amount; i++) { sb.append(m_yank_buffer); } - m_editor->insert_at_cursor_or_replace_selection(sb.to_string()); + m_editor->insert_at_cursor_or_replace_selection(sb.to_deprecated_string()); move_one_left(); } } @@ -1512,7 +1512,7 @@ void VimEditingEngine::put_after() sb.append_code_point(0x0A); sb.append(m_yank_buffer); } - m_editor->insert_at_cursor_or_replace_selection(sb.to_string()); + m_editor->insert_at_cursor_or_replace_selection(sb.to_deprecated_string()); m_editor->set_cursor({ m_editor->cursor().line(), m_editor->current_line().first_non_whitespace_column() }); } else { // FIXME: If attempting to put on the last column a line, @@ -1522,7 +1522,7 @@ void VimEditingEngine::put_after() for (auto i = 0; i < amount; i++) { sb.append(m_yank_buffer); } - m_editor->insert_at_cursor_or_replace_selection(sb.to_string()); + m_editor->insert_at_cursor_or_replace_selection(sb.to_deprecated_string()); move_one_left(); } } diff --git a/Userland/Libraries/LibGUI/Widget.cpp b/Userland/Libraries/LibGUI/Widget.cpp index 1b70be870ad..0d84ce25d32 100644 --- a/Userland/Libraries/LibGUI/Widget.cpp +++ b/Userland/Libraries/LibGUI/Widget.cpp @@ -81,11 +81,11 @@ Widget::Widget() register_property( "font_type", [this] { return m_font->is_fixed_width() ? "FixedWidth" : "Normal"; }, [this](auto& value) { - if (value.to_string() == "FixedWidth") { + if (value.to_deprecated_string() == "FixedWidth") { set_font_fixed_width(true); return true; } - if (value.to_string() == "Normal") { + if (value.to_deprecated_string() == "Normal") { set_font_fixed_width(false); return true; } @@ -127,9 +127,9 @@ Widget::Widget() }); register_property( - "foreground_color", [this]() -> JsonValue { return palette().color(foreground_role()).to_string(); }, + "foreground_color", [this]() -> JsonValue { return palette().color(foreground_role()).to_deprecated_string(); }, [this](auto& value) { - auto c = Color::from_string(value.to_string()); + auto c = Color::from_string(value.to_deprecated_string()); if (c.has_value()) { auto _palette = palette(); _palette.set_color(foreground_role(), c.value()); @@ -140,9 +140,9 @@ Widget::Widget() }); register_property( - "background_color", [this]() -> JsonValue { return palette().color(background_role()).to_string(); }, + "background_color", [this]() -> JsonValue { return palette().color(background_role()).to_deprecated_string(); }, [this](auto& value) { - auto c = Color::from_string(value.to_string()); + auto c = Color::from_string(value.to_deprecated_string()); if (c.has_value()) { auto _palette = palette(); _palette.set_color(background_role(), c.value()); @@ -1188,12 +1188,12 @@ bool Widget::load_from_gml_ast(NonnullRefPtr ast, RefPtrconstruct(); if (!layout || !registration->is_derived_from(layout_class)) { - dbgln("Invalid layout class: '{}'", class_name.to_string()); + dbgln("Invalid layout class: '{}'", class_name.to_deprecated_string()); return false; } set_layout(static_ptr_cast(layout).release_nonnull()); } else { - dbgln("Unknown layout class: '{}'", class_name.to_string()); + dbgln("Unknown layout class: '{}'", class_name.to_deprecated_string()); return false; } diff --git a/Userland/Libraries/LibGUI/Window.cpp b/Userland/Libraries/LibGUI/Window.cpp index e2063ae2627..86f76209bf3 100644 --- a/Userland/Libraries/LibGUI/Window.cpp +++ b/Userland/Libraries/LibGUI/Window.cpp @@ -80,7 +80,7 @@ Window::Window(Core::Object* parent) "title", [this] { return title(); }, [this](auto& value) { - set_title(value.to_string()); + set_title(value.to_deprecated_string()); return true; }); diff --git a/Userland/Libraries/LibGemini/GeminiRequest.cpp b/Userland/Libraries/LibGemini/GeminiRequest.cpp index 37c5798ab42..ef395771ac9 100644 --- a/Userland/Libraries/LibGemini/GeminiRequest.cpp +++ b/Userland/Libraries/LibGemini/GeminiRequest.cpp @@ -13,7 +13,7 @@ namespace Gemini { ByteBuffer GeminiRequest::to_raw_request() const { StringBuilder builder; - builder.append(m_url.to_string()); + builder.append(m_url.to_deprecated_string()); builder.append("\r\n"sv); return builder.to_byte_buffer(); } diff --git a/Userland/Libraries/LibGemini/Line.cpp b/Userland/Libraries/LibGemini/Line.cpp index 78beeb53e23..8db3ef41568 100644 --- a/Userland/Libraries/LibGemini/Line.cpp +++ b/Userland/Libraries/LibGemini/Line.cpp @@ -70,14 +70,14 @@ Link::Link(DeprecatedString text, Document const& document) } m_url = document.url().complete_url(url); if (m_name.is_null()) - m_name = m_url.to_string(); + m_name = m_url.to_deprecated_string(); } DeprecatedString Link::render_to_html() const { StringBuilder builder; builder.append(""sv); builder.append(escape_html_entities(m_name)); builder.append("
\n"sv); diff --git a/Userland/Libraries/LibGfx/Color.cpp b/Userland/Libraries/LibGfx/Color.cpp index f9294247cdb..22e17c8c12e 100644 --- a/Userland/Libraries/LibGfx/Color.cpp +++ b/Userland/Libraries/LibGfx/Color.cpp @@ -18,12 +18,12 @@ namespace Gfx { -DeprecatedString Color::to_string() const +DeprecatedString Color::to_deprecated_string() const { return DeprecatedString::formatted("#{:02x}{:02x}{:02x}{:02x}", red(), green(), blue(), alpha()); } -DeprecatedString Color::to_string_without_alpha() const +DeprecatedString Color::to_deprecated_string_without_alpha() const { return DeprecatedString::formatted("#{:02x}{:02x}{:02x}", red(), green(), blue()); } @@ -384,5 +384,5 @@ ErrorOr IPC::decode(Decoder& decoder, Color& color) ErrorOr AK::Formatter::format(FormatBuilder& builder, Gfx::Color const& value) { - return Formatter::format(builder, value.to_string()); + return Formatter::format(builder, value.to_deprecated_string()); } diff --git a/Userland/Libraries/LibGfx/Color.h b/Userland/Libraries/LibGfx/Color.h index bad930b3561..cf34f6e0171 100644 --- a/Userland/Libraries/LibGfx/Color.h +++ b/Userland/Libraries/LibGfx/Color.h @@ -352,8 +352,8 @@ public: return m_value == other.m_value; } - DeprecatedString to_string() const; - DeprecatedString to_string_without_alpha() const; + DeprecatedString to_deprecated_string() const; + DeprecatedString to_deprecated_string_without_alpha() const; static Optional from_string(StringView); constexpr HSV to_hsv() const diff --git a/Userland/Libraries/LibGfx/DDSLoader.cpp b/Userland/Libraries/LibGfx/DDSLoader.cpp index b122d2f7d64..12de4cbc911 100644 --- a/Userland/Libraries/LibGfx/DDSLoader.cpp +++ b/Userland/Libraries/LibGfx/DDSLoader.cpp @@ -930,7 +930,7 @@ void DDSLoadingContext::dump_debug() builder.append(" DDS_ALPHA_MODE_CUSTOM"sv); builder.append("\n"sv); - dbgln("{}", builder.to_string()); + dbgln("{}", builder.to_deprecated_string()); } DDSImageDecoderPlugin::DDSImageDecoderPlugin(u8 const* data, size_t size) diff --git a/Userland/Libraries/LibGfx/Font/BitmapFont.cpp b/Userland/Libraries/LibGfx/Font/BitmapFont.cpp index 55bf9845eac..395f779a5c9 100644 --- a/Userland/Libraries/LibGfx/Font/BitmapFont.cpp +++ b/Userland/Libraries/LibGfx/Font/BitmapFont.cpp @@ -380,7 +380,7 @@ DeprecatedString BitmapFont::variant() const builder.append(' '); builder.append(slope_to_name(slope())); } - return builder.to_string(); + return builder.to_deprecated_string(); } Font const& Font::bold_variant() const diff --git a/Userland/Libraries/LibGfx/Line.h b/Userland/Libraries/LibGfx/Line.h index 0fd7812374a..487cb7a2dfb 100644 --- a/Userland/Libraries/LibGfx/Line.h +++ b/Userland/Libraries/LibGfx/Line.h @@ -141,7 +141,7 @@ public: return Line(*this); } - DeprecatedString to_string() const; + DeprecatedString to_deprecated_string() const; private: Point m_a; @@ -149,13 +149,13 @@ private: }; template<> -inline DeprecatedString IntLine::to_string() const +inline DeprecatedString IntLine::to_deprecated_string() const { return DeprecatedString::formatted("[{},{} -> {},{}]", m_a.x(), m_a.y(), m_b.x(), m_b.y()); } template<> -inline DeprecatedString FloatLine::to_string() const +inline DeprecatedString FloatLine::to_deprecated_string() const { return DeprecatedString::formatted("[{},{} -> {},{}]", m_a.x(), m_a.y(), m_b.x(), m_b.y()); } diff --git a/Userland/Libraries/LibGfx/Painter.cpp b/Userland/Libraries/LibGfx/Painter.cpp index 498e068c83a..98023587cac 100644 --- a/Userland/Libraries/LibGfx/Painter.cpp +++ b/Userland/Libraries/LibGfx/Painter.cpp @@ -2417,7 +2417,7 @@ DeprecatedString parse_ampersand_string(StringView raw_text, Optional* u } builder.append(raw_text[i]); } - return builder.to_string(); + return builder.to_deprecated_string(); } void Gfx::Painter::draw_ui_text(Gfx::IntRect const& rect, StringView text, Gfx::Font const& font, Gfx::TextAlignment text_alignment, Gfx::Color color) diff --git a/Userland/Libraries/LibGfx/Path.cpp b/Userland/Libraries/LibGfx/Path.cpp index cc758e06f85..c95b0458f54 100644 --- a/Userland/Libraries/LibGfx/Path.cpp +++ b/Userland/Libraries/LibGfx/Path.cpp @@ -177,7 +177,7 @@ void Path::close_all_subpaths() } } -DeprecatedString Path::to_string() const +DeprecatedString Path::to_deprecated_string() const { StringBuilder builder; builder.append("Path { "sv); @@ -207,19 +207,19 @@ DeprecatedString Path::to_string() const switch (segment.type()) { case Segment::Type::QuadraticBezierCurveTo: builder.append(", "sv); - builder.append(static_cast(segment).through().to_string()); + builder.append(static_cast(segment).through().to_deprecated_string()); break; case Segment::Type::CubicBezierCurveTo: builder.append(", "sv); - builder.append(static_cast(segment).through_0().to_string()); + builder.append(static_cast(segment).through_0().to_deprecated_string()); builder.append(", "sv); - builder.append(static_cast(segment).through_1().to_string()); + builder.append(static_cast(segment).through_1().to_deprecated_string()); break; case Segment::Type::EllipticalArcTo: { auto& arc = static_cast(segment); builder.appendff(", {}, {}, {}, {}, {}", - arc.radii().to_string().characters(), - arc.center().to_string().characters(), + arc.radii().to_deprecated_string().characters(), + arc.center().to_deprecated_string().characters(), arc.x_axis_rotation(), arc.theta_1(), arc.theta_delta()); @@ -232,7 +232,7 @@ DeprecatedString Path::to_string() const builder.append(") "sv); } builder.append('}'); - return builder.to_string(); + return builder.to_deprecated_string(); } void Path::segmentize_path() diff --git a/Userland/Libraries/LibGfx/Path.h b/Userland/Libraries/LibGfx/Path.h index de60976ad42..5349020d3d0 100644 --- a/Userland/Libraries/LibGfx/Path.h +++ b/Userland/Libraries/LibGfx/Path.h @@ -245,7 +245,7 @@ public: Path copy_transformed(AffineTransform const&) const; - DeprecatedString to_string() const; + DeprecatedString to_deprecated_string() const; private: void invalidate_split_lines() diff --git a/Userland/Libraries/LibGfx/Point.cpp b/Userland/Libraries/LibGfx/Point.cpp index dd9d3bd2e5a..f5a99bf82e1 100644 --- a/Userland/Libraries/LibGfx/Point.cpp +++ b/Userland/Libraries/LibGfx/Point.cpp @@ -36,13 +36,13 @@ template } template<> -DeprecatedString IntPoint::to_string() const +DeprecatedString IntPoint::to_deprecated_string() const { return DeprecatedString::formatted("[{},{}]", x(), y()); } template<> -DeprecatedString FloatPoint::to_string() const +DeprecatedString FloatPoint::to_deprecated_string() const { return DeprecatedString::formatted("[{},{}]", x(), y()); } diff --git a/Userland/Libraries/LibGfx/Point.h b/Userland/Libraries/LibGfx/Point.h index f74d395332d..452bc605dc0 100644 --- a/Userland/Libraries/LibGfx/Point.h +++ b/Userland/Libraries/LibGfx/Point.h @@ -248,7 +248,7 @@ public: return Point(ceil(x()), ceil(y())); } - [[nodiscard]] DeprecatedString to_string() const; + [[nodiscard]] DeprecatedString to_deprecated_string() const; private: T m_x { 0 }; diff --git a/Userland/Libraries/LibGfx/PortableImageLoaderCommon.h b/Userland/Libraries/LibGfx/PortableImageLoaderCommon.h index 35bf7fcbae9..74a5ad17b96 100644 --- a/Userland/Libraries/LibGfx/PortableImageLoaderCommon.h +++ b/Userland/Libraries/LibGfx/PortableImageLoaderCommon.h @@ -45,7 +45,7 @@ static bool read_number(Streamer& streamer, TValue* value) sb.append(byte); } - auto const opt_value = sb.to_string().to_uint(); + auto const opt_value = sb.to_deprecated_string().to_uint(); if (!opt_value.has_value()) { *value = 0; return false; diff --git a/Userland/Libraries/LibGfx/Rect.cpp b/Userland/Libraries/LibGfx/Rect.cpp index 4c165070042..6c85b50fac0 100644 --- a/Userland/Libraries/LibGfx/Rect.cpp +++ b/Userland/Libraries/LibGfx/Rect.cpp @@ -15,13 +15,13 @@ namespace Gfx { template<> -DeprecatedString IntRect::to_string() const +DeprecatedString IntRect::to_deprecated_string() const { return DeprecatedString::formatted("[{},{} {}x{}]", x(), y(), width(), height()); } template<> -DeprecatedString FloatRect::to_string() const +DeprecatedString FloatRect::to_deprecated_string() const { return DeprecatedString::formatted("[{},{} {}x{}]", x(), y(), width(), height()); } diff --git a/Userland/Libraries/LibGfx/Rect.h b/Userland/Libraries/LibGfx/Rect.h index 2565297771f..953b26f6db0 100644 --- a/Userland/Libraries/LibGfx/Rect.h +++ b/Userland/Libraries/LibGfx/Rect.h @@ -997,7 +997,7 @@ public: }; } - [[nodiscard]] DeprecatedString to_string() const; + [[nodiscard]] DeprecatedString to_deprecated_string() const; private: Point m_location; diff --git a/Userland/Libraries/LibGfx/Size.cpp b/Userland/Libraries/LibGfx/Size.cpp index 767487dd6ee..718312d0522 100644 --- a/Userland/Libraries/LibGfx/Size.cpp +++ b/Userland/Libraries/LibGfx/Size.cpp @@ -12,13 +12,13 @@ namespace Gfx { template<> -DeprecatedString IntSize::to_string() const +DeprecatedString IntSize::to_deprecated_string() const { return DeprecatedString::formatted("[{}x{}]", m_width, m_height); } template<> -DeprecatedString FloatSize::to_string() const +DeprecatedString FloatSize::to_deprecated_string() const { return DeprecatedString::formatted("[{}x{}]", m_width, m_height); } diff --git a/Userland/Libraries/LibGfx/Size.h b/Userland/Libraries/LibGfx/Size.h index 55f1c20532a..ec461de9c2e 100644 --- a/Userland/Libraries/LibGfx/Size.h +++ b/Userland/Libraries/LibGfx/Size.h @@ -182,7 +182,7 @@ public: return Size(*this); } - [[nodiscard]] DeprecatedString to_string() const; + [[nodiscard]] DeprecatedString to_deprecated_string() const; template [[nodiscard]] Size to_rounded() const diff --git a/Userland/Libraries/LibGfx/TextLayout.cpp b/Userland/Libraries/LibGfx/TextLayout.cpp index 78dfe1699b3..afb9d2e07ac 100644 --- a/Userland/Libraries/LibGfx/TextLayout.cpp +++ b/Userland/Libraries/LibGfx/TextLayout.cpp @@ -125,7 +125,7 @@ Vector TextLayout::wrap_lines(TextElision elision, TextWra for (Block& block : blocks) { switch (block.type) { case BlockType::Newline: { - lines.append(builder.to_string()); + lines.append(builder.to_deprecated_string()); builder.clear(); line_width = 0; @@ -147,7 +147,7 @@ Vector TextLayout::wrap_lines(TextElision elision, TextWra } if (wrapping == TextWrapping::Wrap && line_width + block_width > static_cast(m_rect.width())) { - lines.append(builder.to_string()); + lines.append(builder.to_deprecated_string()); builder.clear(); line_width = 0; } @@ -166,7 +166,7 @@ Vector TextLayout::wrap_lines(TextElision elision, TextWra blocks_processed: if (!did_not_finish) { - auto last_line = builder.to_string(); + auto last_line = builder.to_deprecated_string(); if (!last_line.is_empty()) lines.append(last_line); } @@ -212,7 +212,7 @@ DeprecatedString TextLayout::elide_text_from_right(Utf8View text, bool force_eli StringBuilder builder; builder.append(text.substring_view(0, offset).as_string()); builder.append("..."sv); - return builder.to_string(); + return builder.to_deprecated_string(); } } diff --git a/Userland/Libraries/LibGfx/Triangle.cpp b/Userland/Libraries/LibGfx/Triangle.cpp index 71a5e428be4..1642aaed0d3 100644 --- a/Userland/Libraries/LibGfx/Triangle.cpp +++ b/Userland/Libraries/LibGfx/Triangle.cpp @@ -11,13 +11,13 @@ namespace Gfx { template<> -DeprecatedString Triangle::to_string() const +DeprecatedString Triangle::to_deprecated_string() const { return DeprecatedString::formatted("({},{},{})", m_a, m_b, m_c); } template<> -DeprecatedString Triangle::to_string() const +DeprecatedString Triangle::to_deprecated_string() const { return DeprecatedString::formatted("({},{},{})", m_a, m_b, m_c); } diff --git a/Userland/Libraries/LibGfx/Triangle.h b/Userland/Libraries/LibGfx/Triangle.h index 599f5b76034..5b50c6081f1 100644 --- a/Userland/Libraries/LibGfx/Triangle.h +++ b/Userland/Libraries/LibGfx/Triangle.h @@ -49,7 +49,7 @@ public: return true; } - DeprecatedString to_string() const; + DeprecatedString to_deprecated_string() const; private: T m_determinant { 0 }; diff --git a/Userland/Libraries/LibGfx/Vector2.h b/Userland/Libraries/LibGfx/Vector2.h index 2de733de445..64efd3c7691 100644 --- a/Userland/Libraries/LibGfx/Vector2.h +++ b/Userland/Libraries/LibGfx/Vector2.h @@ -29,7 +29,7 @@ template struct Formatter> : Formatter { ErrorOr format(FormatBuilder& builder, Gfx::Vector2 const& value) { - return Formatter::format(builder, value.to_string()); + return Formatter::format(builder, value.to_deprecated_string()); } }; diff --git a/Userland/Libraries/LibGfx/Vector3.h b/Userland/Libraries/LibGfx/Vector3.h index 4c73f915519..7ff4ec40c8c 100644 --- a/Userland/Libraries/LibGfx/Vector3.h +++ b/Userland/Libraries/LibGfx/Vector3.h @@ -29,7 +29,7 @@ template struct Formatter> : Formatter { ErrorOr format(FormatBuilder& builder, Gfx::Vector3 const& value) { - return Formatter::format(builder, value.to_string()); + return Formatter::format(builder, value.to_deprecated_string()); } }; diff --git a/Userland/Libraries/LibGfx/Vector4.h b/Userland/Libraries/LibGfx/Vector4.h index dd059b006b1..829d7b2601d 100644 --- a/Userland/Libraries/LibGfx/Vector4.h +++ b/Userland/Libraries/LibGfx/Vector4.h @@ -29,7 +29,7 @@ template struct Formatter> : Formatter { ErrorOr format(FormatBuilder& builder, Gfx::Vector4 const& value) { - return Formatter::format(builder, value.to_string()); + return Formatter::format(builder, value.to_deprecated_string()); } }; diff --git a/Userland/Libraries/LibGfx/VectorN.h b/Userland/Libraries/LibGfx/VectorN.h index 676494edde5..7e67a726958 100644 --- a/Userland/Libraries/LibGfx/VectorN.h +++ b/Userland/Libraries/LibGfx/VectorN.h @@ -243,7 +243,7 @@ public: return VectorN<3, T>(x(), y(), z()); } - [[nodiscard]] DeprecatedString to_string() const + [[nodiscard]] DeprecatedString to_deprecated_string() const { if constexpr (N == 2) return DeprecatedString::formatted("[{},{}]", x(), y()); diff --git a/Userland/Libraries/LibHTTP/HttpRequest.cpp b/Userland/Libraries/LibHTTP/HttpRequest.cpp index 694752f2ac1..ab6538e3bc0 100644 --- a/Userland/Libraries/LibHTTP/HttpRequest.cpp +++ b/Userland/Libraries/LibHTTP/HttpRequest.cpp @@ -12,7 +12,7 @@ namespace HTTP { -DeprecatedString to_string(HttpRequest::Method method) +DeprecatedString to_deprecated_string(HttpRequest::Method method) { switch (method) { case HttpRequest::Method::GET: @@ -40,7 +40,7 @@ DeprecatedString to_string(HttpRequest::Method method) DeprecatedString HttpRequest::method_name() const { - return to_string(m_method); + return to_deprecated_string(m_method); } ByteBuffer HttpRequest::to_raw_request() const @@ -242,11 +242,11 @@ Optional HttpRequest::get_http_basic_authentication_header( builder.append(url.username()); builder.append(':'); builder.append(url.password()); - auto token = encode_base64(builder.to_string().bytes()); + auto token = encode_base64(builder.to_deprecated_string().bytes()); builder.clear(); builder.append("Basic "sv); builder.append(token); - return Header { "Authorization", builder.to_string() }; + return Header { "Authorization", builder.to_deprecated_string() }; } Optional HttpRequest::parse_http_basic_authentication_header(DeprecatedString const& value) diff --git a/Userland/Libraries/LibHTTP/HttpRequest.h b/Userland/Libraries/LibHTTP/HttpRequest.h index 0f7e8e71aa4..7ab76f6c77b 100644 --- a/Userland/Libraries/LibHTTP/HttpRequest.h +++ b/Userland/Libraries/LibHTTP/HttpRequest.h @@ -73,6 +73,6 @@ private: ByteBuffer m_body; }; -DeprecatedString to_string(HttpRequest::Method); +DeprecatedString to_deprecated_string(HttpRequest::Method); } diff --git a/Userland/Libraries/LibHTTP/Job.cpp b/Userland/Libraries/LibHTTP/Job.cpp index ad089536d97..25c04d951cf 100644 --- a/Userland/Libraries/LibHTTP/Job.cpp +++ b/Userland/Libraries/LibHTTP/Job.cpp @@ -337,7 +337,7 @@ void Job::on_socket_connected() } if (on_headers_received) { if (!m_set_cookie_headers.is_empty()) - m_headers.set("Set-Cookie", JsonArray { m_set_cookie_headers }.to_string()); + m_headers.set("Set-Cookie", JsonArray { m_set_cookie_headers }.to_deprecated_string()); on_headers_received(m_headers, m_code > 0 ? m_code : Optional {}); } m_state = State::InBody; diff --git a/Userland/Libraries/LibIDL/IDLParser.cpp b/Userland/Libraries/LibIDL/IDLParser.cpp index 7a71c01bf20..e54d78861c0 100644 --- a/Userland/Libraries/LibIDL/IDLParser.cpp +++ b/Userland/Libraries/LibIDL/IDLParser.cpp @@ -218,9 +218,9 @@ NonnullRefPtr Parser::parse_type() builder.append(name); if (is_parameterized_type) - return adopt_ref(*new ParameterizedType(builder.to_string(), nullable, move(parameters))); + return adopt_ref(*new ParameterizedType(builder.to_deprecated_string(), nullable, move(parameters))); - return adopt_ref(*new Type(builder.to_string(), nullable)); + return adopt_ref(*new Type(builder.to_deprecated_string(), nullable)); } void Parser::parse_attribute(HashMap& extended_attributes, Interface& interface) @@ -243,7 +243,7 @@ void Parser::parse_attribute(HashMap& extend assert_specific(';'); - auto name_as_string = name.to_string(); + auto name_as_string = name.to_deprecated_string(); auto getter_callback_name = DeprecatedString::formatted("{}_getter", name_as_string.to_snakecase()); auto setter_callback_name = DeprecatedString::formatted("{}_setter", name_as_string.to_snakecase()); diff --git a/Userland/Libraries/LibIMAP/Client.cpp b/Userland/Libraries/LibIMAP/Client.cpp index 6a8371d52b3..0ce5a6a4c0d 100644 --- a/Userland/Libraries/LibIMAP/Client.cpp +++ b/Userland/Libraries/LibIMAP/Client.cpp @@ -378,7 +378,7 @@ RefPtr>> Client::append(StringView mailbox, Mess args.append(flags_sb.build()); } if (date_time.has_value()) - args.append(date_time.value().to_string("\"%d-%b-%Y %H:%M:%S +0000\""sv)); + args.append(date_time.value().to_deprecated_string("\"%d-%b-%Y %H:%M:%S +0000\""sv)); args.append(DeprecatedString::formatted("{{{}}}", message.data.length())); diff --git a/Userland/Libraries/LibIMAP/Objects.cpp b/Userland/Libraries/LibIMAP/Objects.cpp index 01d946b8cd8..ed5dc56578f 100644 --- a/Userland/Libraries/LibIMAP/Objects.cpp +++ b/Userland/Libraries/LibIMAP/Objects.cpp @@ -151,7 +151,7 @@ DeprecatedString SearchKey::serialize() const [&](New const&) { return DeprecatedString("NEW"); }, [&](Not const& x) { return DeprecatedString::formatted("NOT {}", x.operand->serialize()); }, [&](Old const&) { return DeprecatedString("OLD"); }, - [&](On const& x) { return DeprecatedString::formatted("ON {}", x.date.to_string("%d-%b-%Y"sv)); }, + [&](On const& x) { return DeprecatedString::formatted("ON {}", x.date.to_deprecated_string("%d-%b-%Y"sv)); }, [&](Or const& x) { return DeprecatedString::formatted("OR {} {}", x.lhs->serialize(), x.rhs->serialize()); }, [&](Recent const&) { return DeprecatedString("RECENT"); }, [&](SearchKeys const& x) { @@ -167,11 +167,11 @@ DeprecatedString SearchKey::serialize() const return sb.build(); }, [&](Seen const&) { return DeprecatedString("SEEN"); }, - [&](SentBefore const& x) { return DeprecatedString::formatted("SENTBEFORE {}", x.date.to_string("%d-%b-%Y"sv)); }, - [&](SentOn const& x) { return DeprecatedString::formatted("SENTON {}", x.date.to_string("%d-%b-%Y"sv)); }, - [&](SentSince const& x) { return DeprecatedString::formatted("SENTSINCE {}", x.date.to_string("%d-%b-%Y"sv)); }, + [&](SentBefore const& x) { return DeprecatedString::formatted("SENTBEFORE {}", x.date.to_deprecated_string("%d-%b-%Y"sv)); }, + [&](SentOn const& x) { return DeprecatedString::formatted("SENTON {}", x.date.to_deprecated_string("%d-%b-%Y"sv)); }, + [&](SentSince const& x) { return DeprecatedString::formatted("SENTSINCE {}", x.date.to_deprecated_string("%d-%b-%Y"sv)); }, [&](SequenceSet const& x) { return x.sequence.serialize(); }, - [&](Since const& x) { return DeprecatedString::formatted("SINCE {}", x.date.to_string("%d-%b-%Y"sv)); }, + [&](Since const& x) { return DeprecatedString::formatted("SINCE {}", x.date.to_deprecated_string("%d-%b-%Y"sv)); }, [&](Smaller const& x) { return DeprecatedString::formatted("SMALLER {}", x.number); }, [&](Subject const& x) { return DeprecatedString::formatted("SUBJECT {}", serialize_astring(x.subject)); }, [&](Text const& x) { return DeprecatedString::formatted("TEXT {}", serialize_astring(x.text)); }, diff --git a/Userland/Libraries/LibIMAP/Parser.cpp b/Userland/Libraries/LibIMAP/Parser.cpp index 24b5cc91a47..489ab0e233f 100644 --- a/Userland/Libraries/LibIMAP/Parser.cpp +++ b/Userland/Libraries/LibIMAP/Parser.cpp @@ -130,7 +130,7 @@ void Parser::parse_untagged() auto number = try_parse_number(); if (number.has_value()) { consume(" "sv); - auto data_type = parse_atom().to_string(); + auto data_type = parse_atom().to_deprecated_string(); if (data_type == "EXISTS"sv) { m_response.data().set_exists(number.value()); consume("\r\n"sv); diff --git a/Userland/Libraries/LibIPC/Encoder.cpp b/Userland/Libraries/LibIPC/Encoder.cpp index 496b87e6e69..1794915cdb8 100644 --- a/Userland/Libraries/LibIPC/Encoder.cpp +++ b/Userland/Libraries/LibIPC/Encoder.cpp @@ -169,7 +169,7 @@ Encoder& Encoder::operator<<(JsonValue const& value) Encoder& Encoder::operator<<(URL const& value) { - return *this << value.to_string(); + return *this << value.to_deprecated_string(); } Encoder& Encoder::operator<<(Dictionary const& dictionary) diff --git a/Userland/Libraries/LibJS/AST.cpp b/Userland/Libraries/LibJS/AST.cpp index 0edf9e56100..f2aedf9061b 100644 --- a/Userland/Libraries/LibJS/AST.cpp +++ b/Userland/Libraries/LibJS/AST.cpp @@ -3443,7 +3443,7 @@ Completion ImportCall::execute(Interpreter& interpreter) const // 4. If supportedAssertions contains key, then if (supported_assertions.contains_slow(property_key.to_string())) { // a. Append { [[Key]]: key, [[Value]]: value } to assertions. - assertions.empend(property_key.to_string(), value.as_string().string()); + assertions.empend(property_key.to_string(), value.as_string().deprecated_string()); } } } diff --git a/Userland/Libraries/LibJS/Bytecode/BasicBlock.cpp b/Userland/Libraries/LibJS/Bytecode/BasicBlock.cpp index 81e84da4b1c..840ee53b16d 100644 --- a/Userland/Libraries/LibJS/Bytecode/BasicBlock.cpp +++ b/Userland/Libraries/LibJS/Bytecode/BasicBlock.cpp @@ -53,7 +53,7 @@ void BasicBlock::dump(Bytecode::Executable const& executable) const if (!m_name.is_empty()) warnln("{}:", m_name); while (!it.at_end()) { - warnln("[{:4x}] {}", it.offset(), (*it).to_string(executable)); + warnln("[{:4x}] {}", it.offset(), (*it).to_deprecated_string(executable)); ++it; } } diff --git a/Userland/Libraries/LibJS/Bytecode/CodeGenerationError.h b/Userland/Libraries/LibJS/Bytecode/CodeGenerationError.h index 5839d03194d..3d448fc38c4 100644 --- a/Userland/Libraries/LibJS/Bytecode/CodeGenerationError.h +++ b/Userland/Libraries/LibJS/Bytecode/CodeGenerationError.h @@ -16,7 +16,7 @@ struct CodeGenerationError { ASTNode const* failing_node { nullptr }; StringView reason_literal; - DeprecatedString to_string(); + DeprecatedString to_deprecated_string(); }; template diff --git a/Userland/Libraries/LibJS/Bytecode/Generator.cpp b/Userland/Libraries/LibJS/Bytecode/Generator.cpp index 5aa330ed96b..132f5fab65a 100644 --- a/Userland/Libraries/LibJS/Bytecode/Generator.cpp +++ b/Userland/Libraries/LibJS/Bytecode/Generator.cpp @@ -316,7 +316,7 @@ Label Generator::perform_needed_unwinds_for_labelled_continue_and_return_target_ VERIFY_NOT_REACHED(); } -DeprecatedString CodeGenerationError::to_string() +DeprecatedString CodeGenerationError::to_deprecated_string() { return DeprecatedString::formatted("CodeGenerationError in {}: {}", failing_node ? failing_node->class_name() : "", reason_literal); } diff --git a/Userland/Libraries/LibJS/Bytecode/Instruction.h b/Userland/Libraries/LibJS/Bytecode/Instruction.h index 5ab3d82df1d..bf4c624b650 100644 --- a/Userland/Libraries/LibJS/Bytecode/Instruction.h +++ b/Userland/Libraries/LibJS/Bytecode/Instruction.h @@ -106,7 +106,7 @@ public: bool is_terminator() const; Type type() const { return m_type; } size_t length() const; - DeprecatedString to_string(Bytecode::Executable const&) const; + DeprecatedString to_deprecated_string(Bytecode::Executable const&) const; ThrowCompletionOr execute(Bytecode::Interpreter&) const; void replace_references(BasicBlock const&, BasicBlock const&); void replace_references(Register, Register); diff --git a/Userland/Libraries/LibJS/Bytecode/Op.cpp b/Userland/Libraries/LibJS/Bytecode/Op.cpp index 34982463686..c4d1007b5d3 100644 --- a/Userland/Libraries/LibJS/Bytecode/Op.cpp +++ b/Userland/Libraries/LibJS/Bytecode/Op.cpp @@ -29,11 +29,11 @@ namespace JS::Bytecode { -DeprecatedString Instruction::to_string(Bytecode::Executable const& executable) const +DeprecatedString Instruction::to_deprecated_string(Bytecode::Executable const& executable) const { #define __BYTECODE_OP(op) \ case Instruction::Type::op: \ - return static_cast(*this).to_string_impl(executable); + return static_cast(*this).to_deprecated_string_impl(executable); switch (type()) { ENUMERATE_BYTECODE_OPS(__BYTECODE_OP) @@ -136,7 +136,7 @@ static ThrowCompletionOr typed_equals(VM&, Value src1, Value src2) interpreter.accumulator() = TRY(op_snake_case(vm, lhs, rhs)); \ return {}; \ } \ - DeprecatedString OpTitleCase::to_string_impl(Bytecode::Executable const&) const \ + DeprecatedString OpTitleCase::to_deprecated_string_impl(Bytecode::Executable const&) const \ { \ return DeprecatedString::formatted(#OpTitleCase " {}", m_lhs_reg); \ } @@ -160,7 +160,7 @@ static ThrowCompletionOr typeof_(VM& vm, Value value) interpreter.accumulator() = TRY(op_snake_case(vm, interpreter.accumulator())); \ return {}; \ } \ - DeprecatedString OpTitleCase::to_string_impl(Bytecode::Executable const&) const \ + DeprecatedString OpTitleCase::to_deprecated_string_impl(Bytecode::Executable const&) const \ { \ return #OpTitleCase; \ } @@ -1017,64 +1017,64 @@ ThrowCompletionOr TypeofVariable::execute_impl(Bytecode::Interpreter& inte return {}; } -DeprecatedString Load::to_string_impl(Bytecode::Executable const&) const +DeprecatedString Load::to_deprecated_string_impl(Bytecode::Executable const&) const { return DeprecatedString::formatted("Load {}", m_src); } -DeprecatedString LoadImmediate::to_string_impl(Bytecode::Executable const&) const +DeprecatedString LoadImmediate::to_deprecated_string_impl(Bytecode::Executable const&) const { return DeprecatedString::formatted("LoadImmediate {}", m_value); } -DeprecatedString Store::to_string_impl(Bytecode::Executable const&) const +DeprecatedString Store::to_deprecated_string_impl(Bytecode::Executable const&) const { return DeprecatedString::formatted("Store {}", m_dst); } -DeprecatedString NewBigInt::to_string_impl(Bytecode::Executable const&) const +DeprecatedString NewBigInt::to_deprecated_string_impl(Bytecode::Executable const&) const { return DeprecatedString::formatted("NewBigInt \"{}\"", m_bigint.to_base(10)); } -DeprecatedString NewArray::to_string_impl(Bytecode::Executable const&) const +DeprecatedString NewArray::to_deprecated_string_impl(Bytecode::Executable const&) const { StringBuilder builder; builder.append("NewArray"sv); if (m_element_count != 0) { builder.appendff(" [{}-{}]", m_elements[0], m_elements[1]); } - return builder.to_string(); + return builder.to_deprecated_string(); } -DeprecatedString Append::to_string_impl(Bytecode::Executable const&) const +DeprecatedString Append::to_deprecated_string_impl(Bytecode::Executable const&) const { if (m_is_spread) return DeprecatedString::formatted("Append lhs: **{}", m_lhs); return DeprecatedString::formatted("Append lhs: {}", m_lhs); } -DeprecatedString IteratorToArray::to_string_impl(Bytecode::Executable const&) const +DeprecatedString IteratorToArray::to_deprecated_string_impl(Bytecode::Executable const&) const { return "IteratorToArray"; } -DeprecatedString NewString::to_string_impl(Bytecode::Executable const& executable) const +DeprecatedString NewString::to_deprecated_string_impl(Bytecode::Executable const& executable) const { return DeprecatedString::formatted("NewString {} (\"{}\")", m_string, executable.string_table->get(m_string)); } -DeprecatedString NewObject::to_string_impl(Bytecode::Executable const&) const +DeprecatedString NewObject::to_deprecated_string_impl(Bytecode::Executable const&) const { return "NewObject"; } -DeprecatedString NewRegExp::to_string_impl(Bytecode::Executable const& executable) const +DeprecatedString NewRegExp::to_deprecated_string_impl(Bytecode::Executable const& executable) const { return DeprecatedString::formatted("NewRegExp source:{} (\"{}\") flags:{} (\"{}\")", m_source_index, executable.get_string(m_source_index), m_flags_index, executable.get_string(m_flags_index)); } -DeprecatedString CopyObjectExcludingProperties::to_string_impl(Bytecode::Executable const&) const +DeprecatedString CopyObjectExcludingProperties::to_deprecated_string_impl(Bytecode::Executable const&) const { StringBuilder builder; builder.appendff("CopyObjectExcludingProperties from:{}", m_from_object); @@ -1083,25 +1083,25 @@ DeprecatedString CopyObjectExcludingProperties::to_string_impl(Bytecode::Executa builder.join(", "sv, Span(m_excluded_names, m_excluded_names_count)); builder.append(']'); } - return builder.to_string(); + return builder.to_deprecated_string(); } -DeprecatedString ConcatString::to_string_impl(Bytecode::Executable const&) const +DeprecatedString ConcatString::to_deprecated_string_impl(Bytecode::Executable const&) const { return DeprecatedString::formatted("ConcatString {}", m_lhs); } -DeprecatedString GetVariable::to_string_impl(Bytecode::Executable const& executable) const +DeprecatedString GetVariable::to_deprecated_string_impl(Bytecode::Executable const& executable) const { return DeprecatedString::formatted("GetVariable {} ({})", m_identifier, executable.identifier_table->get(m_identifier)); } -DeprecatedString DeleteVariable::to_string_impl(Bytecode::Executable const& executable) const +DeprecatedString DeleteVariable::to_deprecated_string_impl(Bytecode::Executable const& executable) const { return DeprecatedString::formatted("DeleteVariable {} ({})", m_identifier, executable.identifier_table->get(m_identifier)); } -DeprecatedString CreateEnvironment::to_string_impl(Bytecode::Executable const&) const +DeprecatedString CreateEnvironment::to_deprecated_string_impl(Bytecode::Executable const&) const { auto mode_string = m_mode == EnvironmentMode::Lexical ? "Lexical" @@ -1109,18 +1109,18 @@ DeprecatedString CreateEnvironment::to_string_impl(Bytecode::Executable const&) return DeprecatedString::formatted("CreateEnvironment mode:{}", mode_string); } -DeprecatedString CreateVariable::to_string_impl(Bytecode::Executable const& executable) const +DeprecatedString CreateVariable::to_deprecated_string_impl(Bytecode::Executable const& executable) const { auto mode_string = m_mode == EnvironmentMode::Lexical ? "Lexical" : "Variable"; return DeprecatedString::formatted("CreateVariable env:{} immutable:{} global:{} {} ({})", mode_string, m_is_immutable, m_is_global, m_identifier, executable.identifier_table->get(m_identifier)); } -DeprecatedString EnterObjectEnvironment::to_string_impl(Executable const&) const +DeprecatedString EnterObjectEnvironment::to_deprecated_string_impl(Executable const&) const { return DeprecatedString::formatted("EnterObjectEnvironment"); } -DeprecatedString SetVariable::to_string_impl(Bytecode::Executable const& executable) const +DeprecatedString SetVariable::to_deprecated_string_impl(Bytecode::Executable const& executable) const { auto initialization_mode_name = m_initialization_mode == InitializationMode ::Initialize ? "Initialize" : m_initialization_mode == InitializationMode::Set ? "Set" @@ -1129,7 +1129,7 @@ DeprecatedString SetVariable::to_string_impl(Bytecode::Executable const& executa return DeprecatedString::formatted("SetVariable env:{} init:{} {} ({})", mode_string, initialization_mode_name, m_identifier, executable.identifier_table->get(m_identifier)); } -DeprecatedString PutById::to_string_impl(Bytecode::Executable const& executable) const +DeprecatedString PutById::to_deprecated_string_impl(Bytecode::Executable const& executable) const { auto kind = m_kind == PropertyKind::Getter ? "getter" @@ -1140,45 +1140,45 @@ DeprecatedString PutById::to_string_impl(Bytecode::Executable const& executable) return DeprecatedString::formatted("PutById kind:{} base:{}, property:{} ({})", kind, m_base, m_property, executable.identifier_table->get(m_property)); } -DeprecatedString GetById::to_string_impl(Bytecode::Executable const& executable) const +DeprecatedString GetById::to_deprecated_string_impl(Bytecode::Executable const& executable) const { return DeprecatedString::formatted("GetById {} ({})", m_property, executable.identifier_table->get(m_property)); } -DeprecatedString DeleteById::to_string_impl(Bytecode::Executable const& executable) const +DeprecatedString DeleteById::to_deprecated_string_impl(Bytecode::Executable const& executable) const { return DeprecatedString::formatted("DeleteById {} ({})", m_property, executable.identifier_table->get(m_property)); } -DeprecatedString Jump::to_string_impl(Bytecode::Executable const&) const +DeprecatedString Jump::to_deprecated_string_impl(Bytecode::Executable const&) const { if (m_true_target.has_value()) return DeprecatedString::formatted("Jump {}", *m_true_target); return DeprecatedString::formatted("Jump "); } -DeprecatedString JumpConditional::to_string_impl(Bytecode::Executable const&) const +DeprecatedString JumpConditional::to_deprecated_string_impl(Bytecode::Executable const&) const { auto true_string = m_true_target.has_value() ? DeprecatedString::formatted("{}", *m_true_target) : ""; auto false_string = m_false_target.has_value() ? DeprecatedString::formatted("{}", *m_false_target) : ""; return DeprecatedString::formatted("JumpConditional true:{} false:{}", true_string, false_string); } -DeprecatedString JumpNullish::to_string_impl(Bytecode::Executable const&) const +DeprecatedString JumpNullish::to_deprecated_string_impl(Bytecode::Executable const&) const { auto true_string = m_true_target.has_value() ? DeprecatedString::formatted("{}", *m_true_target) : ""; auto false_string = m_false_target.has_value() ? DeprecatedString::formatted("{}", *m_false_target) : ""; return DeprecatedString::formatted("JumpNullish null:{} nonnull:{}", true_string, false_string); } -DeprecatedString JumpUndefined::to_string_impl(Bytecode::Executable const&) const +DeprecatedString JumpUndefined::to_deprecated_string_impl(Bytecode::Executable const&) const { auto true_string = m_true_target.has_value() ? DeprecatedString::formatted("{}", *m_true_target) : ""; auto false_string = m_false_target.has_value() ? DeprecatedString::formatted("{}", *m_false_target) : ""; return DeprecatedString::formatted("JumpUndefined undefined:{} not undefined:{}", true_string, false_string); } -DeprecatedString Call::to_string_impl(Bytecode::Executable const& executable) const +DeprecatedString Call::to_deprecated_string_impl(Bytecode::Executable const& executable) const { if (m_expression_string.has_value()) return DeprecatedString::formatted("Call callee:{}, this:{}, arguments:[...acc] ({})", m_callee, m_this_value, executable.get_string(m_expression_string.value())); @@ -1186,55 +1186,55 @@ DeprecatedString Call::to_string_impl(Bytecode::Executable const& executable) co return DeprecatedString::formatted("Call callee:{}, this:{}, arguments:[...acc]", m_callee, m_this_value); } -DeprecatedString SuperCall::to_string_impl(Bytecode::Executable const&) const +DeprecatedString SuperCall::to_deprecated_string_impl(Bytecode::Executable const&) const { return "SuperCall arguments:[...acc]"sv; } -DeprecatedString NewFunction::to_string_impl(Bytecode::Executable const&) const +DeprecatedString NewFunction::to_deprecated_string_impl(Bytecode::Executable const&) const { return "NewFunction"; } -DeprecatedString NewClass::to_string_impl(Bytecode::Executable const&) const +DeprecatedString NewClass::to_deprecated_string_impl(Bytecode::Executable const&) const { auto name = m_class_expression.name(); return DeprecatedString::formatted("NewClass '{}'", name.is_null() ? ""sv : name); } -DeprecatedString Return::to_string_impl(Bytecode::Executable const&) const +DeprecatedString Return::to_deprecated_string_impl(Bytecode::Executable const&) const { return "Return"; } -DeprecatedString Increment::to_string_impl(Bytecode::Executable const&) const +DeprecatedString Increment::to_deprecated_string_impl(Bytecode::Executable const&) const { return "Increment"; } -DeprecatedString Decrement::to_string_impl(Bytecode::Executable const&) const +DeprecatedString Decrement::to_deprecated_string_impl(Bytecode::Executable const&) const { return "Decrement"; } -DeprecatedString Throw::to_string_impl(Bytecode::Executable const&) const +DeprecatedString Throw::to_deprecated_string_impl(Bytecode::Executable const&) const { return "Throw"; } -DeprecatedString EnterUnwindContext::to_string_impl(Bytecode::Executable const&) const +DeprecatedString EnterUnwindContext::to_deprecated_string_impl(Bytecode::Executable const&) const { auto handler_string = m_handler_target.has_value() ? DeprecatedString::formatted("{}", *m_handler_target) : ""; auto finalizer_string = m_finalizer_target.has_value() ? DeprecatedString::formatted("{}", *m_finalizer_target) : ""; return DeprecatedString::formatted("EnterUnwindContext handler:{} finalizer:{} entry:{}", handler_string, finalizer_string, m_entry_point); } -DeprecatedString FinishUnwind::to_string_impl(Bytecode::Executable const&) const +DeprecatedString FinishUnwind::to_deprecated_string_impl(Bytecode::Executable const&) const { return DeprecatedString::formatted("FinishUnwind next:{}", m_next_target); } -DeprecatedString LeaveEnvironment::to_string_impl(Bytecode::Executable const&) const +DeprecatedString LeaveEnvironment::to_deprecated_string_impl(Bytecode::Executable const&) const { auto mode_string = m_mode == EnvironmentMode::Lexical ? "Lexical" @@ -1242,17 +1242,17 @@ DeprecatedString LeaveEnvironment::to_string_impl(Bytecode::Executable const&) c return DeprecatedString::formatted("LeaveEnvironment env:{}", mode_string); } -DeprecatedString LeaveUnwindContext::to_string_impl(Bytecode::Executable const&) const +DeprecatedString LeaveUnwindContext::to_deprecated_string_impl(Bytecode::Executable const&) const { return "LeaveUnwindContext"; } -DeprecatedString ContinuePendingUnwind::to_string_impl(Bytecode::Executable const&) const +DeprecatedString ContinuePendingUnwind::to_deprecated_string_impl(Bytecode::Executable const&) const { return DeprecatedString::formatted("ContinuePendingUnwind resume:{}", m_resume_target); } -DeprecatedString PushDeclarativeEnvironment::to_string_impl(Bytecode::Executable const& executable) const +DeprecatedString PushDeclarativeEnvironment::to_deprecated_string_impl(Bytecode::Executable const& executable) const { StringBuilder builder; builder.append("PushDeclarativeEnvironment"sv); @@ -1264,22 +1264,22 @@ DeprecatedString PushDeclarativeEnvironment::to_string_impl(Bytecode::Executable builder.append('}'); builder.join(", "sv, names); } - return builder.to_string(); + return builder.to_deprecated_string(); } -DeprecatedString Yield::to_string_impl(Bytecode::Executable const&) const +DeprecatedString Yield::to_deprecated_string_impl(Bytecode::Executable const&) const { if (m_continuation_label.has_value()) return DeprecatedString::formatted("Yield continuation:@{}", m_continuation_label->block().name()); return DeprecatedString::formatted("Yield return"); } -DeprecatedString GetByValue::to_string_impl(Bytecode::Executable const&) const +DeprecatedString GetByValue::to_deprecated_string_impl(Bytecode::Executable const&) const { return DeprecatedString::formatted("GetByValue base:{}", m_base); } -DeprecatedString PutByValue::to_string_impl(Bytecode::Executable const&) const +DeprecatedString PutByValue::to_deprecated_string_impl(Bytecode::Executable const&) const { auto kind = m_kind == PropertyKind::Getter ? "getter" @@ -1290,47 +1290,47 @@ DeprecatedString PutByValue::to_string_impl(Bytecode::Executable const&) const return DeprecatedString::formatted("PutByValue kind:{} base:{}, property:{}", kind, m_base, m_property); } -DeprecatedString DeleteByValue::to_string_impl(Bytecode::Executable const&) const +DeprecatedString DeleteByValue::to_deprecated_string_impl(Bytecode::Executable const&) const { return DeprecatedString::formatted("DeleteByValue base:{}", m_base); } -DeprecatedString GetIterator::to_string_impl(Executable const&) const +DeprecatedString GetIterator::to_deprecated_string_impl(Executable const&) const { return "GetIterator"; } -DeprecatedString GetObjectPropertyIterator::to_string_impl(Bytecode::Executable const&) const +DeprecatedString GetObjectPropertyIterator::to_deprecated_string_impl(Bytecode::Executable const&) const { return "GetObjectPropertyIterator"; } -DeprecatedString IteratorNext::to_string_impl(Executable const&) const +DeprecatedString IteratorNext::to_deprecated_string_impl(Executable const&) const { return "IteratorNext"; } -DeprecatedString IteratorResultDone::to_string_impl(Executable const&) const +DeprecatedString IteratorResultDone::to_deprecated_string_impl(Executable const&) const { return "IteratorResultDone"; } -DeprecatedString IteratorResultValue::to_string_impl(Executable const&) const +DeprecatedString IteratorResultValue::to_deprecated_string_impl(Executable const&) const { return "IteratorResultValue"; } -DeprecatedString ResolveThisBinding::to_string_impl(Bytecode::Executable const&) const +DeprecatedString ResolveThisBinding::to_deprecated_string_impl(Bytecode::Executable const&) const { return "ResolveThisBinding"sv; } -DeprecatedString GetNewTarget::to_string_impl(Bytecode::Executable const&) const +DeprecatedString GetNewTarget::to_deprecated_string_impl(Bytecode::Executable const&) const { return "GetNewTarget"sv; } -DeprecatedString TypeofVariable::to_string_impl(Bytecode::Executable const& executable) const +DeprecatedString TypeofVariable::to_deprecated_string_impl(Bytecode::Executable const& executable) const { return DeprecatedString::formatted("TypeofVariable {} ({})", m_identifier, executable.identifier_table->get(m_identifier)); } diff --git a/Userland/Libraries/LibJS/Bytecode/Op.h b/Userland/Libraries/LibJS/Bytecode/Op.h index bdb6d974a30..0ec54988845 100644 --- a/Userland/Libraries/LibJS/Bytecode/Op.h +++ b/Userland/Libraries/LibJS/Bytecode/Op.h @@ -32,7 +32,7 @@ public: } ThrowCompletionOr execute_impl(Bytecode::Interpreter&) const; - DeprecatedString to_string_impl(Bytecode::Executable const&) const; + DeprecatedString to_deprecated_string_impl(Bytecode::Executable const&) const; void replace_references_impl(BasicBlock const&, BasicBlock const&) { } void replace_references_impl(Register from, Register to) { @@ -53,7 +53,7 @@ public: } ThrowCompletionOr execute_impl(Bytecode::Interpreter&) const; - DeprecatedString to_string_impl(Bytecode::Executable const&) const; + DeprecatedString to_deprecated_string_impl(Bytecode::Executable const&) const; void replace_references_impl(BasicBlock const&, BasicBlock const&) { } void replace_references_impl(Register, Register) { } @@ -70,7 +70,7 @@ public: } ThrowCompletionOr execute_impl(Bytecode::Interpreter&) const; - DeprecatedString to_string_impl(Bytecode::Executable const&) const; + DeprecatedString to_deprecated_string_impl(Bytecode::Executable const&) const; void replace_references_impl(BasicBlock const&, BasicBlock const&) { } void replace_references_impl(Register, Register) { } @@ -104,28 +104,28 @@ private: O(RightShift, right_shift) \ O(UnsignedRightShift, unsigned_right_shift) -#define JS_DECLARE_COMMON_BINARY_OP(OpTitleCase, op_snake_case) \ - class OpTitleCase final : public Instruction { \ - public: \ - explicit OpTitleCase(Register lhs_reg) \ - : Instruction(Type::OpTitleCase) \ - , m_lhs_reg(lhs_reg) \ - { \ - } \ - \ - ThrowCompletionOr execute_impl(Bytecode::Interpreter&) const; \ - DeprecatedString to_string_impl(Bytecode::Executable const&) const; \ - void replace_references_impl(BasicBlock const&, BasicBlock const&) \ - { \ - } \ - void replace_references_impl(Register from, Register to) \ - { \ - if (m_lhs_reg == from) \ - m_lhs_reg = to; \ - } \ - \ - private: \ - Register m_lhs_reg; \ +#define JS_DECLARE_COMMON_BINARY_OP(OpTitleCase, op_snake_case) \ + class OpTitleCase final : public Instruction { \ + public: \ + explicit OpTitleCase(Register lhs_reg) \ + : Instruction(Type::OpTitleCase) \ + , m_lhs_reg(lhs_reg) \ + { \ + } \ + \ + ThrowCompletionOr execute_impl(Bytecode::Interpreter&) const; \ + DeprecatedString to_deprecated_string_impl(Bytecode::Executable const&) const; \ + void replace_references_impl(BasicBlock const&, BasicBlock const&) \ + { \ + } \ + void replace_references_impl(Register from, Register to) \ + { \ + if (m_lhs_reg == from) \ + m_lhs_reg = to; \ + } \ + \ + private: \ + Register m_lhs_reg; \ }; JS_ENUMERATE_COMMON_BINARY_OPS(JS_DECLARE_COMMON_BINARY_OP) @@ -138,22 +138,22 @@ JS_ENUMERATE_COMMON_BINARY_OPS(JS_DECLARE_COMMON_BINARY_OP) O(UnaryMinus, unary_minus) \ O(Typeof, typeof_) -#define JS_DECLARE_COMMON_UNARY_OP(OpTitleCase, op_snake_case) \ - class OpTitleCase final : public Instruction { \ - public: \ - OpTitleCase() \ - : Instruction(Type::OpTitleCase) \ - { \ - } \ - \ - ThrowCompletionOr execute_impl(Bytecode::Interpreter&) const; \ - DeprecatedString to_string_impl(Bytecode::Executable const&) const; \ - void replace_references_impl(BasicBlock const&, BasicBlock const&) \ - { \ - } \ - void replace_references_impl(Register, Register) \ - { \ - } \ +#define JS_DECLARE_COMMON_UNARY_OP(OpTitleCase, op_snake_case) \ + class OpTitleCase final : public Instruction { \ + public: \ + OpTitleCase() \ + : Instruction(Type::OpTitleCase) \ + { \ + } \ + \ + ThrowCompletionOr execute_impl(Bytecode::Interpreter&) const; \ + DeprecatedString to_deprecated_string_impl(Bytecode::Executable const&) const; \ + void replace_references_impl(BasicBlock const&, BasicBlock const&) \ + { \ + } \ + void replace_references_impl(Register, Register) \ + { \ + } \ }; JS_ENUMERATE_COMMON_UNARY_OPS(JS_DECLARE_COMMON_UNARY_OP) @@ -168,7 +168,7 @@ public: } ThrowCompletionOr execute_impl(Bytecode::Interpreter&) const; - DeprecatedString to_string_impl(Bytecode::Executable const&) const; + DeprecatedString to_deprecated_string_impl(Bytecode::Executable const&) const; void replace_references_impl(BasicBlock const&, BasicBlock const&) { } void replace_references_impl(Register, Register) { } @@ -184,7 +184,7 @@ public: } ThrowCompletionOr execute_impl(Bytecode::Interpreter&) const; - DeprecatedString to_string_impl(Bytecode::Executable const&) const; + DeprecatedString to_deprecated_string_impl(Bytecode::Executable const&) const; void replace_references_impl(BasicBlock const&, BasicBlock const&) { } void replace_references_impl(Register, Register) { } }; @@ -199,7 +199,7 @@ public: } ThrowCompletionOr execute_impl(Bytecode::Interpreter&) const; - DeprecatedString to_string_impl(Bytecode::Executable const&) const; + DeprecatedString to_deprecated_string_impl(Bytecode::Executable const&) const; void replace_references_impl(BasicBlock const&, BasicBlock const&) { } void replace_references_impl(Register, Register) { } @@ -221,7 +221,7 @@ public: } ThrowCompletionOr execute_impl(Bytecode::Interpreter&) const; - DeprecatedString to_string_impl(Bytecode::Executable const&) const; + DeprecatedString to_deprecated_string_impl(Bytecode::Executable const&) const; void replace_references_impl(BasicBlock const&, BasicBlock const&) { } void replace_references_impl(Register from, Register to); @@ -242,7 +242,7 @@ public: } ThrowCompletionOr execute_impl(Bytecode::Interpreter&) const; - DeprecatedString to_string_impl(Bytecode::Executable const&) const; + DeprecatedString to_deprecated_string_impl(Bytecode::Executable const&) const; void replace_references_impl(BasicBlock const&, BasicBlock const&) { } void replace_references_impl(Register, Register) { } @@ -268,7 +268,7 @@ public: } ThrowCompletionOr execute_impl(Bytecode::Interpreter&) const; - DeprecatedString to_string_impl(Bytecode::Executable const&) const; + DeprecatedString to_deprecated_string_impl(Bytecode::Executable const&) const; void replace_references_impl(BasicBlock const&, BasicBlock const&) { } // Note: The underlying element range shall never be changed item, by item // shifting it may be done in the future @@ -308,7 +308,7 @@ public: } ThrowCompletionOr execute_impl(Bytecode::Interpreter&) const; - DeprecatedString to_string_impl(Bytecode::Executable const&) const; + DeprecatedString to_deprecated_string_impl(Bytecode::Executable const&) const; void replace_references_impl(BasicBlock const&, BasicBlock const&) { } // Note: This should never do anything, the lhs should always be an array, that is currently being constructed @@ -327,7 +327,7 @@ public: } ThrowCompletionOr execute_impl(Bytecode::Interpreter&) const; - DeprecatedString to_string_impl(Bytecode::Executable const&) const; + DeprecatedString to_deprecated_string_impl(Bytecode::Executable const&) const; void replace_references_impl(BasicBlock const&, BasicBlock const&) { } void replace_references_impl(Register, Register) { } }; @@ -341,7 +341,7 @@ public: } ThrowCompletionOr execute_impl(Bytecode::Interpreter&) const; - DeprecatedString to_string_impl(Bytecode::Executable const&) const; + DeprecatedString to_deprecated_string_impl(Bytecode::Executable const&) const; void replace_references_impl(BasicBlock const&, BasicBlock const&) { } // Note: lhs should always be a string in construction, so this should never do anything void replace_references_impl(Register from, Register) { VERIFY(from != m_lhs); } @@ -364,7 +364,7 @@ public: } ThrowCompletionOr execute_impl(Bytecode::Interpreter&) const; - DeprecatedString to_string_impl(Bytecode::Executable const&) const; + DeprecatedString to_deprecated_string_impl(Bytecode::Executable const&) const; void replace_references_impl(BasicBlock const&, BasicBlock const&) { } void replace_references_impl(Register, Register) { } @@ -380,7 +380,7 @@ public: } ThrowCompletionOr execute_impl(Bytecode::Interpreter&) const; - DeprecatedString to_string_impl(Bytecode::Executable const&) const; + DeprecatedString to_deprecated_string_impl(Bytecode::Executable const&) const; void replace_references_impl(BasicBlock const&, BasicBlock const&) { } void replace_references_impl(Register, Register) { } }; @@ -397,7 +397,7 @@ public: } ThrowCompletionOr execute_impl(Bytecode::Interpreter&) const; - DeprecatedString to_string_impl(Bytecode::Executable const&) const; + DeprecatedString to_deprecated_string_impl(Bytecode::Executable const&) const; void replace_references_impl(BasicBlock const&, BasicBlock const&) { } void replace_references_impl(Register, Register) { } @@ -424,7 +424,7 @@ public: } ThrowCompletionOr execute_impl(Bytecode::Interpreter&) const; - DeprecatedString to_string_impl(Bytecode::Executable const&) const; + DeprecatedString to_deprecated_string_impl(Bytecode::Executable const&) const; void replace_references_impl(BasicBlock const&, BasicBlock const&) { } void replace_references_impl(Register, Register) { } @@ -445,7 +445,7 @@ public: } ThrowCompletionOr execute_impl(Bytecode::Interpreter&) const; - DeprecatedString to_string_impl(Bytecode::Executable const&) const; + DeprecatedString to_deprecated_string_impl(Bytecode::Executable const&) const; void replace_references_impl(BasicBlock const&, BasicBlock const&) { } void replace_references_impl(Register, Register) { } @@ -466,7 +466,7 @@ public: } ThrowCompletionOr execute_impl(Bytecode::Interpreter&) const; - DeprecatedString to_string_impl(Bytecode::Executable const&) const; + DeprecatedString to_deprecated_string_impl(Bytecode::Executable const&) const; void replace_references_impl(BasicBlock const&, BasicBlock const&) { } void replace_references_impl(Register, Register) { } @@ -485,7 +485,7 @@ public: } ThrowCompletionOr execute_impl(Bytecode::Interpreter&) const; - DeprecatedString to_string_impl(Bytecode::Executable const&) const; + DeprecatedString to_deprecated_string_impl(Bytecode::Executable const&) const; void replace_references_impl(BasicBlock const&, BasicBlock const&) { } void replace_references_impl(Register, Register) { } @@ -512,7 +512,7 @@ public: } ThrowCompletionOr execute_impl(Bytecode::Interpreter&) const; - DeprecatedString to_string_impl(Bytecode::Executable const&) const; + DeprecatedString to_deprecated_string_impl(Bytecode::Executable const&) const; void replace_references_impl(BasicBlock const&, BasicBlock const&) { } void replace_references_impl(Register from, Register to) { @@ -535,7 +535,7 @@ public: } ThrowCompletionOr execute_impl(Bytecode::Interpreter&) const; - DeprecatedString to_string_impl(Bytecode::Executable const&) const; + DeprecatedString to_deprecated_string_impl(Bytecode::Executable const&) const; void replace_references_impl(BasicBlock const&, BasicBlock const&) { } void replace_references_impl(Register, Register) { } @@ -552,7 +552,7 @@ public: } ThrowCompletionOr execute_impl(Bytecode::Interpreter&) const; - DeprecatedString to_string_impl(Bytecode::Executable const&) const; + DeprecatedString to_deprecated_string_impl(Bytecode::Executable const&) const; void replace_references_impl(BasicBlock const&, BasicBlock const&) { } void replace_references_impl(Register from, Register to) { @@ -575,7 +575,7 @@ public: } ThrowCompletionOr execute_impl(Bytecode::Interpreter&) const; - DeprecatedString to_string_impl(Bytecode::Executable const&) const; + DeprecatedString to_deprecated_string_impl(Bytecode::Executable const&) const; void replace_references_impl(BasicBlock const&, BasicBlock const&) { } void replace_references_impl(Register from, Register to) { @@ -598,7 +598,7 @@ public: } ThrowCompletionOr execute_impl(Bytecode::Interpreter&) const; - DeprecatedString to_string_impl(Bytecode::Executable const&) const; + DeprecatedString to_deprecated_string_impl(Bytecode::Executable const&) const; void replace_references_impl(BasicBlock const&, BasicBlock const&) { } void replace_references_impl(Register from, Register to) { @@ -635,7 +635,7 @@ public: } ThrowCompletionOr execute_impl(Bytecode::Interpreter&) const; - DeprecatedString to_string_impl(Bytecode::Executable const&) const; + DeprecatedString to_deprecated_string_impl(Bytecode::Executable const&) const; void replace_references_impl(BasicBlock const&, BasicBlock const&); void replace_references_impl(Register, Register) { } @@ -655,7 +655,7 @@ public: } ThrowCompletionOr execute_impl(Bytecode::Interpreter&) const; - DeprecatedString to_string_impl(Bytecode::Executable const&) const; + DeprecatedString to_deprecated_string_impl(Bytecode::Executable const&) const; }; class JumpNullish final : public Jump { @@ -666,7 +666,7 @@ public: } ThrowCompletionOr execute_impl(Bytecode::Interpreter&) const; - DeprecatedString to_string_impl(Bytecode::Executable const&) const; + DeprecatedString to_deprecated_string_impl(Bytecode::Executable const&) const; }; class JumpUndefined final : public Jump { @@ -677,7 +677,7 @@ public: } ThrowCompletionOr execute_impl(Bytecode::Interpreter&) const; - DeprecatedString to_string_impl(Bytecode::Executable const&) const; + DeprecatedString to_deprecated_string_impl(Bytecode::Executable const&) const; }; // NOTE: This instruction is variable-width depending on the number of arguments! @@ -698,7 +698,7 @@ public: } ThrowCompletionOr execute_impl(Bytecode::Interpreter&) const; - DeprecatedString to_string_impl(Bytecode::Executable const&) const; + DeprecatedString to_deprecated_string_impl(Bytecode::Executable const&) const; void replace_references_impl(BasicBlock const&, BasicBlock const&) { } void replace_references_impl(Register, Register); @@ -721,7 +721,7 @@ public: } ThrowCompletionOr execute_impl(Bytecode::Interpreter&) const; - DeprecatedString to_string_impl(Bytecode::Executable const&) const; + DeprecatedString to_deprecated_string_impl(Bytecode::Executable const&) const; void replace_references_impl(BasicBlock const&, BasicBlock const&) { } void replace_references_impl(Register, Register) { } @@ -738,7 +738,7 @@ public: } ThrowCompletionOr execute_impl(Bytecode::Interpreter&) const; - DeprecatedString to_string_impl(Bytecode::Executable const&) const; + DeprecatedString to_deprecated_string_impl(Bytecode::Executable const&) const; void replace_references_impl(BasicBlock const&, BasicBlock const&) { } void replace_references_impl(Register, Register) { } @@ -755,7 +755,7 @@ public: } ThrowCompletionOr execute_impl(Bytecode::Interpreter&) const; - DeprecatedString to_string_impl(Bytecode::Executable const&) const; + DeprecatedString to_deprecated_string_impl(Bytecode::Executable const&) const; void replace_references_impl(BasicBlock const&, BasicBlock const&) { } void replace_references_impl(Register, Register) { } @@ -773,7 +773,7 @@ public: } ThrowCompletionOr execute_impl(Bytecode::Interpreter&) const; - DeprecatedString to_string_impl(Bytecode::Executable const&) const; + DeprecatedString to_deprecated_string_impl(Bytecode::Executable const&) const; void replace_references_impl(BasicBlock const&, BasicBlock const&) { } void replace_references_impl(Register, Register) { } }; @@ -786,7 +786,7 @@ public: } ThrowCompletionOr execute_impl(Bytecode::Interpreter&) const; - DeprecatedString to_string_impl(Bytecode::Executable const&) const; + DeprecatedString to_deprecated_string_impl(Bytecode::Executable const&) const; void replace_references_impl(BasicBlock const&, BasicBlock const&) { } void replace_references_impl(Register, Register) { } }; @@ -799,7 +799,7 @@ public: } ThrowCompletionOr execute_impl(Bytecode::Interpreter&) const; - DeprecatedString to_string_impl(Bytecode::Executable const&) const; + DeprecatedString to_deprecated_string_impl(Bytecode::Executable const&) const; void replace_references_impl(BasicBlock const&, BasicBlock const&) { } void replace_references_impl(Register, Register) { } }; @@ -814,7 +814,7 @@ public: } ThrowCompletionOr execute_impl(Bytecode::Interpreter&) const; - DeprecatedString to_string_impl(Bytecode::Executable const&) const; + DeprecatedString to_deprecated_string_impl(Bytecode::Executable const&) const; void replace_references_impl(BasicBlock const&, BasicBlock const&) { } void replace_references_impl(Register, Register) { } }; @@ -832,7 +832,7 @@ public: } ThrowCompletionOr execute_impl(Bytecode::Interpreter&) const; - DeprecatedString to_string_impl(Bytecode::Executable const&) const; + DeprecatedString to_deprecated_string_impl(Bytecode::Executable const&) const; void replace_references_impl(BasicBlock const&, BasicBlock const&); void replace_references_impl(Register, Register) { } @@ -855,7 +855,7 @@ public: } ThrowCompletionOr execute_impl(Bytecode::Interpreter&) const; - DeprecatedString to_string_impl(Bytecode::Executable const&) const; + DeprecatedString to_deprecated_string_impl(Bytecode::Executable const&) const; void replace_references_impl(BasicBlock const&, BasicBlock const&) { } void replace_references_impl(Register, Register) { } @@ -871,7 +871,7 @@ public: } ThrowCompletionOr execute_impl(Bytecode::Interpreter&) const; - DeprecatedString to_string_impl(Bytecode::Executable const&) const; + DeprecatedString to_deprecated_string_impl(Bytecode::Executable const&) const; void replace_references_impl(BasicBlock const&, BasicBlock const&) { } void replace_references_impl(Register, Register) { } }; @@ -887,7 +887,7 @@ public: } ThrowCompletionOr execute_impl(Bytecode::Interpreter&) const; - DeprecatedString to_string_impl(Bytecode::Executable const&) const; + DeprecatedString to_deprecated_string_impl(Bytecode::Executable const&) const; void replace_references_impl(BasicBlock const&, BasicBlock const&); void replace_references_impl(Register, Register) { } @@ -908,7 +908,7 @@ public: } ThrowCompletionOr execute_impl(Bytecode::Interpreter&) const; - DeprecatedString to_string_impl(Bytecode::Executable const&) const; + DeprecatedString to_deprecated_string_impl(Bytecode::Executable const&) const; void replace_references_impl(BasicBlock const&, BasicBlock const&); void replace_references_impl(Register, Register) { } @@ -934,7 +934,7 @@ public: } ThrowCompletionOr execute_impl(Bytecode::Interpreter&) const; - DeprecatedString to_string_impl(Bytecode::Executable const&) const; + DeprecatedString to_deprecated_string_impl(Bytecode::Executable const&) const; void replace_references_impl(BasicBlock const&, BasicBlock const&); void replace_references_impl(Register, Register) { } @@ -953,7 +953,7 @@ public: } ThrowCompletionOr execute_impl(Bytecode::Interpreter&) const; - DeprecatedString to_string_impl(Bytecode::Executable const&) const; + DeprecatedString to_deprecated_string_impl(Bytecode::Executable const&) const; void replace_references_impl(BasicBlock const&, BasicBlock const&) { } void replace_references_impl(Register, Register) { } @@ -969,7 +969,7 @@ public: } ThrowCompletionOr execute_impl(Bytecode::Interpreter&) const; - DeprecatedString to_string_impl(Bytecode::Executable const&) const; + DeprecatedString to_deprecated_string_impl(Bytecode::Executable const&) const; void replace_references_impl(BasicBlock const&, BasicBlock const&) { } void replace_references_impl(Register, Register) { } }; @@ -982,7 +982,7 @@ public: } ThrowCompletionOr execute_impl(Bytecode::Interpreter&) const; - DeprecatedString to_string_impl(Bytecode::Executable const&) const; + DeprecatedString to_deprecated_string_impl(Bytecode::Executable const&) const; void replace_references_impl(BasicBlock const&, BasicBlock const&) { } void replace_references_impl(Register, Register) { } }; @@ -995,7 +995,7 @@ public: } ThrowCompletionOr execute_impl(Bytecode::Interpreter&) const; - DeprecatedString to_string_impl(Bytecode::Executable const&) const; + DeprecatedString to_deprecated_string_impl(Bytecode::Executable const&) const; void replace_references_impl(BasicBlock const&, BasicBlock const&) { } void replace_references_impl(Register, Register) { } }; @@ -1008,7 +1008,7 @@ public: } ThrowCompletionOr execute_impl(Bytecode::Interpreter&) const; - DeprecatedString to_string_impl(Bytecode::Executable const&) const; + DeprecatedString to_deprecated_string_impl(Bytecode::Executable const&) const; void replace_references_impl(BasicBlock const&, BasicBlock const&) { } void replace_references_impl(Register, Register) { } }; @@ -1021,7 +1021,7 @@ public: } ThrowCompletionOr execute_impl(Bytecode::Interpreter&) const; - DeprecatedString to_string_impl(Bytecode::Executable const&) const; + DeprecatedString to_deprecated_string_impl(Bytecode::Executable const&) const; void replace_references_impl(BasicBlock const&, BasicBlock const&) { } void replace_references_impl(Register, Register) { } }; @@ -1034,7 +1034,7 @@ public: } ThrowCompletionOr execute_impl(Bytecode::Interpreter&) const; - DeprecatedString to_string_impl(Bytecode::Executable const&) const; + DeprecatedString to_deprecated_string_impl(Bytecode::Executable const&) const; void replace_references_impl(BasicBlock const&, BasicBlock const&) { } void replace_references_impl(Register, Register) { } }; @@ -1047,7 +1047,7 @@ public: } ThrowCompletionOr execute_impl(Bytecode::Interpreter&) const; - DeprecatedString to_string_impl(Bytecode::Executable const&) const; + DeprecatedString to_deprecated_string_impl(Bytecode::Executable const&) const; void replace_references_impl(BasicBlock const&, BasicBlock const&) { } void replace_references_impl(Register, Register) { } }; @@ -1061,7 +1061,7 @@ public: } ThrowCompletionOr execute_impl(Bytecode::Interpreter&) const; - DeprecatedString to_string_impl(Bytecode::Executable const&) const; + DeprecatedString to_deprecated_string_impl(Bytecode::Executable const&) const; void replace_references_impl(BasicBlock const&, BasicBlock const&) { } void replace_references_impl(Register, Register) { } diff --git a/Userland/Libraries/LibJS/Console.cpp b/Userland/Libraries/LibJS/Console.cpp index 0c4edd9483c..5a2fd1ce85f 100644 --- a/Userland/Libraries/LibJS/Console.cpp +++ b/Userland/Libraries/LibJS/Console.cpp @@ -107,7 +107,7 @@ ThrowCompletionOr Console::trace() StringBuilder builder; auto data = vm_arguments(); auto formatted_data = TRY(m_client->formatter(data)); - trace.label = TRY(value_vector_to_string(formatted_data)); + trace.label = TRY(value_vector_to_deprecated_string(formatted_data)); } // 3. Perform Printer("trace", « trace »). @@ -212,7 +212,7 @@ ThrowCompletionOr Console::assert_() // 3. Otherwise: else { // 1. Let concat be the concatenation of message, U+003A (:), U+0020 SPACE, and first. - auto concat = js_string(vm, DeprecatedString::formatted("{}: {}", message->string(), first.to_string(vm).value())); + auto concat = js_string(vm, DeprecatedString::formatted("{}: {}", message->deprecated_string(), first.to_string(vm).value())); // 2. Set data[0] to concat. data[0] = concat; } @@ -235,7 +235,7 @@ ThrowCompletionOr Console::group() auto data = vm_arguments(); if (!data.is_empty()) { auto formatted_data = TRY(m_client->formatter(data)); - group_label = TRY(value_vector_to_string(formatted_data)); + group_label = TRY(value_vector_to_deprecated_string(formatted_data)); } // ... Otherwise, let groupLabel be an implementation-chosen label representing a group. else { @@ -269,7 +269,7 @@ ThrowCompletionOr Console::group_collapsed() auto data = vm_arguments(); if (!data.is_empty()) { auto formatted_data = TRY(m_client->formatter(data)); - group_label = TRY(value_vector_to_string(formatted_data)); + group_label = TRY(value_vector_to_deprecated_string(formatted_data)); } // ... Otherwise, let groupLabel be an implementation-chosen label representing a group. else { @@ -457,7 +457,7 @@ void Console::report_exception(JS::Error const& exception, bool in_promise) cons m_client->report_exception(exception, in_promise); } -ThrowCompletionOr Console::value_vector_to_string(MarkedVector const& values) +ThrowCompletionOr Console::value_vector_to_deprecated_string(MarkedVector const& values) { auto& vm = realm().vm(); StringBuilder builder; @@ -466,7 +466,7 @@ ThrowCompletionOr Console::value_vector_to_string(MarkedVector builder.append(' '); builder.append(TRY(item.to_string(vm))); } - return builder.to_string(); + return builder.to_deprecated_string(); } ThrowCompletionOr Console::format_time_since(Core::ElapsedTimer timer) @@ -493,7 +493,7 @@ ThrowCompletionOr Console::format_time_since(Core::ElapsedTime append(builder, "{:.3} seconds"sv, combined_seconds); } - return builder.to_string(); + return builder.to_deprecated_string(); } // 2.1. Logger(logLevel, args), https://console.spec.whatwg.org/#logger diff --git a/Userland/Libraries/LibJS/Console.h b/Userland/Libraries/LibJS/Console.h index 3d4f3f65bf5..e8db5059c67 100644 --- a/Userland/Libraries/LibJS/Console.h +++ b/Userland/Libraries/LibJS/Console.h @@ -85,7 +85,7 @@ public: void report_exception(JS::Error const&, bool) const; private: - ThrowCompletionOr value_vector_to_string(MarkedVector const&); + ThrowCompletionOr value_vector_to_deprecated_string(MarkedVector const&); ThrowCompletionOr format_time_since(Core::ElapsedTimer timer); Realm& m_realm; diff --git a/Userland/Libraries/LibJS/Contrib/Test262/$262Object.cpp b/Userland/Libraries/LibJS/Contrib/Test262/$262Object.cpp index 41439b3ec8c..3691d034b55 100644 --- a/Userland/Libraries/LibJS/Contrib/Test262/$262Object.cpp +++ b/Userland/Libraries/LibJS/Contrib/Test262/$262Object.cpp @@ -97,7 +97,7 @@ JS_DEFINE_NATIVE_FUNCTION($262Object::eval_script) auto& error = script_or_error.error()[0]; // b. Return Completion { [[Type]]: throw, [[Value]]: error, [[Target]]: empty }. - return vm.throw_completion(error.to_string()); + return vm.throw_completion(error.to_deprecated_string()); } // 5. Let status be ScriptEvaluation(s). diff --git a/Userland/Libraries/LibJS/Contrib/Test262/IsHTMLDDA.cpp b/Userland/Libraries/LibJS/Contrib/Test262/IsHTMLDDA.cpp index c7fef161284..115972fbed5 100644 --- a/Userland/Libraries/LibJS/Contrib/Test262/IsHTMLDDA.cpp +++ b/Userland/Libraries/LibJS/Contrib/Test262/IsHTMLDDA.cpp @@ -20,7 +20,7 @@ ThrowCompletionOr IsHTMLDDA::call() auto& vm = this->vm(); if (vm.argument_count() == 0) return js_null(); - if (vm.argument(0).is_string() && vm.argument(0).as_string().string().is_empty()) + if (vm.argument(0).is_string() && vm.argument(0).as_string().deprecated_string().is_empty()) return js_null(); // Not sure if this really matters, INTERPRETING.md simply says: // * IsHTMLDDA - (present only in implementations that can provide it) an object that: diff --git a/Userland/Libraries/LibJS/MarkupGenerator.cpp b/Userland/Libraries/LibJS/MarkupGenerator.cpp index 07edc6ff062..38e73e3ea70 100644 --- a/Userland/Libraries/LibJS/MarkupGenerator.cpp +++ b/Userland/Libraries/LibJS/MarkupGenerator.cpp @@ -26,21 +26,21 @@ DeprecatedString MarkupGenerator::html_from_source(StringView source) builder.append(token.trivia()); builder.append(wrap_string_in_style(token.value(), style_type_for_token(token))); } - return builder.to_string(); + return builder.to_deprecated_string(); } DeprecatedString MarkupGenerator::html_from_value(Value value) { StringBuilder output_html; value_to_html(value, output_html); - return output_html.to_string(); + return output_html.to_deprecated_string(); } DeprecatedString MarkupGenerator::html_from_error(Error const& object, bool in_promise) { StringBuilder output_html; error_to_html(object, output_html, in_promise); - return output_html.to_string(); + return output_html.to_deprecated_string(); } void MarkupGenerator::value_to_html(Value value, StringBuilder& output_html, HashTable seen_objects) diff --git a/Userland/Libraries/LibJS/Parser.cpp b/Userland/Libraries/LibJS/Parser.cpp index 774fedb506e..bf5dfd21eab 100644 --- a/Userland/Libraries/LibJS/Parser.cpp +++ b/Userland/Libraries/LibJS/Parser.cpp @@ -1556,7 +1556,7 @@ NonnullRefPtr Parser::parse_regexp_literal() syntax_error(DeprecatedString::formatted("RegExp compile error: {}", Regex(parsed_regex, parsed_pattern, parsed_flags).error_string()), rule_start.position()); SourceRange range { m_source_code, rule_start.position(), position() }; - return create_ast_node(move(range), move(parsed_regex), move(parsed_pattern), move(parsed_flags), pattern.to_string(), move(flags)); + return create_ast_node(move(range), move(parsed_regex), move(parsed_pattern), move(parsed_flags), pattern.to_deprecated_string(), move(flags)); } static bool is_simple_assignment_target(Expression const& expression, bool allow_web_reality_call_expression = true) @@ -4104,7 +4104,7 @@ ModuleRequest Parser::parse_module_request() while (!done() && !match(TokenType::CurlyClose)) { DeprecatedString key; if (match(TokenType::StringLiteral)) { - key = parse_string_literal(m_state.current_token)->value().to_string(); + key = parse_string_literal(m_state.current_token)->value().to_deprecated_string(); consume(); } else if (match_identifier_name()) { key = consume().value(); @@ -4120,7 +4120,7 @@ ModuleRequest Parser::parse_module_request() if (entries.key == key) syntax_error(DeprecatedString::formatted("Duplicate assertion clauses with name: {}", key)); } - request.add_assertion(move(key), parse_string_literal(m_state.current_token)->value().to_string()); + request.add_assertion(move(key), parse_string_literal(m_state.current_token)->value().to_deprecated_string()); } consume(TokenType::StringLiteral); diff --git a/Userland/Libraries/LibJS/Parser.h b/Userland/Libraries/LibJS/Parser.h index c4cf00a0c0c..7fd192f5e68 100644 --- a/Userland/Libraries/LibJS/Parser.h +++ b/Userland/Libraries/LibJS/Parser.h @@ -184,7 +184,7 @@ public: if (!hint.is_empty()) warnln("{}", hint); } - warnln("SyntaxError: {}", error.to_string()); + warnln("SyntaxError: {}", error.to_deprecated_string()); } } diff --git a/Userland/Libraries/LibJS/ParserError.cpp b/Userland/Libraries/LibJS/ParserError.cpp index d8815245192..ae12e82d563 100644 --- a/Userland/Libraries/LibJS/ParserError.cpp +++ b/Userland/Libraries/LibJS/ParserError.cpp @@ -12,7 +12,7 @@ namespace JS { -DeprecatedString ParserError::to_string() const +DeprecatedString ParserError::to_deprecated_string() const { if (!position.has_value()) return message; diff --git a/Userland/Libraries/LibJS/ParserError.h b/Userland/Libraries/LibJS/ParserError.h index 5225ce46f91..3f5eefec7c1 100644 --- a/Userland/Libraries/LibJS/ParserError.h +++ b/Userland/Libraries/LibJS/ParserError.h @@ -17,7 +17,7 @@ struct ParserError { DeprecatedString message; Optional position; - DeprecatedString to_string() const; + DeprecatedString to_deprecated_string() const; DeprecatedString source_location_hint(StringView source, char const spacer = ' ', char const indicator = '^') const; }; diff --git a/Userland/Libraries/LibJS/Print.cpp b/Userland/Libraries/LibJS/Print.cpp index 85a695f2392..d9bd91fc562 100644 --- a/Userland/Libraries/LibJS/Print.cpp +++ b/Userland/Libraries/LibJS/Print.cpp @@ -82,7 +82,7 @@ DeprecatedString strip_ansi(StringView format_string) } if (i < format_string.length()) builder.append(format_string[i]); - return builder.to_string(); + return builder.to_deprecated_string(); } template diff --git a/Userland/Libraries/LibJS/Runtime/AbstractOperations.cpp b/Userland/Libraries/LibJS/Runtime/AbstractOperations.cpp index d3824857b29..e759ef3c502 100644 --- a/Userland/Libraries/LibJS/Runtime/AbstractOperations.cpp +++ b/Userland/Libraries/LibJS/Runtime/AbstractOperations.cpp @@ -575,13 +575,13 @@ ThrowCompletionOr perform_eval(VM& vm, Value x, CallerMode strict_caller, .in_class_field_initializer = in_class_field_initializer, }; - Parser parser { Lexer { code_string.string() }, Program::Type::Script, move(initial_state) }; + Parser parser { Lexer { code_string.deprecated_string() }, Program::Type::Script, move(initial_state) }; auto program = parser.parse_program(strict_caller == CallerMode::Strict); // b. If script is a List of errors, throw a SyntaxError exception. if (parser.has_errors()) { auto& error = parser.errors()[0]; - return vm.throw_completion(error.to_string()); + return vm.throw_completion(error.to_deprecated_string()); } bool strict_eval = false; @@ -683,7 +683,7 @@ ThrowCompletionOr perform_eval(VM& vm, Value x, CallerMode strict_caller, if (auto* bytecode_interpreter = Bytecode::Interpreter::current()) { auto executable_result = Bytecode::Generator::generate(program); if (executable_result.is_error()) - return vm.throw_completion(ErrorType::NotImplemented, executable_result.error().to_string()); + return vm.throw_completion(ErrorType::NotImplemented, executable_result.error().to_deprecated_string()); auto executable = executable_result.release_value(); executable->name = "eval"sv; diff --git a/Userland/Libraries/LibJS/Runtime/ArrayPrototype.cpp b/Userland/Libraries/LibJS/Runtime/ArrayPrototype.cpp index d9eb4357d98..cfb05f7fa3b 100644 --- a/Userland/Libraries/LibJS/Runtime/ArrayPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/ArrayPrototype.cpp @@ -1012,7 +1012,7 @@ JS_DEFINE_NATIVE_FUNCTION(ArrayPrototype::join) builder.append(string); } - return js_string(vm, builder.to_string()); + return js_string(vm, builder.to_deprecated_string()); } // 23.1.3.19 Array.prototype.keys ( ), https://tc39.es/ecma262/#sec-array.prototype.keys @@ -1743,7 +1743,7 @@ JS_DEFINE_NATIVE_FUNCTION(ArrayPrototype::to_locale_string) } // 7. Return R. - return js_string(vm, builder.to_string()); + return js_string(vm, builder.to_deprecated_string()); } // 1.1.1.4 Array.prototype.toReversed ( ), https://tc39.es/proposal-change-array-by-copy/#sec-array.prototype.toReversed diff --git a/Userland/Libraries/LibJS/Runtime/BigInt.h b/Userland/Libraries/LibJS/Runtime/BigInt.h index 73bdf27871e..8c58a58df67 100644 --- a/Userland/Libraries/LibJS/Runtime/BigInt.h +++ b/Userland/Libraries/LibJS/Runtime/BigInt.h @@ -19,7 +19,7 @@ public: virtual ~BigInt() override = default; Crypto::SignedBigInteger const& big_integer() const { return m_big_integer; } - const DeprecatedString to_string() const { return DeprecatedString::formatted("{}n", m_big_integer.to_base(10)); } + const DeprecatedString to_deprecated_string() const { return DeprecatedString::formatted("{}n", m_big_integer.to_base(10)); } private: explicit BigInt(Crypto::SignedBigInteger); diff --git a/Userland/Libraries/LibJS/Runtime/DateConstructor.cpp b/Userland/Libraries/LibJS/Runtime/DateConstructor.cpp index 7a8ac037a10..5e5a00a9919 100644 --- a/Userland/Libraries/LibJS/Runtime/DateConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/DateConstructor.cpp @@ -239,7 +239,7 @@ ThrowCompletionOr DateConstructor::construct(FunctionObject& new_target if (primitive.is_string()) { // 1. Assert: The next step never returns an abrupt completion because Type(v) is String. // 2. Let tv be the result of parsing v as a date, in exactly the same manner as for the parse method (21.4.3.2). - time_value = parse_date_string(primitive.as_string().string()); + time_value = parse_date_string(primitive.as_string().deprecated_string()); } // iii. Else, else { diff --git a/Userland/Libraries/LibJS/Runtime/DatePrototype.cpp b/Userland/Libraries/LibJS/Runtime/DatePrototype.cpp index c4f9365c018..627454334eb 100644 --- a/Userland/Libraries/LibJS/Runtime/DatePrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/DatePrototype.cpp @@ -1258,7 +1258,7 @@ JS_DEFINE_NATIVE_FUNCTION(DatePrototype::symbol_to_primitive) auto hint_value = vm.argument(0); if (!hint_value.is_string()) return vm.throw_completion(ErrorType::InvalidHint, hint_value.to_string_without_side_effects()); - auto& hint = hint_value.as_string().string(); + auto& hint = hint_value.as_string().deprecated_string(); Value::PreferredType try_first; if (hint == "string" || hint == "default") try_first = Value::PreferredType::String; diff --git a/Userland/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.cpp b/Userland/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.cpp index 1bccffefc5a..becb8b684e6 100644 --- a/Userland/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.cpp @@ -810,7 +810,7 @@ Completion ECMAScriptFunctionObject::ordinary_call_evaluate_body() auto compile = [&](auto& node, auto kind, auto name) -> ThrowCompletionOr> { auto executable_result = Bytecode::Generator::generate(node, kind); if (executable_result.is_error()) - return vm.throw_completion(ErrorType::NotImplemented, executable_result.error().to_string()); + return vm.throw_completion(ErrorType::NotImplemented, executable_result.error().to_deprecated_string()); auto bytecode_executable = executable_result.release_value(); bytecode_executable->name = name; diff --git a/Userland/Libraries/LibJS/Runtime/FunctionConstructor.cpp b/Userland/Libraries/LibJS/Runtime/FunctionConstructor.cpp index 5eaaf26763b..c3afc3947d3 100644 --- a/Userland/Libraries/LibJS/Runtime/FunctionConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/FunctionConstructor.cpp @@ -176,7 +176,7 @@ ThrowCompletionOr FunctionConstructor::create_dynamic // 17. If parameters is a List of errors, throw a SyntaxError exception. if (parameters_parser.has_errors()) { auto error = parameters_parser.errors()[0]; - return vm.throw_completion(error.to_string()); + return vm.throw_completion(error.to_deprecated_string()); } // 18. Let body be ParseText(StringToCodePoints(bodyString), bodySym). @@ -193,7 +193,7 @@ ThrowCompletionOr FunctionConstructor::create_dynamic // 19. If body is a List of errors, throw a SyntaxError exception. if (body_parser.has_errors()) { auto error = body_parser.errors()[0]; - return vm.throw_completion(error.to_string()); + return vm.throw_completion(error.to_deprecated_string()); } // 20. NOTE: The parameters and body are parsed separately to ensure that each is valid alone. For example, new Function("/*", "*/ ) {") is not legal. @@ -207,7 +207,7 @@ ThrowCompletionOr FunctionConstructor::create_dynamic // 23. If expr is a List of errors, throw a SyntaxError exception. if (source_parser.has_errors()) { auto error = source_parser.errors()[0]; - return vm.throw_completion(error.to_string()); + return vm.throw_completion(error.to_deprecated_string()); } // 24. Let proto be ? GetPrototypeFromConstructor(newTarget, fallbackProto). diff --git a/Userland/Libraries/LibJS/Runtime/Intl/AbstractOperations.cpp b/Userland/Libraries/LibJS/Runtime/Intl/AbstractOperations.cpp index c70fed0ef58..c418d1215c2 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/AbstractOperations.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/AbstractOperations.cpp @@ -306,7 +306,7 @@ static MatcherResult lookup_matcher(Vector const& requested_lo // a. Let noExtensionsLocale be the String value that is locale with any Unicode locale extension sequences removed. auto extensions = locale_id->remove_extension_type<::Locale::LocaleExtension>(); - auto no_extensions_locale = locale_id->to_string(); + auto no_extensions_locale = locale_id->to_deprecated_string(); // b. Let availableLocale be ! BestAvailableLocale(availableLocales, noExtensionsLocale). auto available_locale = best_available_locale(no_extensions_locale); @@ -383,7 +383,7 @@ LocaleResult resolve_locale(Vector const& requested_locales, L MatcherResult matcher_result; // 2. If matcher is "lookup", then - if (matcher.is_string() && (matcher.as_string().string() == "lookup"sv)) { + if (matcher.is_string() && (matcher.as_string().deprecated_string() == "lookup"sv)) { // a. Let r be ! LookupMatcher(availableLocales, requestedLocales). matcher_result = lookup_matcher(requested_locales); } @@ -538,7 +538,7 @@ Vector lookup_supported_locales(Vector const // a. Let noExtensionsLocale be the String value that is locale with any Unicode locale extension sequences removed. locale_id->remove_extension_type<::Locale::LocaleExtension>(); - auto no_extensions_locale = locale_id->to_string(); + auto no_extensions_locale = locale_id->to_deprecated_string(); // b. Let availableLocale be ! BestAvailableLocale(availableLocales, noExtensionsLocale). auto available_locale = best_available_locale(no_extensions_locale); @@ -578,7 +578,7 @@ ThrowCompletionOr supported_locales(VM& vm, Vector con Vector supported_locales; // 3. If matcher is "best fit", then - if (matcher.as_string().string() == "best fit"sv) { + if (matcher.as_string().deprecated_string() == "best fit"sv) { // a. Let supportedLocales be BestFitSupportedLocales(availableLocales, requestedLocales). supported_locales = best_fit_supported_locales(requested_locales); } diff --git a/Userland/Libraries/LibJS/Runtime/Intl/CollatorConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Intl/CollatorConstructor.cpp index 93baa46ba15..9240f0e8fa5 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/CollatorConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/CollatorConstructor.cpp @@ -27,7 +27,7 @@ static ThrowCompletionOr initialize_collator(VM& vm, Collator& collat auto usage = TRY(get_option(vm, *options, vm.names.usage, OptionType::String, { "sort"sv, "search"sv }, "sort"sv)); // 4. Set collator.[[Usage]] to usage. - collator.set_usage(usage.as_string().string()); + collator.set_usage(usage.as_string().deprecated_string()); // 5. If usage is "sort", then // a. Let localeData be %Collator%.[[SortLocaleData]]. @@ -49,11 +49,11 @@ static ThrowCompletionOr initialize_collator(VM& vm, Collator& collat // 11. If collation is not undefined, then if (!collation.is_undefined()) { // a. If collation does not match the Unicode Locale Identifier type nonterminal, throw a RangeError exception. - if (!::Locale::is_type_identifier(collation.as_string().string())) + if (!::Locale::is_type_identifier(collation.as_string().deprecated_string())) return vm.throw_completion(ErrorType::OptionIsNotValidValue, collation, "collation"sv); // 12. Set opt.[[co]] to collation. - opt.co = collation.as_string().string(); + opt.co = collation.as_string().deprecated_string(); } // 13. Let numeric be ? GetOption(options, "numeric", "boolean", undefined, undefined). @@ -69,7 +69,7 @@ static ThrowCompletionOr initialize_collator(VM& vm, Collator& collat // 17. Set opt.[[kf]] to caseFirst. auto case_first = TRY(get_option(vm, *options, vm.names.caseFirst, OptionType::String, { "upper"sv, "lower"sv, "false"sv }, Empty {})); if (!case_first.is_undefined()) - opt.kf = case_first.as_string().string(); + opt.kf = case_first.as_string().deprecated_string(); // 18. Let relevantExtensionKeys be %Collator%.[[RelevantExtensionKeys]]. auto relevant_extension_keys = Collator::relevant_extension_keys(); @@ -117,7 +117,7 @@ static ThrowCompletionOr initialize_collator(VM& vm, Collator& collat } // 28. Set collator.[[Sensitivity]] to sensitivity. - collator.set_sensitivity(sensitivity.as_string().string()); + collator.set_sensitivity(sensitivity.as_string().deprecated_string()); // 29. Let ignorePunctuation be ? GetOption(options, "ignorePunctuation", "boolean", undefined, false). auto ignore_punctuation = TRY(get_option(vm, *options, vm.names.ignorePunctuation, OptionType::Boolean, {}, false)); diff --git a/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatConstructor.cpp index 63e6ed52de4..5e85043ac87 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatConstructor.cpp @@ -106,11 +106,11 @@ ThrowCompletionOr initialize_date_time_format(VM& vm, DateTimeF // 7. If calendar is not undefined, then if (!calendar.is_undefined()) { // a. If calendar does not match the Unicode Locale Identifier type nonterminal, throw a RangeError exception. - if (!::Locale::is_type_identifier(calendar.as_string().string())) + if (!::Locale::is_type_identifier(calendar.as_string().deprecated_string())) return vm.throw_completion(ErrorType::OptionIsNotValidValue, calendar, "calendar"sv); // 8. Set opt.[[ca]] to calendar. - opt.ca = calendar.as_string().string(); + opt.ca = calendar.as_string().deprecated_string(); } // 9. Let numberingSystem be ? GetOption(options, "numberingSystem", "string", undefined, undefined). @@ -119,11 +119,11 @@ ThrowCompletionOr initialize_date_time_format(VM& vm, DateTimeF // 10. If numberingSystem is not undefined, then if (!numbering_system.is_undefined()) { // a. If numberingSystem does not match the Unicode Locale Identifier type nonterminal, throw a RangeError exception. - if (!::Locale::is_type_identifier(numbering_system.as_string().string())) + if (!::Locale::is_type_identifier(numbering_system.as_string().deprecated_string())) return vm.throw_completion(ErrorType::OptionIsNotValidValue, numbering_system, "numberingSystem"sv); // 11. Set opt.[[nu]] to numberingSystem. - opt.nu = numbering_system.as_string().string(); + opt.nu = numbering_system.as_string().deprecated_string(); } // 12. Let hour12 be ? GetOption(options, "hour12", "boolean", undefined, undefined). @@ -140,7 +140,7 @@ ThrowCompletionOr initialize_date_time_format(VM& vm, DateTimeF // 15. Set opt.[[hc]] to hourCycle. if (!hour_cycle.is_nullish()) - opt.hc = hour_cycle.as_string().string(); + opt.hc = hour_cycle.as_string().deprecated_string(); // 16. Let localeData be %DateTimeFormat%.[[LocaleData]]. // 17. Let r be ResolveLocale(%DateTimeFormat%.[[AvailableLocales]], requestedLocales, opt, %DateTimeFormat%.[[RelevantExtensionKeys]], localeData). @@ -275,7 +275,7 @@ ThrowCompletionOr initialize_date_time_format(VM& vm, DateTimeF // d. Set formatOptions.[[]] to value. if (!value.is_undefined()) { - option = ::Locale::calendar_pattern_style_from_string(value.as_string().string()); + option = ::Locale::calendar_pattern_style_from_string(value.as_string().deprecated_string()); // e. If value is not undefined, then // i. Set hasExplicitFormatComponents to true. @@ -294,14 +294,14 @@ ThrowCompletionOr initialize_date_time_format(VM& vm, DateTimeF // 39. Set dateTimeFormat.[[DateStyle]] to dateStyle. if (!date_style.is_undefined()) - date_time_format.set_date_style(date_style.as_string().string()); + date_time_format.set_date_style(date_style.as_string().deprecated_string()); // 40. Let timeStyle be ? GetOption(options, "timeStyle", "string", « "full", "long", "medium", "short" », undefined). auto time_style = TRY(get_option(vm, *options, vm.names.timeStyle, OptionType::String, AK::Array { "full"sv, "long"sv, "medium"sv, "short"sv }, Empty {})); // 41. Set dateTimeFormat.[[TimeStyle]] to timeStyle. if (!time_style.is_undefined()) - date_time_format.set_time_style(time_style.as_string().string()); + date_time_format.set_time_style(time_style.as_string().deprecated_string()); Optional<::Locale::CalendarPattern> best_format {}; @@ -323,7 +323,7 @@ ThrowCompletionOr initialize_date_time_format(VM& vm, DateTimeF auto formats = ::Locale::get_calendar_available_formats(data_locale, date_time_format.calendar()); // b. If matcher is "basic", then - if (matcher.as_string().string() == "basic"sv) { + if (matcher.as_string().deprecated_string() == "basic"sv) { // i. Let bestFormat be BasicFormatMatcher(formatOptions, formats). best_format = basic_format_matcher(format_options, move(formats)); } diff --git a/Userland/Libraries/LibJS/Runtime/Intl/DisplayNamesConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Intl/DisplayNamesConstructor.cpp index 167dcdb9fe5..89c9b950b20 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/DisplayNamesConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/DisplayNamesConstructor.cpp @@ -82,7 +82,7 @@ ThrowCompletionOr DisplayNamesConstructor::construct(FunctionObject& ne auto style = TRY(get_option(vm, *options, vm.names.style, OptionType::String, { "narrow"sv, "short"sv, "long"sv }, "long"sv)); // 12. Set displayNames.[[Style]] to style. - display_names->set_style(style.as_string().string()); + display_names->set_style(style.as_string().deprecated_string()); // 13. Let type be ? GetOption(options, "type", "string", « "language", "region", "script", "currency", "calendar", "dateTimeField" », undefined). auto type = TRY(get_option(vm, *options, vm.names.type, OptionType::String, { "language"sv, "region"sv, "script"sv, "currency"sv, "calendar"sv, "dateTimeField"sv }, Empty {})); @@ -92,13 +92,13 @@ ThrowCompletionOr DisplayNamesConstructor::construct(FunctionObject& ne return vm.throw_completion(ErrorType::IsUndefined, "options.type"sv); // 15. Set displayNames.[[Type]] to type. - display_names->set_type(type.as_string().string()); + display_names->set_type(type.as_string().deprecated_string()); // 16. Let fallback be ? GetOption(options, "fallback", "string", « "code", "none" », "code"). auto fallback = TRY(get_option(vm, *options, vm.names.fallback, OptionType::String, { "code"sv, "none"sv }, "code"sv)); // 17. Set displayNames.[[Fallback]] to fallback. - display_names->set_fallback(fallback.as_string().string()); + display_names->set_fallback(fallback.as_string().deprecated_string()); // 18. Set displayNames.[[Locale]] to r.[[locale]]. display_names->set_locale(move(result.locale)); @@ -119,7 +119,7 @@ ThrowCompletionOr DisplayNamesConstructor::construct(FunctionObject& ne // 26. If type is "language", then if (display_names->type() == DisplayNames::Type::Language) { // a. Set displayNames.[[LanguageDisplay]] to languageDisplay. - display_names->set_language_display(language_display.as_string().string()); + display_names->set_language_display(language_display.as_string().deprecated_string()); // b. Let typeFields be typeFields.[[]]. // c. Assert: typeFields is a Record (see 12.4.3). diff --git a/Userland/Libraries/LibJS/Runtime/Intl/DisplayNamesPrototype.cpp b/Userland/Libraries/LibJS/Runtime/Intl/DisplayNamesPrototype.cpp index d88c6d33369..a0fd0bf7afe 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/DisplayNamesPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/DisplayNamesPrototype.cpp @@ -47,7 +47,7 @@ JS_DEFINE_NATIVE_FUNCTION(DisplayNamesPrototype::of) code = js_string(vm, move(code_string)); // 4. Let code be ? CanonicalCodeForDisplayNames(displayNames.[[Type]], code). - code = TRY(canonical_code_for_display_names(vm, display_names->type(), code.as_string().string())); + code = TRY(canonical_code_for_display_names(vm, display_names->type(), code.as_string().deprecated_string())); // 5. Let fields be displayNames.[[Fields]]. // 6. If fields has a field [[]], return fields.[[]]. @@ -57,48 +57,48 @@ JS_DEFINE_NATIVE_FUNCTION(DisplayNamesPrototype::of) switch (display_names->type()) { case DisplayNames::Type::Language: if (display_names->language_display() == DisplayNames::LanguageDisplay::Dialect) { - result = ::Locale::get_locale_language_mapping(display_names->locale(), code.as_string().string()); + result = ::Locale::get_locale_language_mapping(display_names->locale(), code.as_string().deprecated_string()); if (result.has_value()) break; } - if (auto locale = is_structurally_valid_language_tag(code.as_string().string()); locale.has_value()) + if (auto locale = is_structurally_valid_language_tag(code.as_string().deprecated_string()); locale.has_value()) formatted_result = ::Locale::format_locale_for_display(display_names->locale(), locale.release_value()); break; case DisplayNames::Type::Region: - result = ::Locale::get_locale_territory_mapping(display_names->locale(), code.as_string().string()); + result = ::Locale::get_locale_territory_mapping(display_names->locale(), code.as_string().deprecated_string()); break; case DisplayNames::Type::Script: - result = ::Locale::get_locale_script_mapping(display_names->locale(), code.as_string().string()); + result = ::Locale::get_locale_script_mapping(display_names->locale(), code.as_string().deprecated_string()); break; case DisplayNames::Type::Currency: switch (display_names->style()) { case ::Locale::Style::Long: - result = ::Locale::get_locale_long_currency_mapping(display_names->locale(), code.as_string().string()); + result = ::Locale::get_locale_long_currency_mapping(display_names->locale(), code.as_string().deprecated_string()); break; case ::Locale::Style::Short: - result = ::Locale::get_locale_short_currency_mapping(display_names->locale(), code.as_string().string()); + result = ::Locale::get_locale_short_currency_mapping(display_names->locale(), code.as_string().deprecated_string()); break; case ::Locale::Style::Narrow: - result = ::Locale::get_locale_narrow_currency_mapping(display_names->locale(), code.as_string().string()); + result = ::Locale::get_locale_narrow_currency_mapping(display_names->locale(), code.as_string().deprecated_string()); break; default: VERIFY_NOT_REACHED(); } break; case DisplayNames::Type::Calendar: - result = ::Locale::get_locale_calendar_mapping(display_names->locale(), code.as_string().string()); + result = ::Locale::get_locale_calendar_mapping(display_names->locale(), code.as_string().deprecated_string()); break; case DisplayNames::Type::DateTimeField: switch (display_names->style()) { case ::Locale::Style::Long: - result = ::Locale::get_locale_long_date_field_mapping(display_names->locale(), code.as_string().string()); + result = ::Locale::get_locale_long_date_field_mapping(display_names->locale(), code.as_string().deprecated_string()); break; case ::Locale::Style::Short: - result = ::Locale::get_locale_short_date_field_mapping(display_names->locale(), code.as_string().string()); + result = ::Locale::get_locale_short_date_field_mapping(display_names->locale(), code.as_string().deprecated_string()); break; case ::Locale::Style::Narrow: - result = ::Locale::get_locale_narrow_date_field_mapping(display_names->locale(), code.as_string().string()); + result = ::Locale::get_locale_narrow_date_field_mapping(display_names->locale(), code.as_string().deprecated_string()); break; default: VERIFY_NOT_REACHED(); diff --git a/Userland/Libraries/LibJS/Runtime/Intl/DurationFormat.cpp b/Userland/Libraries/LibJS/Runtime/Intl/DurationFormat.cpp index 7c6f32337e6..ce8b24b665c 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/DurationFormat.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/DurationFormat.cpp @@ -272,7 +272,7 @@ ThrowCompletionOr get_duration_unit_options(VM& vm, Depreca } } } else { - style = style_value.as_string().string(); + style = style_value.as_string().deprecated_string(); } // 4. Let displayField be the string-concatenation of unit and "Display". @@ -296,7 +296,7 @@ ThrowCompletionOr get_duration_unit_options(VM& vm, Depreca } // 7. Return the Record { [[Style]]: style, [[Display]]: display }. - return DurationUnitOptions { .style = move(style), .display = display.as_string().string() }; + return DurationUnitOptions { .style = move(style), .display = display.as_string().deprecated_string() }; } // 1.1.7 PartitionDurationFormatPattern ( durationFormat, duration ), https://tc39.es/proposal-intl-duration-format/#sec-partitiondurationformatpattern diff --git a/Userland/Libraries/LibJS/Runtime/Intl/DurationFormatConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Intl/DurationFormatConstructor.cpp index 02459a4c6fc..d86535bf5ad 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/DurationFormatConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/DurationFormatConstructor.cpp @@ -67,14 +67,14 @@ ThrowCompletionOr DurationFormatConstructor::construct(FunctionObject& // 7. If numberingSystem is not undefined, then if (!numbering_system.is_undefined()) { // a. If numberingSystem does not match the Unicode Locale Identifier type nonterminal, throw a RangeError exception. - if (!::Locale::is_type_identifier(numbering_system.as_string().string())) + if (!::Locale::is_type_identifier(numbering_system.as_string().deprecated_string())) return vm.throw_completion(ErrorType::OptionIsNotValidValue, numbering_system, "numberingSystem"sv); } // 8. Let opt be the Record { [[localeMatcher]]: matcher, [[nu]]: numberingSystem }. LocaleOptions opt {}; opt.locale_matcher = matcher; - opt.nu = numbering_system.is_undefined() ? Optional() : numbering_system.as_string().string(); + opt.nu = numbering_system.is_undefined() ? Optional() : numbering_system.as_string().deprecated_string(); // 9. Let r be ResolveLocale(%DurationFormat%.[[AvailableLocales]], requestedLocales, opt, %DurationFormat%.[[RelevantExtensionKeys]], %DurationFormat%.[[LocaleData]]). auto result = resolve_locale(requested_locales, opt, DurationFormat::relevant_extension_keys()); @@ -93,7 +93,7 @@ ThrowCompletionOr DurationFormatConstructor::construct(FunctionObject& auto style = TRY(get_option(vm, *options, vm.names.style, OptionType::String, { "long"sv, "short"sv, "narrow"sv, "digital"sv }, "short"sv)); // 14. Set durationFormat.[[Style]] to style. - duration_format->set_style(style.as_string().string()); + duration_format->set_style(style.as_string().deprecated_string()); // 15. Set durationFormat.[[DataLocale]] to r.[[dataLocale]]. duration_format->set_data_locale(move(result.data_locale)); @@ -119,7 +119,7 @@ ThrowCompletionOr DurationFormatConstructor::construct(FunctionObject& auto digital_base = duration_instances_component.digital_default; // f. Let unitOptions be ? GetDurationUnitOptions(unit, options, style, valueList, digitalBase, prevStyle). - auto unit_options = TRY(get_duration_unit_options(vm, unit, *options, style.as_string().string(), value_list, digital_base, previous_style)); + auto unit_options = TRY(get_duration_unit_options(vm, unit, *options, style.as_string().deprecated_string(), value_list, digital_base, previous_style)); // g. Set the value of the styleSlot slot of durationFormat to unitOptions.[[Style]]. (duration_format->*style_slot)(unit_options.style); diff --git a/Userland/Libraries/LibJS/Runtime/Intl/ListFormat.cpp b/Userland/Libraries/LibJS/Runtime/Intl/ListFormat.cpp index bad9f2e087e..fed856a4949 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/ListFormat.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/ListFormat.cpp @@ -274,7 +274,7 @@ ThrowCompletionOr> string_list_from_iterable(VM& vm, Va } // iii. Append nextValue to the end of the List list. - list.append(next_value.as_string().string()); + list.append(next_value.as_string().deprecated_string()); } } while (next != nullptr); diff --git a/Userland/Libraries/LibJS/Runtime/Intl/ListFormatConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Intl/ListFormatConstructor.cpp index 0e6246d054c..92146931699 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/ListFormatConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/ListFormatConstructor.cpp @@ -80,13 +80,13 @@ ThrowCompletionOr ListFormatConstructor::construct(FunctionObject& new_ auto type = TRY(get_option(vm, *options, vm.names.type, OptionType::String, { "conjunction"sv, "disjunction"sv, "unit"sv }, "conjunction"sv)); // 12. Set listFormat.[[Type]] to type. - list_format->set_type(type.as_string().string()); + list_format->set_type(type.as_string().deprecated_string()); // 13. Let style be ? GetOption(options, "style", "string", « "long", "short", "narrow" », "long"). auto style = TRY(get_option(vm, *options, vm.names.style, OptionType::String, { "long"sv, "short"sv, "narrow"sv }, "long"sv)); // 14. Set listFormat.[[Style]] to style. - list_format->set_style(style.as_string().string()); + list_format->set_style(style.as_string().deprecated_string()); // Note: The remaining steps are skipped in favor of deferring to LibUnicode. diff --git a/Userland/Libraries/LibJS/Runtime/Intl/Locale.cpp b/Userland/Libraries/LibJS/Runtime/Intl/Locale.cpp index a685623fcb4..a63486c79b1 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/Locale.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/Locale.cpp @@ -28,7 +28,7 @@ Locale::Locale(Object& prototype) Locale::Locale(::Locale::LocaleID const& locale_id, Object& prototype) : Object(prototype) { - set_locale(locale_id.to_string()); + set_locale(locale_id.to_deprecated_string()); for (auto const& extension : locale_id.extensions) { if (!extension.has<::Locale::LocaleExtension>()) diff --git a/Userland/Libraries/LibJS/Runtime/Intl/LocaleConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Intl/LocaleConstructor.cpp index 9b076369738..d86b9e4d23d 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/LocaleConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/LocaleConstructor.cpp @@ -33,10 +33,10 @@ static ThrowCompletionOr> get_string_option(VM& vm, O if (option.is_undefined()) return Optional {}; - if (validator && !validator(option.as_string().string())) + if (validator && !validator(option.as_string().deprecated_string())) return vm.throw_completion(ErrorType::OptionIsNotValidValue, option, property); - return option.as_string().string(); + return option.as_string().deprecated_string(); } // 14.1.2 ApplyOptionsToTag ( tag, options ), https://tc39.es/ecma402/#sec-apply-options-to-tag @@ -198,7 +198,7 @@ static LocaleAndKeys apply_unicode_extension_to_tag(StringView tag, LocaleAndKey // 7. Let locale be the String value that is tag with any Unicode locale extension sequences removed. locale_id->remove_extension_type<::Locale::LocaleExtension>(); - auto locale = locale_id->to_string(); + auto locale = locale_id->to_deprecated_string(); // 8. Let newExtension be a Unicode BCP 47 U Extension based on attributes and keywords. ::Locale::LocaleExtension new_extension { move(attributes), move(keywords) }; diff --git a/Userland/Libraries/LibJS/Runtime/Intl/LocalePrototype.cpp b/Userland/Libraries/LibJS/Runtime/Intl/LocalePrototype.cpp index 9e57070227d..b9d217e6b97 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/LocalePrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/LocalePrototype.cpp @@ -115,7 +115,7 @@ JS_DEFINE_NATIVE_FUNCTION(LocalePrototype::base_name) VERIFY(locale.has_value()); // 4. Return the substring of locale corresponding to the unicode_language_id production. - return js_string(vm, locale->language_id.to_string()); + return js_string(vm, locale->language_id.to_deprecated_string()); } #define JS_ENUMERATE_LOCALE_KEYWORD_PROPERTIES \ diff --git a/Userland/Libraries/LibJS/Runtime/Intl/MathematicalValue.cpp b/Userland/Libraries/LibJS/Runtime/Intl/MathematicalValue.cpp index ab254b1c0ee..8cfc51906c3 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/MathematicalValue.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/MathematicalValue.cpp @@ -293,7 +293,7 @@ bool MathematicalValue::is_zero() const [](auto) { return false; }); } -DeprecatedString MathematicalValue::to_string() const +DeprecatedString MathematicalValue::to_deprecated_string() const { return m_value.visit( [](double value) { return number_to_string(value, NumberToStringMode::WithoutExponent); }, diff --git a/Userland/Libraries/LibJS/Runtime/Intl/MathematicalValue.h b/Userland/Libraries/LibJS/Runtime/Intl/MathematicalValue.h index 25436c290f4..bbef224db42 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/MathematicalValue.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/MathematicalValue.h @@ -87,7 +87,7 @@ public: bool is_positive() const; bool is_zero() const; - DeprecatedString to_string() const; + DeprecatedString to_deprecated_string() const; Value to_value(VM&) const; private: diff --git a/Userland/Libraries/LibJS/Runtime/Intl/NumberFormat.cpp b/Userland/Libraries/LibJS/Runtime/Intl/NumberFormat.cpp index e66e20525a2..786cfe85089 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/NumberFormat.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/NumberFormat.cpp @@ -960,7 +960,7 @@ static DeprecatedString cut_trailing_zeroes(StringView string, int cut) string = string.substring_view(0, string.length() - 1); } - return string.to_string(); + return string.to_deprecated_string(); } enum class PreferredResult { @@ -996,7 +996,7 @@ static auto to_raw_precision_function(MathematicalValue const& number, int preci result.number = number.divided_by_power(result.exponent - precision); // FIXME: Can we do this without string conversion? - auto digits = result.number.to_string(); + auto digits = result.number.to_deprecated_string(); auto digit = digits.substring_view(digits.length() - 1); result.number = result.number.divided_by(10); @@ -1067,7 +1067,7 @@ RawFormatResult to_raw_precision(MathematicalValue const& number, int min_precis } // f. Let m be the String consisting of the digits of the decimal representation of n (in order, with no leading zeroes). - result.formatted_string = n.to_string(); + result.formatted_string = n.to_deprecated_string(); } // 4. If e ≥ p–1, then @@ -1144,7 +1144,7 @@ static auto to_raw_fixed_function(MathematicalValue const& number, int fraction, result.number = number.multiplied_by_power(fraction - 1); // FIXME: Can we do this without string conversion? - auto digits = result.number.to_string(); + auto digits = result.number.to_deprecated_string(); auto digit = digits.substring_view(digits.length() - 1); result.number = result.number.multiplied_by(10); @@ -1206,7 +1206,7 @@ RawFormatResult to_raw_fixed(MathematicalValue const& number, int min_fraction, } // 7. If n = 0, let m be "0". Otherwise, let m be the String consisting of the digits of the decimal representation of n (in order, with no leading zeroes). - result.formatted_string = n.is_zero() ? DeprecatedString("0"sv) : n.to_string(); + result.formatted_string = n.is_zero() ? DeprecatedString("0"sv) : n.to_deprecated_string(); // 8. If f ≠ 0, then if (fraction != 0) { @@ -1592,7 +1592,7 @@ ThrowCompletionOr to_intl_mathematical_value(VM& vm, Value va // 3. If Type(primValue) is String, // a. Let str be primValue. - auto const& string = primitive_value.as_string().string(); + auto const& string = primitive_value.as_string().deprecated_string(); // Step 4 handled separately by the FIXME above. diff --git a/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatConstructor.cpp index d791c4d140e..269c6763ba0 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatConstructor.cpp @@ -103,11 +103,11 @@ ThrowCompletionOr initialize_number_format(VM& vm, NumberFormat& // 7. If numberingSystem is not undefined, then if (!numbering_system.is_undefined()) { // a. If numberingSystem does not match the Unicode Locale Identifier type nonterminal, throw a RangeError exception. - if (!::Locale::is_type_identifier(numbering_system.as_string().string())) + if (!::Locale::is_type_identifier(numbering_system.as_string().deprecated_string())) return vm.throw_completion(ErrorType::OptionIsNotValidValue, numbering_system, "numberingSystem"sv); // 8. Set opt.[[nu]] to numberingSystem. - opt.nu = numbering_system.as_string().string(); + opt.nu = numbering_system.as_string().deprecated_string(); } // 9. Let localeData be %NumberFormat%.[[LocaleData]]. @@ -176,7 +176,7 @@ ThrowCompletionOr initialize_number_format(VM& vm, NumberFormat& auto notation = TRY(get_option(vm, *options, vm.names.notation, OptionType::String, { "standard"sv, "scientific"sv, "engineering"sv, "compact"sv }, "standard"sv)); // 22. Set numberFormat.[[Notation]] to notation. - number_format.set_notation(notation.as_string().string()); + number_format.set_notation(notation.as_string().deprecated_string()); // 23. Perform ? SetNumberFormatDigitOptions(numberFormat, options, mnfdDefault, mxfdDefault, notation). TRY(set_number_format_digit_options(vm, number_format, *options, default_min_fraction_digits, default_max_fraction_digits, number_format.notation())); @@ -199,7 +199,7 @@ ThrowCompletionOr initialize_number_format(VM& vm, NumberFormat& auto trailing_zero_display = TRY(get_option(vm, *options, vm.names.trailingZeroDisplay, OptionType::String, { "auto"sv, "stripIfInteger"sv }, "auto"sv)); // 27. Set numberFormat.[[TrailingZeroDisplay]] to trailingZeroDisplay. - number_format.set_trailing_zero_display(trailing_zero_display.as_string().string()); + number_format.set_trailing_zero_display(trailing_zero_display.as_string().deprecated_string()); // 28. Let compactDisplay be ? GetOption(options, "compactDisplay", "string", « "short", "long" », "short"). auto compact_display = TRY(get_option(vm, *options, vm.names.compactDisplay, OptionType::String, { "short"sv, "long"sv }, "short"sv)); @@ -210,7 +210,7 @@ ThrowCompletionOr initialize_number_format(VM& vm, NumberFormat& // 30. If notation is "compact", then if (number_format.notation() == NumberFormat::Notation::Compact) { // a. Set numberFormat.[[CompactDisplay]] to compactDisplay. - number_format.set_compact_display(compact_display.as_string().string()); + number_format.set_compact_display(compact_display.as_string().deprecated_string()); // b. Set defaultUseGrouping to "min2". default_use_grouping = "min2"sv; @@ -226,13 +226,13 @@ ThrowCompletionOr initialize_number_format(VM& vm, NumberFormat& auto sign_display = TRY(get_option(vm, *options, vm.names.signDisplay, OptionType::String, { "auto"sv, "never"sv, "always"sv, "exceptZero"sv, "negative"sv }, "auto"sv)); // 34. Set numberFormat.[[SignDisplay]] to signDisplay. - number_format.set_sign_display(sign_display.as_string().string()); + number_format.set_sign_display(sign_display.as_string().deprecated_string()); // 35. Let roundingMode be ? GetOption(options, "roundingMode", "string", « "ceil", "floor", "expand", "trunc", "halfCeil", "halfFloor", "halfExpand", "halfTrunc", "halfEven" », "halfExpand"). auto rounding_mode = TRY(get_option(vm, *options, vm.names.roundingMode, OptionType::String, { "ceil"sv, "floor"sv, "expand"sv, "trunc"sv, "halfCeil"sv, "halfFloor"sv, "halfExpand"sv, "halfTrunc"sv, "halfEven"sv }, "halfExpand"sv)); // 36. Set numberFormat.[[RoundingMode]] to roundingMode. - number_format.set_rounding_mode(rounding_mode.as_string().string()); + number_format.set_rounding_mode(rounding_mode.as_string().deprecated_string()); // 37. Return numberFormat. return &number_format; @@ -282,7 +282,7 @@ ThrowCompletionOr set_number_format_digit_options(VM& vm, NumberFormatBase bool need_fraction_digits = true; // 14. If roundingPriority is "auto", then - if (rounding_priority.as_string().string() == "auto"sv) { + if (rounding_priority.as_string().deprecated_string() == "auto"sv) { // a. Set needSd to hasSd. need_significant_digits = has_significant_digits; @@ -358,12 +358,12 @@ ThrowCompletionOr set_number_format_digit_options(VM& vm, NumberFormatBase // 17. If needSd is true or needFd is true, then if (need_significant_digits || need_fraction_digits) { // a. If roundingPriority is "morePrecision", then - if (rounding_priority.as_string().string() == "morePrecision"sv) { + if (rounding_priority.as_string().deprecated_string() == "morePrecision"sv) { // i. Set intlObj.[[RoundingType]] to morePrecision. intl_object.set_rounding_type(NumberFormatBase::RoundingType::MorePrecision); } // b. Else if roundingPriority is "lessPrecision", then - else if (rounding_priority.as_string().string() == "lessPrecision"sv) { + else if (rounding_priority.as_string().deprecated_string() == "lessPrecision"sv) { // i. Set intlObj.[[RoundingType]] to lessPrecision. intl_object.set_rounding_type(NumberFormatBase::RoundingType::LessPrecision); } @@ -410,7 +410,7 @@ ThrowCompletionOr set_number_format_unit_options(VM& vm, NumberFormat& int auto style = TRY(get_option(vm, options, vm.names.style, OptionType::String, { "decimal"sv, "percent"sv, "currency"sv, "unit"sv }, "decimal"sv)); // 4. Set intlObj.[[Style]] to style. - intl_object.set_style(style.as_string().string()); + intl_object.set_style(style.as_string().deprecated_string()); // 5. Let currency be ? GetOption(options, "currency", "string", undefined, undefined). auto currency = TRY(get_option(vm, options, vm.names.currency, OptionType::String, {}, Empty {})); @@ -423,7 +423,7 @@ ThrowCompletionOr set_number_format_unit_options(VM& vm, NumberFormat& int } // 7. Else, // a. If ! IsWellFormedCurrencyCode(currency) is false, throw a RangeError exception. - else if (!is_well_formed_currency_code(currency.as_string().string())) + else if (!is_well_formed_currency_code(currency.as_string().deprecated_string())) return vm.throw_completion(ErrorType::OptionIsNotValidValue, currency, "currency"sv); // 8. Let currencyDisplay be ? GetOption(options, "currencyDisplay", "string", « "code", "symbol", "narrowSymbol", "name" », "symbol"). @@ -443,7 +443,7 @@ ThrowCompletionOr set_number_format_unit_options(VM& vm, NumberFormat& int } // 12. Else, // a. If ! IsWellFormedUnitIdentifier(unit) is false, throw a RangeError exception. - else if (!is_well_formed_unit_identifier(unit.as_string().string())) + else if (!is_well_formed_unit_identifier(unit.as_string().deprecated_string())) return vm.throw_completion(ErrorType::OptionIsNotValidValue, unit, "unit"sv); // 13. Let unitDisplay be ? GetOption(options, "unitDisplay", "string", « "short", "narrow", "long" », "short"). @@ -452,22 +452,22 @@ ThrowCompletionOr set_number_format_unit_options(VM& vm, NumberFormat& int // 14. If style is "currency", then if (intl_object.style() == NumberFormat::Style::Currency) { // a. Set intlObj.[[Currency]] to the ASCII-uppercase of currency. - intl_object.set_currency(currency.as_string().string().to_uppercase()); + intl_object.set_currency(currency.as_string().deprecated_string().to_uppercase()); // c. Set intlObj.[[CurrencyDisplay]] to currencyDisplay. - intl_object.set_currency_display(currency_display.as_string().string()); + intl_object.set_currency_display(currency_display.as_string().deprecated_string()); // d. Set intlObj.[[CurrencySign]] to currencySign. - intl_object.set_currency_sign(currency_sign.as_string().string()); + intl_object.set_currency_sign(currency_sign.as_string().deprecated_string()); } // 15. If style is "unit", then if (intl_object.style() == NumberFormat::Style::Unit) { // a. Set intlObj.[[Unit]] to unit. - intl_object.set_unit(unit.as_string().string()); + intl_object.set_unit(unit.as_string().deprecated_string()); // b. Set intlObj.[[UnitDisplay]] to unitDisplay. - intl_object.set_unit_display(unit_display.as_string().string()); + intl_object.set_unit_display(unit_display.as_string().deprecated_string()); } return {}; diff --git a/Userland/Libraries/LibJS/Runtime/Intl/PluralRulesConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Intl/PluralRulesConstructor.cpp index 3b598ff3f29..8585aca319d 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/PluralRulesConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/PluralRulesConstructor.cpp @@ -94,7 +94,7 @@ ThrowCompletionOr initialize_plural_rules(VM& vm, PluralRules& plu auto type = TRY(get_option(vm, *options, vm.names.type, OptionType::String, AK::Array { "cardinal"sv, "ordinal"sv }, "cardinal"sv)); // 7. Set pluralRules.[[Type]] to t. - plural_rules.set_type(type.as_string().string()); + plural_rules.set_type(type.as_string().deprecated_string()); // 8. Perform ? SetNumberFormatDigitOptions(pluralRules, options, +0𝔽, 3𝔽, "standard"). TRY(set_number_format_digit_options(vm, plural_rules, *options, 0, 3, NumberFormat::Notation::Standard)); diff --git a/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormat.cpp b/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormat.cpp index f8184567c13..248782ebdee 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormat.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormat.cpp @@ -148,7 +148,7 @@ ThrowCompletionOr> partition_relative_time_patt VERIFY(patterns.size() == 1); // i. Let result be patterns.[[]]. - auto result = patterns[0].pattern.to_string(); + auto result = patterns[0].pattern.to_deprecated_string(); // ii. Return a List containing the Record { [[Type]]: "literal", [[Value]]: result }. return Vector { { "literal"sv, move(result) } }; diff --git a/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormatConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormatConstructor.cpp index c3626ad4aec..8a2731b6881 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormatConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormatConstructor.cpp @@ -101,11 +101,11 @@ ThrowCompletionOr initialize_relative_time_format(VM& vm, R // 7. If numberingSystem is not undefined, then if (!numbering_system.is_undefined()) { // a. If numberingSystem does not match the Unicode Locale Identifier type nonterminal, throw a RangeError exception. - if (!::Locale::is_type_identifier(numbering_system.as_string().string())) + if (!::Locale::is_type_identifier(numbering_system.as_string().deprecated_string())) return vm.throw_completion(ErrorType::OptionIsNotValidValue, numbering_system, "numberingSystem"sv); // 8. Set opt.[[nu]] to numberingSystem. - opt.nu = numbering_system.as_string().string(); + opt.nu = numbering_system.as_string().deprecated_string(); } // 9. Let localeData be %RelativeTimeFormat%.[[LocaleData]]. @@ -129,13 +129,13 @@ ThrowCompletionOr initialize_relative_time_format(VM& vm, R auto style = TRY(get_option(vm, *options, vm.names.style, OptionType::String, { "long"sv, "short"sv, "narrow"sv }, "long"sv)); // 16. Set relativeTimeFormat.[[Style]] to style. - relative_time_format.set_style(style.as_string().string()); + relative_time_format.set_style(style.as_string().deprecated_string()); // 17. Let numeric be ? GetOption(options, "numeric", "string", « "always", "auto" », "always"). auto numeric = TRY(get_option(vm, *options, vm.names.numeric, OptionType::String, { "always"sv, "auto"sv }, "always"sv)); // 18. Set relativeTimeFormat.[[Numeric]] to numeric. - relative_time_format.set_numeric(numeric.as_string().string()); + relative_time_format.set_numeric(numeric.as_string().deprecated_string()); // 19. Let relativeTimeFormat.[[NumberFormat]] be ! Construct(%NumberFormat%, « locale »). auto* number_format = MUST(construct(vm, *realm.intrinsics().intl_number_format_constructor(), js_string(vm, locale))); diff --git a/Userland/Libraries/LibJS/Runtime/Intl/SegmenterConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Intl/SegmenterConstructor.cpp index e38c0ba4724..8c9583987d5 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/SegmenterConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/SegmenterConstructor.cpp @@ -80,7 +80,7 @@ ThrowCompletionOr SegmenterConstructor::construct(FunctionObject& new_t auto granularity = TRY(get_option(vm, *options, vm.names.granularity, OptionType::String, { "grapheme"sv, "word"sv, "sentence"sv }, "grapheme"sv)); // 13. Set segmenter.[[SegmenterGranularity]] to granularity. - segmenter->set_segmenter_granularity(granularity.as_string().string()); + segmenter->set_segmenter_granularity(granularity.as_string().deprecated_string()); // 14. Return segmenter. return segmenter; diff --git a/Userland/Libraries/LibJS/Runtime/JSONObject.cpp b/Userland/Libraries/LibJS/Runtime/JSONObject.cpp index 138a4ed5067..3f59ebf9428 100644 --- a/Userland/Libraries/LibJS/Runtime/JSONObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/JSONObject.cpp @@ -63,7 +63,7 @@ ThrowCompletionOr JSONObject::stringify_impl(VM& vm, Value val auto replacer_value = TRY(replacer_object.get(i)); DeprecatedString item; if (replacer_value.is_string()) { - item = replacer_value.as_string().string(); + item = replacer_value.as_string().deprecated_string(); } else if (replacer_value.is_number()) { item = MUST(replacer_value.to_string(vm)); } else if (replacer_value.is_object()) { @@ -93,7 +93,7 @@ ThrowCompletionOr JSONObject::stringify_impl(VM& vm, Value val space_mv = min(10, space_mv); state.gap = space_mv < 1 ? DeprecatedString::empty() : DeprecatedString::repeated(' ', space_mv); } else if (space.is_string()) { - auto string = space.as_string().string(); + auto string = space.as_string().deprecated_string(); if (string.length() <= 10) state.gap = string; else @@ -185,7 +185,7 @@ ThrowCompletionOr JSONObject::serialize_json_property(VM& vm, // 8. If Type(value) is String, return QuoteJSONString(value). if (value.is_string()) - return quote_json_string(value.as_string().string()); + return quote_json_string(value.as_string().deprecated_string()); // 9. If Type(value) is Number, then if (value.is_number()) { @@ -250,7 +250,7 @@ ThrowCompletionOr JSONObject::serialize_json_object(VM& vm, St } else { auto property_list = TRY(object.enumerable_own_property_names(PropertyKind::Key)); for (auto& property : property_list) - TRY(process_property(property.as_string().string())); + TRY(process_property(property.as_string().deprecated_string())); } StringBuilder builder; if (property_strings.is_empty()) { @@ -283,7 +283,7 @@ ThrowCompletionOr JSONObject::serialize_json_object(VM& vm, St state.seen_objects.remove(&object); state.indent = previous_indent; - return builder.to_string(); + return builder.to_deprecated_string(); } // 25.5.2.5 SerializeJSONArray ( state, value ), https://tc39.es/ecma262/#sec-serializejsonarray @@ -344,7 +344,7 @@ ThrowCompletionOr JSONObject::serialize_json_array(VM& vm, Str state.seen_objects.remove(&object); state.indent = previous_indent; - return builder.to_string(); + return builder.to_deprecated_string(); } // 25.5.2.2 QuoteJSONString ( value ), https://tc39.es/ecma262/#sec-quotejsonstring @@ -385,7 +385,7 @@ DeprecatedString JSONObject::quote_json_string(DeprecatedString string) } } builder.append('"'); - return builder.to_string(); + return builder.to_deprecated_string(); } // 25.5.1 JSON.parse ( text [ , reviver ] ), https://tc39.es/ecma262/#sec-json.parse @@ -422,7 +422,7 @@ Value JSONObject::parse_json_value(VM& vm, JsonValue const& value) if (value.is_number()) return Value(value.to_double(0)); if (value.is_string()) - return js_string(vm, value.to_string()); + return js_string(vm, value.to_deprecated_string()); if (value.is_bool()) return Value(static_cast(value.as_bool())); VERIFY_NOT_REACHED(); @@ -473,7 +473,7 @@ ThrowCompletionOr JSONObject::internalize_json_property(VM& vm, Object* h } else { auto property_list = TRY(value_object.enumerable_own_property_names(Object::PropertyKind::Key)); for (auto& property_key : property_list) - TRY(process_property(property_key.as_string().string())); + TRY(process_property(property_key.as_string().deprecated_string())); } } diff --git a/Userland/Libraries/LibJS/Runtime/Object.cpp b/Userland/Libraries/LibJS/Runtime/Object.cpp index 714c539ea30..a193aa3a2db 100644 --- a/Userland/Libraries/LibJS/Runtime/Object.cpp +++ b/Userland/Libraries/LibJS/Runtime/Object.cpp @@ -1246,7 +1246,7 @@ Optional Object::enumerate_object_properties(Functioninternal_get_own_property(property_key)); diff --git a/Userland/Libraries/LibJS/Runtime/ObjectPrototype.cpp b/Userland/Libraries/LibJS/Runtime/ObjectPrototype.cpp index cb7b30fa3d2..ba4a0eb7c64 100644 --- a/Userland/Libraries/LibJS/Runtime/ObjectPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/ObjectPrototype.cpp @@ -125,7 +125,7 @@ JS_DEFINE_NATIVE_FUNCTION(ObjectPrototype::to_string) if (!to_string_tag.is_string()) tag = move(builtin_tag); else - tag = to_string_tag.as_string().string(); + tag = to_string_tag.as_string().deprecated_string(); // 17. Return the string-concatenation of "[object ", tag, and "]". return js_string(vm, DeprecatedString::formatted("[object {}]", tag)); diff --git a/Userland/Libraries/LibJS/Runtime/PrimitiveString.cpp b/Userland/Libraries/LibJS/Runtime/PrimitiveString.cpp index b2be26ac9d8..51f4a1f7567 100644 --- a/Userland/Libraries/LibJS/Runtime/PrimitiveString.cpp +++ b/Userland/Libraries/LibJS/Runtime/PrimitiveString.cpp @@ -63,7 +63,7 @@ bool PrimitiveString::is_empty() const VERIFY_NOT_REACHED(); } -DeprecatedString const& PrimitiveString::string() const +DeprecatedString const& PrimitiveString::deprecated_string() const { resolve_rope_if_needed(); if (!m_has_utf8_string) { @@ -234,21 +234,21 @@ void PrimitiveString::resolve_rope_if_needed() const for (auto const* current : pieces) { if (!previous) { // This is the very first piece, just append it and continue. - builder.append(current->string()); + builder.append(current->deprecated_string()); previous = current; continue; } // Get the UTF-8 representations for both strings. - auto const& previous_string_as_utf8 = previous->string(); - auto const& current_string_as_utf8 = current->string(); + auto const& previous_string_as_utf8 = previous->deprecated_string(); + auto const& current_string_as_utf8 = current->deprecated_string(); // NOTE: Now we need to look at the end of the previous string and the start // of the current string, to see if they should be combined into a surrogate. // Surrogates encoded as UTF-8 are 3 bytes. if ((previous_string_as_utf8.length() < 3) || (current_string_as_utf8.length() < 3)) { - builder.append(current->string()); + builder.append(current->deprecated_string()); previous = current; continue; } @@ -256,7 +256,7 @@ void PrimitiveString::resolve_rope_if_needed() const // Might the previous string end with a UTF-8 encoded surrogate? if ((static_cast(previous_string_as_utf8[previous_string_as_utf8.length() - 3]) & 0xf0) != 0xe0) { // If not, just append the current string and continue. - builder.append(current->string()); + builder.append(current->deprecated_string()); previous = current; continue; } @@ -264,7 +264,7 @@ void PrimitiveString::resolve_rope_if_needed() const // Might the current string begin with a UTF-8 encoded surrogate? if ((static_cast(current_string_as_utf8[0]) & 0xf0) != 0xe0) { // If not, just append the current string and continue. - builder.append(current->string()); + builder.append(current->deprecated_string()); previous = current; continue; } @@ -273,7 +273,7 @@ void PrimitiveString::resolve_rope_if_needed() const auto low_surrogate = *Utf8View(current_string_as_utf8).begin(); if (!Utf16View::is_high_surrogate(high_surrogate) || !Utf16View::is_low_surrogate(low_surrogate)) { - builder.append(current->string()); + builder.append(current->deprecated_string()); previous = current; continue; } @@ -287,7 +287,7 @@ void PrimitiveString::resolve_rope_if_needed() const previous = current; } - m_utf8_string = builder.to_string(); + m_utf8_string = builder.to_deprecated_string(); m_has_utf8_string = true; m_is_rope = false; m_lhs = nullptr; diff --git a/Userland/Libraries/LibJS/Runtime/PrimitiveString.h b/Userland/Libraries/LibJS/Runtime/PrimitiveString.h index 469b79edac3..0cd9ad8a620 100644 --- a/Userland/Libraries/LibJS/Runtime/PrimitiveString.h +++ b/Userland/Libraries/LibJS/Runtime/PrimitiveString.h @@ -26,7 +26,7 @@ public: bool is_empty() const; - DeprecatedString const& string() const; + DeprecatedString const& deprecated_string() const; bool has_utf8_string() const { return m_has_utf8_string; } Utf16String const& utf16_string() const; diff --git a/Userland/Libraries/LibJS/Runtime/Reference.cpp b/Userland/Libraries/LibJS/Runtime/Reference.cpp index 77a6446eac9..908150a019c 100644 --- a/Userland/Libraries/LibJS/Runtime/Reference.cpp +++ b/Userland/Libraries/LibJS/Runtime/Reference.cpp @@ -194,7 +194,7 @@ ThrowCompletionOr Reference::delete_(VM& vm) return m_base_environment->delete_binding(vm, m_name.as_string()); } -DeprecatedString Reference::to_string() const +DeprecatedString Reference::to_deprecated_string() const { StringBuilder builder; builder.append("Reference { Base="sv); @@ -216,7 +216,7 @@ DeprecatedString Reference::to_string() const if (!m_name.is_valid()) builder.append(""sv); else if (m_name.is_symbol()) - builder.appendff("{}", m_name.as_symbol()->to_string()); + builder.appendff("{}", m_name.as_symbol()->to_deprecated_string()); else builder.appendff("{}", m_name.to_string()); builder.appendff(", Strict={}", m_strict); @@ -227,7 +227,7 @@ DeprecatedString Reference::to_string() const builder.appendff("{}", m_this_value.to_string_without_side_effects()); builder.append(" }"sv); - return builder.to_string(); + return builder.to_deprecated_string(); } // 6.2.4.8 InitializeReferencedBinding ( V, W ), https://tc39.es/ecma262/#sec-object.prototype.hasownproperty diff --git a/Userland/Libraries/LibJS/Runtime/Reference.h b/Userland/Libraries/LibJS/Runtime/Reference.h index f7e6aa0bf22..10c19fc04b6 100644 --- a/Userland/Libraries/LibJS/Runtime/Reference.h +++ b/Userland/Libraries/LibJS/Runtime/Reference.h @@ -127,7 +127,7 @@ public: ThrowCompletionOr get_value(VM&) const; ThrowCompletionOr delete_(VM&); - DeprecatedString to_string() const; + DeprecatedString to_deprecated_string() const; bool is_valid_reference() const { return m_name.is_valid() || m_is_private; } diff --git a/Userland/Libraries/LibJS/Runtime/RegExpPrototype.cpp b/Userland/Libraries/LibJS/Runtime/RegExpPrototype.cpp index c7ec95085e0..677fb0a7e5d 100644 --- a/Userland/Libraries/LibJS/Runtime/RegExpPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/RegExpPrototype.cpp @@ -510,7 +510,7 @@ JS_DEFINE_NATIVE_FUNCTION(RegExpPrototype::flags) #undef __JS_ENUMERATE // 18. Return result. - return js_string(vm, builder.to_string()); + return js_string(vm, builder.to_deprecated_string()); } // 22.2.5.8 RegExp.prototype [ @@match ] ( string ), https://tc39.es/ecma262/#sec-regexp.prototype-@@match diff --git a/Userland/Libraries/LibJS/Runtime/ShadowRealm.cpp b/Userland/Libraries/LibJS/Runtime/ShadowRealm.cpp index 9db09517f69..b7cafea214b 100644 --- a/Userland/Libraries/LibJS/Runtime/ShadowRealm.cpp +++ b/Userland/Libraries/LibJS/Runtime/ShadowRealm.cpp @@ -86,7 +86,7 @@ ThrowCompletionOr copy_name_and_length(VM& vm, FunctionObject& function, F target_name = js_string(vm, DeprecatedString::empty()); // 8. Perform SetFunctionName(F, targetName, prefix). - function.set_function_name({ target_name.as_string().string() }, move(prefix)); + function.set_function_name({ target_name.as_string().deprecated_string() }, move(prefix)); return {}; } @@ -107,7 +107,7 @@ ThrowCompletionOr perform_shadow_realm_eval(VM& vm, StringView source_tex // b. If script is a List of errors, throw a SyntaxError exception. if (parser.has_errors()) { auto& error = parser.errors()[0]; - return vm.throw_completion(error.to_string()); + return vm.throw_completion(error.to_deprecated_string()); } // c. If script Contains ScriptBody is false, return undefined. @@ -272,7 +272,7 @@ ThrowCompletionOr shadow_realm_import_value(VM& vm, DeprecatedString spec // NOTE: Even though the spec tells us to use %ThrowTypeError%, it's not observable if we actually do. // Throw a nicer TypeError forwarding the import error message instead (we know the argument is an Error object). auto* throw_type_error = NativeFunction::create(realm, {}, [](auto& vm) -> ThrowCompletionOr { - return vm.template throw_completion(vm.argument(0).as_object().get_without_side_effects(vm.names.message).as_string().string()); + return vm.template throw_completion(vm.argument(0).as_object().get_without_side_effects(vm.names.message).as_string().deprecated_string()); }); // 13. Return PerformPromiseThen(innerCapability.[[Promise]], onFulfilled, callerRealm.[[Intrinsics]].[[%ThrowTypeError%]], promiseCapability). diff --git a/Userland/Libraries/LibJS/Runtime/ShadowRealmPrototype.cpp b/Userland/Libraries/LibJS/Runtime/ShadowRealmPrototype.cpp index 7a510e9a71a..9025b7197f5 100644 --- a/Userland/Libraries/LibJS/Runtime/ShadowRealmPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/ShadowRealmPrototype.cpp @@ -49,7 +49,7 @@ JS_DEFINE_NATIVE_FUNCTION(ShadowRealmPrototype::evaluate) auto& eval_realm = object->shadow_realm(); // 6. Return ? PerformShadowRealmEval(sourceText, callerRealm, evalRealm). - return perform_shadow_realm_eval(vm, source_text.as_string().string(), *caller_realm, eval_realm); + return perform_shadow_realm_eval(vm, source_text.as_string().deprecated_string(), *caller_realm, eval_realm); } // 3.4.2 ShadowRealm.prototype.importValue ( specifier, exportName ), https://tc39.es/proposal-shadowrealm/#sec-shadowrealm.prototype.importvalue @@ -79,7 +79,7 @@ JS_DEFINE_NATIVE_FUNCTION(ShadowRealmPrototype::import_value) auto& eval_context = object->execution_context(); // 8. Return ? ShadowRealmImportValue(specifierString, exportNameString, callerRealm, evalRealm, evalContext). - return shadow_realm_import_value(vm, move(specifier_string), export_name.as_string().string(), *caller_realm, eval_realm, eval_context); + return shadow_realm_import_value(vm, move(specifier_string), export_name.as_string().deprecated_string(), *caller_realm, eval_realm, eval_context); } } diff --git a/Userland/Libraries/LibJS/Runtime/StringConstructor.cpp b/Userland/Libraries/LibJS/Runtime/StringConstructor.cpp index 13299a6197d..9526a764bc6 100644 --- a/Userland/Libraries/LibJS/Runtime/StringConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/StringConstructor.cpp @@ -45,7 +45,7 @@ ThrowCompletionOr StringConstructor::call() if (!vm.argument_count()) return js_string(heap(), ""); if (vm.argument(0).is_symbol()) - return js_string(vm, vm.argument(0).as_symbol().to_string()); + return js_string(vm, vm.argument(0).as_symbol().to_deprecated_string()); return TRY(vm.argument(0).to_primitive_string(vm)); } diff --git a/Userland/Libraries/LibJS/Runtime/StringIteratorPrototype.cpp b/Userland/Libraries/LibJS/Runtime/StringIteratorPrototype.cpp index 72386b10150..3f250daed4e 100644 --- a/Userland/Libraries/LibJS/Runtime/StringIteratorPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/StringIteratorPrototype.cpp @@ -46,7 +46,7 @@ JS_DEFINE_NATIVE_FUNCTION(StringIteratorPrototype::next) builder.append_code_point(*utf8_iterator); ++utf8_iterator; - return create_iterator_result_object(vm, js_string(vm, builder.to_string()), false); + return create_iterator_result_object(vm, js_string(vm, builder.to_deprecated_string()), false); } } diff --git a/Userland/Libraries/LibJS/Runtime/StringOrSymbol.h b/Userland/Libraries/LibJS/Runtime/StringOrSymbol.h index f6d41cacfa0..7e96e84fb43 100644 --- a/Userland/Libraries/LibJS/Runtime/StringOrSymbol.h +++ b/Userland/Libraries/LibJS/Runtime/StringOrSymbol.h @@ -79,7 +79,7 @@ public: if (is_string()) return as_string(); if (is_symbol()) - return as_symbol()->to_string(); + return as_symbol()->to_deprecated_string(); VERIFY_NOT_REACHED(); } diff --git a/Userland/Libraries/LibJS/Runtime/StringPrototype.cpp b/Userland/Libraries/LibJS/Runtime/StringPrototype.cpp index fbbc8bc3fe7..423b3b711d0 100644 --- a/Userland/Libraries/LibJS/Runtime/StringPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/StringPrototype.cpp @@ -578,7 +578,7 @@ JS_DEFINE_NATIVE_FUNCTION(StringPrototype::repeat) StringBuilder builder; for (size_t i = 0; i < n; ++i) builder.append(string); - return js_string(vm, builder.to_string()); + return js_string(vm, builder.to_deprecated_string()); } // 22.1.3.18 String.prototype.replace ( searchValue, replaceValue ), https://tc39.es/ecma262/#sec-string.prototype.replace @@ -897,7 +897,7 @@ static ThrowCompletionOr transform_case(VM& vm, StringView str // 4. Let noExtensionsLocale be the String value that is requestedLocale with any Unicode locale extension sequences (6.2.1) removed. requested_locale->remove_extension_type(); - auto no_extensions_locale = requested_locale->to_string(); + auto no_extensions_locale = requested_locale->to_deprecated_string(); // 5. Let availableLocales be a List with language tags that includes the languages for which the Unicode Character Database contains language sensitive case mappings. Implementations may add additional language tags if they support case mapping for additional locales. // 6. Let locale be ! BestAvailableLocale(availableLocales, noExtensionsLocale). diff --git a/Userland/Libraries/LibJS/Runtime/Symbol.h b/Userland/Libraries/LibJS/Runtime/Symbol.h index 3ff1c91f96c..f8fbb99247e 100644 --- a/Userland/Libraries/LibJS/Runtime/Symbol.h +++ b/Userland/Libraries/LibJS/Runtime/Symbol.h @@ -23,7 +23,7 @@ public: DeprecatedString description() const { return m_description.value_or(""); } Optional const& raw_description() const { return m_description; } bool is_global() const { return m_is_global; } - DeprecatedString to_string() const { return DeprecatedString::formatted("Symbol({})", description()); } + DeprecatedString to_deprecated_string() const { return DeprecatedString::formatted("Symbol({})", description()); } private: Symbol(Optional, bool); diff --git a/Userland/Libraries/LibJS/Runtime/SymbolPrototype.cpp b/Userland/Libraries/LibJS/Runtime/SymbolPrototype.cpp index 7e9b5748137..ae33feff44f 100644 --- a/Userland/Libraries/LibJS/Runtime/SymbolPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/SymbolPrototype.cpp @@ -61,7 +61,7 @@ JS_DEFINE_NATIVE_FUNCTION(SymbolPrototype::description_getter) JS_DEFINE_NATIVE_FUNCTION(SymbolPrototype::to_string) { auto* symbol = TRY(this_symbol_value(vm, vm.this_value())); - return js_string(vm, symbol->to_string()); + return js_string(vm, symbol->to_deprecated_string()); } // 20.4.3.4 Symbol.prototype.valueOf ( ), https://tc39.es/ecma262/#sec-symbol.prototype.valueof diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.cpp index af5f8fde258..430a98e44e2 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.cpp @@ -147,8 +147,8 @@ ThrowCompletionOr get_option(VM& vm, Object const& options, PropertyKey c if (!values.is_empty()) { // NOTE: Every location in the spec that invokes GetOption with type=boolean also has values=undefined. VERIFY(value.is_string()); - if (!values.contains_slow(value.as_string().string())) - return vm.throw_completion(ErrorType::OptionIsNotValidValue, value.as_string().string(), property.as_string()); + if (!values.contains_slow(value.as_string().deprecated_string())) + return vm.throw_completion(ErrorType::OptionIsNotValidValue, value.as_string().deprecated_string(), property.as_string()); } // 9. Return value. @@ -166,7 +166,7 @@ ThrowCompletionOr to_temporal_overflow(VM& vm, Object const* o auto option = TRY(get_option(vm, *options, vm.names.overflow, OptionType::String, { "constrain"sv, "reject"sv }, "constrain"sv)); VERIFY(option.is_string()); - return option.as_string().string(); + return option.as_string().deprecated_string(); } // 13.5 ToTemporalDisambiguation ( options ), https://tc39.es/proposal-temporal/#sec-temporal-totemporaldisambiguation @@ -180,7 +180,7 @@ ThrowCompletionOr to_temporal_disambiguation(VM& vm, Object co auto option = TRY(get_option(vm, *options, vm.names.disambiguation, OptionType::String, { "compatible"sv, "earlier"sv, "later"sv, "reject"sv }, "compatible"sv)); VERIFY(option.is_string()); - return option.as_string().string(); + return option.as_string().deprecated_string(); } // 13.6 ToTemporalRoundingMode ( normalizedOptions, fallback ), https://tc39.es/proposal-temporal/#sec-temporal-totemporalroundingmode @@ -203,7 +203,7 @@ ThrowCompletionOr to_temporal_rounding_mode(VM& vm, Object con fallback.view())); VERIFY(option.is_string()); - return option.as_string().string(); + return option.as_string().deprecated_string(); } // 13.7 NegateTemporalRoundingMode ( roundingMode ), https://tc39.es/proposal-temporal/#sec-temporal-negatetemporalroundingmode @@ -240,7 +240,7 @@ ThrowCompletionOr to_temporal_offset(VM& vm, Object const* opt auto option = TRY(get_option(vm, *options, vm.names.offset, OptionType::String, { "prefer"sv, "use"sv, "ignore"sv, "reject"sv }, fallback.view())); VERIFY(option.is_string()); - return option.as_string().string(); + return option.as_string().deprecated_string(); } // 13.9 ToCalendarNameOption ( normalizedOptions ), https://tc39.es/proposal-temporal/#sec-temporal-tocalendarnameoption @@ -250,7 +250,7 @@ ThrowCompletionOr to_calendar_name_option(VM& vm, Object const auto option = TRY(get_option(vm, normalized_options, vm.names.calendarName, OptionType::String, { "auto"sv, "always"sv, "never"sv, "critical"sv }, "auto"sv)); VERIFY(option.is_string()); - return option.as_string().string(); + return option.as_string().deprecated_string(); } // 13.10 ToTimeZoneNameOption ( normalizedOptions ), https://tc39.es/proposal-temporal/#sec-temporal-totimezonenameoption @@ -260,7 +260,7 @@ ThrowCompletionOr to_time_zone_name_option(VM& vm, Object cons auto option = TRY(get_option(vm, normalized_options, vm.names.timeZoneName, OptionType::String, { "auto"sv, "never"sv, "critical"sv }, "auto"sv)); VERIFY(option.is_string()); - return option.as_string().string(); + return option.as_string().deprecated_string(); } // 13.11 ToShowOffsetOption ( normalizedOptions ), https://tc39.es/proposal-temporal/#sec-temporal-toshowoffsetoption @@ -270,7 +270,7 @@ ThrowCompletionOr to_show_offset_option(VM& vm, Object const& auto option = TRY(get_option(vm, normalized_options, vm.names.offset, OptionType::String, { "auto"sv, "never"sv }, "auto"sv)); VERIFY(option.is_string()); - return option.as_string().string(); + return option.as_string().deprecated_string(); } // 13.12 ToTemporalRoundingIncrement ( normalizedOptions, dividend, inclusive ), https://tc39.es/proposal-temporal/#sec-temporal-totemporalroundingincrement @@ -531,7 +531,7 @@ ThrowCompletionOr> get_temporal_unit(VM& vm, Object c Optional value = option_value.is_undefined() ? Optional {} - : option_value.as_string().string(); + : option_value.as_string().deprecated_string(); // 11. If value is listed in the Plural column of Table 13, then for (auto const& row : temporal_units) { diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/Calendar.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/Calendar.cpp index 3d82029cdc9..25b4dcaf57d 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/Calendar.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/Calendar.cpp @@ -126,7 +126,7 @@ ThrowCompletionOr> calendar_fields(VM& vm, Object& cale Vector result; for (auto& value : list) - result.append(value.as_string().string()); + result.append(value.as_string().deprecated_string()); return result; } @@ -791,7 +791,7 @@ ThrowCompletionOr resolve_iso_month(VM& vm, Object const& fields) // 6. Assert: Type(monthCode) is String. VERIFY(month_code.is_string()); - auto& month_code_string = month_code.as_string().string(); + auto& month_code_string = month_code.as_string().deprecated_string(); // 7. If the length of monthCode is not 3, throw a RangeError exception. auto month_length = month_code_string.length(); @@ -953,7 +953,7 @@ ThrowCompletionOr default_merge_calendar_fields(VM& vm, Object const& f // 3. For each element key of fieldsKeys, do for (auto& key : fields_keys) { // a. If key is not "month" or "monthCode", then - if (key.as_string().string() != vm.names.month.as_string() && key.as_string().string() != vm.names.monthCode.as_string()) { + if (key.as_string().deprecated_string() != vm.names.month.as_string() && key.as_string().deprecated_string() != vm.names.monthCode.as_string()) { auto property_key = MUST(PropertyKey::from_value(vm, key)); // i. Let propValue be ? Get(fields, key). @@ -987,7 +987,7 @@ ThrowCompletionOr default_merge_calendar_fields(VM& vm, Object const& f } // See comment above. - additional_fields_keys_contains_month_or_month_code_property |= key.as_string().string() == vm.names.month.as_string() || key.as_string().string() == vm.names.monthCode.as_string(); + additional_fields_keys_contains_month_or_month_code_property |= key.as_string().deprecated_string() == vm.names.month.as_string() || key.as_string().deprecated_string() == vm.names.monthCode.as_string(); } // 6. If additionalFieldsKeys does not contain either "month" or "monthCode", then diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/CalendarPrototype.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/CalendarPrototype.cpp index 2ed6a5208d6..091fd039919 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/CalendarPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/CalendarPrototype.cpp @@ -537,16 +537,16 @@ JS_DEFINE_NATIVE_FUNCTION(CalendarPrototype::fields) // iii. If fieldNames contains nextValue, then if (field_names.contains_slow(next_value)) { // 1. Let completion be ThrowCompletion(a newly created RangeError object). - auto completion = vm.throw_completion(ErrorType::TemporalDuplicateCalendarField, next_value.as_string().string()); + auto completion = vm.throw_completion(ErrorType::TemporalDuplicateCalendarField, next_value.as_string().deprecated_string()); // 2. Return ? IteratorClose(iteratorRecord, completion). return TRY(iterator_close(vm, iterator_record, move(completion))); } // iv. If nextValue is not one of "year", "month", "monthCode", "day", "hour", "minute", "second", "millisecond", "microsecond", "nanosecond", then - if (!next_value.as_string().string().is_one_of("year"sv, "month"sv, "monthCode"sv, "day"sv, "hour"sv, "minute"sv, "second"sv, "millisecond"sv, "microsecond"sv, "nanosecond"sv)) { + if (!next_value.as_string().deprecated_string().is_one_of("year"sv, "month"sv, "monthCode"sv, "day"sv, "hour"sv, "minute"sv, "second"sv, "millisecond"sv, "microsecond"sv, "nanosecond"sv)) { // 1. Let completion be ThrowCompletion(a newly created RangeError object). - auto completion = vm.throw_completion(ErrorType::TemporalInvalidCalendarFieldName, next_value.as_string().string()); + auto completion = vm.throw_completion(ErrorType::TemporalInvalidCalendarFieldName, next_value.as_string().deprecated_string()); // 2. Return ? IteratorClose(iteratorRecord, completion). return TRY(iterator_close(vm, iterator_record, move(completion))); diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/Duration.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/Duration.cpp index 829938cfb6d..a67171b5a90 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/Duration.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/Duration.cpp @@ -1789,7 +1789,7 @@ DeprecatedString temporal_duration_to_string(double years, double months, double } // 20. Return result. - return result.to_string(); + return result.to_deprecated_string(); } // 7.5.28 AddDurationToOrSubtractDurationFromDuration ( operation, duration, other, options ), https://tc39.es/proposal-temporal/#sec-temporal-adddurationtoorsubtractdurationfromduration diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/TimeZone.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/TimeZone.cpp index dd662d45122..4b57afa5c0c 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/TimeZone.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/TimeZone.cpp @@ -259,7 +259,7 @@ DeprecatedString format_time_zone_offset_string(double offset_nanoseconds) // a. Let post be the empty String. // 14. Return the string-concatenation of sign, h, the code unit 0x003A (COLON), m, and post. - return builder.to_string(); + return builder.to_deprecated_string(); } // 11.6.6 FormatISOTimeZoneOffsetString ( offsetNanoseconds ), https://tc39.es/proposal-temporal/#sec-temporal-formatisotimezoneoffsetstring diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTimePrototype.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTimePrototype.cpp index 452d40ac90e..5b4fa31ec41 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTimePrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTimePrototype.cpp @@ -777,7 +777,7 @@ JS_DEFINE_NATIVE_FUNCTION(ZonedDateTimePrototype::with) // 18. Assert: Type(offsetString) is String. VERIFY(offset_string_value.is_string()); - auto const& offset_string = offset_string_value.as_string().string(); + auto const& offset_string = offset_string_value.as_string().deprecated_string(); // 19. Let dateTimeResult be ? InterpretTemporalDateTimeFields(calendar, fields, options). auto date_time_result = TRY(interpret_temporal_date_time_fields(vm, calendar, *fields, *options)); diff --git a/Userland/Libraries/LibJS/Runtime/TypedArrayPrototype.cpp b/Userland/Libraries/LibJS/Runtime/TypedArrayPrototype.cpp index acb6d96cd3b..185d3e22833 100644 --- a/Userland/Libraries/LibJS/Runtime/TypedArrayPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/TypedArrayPrototype.cpp @@ -780,7 +780,7 @@ JS_DEFINE_NATIVE_FUNCTION(TypedArrayPrototype::join) } // 9. Return R. - return js_string(vm, builder.to_string()); + return js_string(vm, builder.to_deprecated_string()); } // 23.2.3.19 %TypedArray%.prototype.keys ( ), https://tc39.es/ecma262/#sec-%typedarray%.prototype.keys @@ -1565,7 +1565,7 @@ JS_DEFINE_NATIVE_FUNCTION(TypedArrayPrototype::to_locale_string) } // 7. Return R. - return js_string(vm, builder.to_string()); + return js_string(vm, builder.to_deprecated_string()); } // 1.2.2.1.3 %TypedArray%.prototype.toReversed ( ), https://tc39.es/proposal-change-array-by-copy/#sec-%typedarray%.prototype.toReversed diff --git a/Userland/Libraries/LibJS/Runtime/VM.cpp b/Userland/Libraries/LibJS/Runtime/VM.cpp index c6aebf655fe..b69d05469e2 100644 --- a/Userland/Libraries/LibJS/Runtime/VM.cpp +++ b/Userland/Libraries/LibJS/Runtime/VM.cpp @@ -963,7 +963,7 @@ ThrowCompletionOr> VM::resolve_imported_module(ScriptOrModu if (module_or_errors.is_error()) { VERIFY(module_or_errors.error().size() > 0); - return throw_completion(module_or_errors.error().first().to_string()); + return throw_completion(module_or_errors.error().first().to_deprecated_string()); } return module_or_errors.release_value(); }()); diff --git a/Userland/Libraries/LibJS/Runtime/Value.cpp b/Userland/Libraries/LibJS/Runtime/Value.cpp index 2f4ffcdaf01..cd00c14e06d 100644 --- a/Userland/Libraries/LibJS/Runtime/Value.cpp +++ b/Userland/Libraries/LibJS/Runtime/Value.cpp @@ -153,7 +153,7 @@ DeprecatedString number_to_string(double d, NumberToStringMode mode) builder.append(mantissa_digits.data(), k); } - return builder.to_string(); + return builder.to_deprecated_string(); } // 7. NOTE: In this case, the input will be represented using scientific E notation, such as 1.2e+3. @@ -180,7 +180,7 @@ DeprecatedString number_to_string(double d, NumberToStringMode mode) // the code units of the decimal representation of abs(n - 1) builder.append(exponent_digits.data(), exponent_length); - return builder.to_string(); + return builder.to_deprecated_string(); } // 12. Return the string-concatenation of: @@ -197,7 +197,7 @@ DeprecatedString number_to_string(double d, NumberToStringMode mode) // the code units of the decimal representation of abs(n - 1) builder.append(exponent_digits.data(), exponent_length); - return builder.to_string(); + return builder.to_deprecated_string(); } // 7.2.2 IsArray ( argument ), https://tc39.es/ecma262/#sec-isarray @@ -315,11 +315,11 @@ DeprecatedString Value::to_string_without_side_effects() const case INT32_TAG: return DeprecatedString::number(as_i32()); case STRING_TAG: - return as_string().string(); + return as_string().deprecated_string(); case SYMBOL_TAG: - return as_symbol().to_string(); + return as_symbol().to_deprecated_string(); case BIGINT_TAG: - return as_bigint().to_string(); + return as_bigint().to_deprecated_string(); case OBJECT_TAG: return DeprecatedString::formatted("[object {}]", as_object().class_name()); case ACCESSOR_TAG: @@ -353,7 +353,7 @@ ThrowCompletionOr Value::to_string(VM& vm) const case INT32_TAG: return DeprecatedString::number(as_i32()); case STRING_TAG: - return as_string().string(); + return as_string().deprecated_string(); case SYMBOL_TAG: return vm.throw_completion(ErrorType::Convert, "symbol", "string"); case BIGINT_TAG: @@ -576,7 +576,7 @@ ThrowCompletionOr Value::to_number(VM& vm) const case BOOLEAN_TAG: return Value(as_bool() ? 1 : 0); case STRING_TAG: - return string_to_number(as_string().string().view()); + return string_to_number(as_string().deprecated_string().view()); case SYMBOL_TAG: return vm.throw_completion(ErrorType::Convert, "symbol", "number"); case BIGINT_TAG: @@ -614,7 +614,7 @@ ThrowCompletionOr Value::to_bigint(VM& vm) const return &primitive.as_bigint(); case STRING_TAG: { // 1. Let n be ! StringToBigInt(prim). - auto bigint = string_to_bigint(vm, primitive.as_string().string()); + auto bigint = string_to_bigint(vm, primitive.as_string().deprecated_string()); // 2. If n is undefined, throw a SyntaxError exception. if (!bigint.has_value()) @@ -1428,7 +1428,7 @@ bool same_value_non_numeric(Value lhs, Value rhs) VERIFY(same_type_for_equality(lhs, rhs)); if (lhs.is_string()) - return lhs.as_string().string() == rhs.as_string().string(); + return lhs.as_string().deprecated_string() == rhs.as_string().deprecated_string(); return lhs.m_value.encoded == rhs.m_value.encoded; } @@ -1491,7 +1491,7 @@ ThrowCompletionOr is_loosely_equal(VM& vm, Value lhs, Value rhs) // 7. If Type(x) is BigInt and Type(y) is String, then if (lhs.is_bigint() && rhs.is_string()) { // a. Let n be StringToBigInt(y). - auto bigint = string_to_bigint(vm, rhs.as_string().string()); + auto bigint = string_to_bigint(vm, rhs.as_string().deprecated_string()); // b. If n is undefined, return false. if (!bigint.has_value()) @@ -1562,8 +1562,8 @@ ThrowCompletionOr is_less_than(VM& vm, Value lhs, Value rhs, bool left } if (x_primitive.is_string() && y_primitive.is_string()) { - auto x_string = x_primitive.as_string().string(); - auto y_string = y_primitive.as_string().string(); + auto x_string = x_primitive.as_string().deprecated_string(); + auto y_string = y_primitive.as_string().deprecated_string(); Utf8View x_code_points { x_string }; Utf8View y_code_points { y_string }; @@ -1588,7 +1588,7 @@ ThrowCompletionOr is_less_than(VM& vm, Value lhs, Value rhs, bool left } if (x_primitive.is_bigint() && y_primitive.is_string()) { - auto y_bigint = string_to_bigint(vm, y_primitive.as_string().string()); + auto y_bigint = string_to_bigint(vm, y_primitive.as_string().deprecated_string()); if (!y_bigint.has_value()) return TriState::Unknown; @@ -1598,7 +1598,7 @@ ThrowCompletionOr is_less_than(VM& vm, Value lhs, Value rhs, bool left } if (x_primitive.is_string() && y_primitive.is_bigint()) { - auto x_bigint = string_to_bigint(vm, x_primitive.as_string().string()); + auto x_bigint = string_to_bigint(vm, x_primitive.as_string().deprecated_string()); if (!x_bigint.has_value()) return TriState::Unknown; diff --git a/Userland/Libraries/LibJS/Runtime/ValueTraits.h b/Userland/Libraries/LibJS/Runtime/ValueTraits.h index 3922d3b7795..2bae2c9cde0 100644 --- a/Userland/Libraries/LibJS/Runtime/ValueTraits.h +++ b/Userland/Libraries/LibJS/Runtime/ValueTraits.h @@ -17,7 +17,7 @@ struct ValueTraits : public Traits { { VERIFY(!value.is_empty()); if (value.is_string()) - return value.as_string().string().hash(); + return value.as_string().deprecated_string().hash(); if (value.is_bigint()) return value.as_bigint().big_integer().hash(); diff --git a/Userland/Libraries/LibJS/Token.cpp b/Userland/Libraries/LibJS/Token.cpp index d5adeaa6bb7..74b22461da1 100644 --- a/Userland/Libraries/LibJS/Token.cpp +++ b/Userland/Libraries/LibJS/Token.cpp @@ -63,7 +63,7 @@ double Token::double_value() const builder.append(ch); } - DeprecatedString value_string = builder.to_string(); + DeprecatedString value_string = builder.to_deprecated_string(); if (value_string[0] == '0' && value_string.length() >= 2) { if (value_string[1] == 'x' || value_string[1] == 'X') { // hexadecimal @@ -209,7 +209,7 @@ DeprecatedString Token::string_value(StringValueStatus& status) const lexer.retreat(); builder.append(lexer.consume_escaped_character('\\', "b\bf\fn\nr\rt\tv\v"sv)); } - return builder.to_string(); + return builder.to_deprecated_string(); } // 12.8.6.2 Static Semantics: TRV, https://tc39.es/ecma262/#sec-static-semantics-trv diff --git a/Userland/Libraries/LibKeyboard/CharacterMapFile.cpp b/Userland/Libraries/LibKeyboard/CharacterMapFile.cpp index b736ec614aa..af1029754f1 100644 --- a/Userland/Libraries/LibKeyboard/CharacterMapFile.cpp +++ b/Userland/Libraries/LibKeyboard/CharacterMapFile.cpp @@ -19,7 +19,7 @@ ErrorOr CharacterMapFile::load_from_file(DeprecatedString cons full_path.append("/res/keymaps/"sv); full_path.append(filename); full_path.append(".json"sv); - path = full_path.to_string(); + path = full_path.to_deprecated_string(); } auto file = TRY(Core::File::open(path, Core::OpenMode::ReadOnly)); diff --git a/Userland/Libraries/LibLine/Editor.cpp b/Userland/Libraries/LibLine/Editor.cpp index e457ab2999f..064a4e031b6 100644 --- a/Userland/Libraries/LibLine/Editor.cpp +++ b/Userland/Libraries/LibLine/Editor.cpp @@ -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; } } diff --git a/Userland/Libraries/LibLine/InternalFunctions.cpp b/Userland/Libraries/LibLine/InternalFunctions.cpp index 2fcc3faa6b2..8dcfbe87cd4 100644 --- a/Userland/Libraries/LibLine/InternalFunctions.cpp +++ b/Userland/Libraries/LibLine/InternalFunctions.cpp @@ -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)) { diff --git a/Userland/Libraries/LibLine/Style.h b/Userland/Libraries/LibLine/Style.h index 6c530223f3e..d054a17c144 100644 --- a/Userland/Libraries/LibLine/Style.h +++ b/Userland/Libraries/LibLine/Style.h @@ -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 }; diff --git a/Userland/Libraries/LibLocale/Locale.cpp b/Userland/Libraries/LibLocale/Locale.cpp index 7c735586923..a45e4e9ec13 100644 --- a/Userland/Libraries/LibLocale/Locale.cpp +++ b/Userland/Libraries/LibLocale/Locale.cpp @@ -560,7 +560,7 @@ void canonicalize_unicode_extension_values(StringView key, DeprecatedString& val // FIXME: Subdivision subtags do not appear in the CLDR likelySubtags.json file. // Implement the spec's recommendation of using just the first alias for now, // but we should determine if there's anything else needed here. - value = aliases[0].to_string(); + value = aliases[0].to_deprecated_string(); } } } @@ -903,10 +903,10 @@ DeprecatedString resolve_most_likely_territory_alias(LanguageID const& language_ return territory.release_value(); } - return aliases[0].to_string(); + return aliases[0].to_deprecated_string(); } -DeprecatedString LanguageID::to_string() const +DeprecatedString LanguageID::to_deprecated_string() const { StringBuilder builder; @@ -927,7 +927,7 @@ DeprecatedString LanguageID::to_string() const return builder.build(); } -DeprecatedString LocaleID::to_string() const +DeprecatedString LocaleID::to_deprecated_string() const { StringBuilder builder; @@ -939,7 +939,7 @@ DeprecatedString LocaleID::to_string() const builder.append(*segment); }; - append_segment(language_id.to_string()); + append_segment(language_id.to_deprecated_string()); for (auto const& extension : extensions) { extension.visit( @@ -955,7 +955,7 @@ DeprecatedString LocaleID::to_string() const [&](TransformedExtension const& ext) { builder.append("-t"sv); if (ext.language.has_value()) - append_segment(ext.language->to_string()); + append_segment(ext.language->to_deprecated_string()); for (auto const& field : ext.fields) { append_segment(field.key); append_segment(field.value); diff --git a/Userland/Libraries/LibLocale/Locale.h b/Userland/Libraries/LibLocale/Locale.h index 54ad05a9537..db3fa2a1d9f 100644 --- a/Userland/Libraries/LibLocale/Locale.h +++ b/Userland/Libraries/LibLocale/Locale.h @@ -17,7 +17,7 @@ namespace Locale { struct LanguageID { - DeprecatedString to_string() const; + DeprecatedString to_deprecated_string() const; bool operator==(LanguageID const&) const = default; bool is_root { false }; @@ -55,7 +55,7 @@ struct OtherExtension { using Extension = AK::Variant; struct LocaleID { - DeprecatedString to_string() const; + DeprecatedString to_deprecated_string() const; template Vector remove_extension_type() diff --git a/Userland/Libraries/LibMarkdown/HorizontalRule.cpp b/Userland/Libraries/LibMarkdown/HorizontalRule.cpp index 6f80249f87c..47ffb9ae732 100644 --- a/Userland/Libraries/LibMarkdown/HorizontalRule.cpp +++ b/Userland/Libraries/LibMarkdown/HorizontalRule.cpp @@ -23,7 +23,7 @@ DeprecatedString HorizontalRule::render_for_terminal(size_t view_width) const for (size_t i = 0; i < view_width; ++i) builder.append('-'); builder.append("\n\n"sv); - return builder.to_string(); + return builder.to_deprecated_string(); } RecursionDecision HorizontalRule::walk(Visitor& visitor) const diff --git a/Userland/Libraries/LibMarkdown/Table.cpp b/Userland/Libraries/LibMarkdown/Table.cpp index 3c63a11f398..dfebf833e94 100644 --- a/Userland/Libraries/LibMarkdown/Table.cpp +++ b/Userland/Libraries/LibMarkdown/Table.cpp @@ -65,7 +65,7 @@ DeprecatedString Table::render_for_terminal(size_t view_width) const builder.append('\n'); - return builder.to_string(); + return builder.to_deprecated_string(); } DeprecatedString Table::render_to_html(bool) const @@ -108,7 +108,7 @@ DeprecatedString Table::render_to_html(bool) const builder.append(""sv); builder.append(""sv); - return builder.to_string(); + return builder.to_deprecated_string(); } RecursionDecision Table::walk(Visitor& visitor) const diff --git a/Userland/Libraries/LibPDF/Document.cpp b/Userland/Libraries/LibPDF/Document.cpp index f6260d50205..e25dc0e6a00 100644 --- a/Userland/Libraries/LibPDF/Document.cpp +++ b/Userland/Libraries/LibPDF/Document.cpp @@ -10,14 +10,14 @@ namespace PDF { -DeprecatedString OutlineItem::to_string(int indent) const +DeprecatedString OutlineItem::to_deprecated_string(int indent) const { auto indent_str = DeprecatedString::repeated(" "sv, indent + 1); StringBuilder child_builder; child_builder.append('['); for (auto& child : children) - child_builder.appendff("{}\n", child.to_string(indent + 1)); + child_builder.appendff("{}\n", child.to_deprecated_string(indent + 1)); child_builder.appendff("{}]", indent_str); StringBuilder builder; @@ -28,10 +28,10 @@ DeprecatedString OutlineItem::to_string(int indent) const builder.appendff("{}color={}\n", indent_str, color); builder.appendff("{}italic={}\n", indent_str, italic); builder.appendff("{}bold={}\n", indent_str, bold); - builder.appendff("{}children={}\n", indent_str, child_builder.to_string()); + builder.appendff("{}children={}\n", indent_str, child_builder.to_deprecated_string()); builder.appendff("{}}}", DeprecatedString::repeated(" "sv, indent)); - return builder.to_string(); + return builder.to_deprecated_string(); } PDFErrorOr> Document::create(ReadonlyBytes bytes) diff --git a/Userland/Libraries/LibPDF/Document.h b/Userland/Libraries/LibPDF/Document.h index 8dca3cc3e98..99a41aa6410 100644 --- a/Userland/Libraries/LibPDF/Document.h +++ b/Userland/Libraries/LibPDF/Document.h @@ -66,7 +66,7 @@ struct OutlineItem final : public RefCounted { OutlineItem() = default; - DeprecatedString to_string(int indent) const; + DeprecatedString to_deprecated_string(int indent) const; }; struct OutlineDict final : public RefCounted { @@ -185,8 +185,8 @@ struct Formatter : Formatter { { return Formatter::format(builder, "Page {{\n resources={}\n contents={}\n media_box={}\n crop_box={}\n user_unit={}\n rotate={}\n}}"sv, - page.resources->to_string(1), - page.contents->to_string(1), + page.resources->to_deprecated_string(1), + page.contents->to_deprecated_string(1), page.media_box, page.crop_box, page.user_unit, @@ -230,7 +230,7 @@ struct Formatter : Formatter { for (auto& param : destination.parameters) param_builder.appendff("{} ", param); - return Formatter::format(builder, "{{ type={} page={} params={} }}"sv, type_str, destination.page, param_builder.to_string()); + return Formatter::format(builder, "{{ type={} page={} params={} }}"sv, type_str, destination.page, param_builder.to_deprecated_string()); } }; @@ -238,7 +238,7 @@ template<> struct Formatter : Formatter { ErrorOr format(FormatBuilder& builder, PDF::OutlineItem const& item) { - return builder.put_string(item.to_string(0)); + return builder.put_string(item.to_deprecated_string(0)); } }; @@ -249,11 +249,11 @@ struct Formatter : Formatter { StringBuilder child_builder; child_builder.append('['); for (auto& child : dict.children) - child_builder.appendff("{}\n", child.to_string(2)); + child_builder.appendff("{}\n", child.to_deprecated_string(2)); child_builder.append(" ]"sv); return Formatter::format(builder, - "OutlineDict {{\n count={}\n children={}\n}}"sv, dict.count, child_builder.to_string()); + "OutlineDict {{\n count={}\n children={}\n}}"sv, dict.count, child_builder.to_deprecated_string()); } }; diff --git a/Userland/Libraries/LibPDF/DocumentParser.cpp b/Userland/Libraries/LibPDF/DocumentParser.cpp index 72126456652..2da3eae5a2d 100644 --- a/Userland/Libraries/LibPDF/DocumentParser.cpp +++ b/Userland/Libraries/LibPDF/DocumentParser.cpp @@ -741,7 +741,7 @@ struct Formatter : Formatter::format(format_builder, builder.to_string()); + return Formatter::format(format_builder, builder.to_deprecated_string()); } }; @@ -765,7 +765,7 @@ struct Formatter : Formatter::format(format_builder, builder.to_string()); + return Formatter::format(format_builder, builder.to_deprecated_string()); } }; @@ -789,7 +789,7 @@ struct Formatter : Formatter::format(format_builder, builder.to_string()); + return Formatter::format(format_builder, builder.to_deprecated_string()); } }; diff --git a/Userland/Libraries/LibPDF/Object.h b/Userland/Libraries/LibPDF/Object.h index ae70cefebd3..0b3237e4a79 100644 --- a/Userland/Libraries/LibPDF/Object.h +++ b/Userland/Libraries/LibPDF/Object.h @@ -75,7 +75,7 @@ public: } virtual char const* type_name() const = 0; - virtual DeprecatedString to_string(int indent) const = 0; + virtual DeprecatedString to_deprecated_string(int indent) const = 0; protected: #define ENUMERATE_TYPE(_, name) \ @@ -98,7 +98,7 @@ template struct Formatter : Formatter { ErrorOr format(FormatBuilder& builder, T const& object) { - return Formatter::format(builder, object.to_string(0)); + return Formatter::format(builder, object.to_deprecated_string(0)); } }; diff --git a/Userland/Libraries/LibPDF/ObjectDerivatives.cpp b/Userland/Libraries/LibPDF/ObjectDerivatives.cpp index e6c2a26f6e3..9b1e0b834dd 100644 --- a/Userland/Libraries/LibPDF/ObjectDerivatives.cpp +++ b/Userland/Libraries/LibPDF/ObjectDerivatives.cpp @@ -36,21 +36,21 @@ static void append_indent(StringBuilder& builder, int indent) builder.append(" "sv); } -DeprecatedString StringObject::to_string(int) const +DeprecatedString StringObject::to_deprecated_string(int) const { if (is_binary()) return DeprecatedString::formatted("<{}>", encode_hex(string().bytes()).to_uppercase()); return DeprecatedString::formatted("({})", string()); } -DeprecatedString NameObject::to_string(int) const +DeprecatedString NameObject::to_deprecated_string(int) const { StringBuilder builder; builder.appendff("/{}", this->name()); - return builder.to_string(); + return builder.to_deprecated_string(); } -DeprecatedString ArrayObject::to_string(int indent) const +DeprecatedString ArrayObject::to_deprecated_string(int indent) const { StringBuilder builder; builder.append("[\n"sv); @@ -61,16 +61,16 @@ DeprecatedString ArrayObject::to_string(int indent) const builder.append(",\n"sv); first = false; append_indent(builder, indent + 1); - builder.appendff("{}", element.to_string(indent)); + builder.appendff("{}", element.to_deprecated_string(indent)); } builder.append('\n'); append_indent(builder, indent); builder.append(']'); - return builder.to_string(); + return builder.to_deprecated_string(); } -DeprecatedString DictObject::to_string(int indent) const +DeprecatedString DictObject::to_deprecated_string(int indent) const { StringBuilder builder; builder.append("<<\n"sv); @@ -82,21 +82,21 @@ DeprecatedString DictObject::to_string(int indent) const first = false; append_indent(builder, indent + 1); builder.appendff("/{} ", key); - builder.appendff("{}", value.to_string(indent + 1)); + builder.appendff("{}", value.to_deprecated_string(indent + 1)); } builder.append('\n'); append_indent(builder, indent); builder.append(">>"sv); - return builder.to_string(); + return builder.to_deprecated_string(); } -DeprecatedString StreamObject::to_string(int indent) const +DeprecatedString StreamObject::to_deprecated_string(int indent) const { StringBuilder builder; builder.append("stream\n"sv); append_indent(builder, indent); - builder.appendff("{}\n", dict()->to_string(indent + 1)); + builder.appendff("{}\n", dict()->to_deprecated_string(indent + 1)); append_indent(builder, indent + 1); auto string = encode_hex(bytes()); @@ -114,19 +114,19 @@ DeprecatedString StreamObject::to_string(int indent) const append_indent(builder, indent); builder.append("endstream"sv); - return builder.to_string(); + return builder.to_deprecated_string(); } -DeprecatedString IndirectValue::to_string(int indent) const +DeprecatedString IndirectValue::to_deprecated_string(int indent) const { StringBuilder builder; builder.appendff("{} {} obj\n", index(), generation_index()); append_indent(builder, indent + 1); - builder.append(value().to_string(indent + 1)); + builder.append(value().to_deprecated_string(indent + 1)); builder.append('\n'); append_indent(builder, indent); builder.append("endobj"sv); - return builder.to_string(); + return builder.to_deprecated_string(); } } diff --git a/Userland/Libraries/LibPDF/ObjectDerivatives.h b/Userland/Libraries/LibPDF/ObjectDerivatives.h index d98fed63c37..7375d5f1d50 100644 --- a/Userland/Libraries/LibPDF/ObjectDerivatives.h +++ b/Userland/Libraries/LibPDF/ObjectDerivatives.h @@ -32,7 +32,7 @@ public: void set_string(DeprecatedString string) { m_string = move(string); } char const* type_name() const override { return "string"; } - DeprecatedString to_string(int indent) const override; + DeprecatedString to_deprecated_string(int indent) const override; protected: bool is_string() const override { return true; } @@ -54,7 +54,7 @@ public: [[nodiscard]] ALWAYS_INLINE FlyString const& name() const { return m_name; } char const* type_name() const override { return "name"; } - DeprecatedString to_string(int indent) const override; + DeprecatedString to_deprecated_string(int indent) const override; protected: bool is_name() const override { return true; } @@ -90,7 +90,7 @@ public: { return "array"; } - DeprecatedString to_string(int indent) const override; + DeprecatedString to_deprecated_string(int indent) const override; protected: bool is_array() const override { return true; } @@ -136,7 +136,7 @@ public: { return "dict"; } - DeprecatedString to_string(int indent) const override; + DeprecatedString to_deprecated_string(int indent) const override; protected: bool is_dict() const override { return true; } @@ -160,7 +160,7 @@ public: [[nodiscard]] ByteBuffer& buffer() { return m_buffer; }; char const* type_name() const override { return "stream"; } - DeprecatedString to_string(int indent) const override; + DeprecatedString to_deprecated_string(int indent) const override; private: bool is_stream() const override { return true; } @@ -184,7 +184,7 @@ public: [[nodiscard]] ALWAYS_INLINE Value const& value() const { return m_value; } char const* type_name() const override { return "indirect_object"; } - DeprecatedString to_string(int indent) const override; + DeprecatedString to_deprecated_string(int indent) const override; protected: bool is_indirect_value() const override { return true; } diff --git a/Userland/Libraries/LibPDF/Operator.h b/Userland/Libraries/LibPDF/Operator.h index 4ab1062398b..4ec3fc3cd7d 100644 --- a/Userland/Libraries/LibPDF/Operator.h +++ b/Userland/Libraries/LibPDF/Operator.h @@ -180,7 +180,7 @@ struct Formatter : Formatter { builder.append(" ]"sv); } - return Formatter::format(format_builder, builder.to_string()); + return Formatter::format(format_builder, builder.to_deprecated_string()); } }; diff --git a/Userland/Libraries/LibPDF/Parser.cpp b/Userland/Libraries/LibPDF/Parser.cpp index 245162b695e..9599ba899c5 100644 --- a/Userland/Libraries/LibPDF/Parser.cpp +++ b/Userland/Libraries/LibPDF/Parser.cpp @@ -233,7 +233,7 @@ PDFErrorOr> Parser::parse_name() m_reader.consume_whitespace(); - return make_object(builder.to_string()); + return make_object(builder.to_deprecated_string()); } NonnullRefPtr Parser::parse_string() @@ -347,7 +347,7 @@ DeprecatedString Parser::parse_literal_string() } } - return builder.to_string(); + return builder.to_deprecated_string(); } DeprecatedString Parser::parse_hex_string() @@ -359,7 +359,7 @@ DeprecatedString Parser::parse_hex_string() while (true) { if (m_reader.matches('>')) { m_reader.consume(); - return builder.to_string(); + return builder.to_deprecated_string(); } else { int hex_value = 0; @@ -372,7 +372,7 @@ DeprecatedString Parser::parse_hex_string() m_reader.consume(); hex_value *= 16; builder.append(static_cast(hex_value)); - return builder.to_string(); + return builder.to_deprecated_string(); } VERIFY(isxdigit(ch)); diff --git a/Userland/Libraries/LibPDF/Renderer.h b/Userland/Libraries/LibPDF/Renderer.h index be4341bc00a..9ca5cab8155 100644 --- a/Userland/Libraries/LibPDF/Renderer.h +++ b/Userland/Libraries/LibPDF/Renderer.h @@ -193,7 +193,7 @@ struct Formatter : Formatter { } builder.appendff("] {}", pattern.phase); - return format_builder.put_string(builder.to_string()); + return format_builder.put_string(builder.to_deprecated_string()); } }; @@ -237,7 +237,7 @@ struct Formatter : Formatter { builder.appendff(" rise={}\n", state.rise); builder.appendff(" knockout={}\n", state.knockout); builder.append(" }"sv); - return format_builder.put_string(builder.to_string()); + return format_builder.put_string(builder.to_deprecated_string()); } }; @@ -257,7 +257,7 @@ struct Formatter : Formatter { builder.appendff(" line_dash_pattern={}\n", state.line_dash_pattern); builder.appendff(" text_state={}\n", state.text_state); builder.append('}'); - return format_builder.put_string(builder.to_string()); + return format_builder.put_string(builder.to_deprecated_string()); } }; diff --git a/Userland/Libraries/LibPDF/Value.cpp b/Userland/Libraries/LibPDF/Value.cpp index a95da9774bb..b95d619f0cb 100644 --- a/Userland/Libraries/LibPDF/Value.cpp +++ b/Userland/Libraries/LibPDF/Value.cpp @@ -9,7 +9,7 @@ namespace PDF { -DeprecatedString Value::to_string(int indent) const +DeprecatedString Value::to_deprecated_string(int indent) const { return visit( [&](Empty const&) -> DeprecatedString { @@ -32,7 +32,7 @@ DeprecatedString Value::to_string(int indent) const return DeprecatedString::formatted("{} {} R", ref.as_ref_index(), ref.as_ref_generation_index()); }, [&](NonnullRefPtr const& object) { - return object->to_string(indent); + return object->to_deprecated_string(indent); }); } diff --git a/Userland/Libraries/LibPDF/Value.h b/Userland/Libraries/LibPDF/Value.h index 4c7ebe21fdf..4144b09a15a 100644 --- a/Userland/Libraries/LibPDF/Value.h +++ b/Userland/Libraries/LibPDF/Value.h @@ -36,7 +36,7 @@ public: set>(*refptr); } - [[nodiscard]] DeprecatedString to_string(int indent = 0) const; + [[nodiscard]] DeprecatedString to_deprecated_string(int indent = 0) const; [[nodiscard]] ALWAYS_INLINE bool has_number() const { return has() || has(); } @@ -95,7 +95,7 @@ template<> struct Formatter : Formatter { ErrorOr format(FormatBuilder& builder, PDF::Value const& value) { - return Formatter::format(builder, value.to_string()); + return Formatter::format(builder, value.to_deprecated_string()); } }; diff --git a/Userland/Libraries/LibPDF/XRefTable.h b/Userland/Libraries/LibPDF/XRefTable.h index 9a2ffd4c7be..ab289f0d2b4 100644 --- a/Userland/Libraries/LibPDF/XRefTable.h +++ b/Userland/Libraries/LibPDF/XRefTable.h @@ -140,7 +140,7 @@ struct Formatter : Formatter { for (auto& entry : table.m_entries) builder.appendff("\n {}", entry); builder.append("\n}"sv); - return Formatter::format(format_builder, builder.to_string()); + return Formatter::format(format_builder, builder.to_deprecated_string()); } }; diff --git a/Userland/Libraries/LibRegex/RegexByteCode.cpp b/Userland/Libraries/LibRegex/RegexByteCode.cpp index c406a040078..f3e669c00f9 100644 --- a/Userland/Libraries/LibRegex/RegexByteCode.cpp +++ b/Userland/Libraries/LibRegex/RegexByteCode.cpp @@ -398,7 +398,7 @@ ALWAYS_INLINE ExecutionResult OpCode_SaveRightCaptureGroup::execute(MatchInput c auto view = input.view.substring_view(start_position, length); if (input.regex_options & AllFlags::StringCopyMatches) { - match = { view.to_string(), input.line, start_position, input.global_offset + start_position }; // create a copy of the original string + match = { view.to_deprecated_string(), input.line, start_position, input.global_offset + start_position }; // create a copy of the original string } else { match = { view, input.line, start_position, input.global_offset + start_position }; // take view to original string } @@ -423,7 +423,7 @@ ALWAYS_INLINE ExecutionResult OpCode_SaveRightNamedCaptureGroup::execute(MatchIn auto view = input.view.substring_view(start_position, length); if (input.regex_options & AllFlags::StringCopyMatches) { - match = { view.to_string(), name(), input.line, start_position, input.global_offset + start_position }; // create a copy of the original string + match = { view.to_deprecated_string(), name(), input.line, start_position, input.global_offset + start_position }; // create a copy of the original string } else { match = { view, name(), input.line, start_position, input.global_offset + start_position }; // take view to original string } @@ -927,7 +927,7 @@ Vector OpCode_Compare::flat_compares() const return result; } -Vector OpCode_Compare::variable_arguments_to_string(Optional input) const +Vector OpCode_Compare::variable_arguments_to_deprecated_string(Optional input) const { Vector result; @@ -952,9 +952,9 @@ Vector OpCode_Compare::variable_arguments_to_string(Optional view.length() ? 0 : 1).to_string())); + view.substring_view(string_start_offset, string_start_offset > view.length() ? 0 : 1).to_deprecated_string())); } else { - auto str = view.substring_view(string_start_offset, string_start_offset > view.length() ? 0 : 1).to_string(); + auto str = view.substring_view(string_start_offset, string_start_offset > view.length() ? 0 : 1).to_deprecated_string(); u8 buf[8] { 0 }; __builtin_memcpy(buf, str.characters(), min(str.length(), sizeof(buf))); result.empend(DeprecatedString::formatted(" compare against: {:x},{:x},{:x},{:x},{:x},{:x},{:x},{:x}", @@ -988,21 +988,21 @@ Vector OpCode_Compare::variable_arguments_to_string(Optional state().string_position) result.empend(DeprecatedString::formatted( " compare against: \"{}\"", - input.value().view.substring_view(string_start_offset, string_start_offset + length > view.length() ? 0 : length).to_string())); + input.value().view.substring_view(string_start_offset, string_start_offset + length > view.length() ? 0 : length).to_deprecated_string())); } else if (compare_type == CharacterCompareType::CharClass) { auto character_class = (CharClass)m_bytecode->at(offset++); result.empend(DeprecatedString::formatted(" ch_class={} [{}]", (size_t)character_class, character_class_name(character_class))); if (!view.is_null() && view.length() > state().string_position) result.empend(DeprecatedString::formatted( " compare against: '{}'", - input.value().view.substring_view(string_start_offset, state().string_position > view.length() ? 0 : 1).to_string())); + input.value().view.substring_view(string_start_offset, state().string_position > view.length() ? 0 : 1).to_deprecated_string())); } else if (compare_type == CharacterCompareType::CharRange) { auto value = (CharRange)m_bytecode->at(offset++); result.empend(DeprecatedString::formatted(" ch_range={:x}-{:x}", value.from, value.to)); if (!view.is_null() && view.length() > state().string_position) result.empend(DeprecatedString::formatted( " compare against: '{}'", - input.value().view.substring_view(string_start_offset, state().string_position > view.length() ? 0 : 1).to_string())); + input.value().view.substring_view(string_start_offset, state().string_position > view.length() ? 0 : 1).to_deprecated_string())); } else if (compare_type == CharacterCompareType::LookupTable) { auto count = m_bytecode->at(offset++); for (size_t j = 0; j < count; ++j) { @@ -1012,7 +1012,7 @@ Vector OpCode_Compare::variable_arguments_to_string(Optional state().string_position) result.empend(DeprecatedString::formatted( " compare against: '{}'", - input.value().view.substring_view(string_start_offset, state().string_position > view.length() ? 0 : 1).to_string())); + input.value().view.substring_view(string_start_offset, state().string_position > view.length() ? 0 : 1).to_deprecated_string())); } else if (compare_type == CharacterCompareType::GeneralCategory || compare_type == CharacterCompareType::Property || compare_type == CharacterCompareType::Script diff --git a/Userland/Libraries/LibRegex/RegexByteCode.h b/Userland/Libraries/LibRegex/RegexByteCode.h index 9ebc8970a21..8473dec4680 100644 --- a/Userland/Libraries/LibRegex/RegexByteCode.h +++ b/Userland/Libraries/LibRegex/RegexByteCode.h @@ -570,7 +570,7 @@ public: return *m_state; } - DeprecatedString to_string() const + DeprecatedString to_deprecated_string() const { return DeprecatedString::formatted("[{:#02X}] {}", (int)opcode_id(), name(opcode_id())); } @@ -748,7 +748,7 @@ public: ALWAYS_INLINE size_t arguments_count() const { return argument(0); } ALWAYS_INLINE size_t arguments_size() const { return argument(1); } DeprecatedString arguments_string() const override; - Vector variable_arguments_to_string(Optional input = {}) const; + Vector variable_arguments_to_deprecated_string(Optional input = {}) const; Vector flat_compares() const; static bool matches_character_class(CharClass, u32, bool insensitive); diff --git a/Userland/Libraries/LibRegex/RegexDebug.h b/Userland/Libraries/LibRegex/RegexDebug.h index a25cfb65340..d7705f53ca7 100644 --- a/Userland/Libraries/LibRegex/RegexDebug.h +++ b/Userland/Libraries/LibRegex/RegexDebug.h @@ -61,13 +61,13 @@ public: system.characters(), state.instruction_position, recursion, - opcode.to_string().characters(), + opcode.to_deprecated_string().characters(), opcode.arguments_string().characters(), DeprecatedString::formatted("ip: {:3}, sp: {:3}", state.instruction_position, state.string_position)); if (newline) outln(); if (newline && is(opcode)) { - for (auto& line : to(opcode).variable_arguments_to_string()) + for (auto& line : to(opcode).variable_arguments_to_deprecated_string()) outln(m_file, "{:15} | {:5} | {:9} | {:35} | {:30} | {:20}", "", "", "", "", line, ""); } } @@ -85,10 +85,10 @@ public: builder.appendff(", next ip: {}", state.instruction_position + opcode.size()); } - outln(m_file, " | {:20}", builder.to_string()); + outln(m_file, " | {:20}", builder.to_deprecated_string()); if (is(opcode)) { - for (auto& line : to(opcode).variable_arguments_to_string(input)) { + for (auto& line : to(opcode).variable_arguments_to_deprecated_string(input)) { outln(m_file, "{:15} | {:5} | {:9} | {:35} | {:30} | {:20}", "", "", "", "", line, ""); } } @@ -104,7 +104,7 @@ public: for (size_t i = 0; i < length; ++i) { builder.append('='); } - auto str = builder.to_string(); + auto str = builder.to_deprecated_string(); VERIFY(!str.is_empty()); outln(m_file, "{}", str); @@ -115,7 +115,7 @@ public: builder.append('-'); } builder.append('\n'); - m_debug_stripline = builder.to_string(); + m_debug_stripline = builder.to_deprecated_string(); } private: diff --git a/Userland/Libraries/LibRegex/RegexMatch.h b/Userland/Libraries/LibRegex/RegexMatch.h index 5988454e7a2..619fdd3c845 100644 --- a/Userland/Libraries/LibRegex/RegexMatch.h +++ b/Userland/Libraries/LibRegex/RegexMatch.h @@ -381,16 +381,16 @@ public: return view; } - DeprecatedString to_string() const + DeprecatedString to_deprecated_string() const { return m_view.visit( - [](StringView view) { return view.to_string(); }, + [](StringView view) { return view.to_deprecated_string(); }, [](Utf16View view) { return view.to_utf8(Utf16View::AllowInvalidCodeUnits::Yes); }, [](auto& view) { StringBuilder builder; for (auto it = view.begin(); it != view.end(); ++it) builder.append_code_point(*it); - return builder.to_string(); + return builder.to_deprecated_string(); }); } @@ -434,8 +434,8 @@ public: bool operator==(char const* cstring) const { return m_view.visit( - [&](Utf32View) { return to_string() == cstring; }, - [&](Utf16View) { return to_string() == cstring; }, + [&](Utf32View) { return to_deprecated_string() == cstring; }, + [&](Utf16View) { return to_deprecated_string() == cstring; }, [&](Utf8View const& view) { return view.as_string() == cstring; }, [&](StringView view) { return view == cstring; }); } @@ -443,8 +443,8 @@ public: bool operator==(DeprecatedString const& string) const { return m_view.visit( - [&](Utf32View) { return to_string() == string; }, - [&](Utf16View) { return to_string() == string; }, + [&](Utf32View) { return to_deprecated_string() == string; }, + [&](Utf16View) { return to_deprecated_string() == string; }, [&](Utf8View const& view) { return view.as_string() == string; }, [&](StringView view) { return view == string; }); } @@ -452,8 +452,8 @@ public: bool operator==(StringView string) const { return m_view.visit( - [&](Utf32View) { return to_string() == string; }, - [&](Utf16View) { return to_string() == string; }, + [&](Utf32View) { return to_deprecated_string() == string; }, + [&](Utf16View) { return to_deprecated_string() == string; }, [&](Utf8View const& view) { return view.as_string() == string; }, [&](StringView view) { return view == string; }); } @@ -464,25 +464,25 @@ public: [&](Utf32View view) { return view.length() == other.length() && __builtin_memcmp(view.code_points(), other.code_points(), view.length() * sizeof(u32)) == 0; }, - [&](Utf16View) { return to_string() == RegexStringView { other }.to_string(); }, - [&](Utf8View const& view) { return view.as_string() == RegexStringView { other }.to_string(); }, - [&](StringView view) { return view == RegexStringView { other }.to_string(); }); + [&](Utf16View) { return to_deprecated_string() == RegexStringView { other }.to_deprecated_string(); }, + [&](Utf8View const& view) { return view.as_string() == RegexStringView { other }.to_deprecated_string(); }, + [&](StringView view) { return view == RegexStringView { other }.to_deprecated_string(); }); } bool operator==(Utf16View const& other) const { return m_view.visit( - [&](Utf32View) { return to_string() == RegexStringView { other }.to_string(); }, + [&](Utf32View) { return to_deprecated_string() == RegexStringView { other }.to_deprecated_string(); }, [&](Utf16View const& view) { return view == other; }, - [&](Utf8View const& view) { return view.as_string() == RegexStringView { other }.to_string(); }, - [&](StringView view) { return view == RegexStringView { other }.to_string(); }); + [&](Utf8View const& view) { return view.as_string() == RegexStringView { other }.to_deprecated_string(); }, + [&](StringView view) { return view == RegexStringView { other }.to_deprecated_string(); }); } bool operator==(Utf8View const& other) const { return m_view.visit( - [&](Utf32View) { return to_string() == other.as_string(); }, - [&](Utf16View) { return to_string() == other.as_string(); }, + [&](Utf32View) { return to_deprecated_string() == other.as_string(); }, + [&](Utf16View) { return to_deprecated_string() == other.as_string(); }, [&](Utf8View const& view) { return view.as_string() == other.as_string(); }, [&](StringView view) { return other.as_string() == view; }); } @@ -653,7 +653,7 @@ template<> struct AK::Formatter : Formatter { ErrorOr format(FormatBuilder& builder, regex::RegexStringView value) { - auto string = value.to_string(); + auto string = value.to_deprecated_string(); return Formatter::format(builder, string); } }; diff --git a/Userland/Libraries/LibRegex/RegexMatcher.cpp b/Userland/Libraries/LibRegex/RegexMatcher.cpp index 1b2451377ac..71caf5cecdf 100644 --- a/Userland/Libraries/LibRegex/RegexMatcher.cpp +++ b/Userland/Libraries/LibRegex/RegexMatcher.cpp @@ -169,7 +169,7 @@ RegexResult Matcher::match(Vector const& views, Optiona VERIFY(start_position + state.string_position - start_position <= input.view.length()); if (input.regex_options.has_flag_set(AllFlags::StringCopyMatches)) { - state.matches.at(input.match_index) = { input.view.substring_view(start_position, state.string_position - start_position).to_string(), input.line, start_position, input.global_offset + start_position }; + state.matches.at(input.match_index) = { input.view.substring_view(start_position, state.string_position - start_position).to_deprecated_string(), input.line, start_position, input.global_offset + start_position }; } else { // let the view point to the original string ... state.matches.at(input.match_index) = { input.view.substring_view(start_position, state.string_position - start_position), input.line, start_position, input.global_offset + start_position }; } diff --git a/Userland/Libraries/LibRegex/RegexMatcher.h b/Userland/Libraries/LibRegex/RegexMatcher.h index 4dd739a8963..484d207b2dc 100644 --- a/Userland/Libraries/LibRegex/RegexMatcher.h +++ b/Userland/Libraries/LibRegex/RegexMatcher.h @@ -123,11 +123,11 @@ public: size_t start_offset = 0; RegexResult result = matcher->match(view, regex_options); if (!result.success) - return view.to_string(); + return view.to_deprecated_string(); for (size_t i = 0; i < result.matches.size(); ++i) { auto& match = result.matches[i]; - builder.append(view.substring_view(start_offset, match.global_offset - start_offset).to_string()); + builder.append(view.substring_view(start_offset, match.global_offset - start_offset).to_deprecated_string()); start_offset = match.global_offset + match.view.length(); GenericLexer lexer(replacement_pattern); while (!lexer.is_eof()) { @@ -138,7 +138,7 @@ public: } auto number = lexer.consume_while(isdigit); if (auto index = number.to_uint(); index.has_value() && result.n_capture_groups >= index.value()) { - builder.append(result.capture_group_matches[i][index.value() - 1].view.to_string()); + builder.append(result.capture_group_matches[i][index.value() - 1].view.to_deprecated_string()); } else { builder.appendff("\\{}", number); } @@ -148,9 +148,9 @@ public: } } - builder.append(view.substring_view(start_offset, view.length() - start_offset).to_string()); + builder.append(view.substring_view(start_offset, view.length() - start_offset).to_deprecated_string()); - return builder.to_string(); + return builder.to_deprecated_string(); } // FIXME: replace(Vector const , ...) diff --git a/Userland/Libraries/LibSQL/AST/Expression.cpp b/Userland/Libraries/LibSQL/AST/Expression.cpp index 63a39c3b210..043670b5b41 100644 --- a/Userland/Libraries/LibSQL/AST/Expression.cpp +++ b/Userland/Libraries/LibSQL/AST/Expression.cpp @@ -56,9 +56,9 @@ ResultOr BinaryOperatorExpression::evaluate(ExecutionContext& context) co return Result { SQLCommand::Unknown, SQLErrorCode::BooleanOperatorTypeMismatch, BinaryOperator_name(type()) }; AK::StringBuilder builder; - builder.append(lhs_value.to_string()); - builder.append(rhs_value.to_string()); - return Value(builder.to_string()); + builder.append(lhs_value.to_deprecated_string()); + builder.append(rhs_value.to_deprecated_string()); + return Value(builder.to_deprecated_string()); } case BinaryOperator::Multiplication: return lhs_value.multiply(rhs_value); @@ -181,7 +181,7 @@ ResultOr MatchExpression::evaluate(ExecutionContext& context) const char escape_char = '\0'; if (escape()) { - auto escape_str = TRY(escape()->evaluate(context)).to_string(); + auto escape_str = TRY(escape()->evaluate(context)).to_deprecated_string(); if (escape_str.length() != 1) return Result { SQLCommand::Unknown, SQLErrorCode::SyntaxError, "ESCAPE should be a single character" }; escape_char = escape_str[0]; @@ -192,7 +192,7 @@ ResultOr MatchExpression::evaluate(ExecutionContext& context) const bool escaped = false; AK::StringBuilder builder; builder.append('^'); - for (auto c : rhs_value.to_string()) { + for (auto c : rhs_value.to_deprecated_string()) { if (escape() && c == escape_char && !escaped) { escaped = true; } else if (s_posix_basic_metacharacters.contains(c)) { @@ -212,14 +212,14 @@ ResultOr MatchExpression::evaluate(ExecutionContext& context) const // FIXME: We should probably cache this regex. auto regex = Regex(builder.build()); - auto result = regex.match(lhs_value.to_string(), PosixFlags::Insensitive | PosixFlags::Unicode); + auto result = regex.match(lhs_value.to_deprecated_string(), PosixFlags::Insensitive | PosixFlags::Unicode); return Value(invert_expression() ? !result.success : result.success); } case MatchOperator::Regexp: { Value lhs_value = TRY(lhs()->evaluate(context)); Value rhs_value = TRY(rhs()->evaluate(context)); - auto regex = Regex(rhs_value.to_string()); + auto regex = Regex(rhs_value.to_deprecated_string()); auto err = regex.parser_result.error; if (err != regex::Error::NoError) { StringBuilder builder; @@ -229,7 +229,7 @@ ResultOr MatchExpression::evaluate(ExecutionContext& context) const return Result { SQLCommand::Unknown, SQLErrorCode::SyntaxError, builder.build() }; } - auto result = regex.match(lhs_value.to_string(), PosixFlags::Insensitive | PosixFlags::Unicode); + auto result = regex.match(lhs_value.to_deprecated_string(), PosixFlags::Insensitive | PosixFlags::Unicode); return Value(invert_expression() ? !result.success : result.success); } case MatchOperator::Glob: diff --git a/Userland/Libraries/LibSQL/AST/Parser.h b/Userland/Libraries/LibSQL/AST/Parser.h index 1a3d66c5831..64e0d9f6ad8 100644 --- a/Userland/Libraries/LibSQL/AST/Parser.h +++ b/Userland/Libraries/LibSQL/AST/Parser.h @@ -26,7 +26,7 @@ class Parser { DeprecatedString message; SourcePosition position; - DeprecatedString to_string() const + DeprecatedString to_deprecated_string() const { return DeprecatedString::formatted("{} (line: {}, column: {})", message, position.line, position.column); } diff --git a/Userland/Libraries/LibSQL/HashIndex.cpp b/Userland/Libraries/LibSQL/HashIndex.cpp index bde86fbb7df..f913cec43bc 100644 --- a/Userland/Libraries/LibSQL/HashIndex.cpp +++ b/Userland/Libraries/LibSQL/HashIndex.cpp @@ -102,7 +102,7 @@ void HashBucket::deserialize(Serializer& serializer) dbgln_if(SQL_DEBUG, "Bucket has {} keys", size); for (auto ix = 0u; ix < size; ix++) { auto key = serializer.deserialize(m_hash_index.descriptor()); - dbgln_if(SQL_DEBUG, "Key {}: {}", ix, key.to_string()); + dbgln_if(SQL_DEBUG, "Key {}: {}", ix, key.to_deprecated_string()); m_entries.append(key); } m_inflated = true; @@ -136,7 +136,7 @@ bool HashBucket::insert(Key const& key) return false; } if ((length() + key.length()) > BLOCKSIZE) { - dbgln_if(SQL_DEBUG, "Adding key {} would make length exceed block size", key.to_string()); + dbgln_if(SQL_DEBUG, "Adding key {} would make length exceed block size", key.to_deprecated_string()); return false; } m_entries.append(key); @@ -202,7 +202,7 @@ void HashBucket::list_bucket() warnln("Bucket #{} size {} local depth {} pointer {}{}", index(), size(), local_depth(), pointer(), (pointer() ? "" : " (VIRTUAL)")); for (auto& key : entries()) { - warnln(" {} hash {}", key.to_string(), key.hash()); + warnln(" {} hash {}", key.to_deprecated_string(), key.hash()); } } @@ -253,7 +253,7 @@ HashBucket* HashIndex::get_bucket_for_insert(Key const& key) auto key_hash = key.hash(); do { - dbgln_if(SQL_DEBUG, "HashIndex::get_bucket_for_insert({}) bucket {} of {}", key.to_string(), key_hash % size(), size()); + dbgln_if(SQL_DEBUG, "HashIndex::get_bucket_for_insert({}) bucket {} of {}", key.to_deprecated_string(), key_hash % size(), size()); auto bucket = get_bucket(key_hash % size()); if (bucket->length() + key.length() < BLOCKSIZE) { return bucket; @@ -349,7 +349,7 @@ Optional HashIndex::get(Key& key) { auto hash = key.hash(); auto bucket_index = hash % size(); - dbgln_if(SQL_DEBUG, "HashIndex::get({}) bucket_index {}", key.to_string(), bucket_index); + dbgln_if(SQL_DEBUG, "HashIndex::get({}) bucket_index {}", key.to_deprecated_string(), bucket_index); auto bucket = get_bucket(bucket_index); if constexpr (SQL_DEBUG) bucket->list_bucket(); @@ -358,7 +358,7 @@ Optional HashIndex::get(Key& key) bool HashIndex::insert(Key const& key) { - dbgln_if(SQL_DEBUG, "HashIndex::insert({})", key.to_string()); + dbgln_if(SQL_DEBUG, "HashIndex::insert({})", key.to_deprecated_string()); auto bucket = get_bucket_for_insert(key); bucket->insert(key); if constexpr (SQL_DEBUG) diff --git a/Userland/Libraries/LibSQL/Meta.cpp b/Userland/Libraries/LibSQL/Meta.cpp index eab715d72f5..3924a601f50 100644 --- a/Userland/Libraries/LibSQL/Meta.cpp +++ b/Userland/Libraries/LibSQL/Meta.cpp @@ -21,7 +21,7 @@ SchemaDef::SchemaDef(DeprecatedString name) } SchemaDef::SchemaDef(Key const& key) - : Relation(key["schema_name"].to_string()) + : Relation(key["schema_name"].to_deprecated_string()) { } @@ -186,7 +186,7 @@ void TableDef::append_column(Key const& column) auto column_type = column["column_type"].to_int(); VERIFY(column_type.has_value()); - append_column(column["column_name"].to_string(), static_cast(*column_type)); + append_column(column["column_name"].to_deprecated_string(), static_cast(*column_type)); } Key TableDef::make_key(SchemaDef const& schema_def) diff --git a/Userland/Libraries/LibSQL/Serializer.h b/Userland/Libraries/LibSQL/Serializer.h index 848b4bc72e6..71903ca9736 100644 --- a/Userland/Libraries/LibSQL/Serializer.h +++ b/Userland/Libraries/LibSQL/Serializer.h @@ -164,8 +164,8 @@ private: } StringBuilder bytes_builder; bytes_builder.join(' ', bytes); - builder.append(bytes_builder.to_string()); - dbgln(builder.to_string()); + builder.append(bytes_builder.to_deprecated_string()); + dbgln(builder.to_deprecated_string()); } ByteBuffer m_buffer {}; diff --git a/Userland/Libraries/LibSQL/TreeNode.cpp b/Userland/Libraries/LibSQL/TreeNode.cpp index a16016ed3ea..9f2f74d5b93 100644 --- a/Userland/Libraries/LibSQL/TreeNode.cpp +++ b/Userland/Libraries/LibSQL/TreeNode.cpp @@ -153,7 +153,7 @@ size_t TreeNode::length() const bool TreeNode::insert(Key const& key) { - dbgln_if(SQL_DEBUG, "[#{}] INSERT({})", pointer(), key.to_string()); + dbgln_if(SQL_DEBUG, "[#{}] INSERT({})", pointer(), key.to_deprecated_string()); if (!is_leaf()) return node_for(key)->insert_in_leaf(key); return insert_in_leaf(key); @@ -161,14 +161,14 @@ bool TreeNode::insert(Key const& key) bool TreeNode::update_key_pointer(Key const& key) { - dbgln_if(SQL_DEBUG, "[#{}] UPDATE({}, {})", pointer(), key.to_string(), key.pointer()); + dbgln_if(SQL_DEBUG, "[#{}] UPDATE({}, {})", pointer(), key.to_deprecated_string(), key.pointer()); if (!is_leaf()) return node_for(key)->update_key_pointer(key); for (auto ix = 0u; ix < size(); ix++) { if (key == m_entries[ix]) { dbgln_if(SQL_DEBUG, "[#{}] {} == {}", - pointer(), key.to_string(), m_entries[ix].to_string()); + pointer(), key.to_deprecated_string(), m_entries[ix].to_deprecated_string()); if (m_entries[ix].pointer() != key.pointer()) { m_entries[ix].set_pointer(key.pointer()); dump_if(SQL_DEBUG, "To WAL"); @@ -186,13 +186,13 @@ bool TreeNode::insert_in_leaf(Key const& key) if (!m_tree.duplicates_allowed()) { for (auto& entry : m_entries) { if (key == entry) { - dbgln_if(SQL_DEBUG, "[#{}] duplicate key {}", pointer(), key.to_string()); + dbgln_if(SQL_DEBUG, "[#{}] duplicate key {}", pointer(), key.to_deprecated_string()); return false; } } } - dbgln_if(SQL_DEBUG, "[#{}] insert_in_leaf({})", pointer(), key.to_string()); + dbgln_if(SQL_DEBUG, "[#{}] insert_in_leaf({})", pointer(), key.to_deprecated_string()); just_insert(key, nullptr); return true; } @@ -209,7 +209,7 @@ TreeNode* TreeNode::down_node(size_t ix) TreeNode* TreeNode::node_for(Key const& key) { - dump_if(SQL_DEBUG, DeprecatedString::formatted("node_for(Key {})", key.to_string())); + dump_if(SQL_DEBUG, DeprecatedString::formatted("node_for(Key {})", key.to_deprecated_string())); if (is_leaf()) return this; for (size_t ix = 0; ix < size(); ix++) { @@ -220,45 +220,45 @@ TreeNode* TreeNode::node_for(Key const& key) } } dbgln_if(SQL_DEBUG, "[#{}] {} >= {} v{}", - pointer(), key.to_string(), (DeprecatedString)m_entries[size() - 1], m_down[size()].pointer()); + pointer(), key.to_deprecated_string(), (DeprecatedString)m_entries[size() - 1], m_down[size()].pointer()); return down_node(size())->node_for(key); } Optional TreeNode::get(Key& key) { - dump_if(SQL_DEBUG, DeprecatedString::formatted("get({})", key.to_string())); + dump_if(SQL_DEBUG, DeprecatedString::formatted("get({})", key.to_deprecated_string())); for (auto ix = 0u; ix < size(); ix++) { if (key < m_entries[ix]) { if (is_leaf()) { dbgln_if(SQL_DEBUG, "[#{}] {} < {} -> 0", - pointer(), key.to_string(), (DeprecatedString)m_entries[ix]); + pointer(), key.to_deprecated_string(), (DeprecatedString)m_entries[ix]); return {}; } else { dbgln_if(SQL_DEBUG, "[{}] {} < {} ({} -> {})", - pointer(), key.to_string(), (DeprecatedString)m_entries[ix], + pointer(), key.to_deprecated_string(), (DeprecatedString)m_entries[ix], ix, m_down[ix].pointer()); return down_node(ix)->get(key); } } if (key == m_entries[ix]) { dbgln_if(SQL_DEBUG, "[#{}] {} == {} -> {}", - pointer(), key.to_string(), (DeprecatedString)m_entries[ix], + pointer(), key.to_deprecated_string(), (DeprecatedString)m_entries[ix], m_entries[ix].pointer()); key.set_pointer(m_entries[ix].pointer()); return m_entries[ix].pointer(); } } if (m_entries.is_empty()) { - dbgln_if(SQL_DEBUG, "[#{}] {} Empty node??", pointer(), key.to_string()); + dbgln_if(SQL_DEBUG, "[#{}] {} Empty node??", pointer(), key.to_deprecated_string()); VERIFY_NOT_REACHED(); } if (is_leaf()) { dbgln_if(SQL_DEBUG, "[#{}] {} > {} -> 0", - pointer(), key.to_string(), (DeprecatedString)m_entries[size() - 1]); + pointer(), key.to_deprecated_string(), (DeprecatedString)m_entries[size() - 1]); return {}; } dbgln_if(SQL_DEBUG, "[#{}] {} > {} ({} -> {})", - pointer(), key.to_string(), (DeprecatedString)m_entries[size() - 1], + pointer(), key.to_deprecated_string(), (DeprecatedString)m_entries[size() - 1], size(), m_down[size()].pointer()); return down_node(size())->get(key); } @@ -381,7 +381,7 @@ void TreeNode::list_node(int indent) down_node(ix)->list_node(indent + 2); } do_indent(); - warnln("{}", m_entries[ix].to_string()); + warnln("{}", m_entries[ix].to_deprecated_string()); } if (!is_leaf()) { down_node(size())->list_node(indent + 2); diff --git a/Userland/Libraries/LibSQL/Tuple.cpp b/Userland/Libraries/LibSQL/Tuple.cpp index cbfb077082f..093bca530de 100644 --- a/Userland/Libraries/LibSQL/Tuple.cpp +++ b/Userland/Libraries/LibSQL/Tuple.cpp @@ -161,14 +161,14 @@ size_t Tuple::length() const return len; } -DeprecatedString Tuple::to_string() const +DeprecatedString Tuple::to_deprecated_string() const { StringBuilder builder; for (auto& part : m_data) { if (!builder.is_empty()) { builder.append('|'); } - builder.append(part.to_string()); + builder.append(part.to_deprecated_string()); } if (pointer() != 0) { builder.appendff(":{}", pointer()); @@ -176,11 +176,11 @@ DeprecatedString Tuple::to_string() const return builder.build(); } -Vector Tuple::to_string_vector() const +Vector Tuple::to_deprecated_string_vector() const { Vector ret; for (auto& value : m_data) { - ret.append(value.to_string()); + ret.append(value.to_deprecated_string()); } return ret; } diff --git a/Userland/Libraries/LibSQL/Tuple.h b/Userland/Libraries/LibSQL/Tuple.h index bf2d1c0db40..d4a1e6a5f58 100644 --- a/Userland/Libraries/LibSQL/Tuple.h +++ b/Userland/Libraries/LibSQL/Tuple.h @@ -35,9 +35,9 @@ public: Tuple& operator=(Tuple const&); - [[nodiscard]] DeprecatedString to_string() const; - explicit operator DeprecatedString() const { return to_string(); } - [[nodiscard]] Vector to_string_vector() const; + [[nodiscard]] DeprecatedString to_deprecated_string() const; + explicit operator DeprecatedString() const { return to_deprecated_string(); } + [[nodiscard]] Vector to_deprecated_string_vector() const; bool operator<(Tuple const& other) const { return compare(other) < 0; } bool operator<=(Tuple const& other) const { return compare(other) <= 0; } diff --git a/Userland/Libraries/LibSQL/TupleDescriptor.h b/Userland/Libraries/LibSQL/TupleDescriptor.h index e9f30850b00..26f34102286 100644 --- a/Userland/Libraries/LibSQL/TupleDescriptor.h +++ b/Userland/Libraries/LibSQL/TupleDescriptor.h @@ -39,7 +39,7 @@ struct TupleElementDescriptor { return (sizeof(u32) + name.length()) + 2 * sizeof(u8); } - DeprecatedString to_string() const + DeprecatedString to_deprecated_string() const { return DeprecatedString::formatted(" name: {} type: {} order: {}", name, SQLType_name(type), Order_name(order)); } @@ -91,11 +91,11 @@ public: return len; } - DeprecatedString to_string() const + DeprecatedString to_deprecated_string() const { Vector elements; for (auto& element : *this) { - elements.append(element.to_string()); + elements.append(element.to_deprecated_string()); } return DeprecatedString::formatted("[\n{}\n]", DeprecatedString::join('\n', elements)); } diff --git a/Userland/Libraries/LibSQL/Value.cpp b/Userland/Libraries/LibSQL/Value.cpp index e65030fb644..7f7f5c841b2 100644 --- a/Userland/Libraries/LibSQL/Value.cpp +++ b/Userland/Libraries/LibSQL/Value.cpp @@ -105,7 +105,7 @@ bool Value::is_null() const return !m_value.has_value(); } -DeprecatedString Value::to_string() const +DeprecatedString Value::to_deprecated_string() const { if (is_null()) return "(null)"sv; @@ -346,7 +346,7 @@ int Value::compare(Value const& other) const return 1; return m_value->visit( - [&](DeprecatedString const& value) -> int { return value.view().compare(other.to_string()); }, + [&](DeprecatedString const& value) -> int { return value.view().compare(other.to_deprecated_string()); }, [&](int value) -> int { auto casted = other.to_int(); if (!casted.has_value()) @@ -407,7 +407,7 @@ bool Value::operator==(Value const& value) const bool Value::operator==(StringView value) const { - return to_string() == value; + return to_deprecated_string() == value; } bool Value::operator==(int value) const diff --git a/Userland/Libraries/LibSQL/Value.h b/Userland/Libraries/LibSQL/Value.h index ff5054bea0d..8ae98a41026 100644 --- a/Userland/Libraries/LibSQL/Value.h +++ b/Userland/Libraries/LibSQL/Value.h @@ -49,7 +49,7 @@ public: [[nodiscard]] StringView type_name() const; [[nodiscard]] bool is_null() const; - [[nodiscard]] DeprecatedString to_string() const; + [[nodiscard]] DeprecatedString to_deprecated_string() const; [[nodiscard]] Optional to_int() const; [[nodiscard]] Optional to_u32() const; [[nodiscard]] Optional to_double() const; @@ -125,6 +125,6 @@ template<> struct AK::Formatter : Formatter { ErrorOr format(FormatBuilder& builder, SQL::Value const& value) { - return Formatter::format(builder, value.to_string()); + return Formatter::format(builder, value.to_deprecated_string()); } }; diff --git a/Userland/Libraries/LibSoftGPU/Device.cpp b/Userland/Libraries/LibSoftGPU/Device.cpp index 9f6d2e7082c..284daabb722 100644 --- a/Userland/Libraries/LibSoftGPU/Device.cpp +++ b/Userland/Libraries/LibSoftGPU/Device.cpp @@ -1579,7 +1579,7 @@ void Device::draw_statistics_overlay(Gfx::Bitmap& target) num_rendertarget_pixels > 0 ? g_num_pixels_shaded * 100 / num_rendertarget_pixels - 100 : 0)); builder.append(DeprecatedString::formatted("Sampler calls: {}\n", g_num_sampler_calls)); - debug_string = builder.to_string(); + debug_string = builder.to_deprecated_string(); frame_counter = 0; timer.start(); diff --git a/Userland/Libraries/LibSymbolication/Symbolication.cpp b/Userland/Libraries/LibSymbolication/Symbolication.cpp index 2d5733fd32b..231407116d1 100644 --- a/Userland/Libraries/LibSymbolication/Symbolication.cpp +++ b/Userland/Libraries/LibSymbolication/Symbolication.cpp @@ -187,7 +187,7 @@ Vector symbolicate_thread(pid_t pid, pid_t tid, IncludeSourcePosition in for (auto& region_value : json.value().as_array().values()) { auto& region = region_value.as_object(); - auto name = region.get("name"sv).to_string(); + auto name = region.get("name"sv).to_deprecated_string(); auto address = region.get("address"sv).to_addr(); auto size = region.get("size"sv).to_addr(); diff --git a/Userland/Libraries/LibTLS/Certificate.cpp b/Userland/Libraries/LibTLS/Certificate.cpp index b5cce14b864..52e0db28a30 100644 --- a/Userland/Libraries/LibTLS/Certificate.cpp +++ b/Userland/Libraries/LibTLS/Certificate.cpp @@ -446,7 +446,7 @@ Optional Certificate::parse_asn1(ReadonlyBytes buffer, bool) // IP Address READ_OBJECT_OR_FAIL(OctetString, StringView, ip_addr_sv, "Certificate::TBSCertificate::Extensions::$::Extension::extension_value::SubjectAlternativeName::$::IPAddress"); IPv4Address ip_addr { ip_addr_sv.bytes().data() }; - certificate.SAN.append(ip_addr.to_string()); + certificate.SAN.append(ip_addr.to_deprecated_string()); break; } case 8: diff --git a/Userland/Libraries/LibTLS/TLSv12.cpp b/Userland/Libraries/LibTLS/TLSv12.cpp index 757cca8270e..fefd7272be3 100644 --- a/Userland/Libraries/LibTLS/TLSv12.cpp +++ b/Userland/Libraries/LibTLS/TLSv12.cpp @@ -102,12 +102,12 @@ bool Certificate::is_valid() const auto now = Core::DateTime::now(); if (now < not_before) { - dbgln("certificate expired (not yet valid, signed for {})", not_before.to_string()); + dbgln("certificate expired (not yet valid, signed for {})", not_before.to_deprecated_string()); return false; } if (not_after < now) { - dbgln("certificate expired (expiry date {})", not_after.to_string()); + dbgln("certificate expired (expiry date {})", not_after.to_deprecated_string()); return false; } diff --git a/Userland/Libraries/LibTest/JavaScriptTestRunner.h b/Userland/Libraries/LibTest/JavaScriptTestRunner.h index 99cadf7884c..fa7389678e4 100644 --- a/Userland/Libraries/LibTest/JavaScriptTestRunner.h +++ b/Userland/Libraries/LibTest/JavaScriptTestRunner.h @@ -353,7 +353,7 @@ inline JSFileResult TestRunner::run_file_test(DeprecatedString const& test_path) auto result = parse_script(m_common_path, interpreter->realm()); if (result.is_error()) { warnln("Unable to parse test-common.js"); - warnln("{}", result.error().error.to_string()); + warnln("{}", result.error().error.to_deprecated_string()); warnln("{}", result.error().hint); cleanup_and_exit(); } @@ -487,7 +487,7 @@ inline JSFileResult TestRunner::run_file_test(DeprecatedString const& test_path) detail_builder.append(error_as_error.stack_string()); } - test_case.details = detail_builder.to_string(); + test_case.details = detail_builder.to_deprecated_string(); } else { test_case.details = error.to_string_without_side_effects(); } @@ -567,7 +567,7 @@ inline void TestRunner::print_file_result(JSFileResult const& file_result) const outln(" {}", message); } print_modifiers({ FG_RED }); - outln(" {}", test_error.error.to_string()); + outln(" {}", test_error.error.to_deprecated_string()); outln(); return; } diff --git a/Userland/Libraries/LibTest/TestRunner.h b/Userland/Libraries/LibTest/TestRunner.h index 8760ab7008e..73211d03408 100644 --- a/Userland/Libraries/LibTest/TestRunner.h +++ b/Userland/Libraries/LibTest/TestRunner.h @@ -264,7 +264,7 @@ inline void TestRunner::print_test_results_as_json() const root.set("files_total", m_counts.files_total); root.set("duration", m_total_elapsed_time_in_ms / 1000.0); } - outln("{}", root.to_string()); + outln("{}", root.to_deprecated_string()); } } diff --git a/Userland/Libraries/LibTextCodec/Decoder.cpp b/Userland/Libraries/LibTextCodec/Decoder.cpp index 71db2563b51..47f4805bd85 100644 --- a/Userland/Libraries/LibTextCodec/Decoder.cpp +++ b/Userland/Libraries/LibTextCodec/Decoder.cpp @@ -211,7 +211,7 @@ DeprecatedString Decoder::to_utf8(StringView input) { StringBuilder builder(input.length()); process(input, [&builder](u32 c) { builder.append_code_point(c); }); - return builder.to_string(); + return builder.to_deprecated_string(); } void UTF8Decoder::process(StringView input, Function on_code_point) @@ -250,7 +250,7 @@ DeprecatedString UTF16BEDecoder::to_utf8(StringView input) StringBuilder builder(bomless_input.length() / 2); process(bomless_input, [&builder](u32 c) { builder.append_code_point(c); }); - return builder.to_string(); + return builder.to_deprecated_string(); } void UTF16LEDecoder::process(StringView input, Function on_code_point) @@ -271,7 +271,7 @@ DeprecatedString UTF16LEDecoder::to_utf8(StringView input) StringBuilder builder(bomless_input.length() / 2); process(bomless_input, [&builder](u32 c) { builder.append_code_point(c); }); - return builder.to_string(); + return builder.to_deprecated_string(); } void Latin1Decoder::process(StringView input, Function on_code_point) diff --git a/Userland/Libraries/LibUnicode/Normalize.cpp b/Userland/Libraries/LibUnicode/Normalize.cpp index b765c0258fc..55ad0877e97 100644 --- a/Userland/Libraries/LibUnicode/Normalize.cpp +++ b/Userland/Libraries/LibUnicode/Normalize.cpp @@ -307,7 +307,7 @@ DeprecatedString normalize(StringView string, NormalizationForm form) builder.append_code_point(code_point); } - return builder.to_string(); + return builder.to_deprecated_string(); } } diff --git a/Userland/Libraries/LibVT/Terminal.cpp b/Userland/Libraries/LibVT/Terminal.cpp index 27c5e9cf4d3..39cf984b7c5 100644 --- a/Userland/Libraries/LibVT/Terminal.cpp +++ b/Userland/Libraries/LibVT/Terminal.cpp @@ -1264,7 +1264,7 @@ void Terminal::execute_osc_sequence(OscParameters parameters, u8 last_byte) // FIXME: the split breaks titles containing semicolons. // Should we expose the raw OSC string from the parser? Or join by semicolon? #ifndef KERNEL - m_current_window_title = stringview_ify(1).to_string(); + m_current_window_title = stringview_ify(1).to_deprecated_string(); m_client.set_window_title(m_current_window_title); #endif } diff --git a/Userland/Libraries/LibVT/TerminalWidget.cpp b/Userland/Libraries/LibVT/TerminalWidget.cpp index 039a97b25af..a53d5a6b9a3 100644 --- a/Userland/Libraries/LibVT/TerminalWidget.cpp +++ b/Userland/Libraries/LibVT/TerminalWidget.cpp @@ -980,7 +980,7 @@ DeprecatedString TerminalWidget::selected_text() const } } - return builder.to_string(); + return builder.to_deprecated_string(); } int TerminalWidget::first_selection_column_on_row(int row) const @@ -1153,7 +1153,7 @@ void TerminalWidget::drop_event(GUI::DropEvent& event) if (url.scheme() == "file") send_non_user_input(url.path().bytes()); else - send_non_user_input(url.to_string().bytes()); + send_non_user_input(url.to_deprecated_string().bytes()); first = false; } diff --git a/Userland/Libraries/LibVideo/PlaybackManager.cpp b/Userland/Libraries/LibVideo/PlaybackManager.cpp index 2332f69494f..725516dee4f 100644 --- a/Userland/Libraries/LibVideo/PlaybackManager.cpp +++ b/Userland/Libraries/LibVideo/PlaybackManager.cpp @@ -176,7 +176,7 @@ void PlaybackManager::update_presented_frame() debug_string_builder.append("a future frame"sv); } debug_string_builder.append(", checking for error and buffering"sv); - dbgln_if(PLAYBACK_MANAGER_DEBUG, debug_string_builder.to_string()); + dbgln_if(PLAYBACK_MANAGER_DEBUG, debug_string_builder.to_deprecated_string()); #endif if (future_frame_item.has_value()) { if (future_frame_item->is_error()) { diff --git a/Userland/Libraries/LibWasm/AbstractMachine/Validator.h b/Userland/Libraries/LibWasm/AbstractMachine/Validator.h index 29e08fae64b..f8b4ef2d0c5 100644 --- a/Userland/Libraries/LibWasm/AbstractMachine/Validator.h +++ b/Userland/Libraries/LibWasm/AbstractMachine/Validator.h @@ -306,7 +306,7 @@ private: } } builder.append(']'); - return { builder.to_string() }; + return { builder.to_deprecated_string() }; } private: diff --git a/Userland/Libraries/LibWasm/Parser/Parser.cpp b/Userland/Libraries/LibWasm/Parser/Parser.cpp index f135de03346..362acf2891e 100644 --- a/Userland/Libraries/LibWasm/Parser/Parser.cpp +++ b/Userland/Libraries/LibWasm/Parser/Parser.cpp @@ -1364,7 +1364,7 @@ bool Module::populate_sections() return is_ok; } -DeprecatedString parse_error_to_string(ParseError error) +DeprecatedString parse_error_to_deprecated_string(ParseError error) { switch (error) { case ParseError::UnexpectedEof: diff --git a/Userland/Libraries/LibWasm/Types.h b/Userland/Libraries/LibWasm/Types.h index 72b1cdbd1fc..e9034de338b 100644 --- a/Userland/Libraries/LibWasm/Types.h +++ b/Userland/Libraries/LibWasm/Types.h @@ -43,7 +43,7 @@ enum class ParseError { NotImplemented, }; -DeprecatedString parse_error_to_string(ParseError); +DeprecatedString parse_error_to_deprecated_string(ParseError); template using ParseResult = Result; diff --git a/Userland/Libraries/LibWeb/Bindings/LocationObject.cpp b/Userland/Libraries/LibWeb/Bindings/LocationObject.cpp index 67f5223a37f..1f7bfaa2bda 100644 --- a/Userland/Libraries/LibWeb/Bindings/LocationObject.cpp +++ b/Userland/Libraries/LibWeb/Bindings/LocationObject.cpp @@ -97,7 +97,7 @@ JS_DEFINE_NATIVE_FUNCTION(LocationObject::href_getter) // FIXME: 1. If this's relevant Document is non-null and its origin is not same origin-domain with the entry settings object's origin, then throw a "SecurityError" DOMException. // 2. Return this's url, serialized. - return JS::js_string(vm, location_object->url().to_string()); + return JS::js_string(vm, location_object->url().to_deprecated_string()); } // https://html.spec.whatwg.org/multipage/history.html#the-location-interface:dom-location-href-2 diff --git a/Userland/Libraries/LibWeb/CSS/Angle.cpp b/Userland/Libraries/LibWeb/CSS/Angle.cpp index fb1119fa800..91652479af9 100644 --- a/Userland/Libraries/LibWeb/CSS/Angle.cpp +++ b/Userland/Libraries/LibWeb/CSS/Angle.cpp @@ -41,10 +41,10 @@ Angle Angle::percentage_of(Percentage const& percentage) const return Angle { percentage.as_fraction() * m_value, m_type }; } -DeprecatedString Angle::to_string() const +DeprecatedString Angle::to_deprecated_string() const { if (is_calculated()) - return m_calculated_style->to_string(); + return m_calculated_style->to_deprecated_string(); return DeprecatedString::formatted("{}{}", m_value, unit_name()); } diff --git a/Userland/Libraries/LibWeb/CSS/Angle.h b/Userland/Libraries/LibWeb/CSS/Angle.h index 1200fb8719f..10351cc28c3 100644 --- a/Userland/Libraries/LibWeb/CSS/Angle.h +++ b/Userland/Libraries/LibWeb/CSS/Angle.h @@ -33,7 +33,7 @@ public: bool is_calculated() const { return m_type == Type::Calculated; } NonnullRefPtr calculated_style_value() const; - DeprecatedString to_string() const; + DeprecatedString to_deprecated_string() const; float to_degrees() const; bool operator==(Angle const& other) const @@ -57,6 +57,6 @@ template<> struct AK::Formatter : Formatter { ErrorOr format(FormatBuilder& builder, Web::CSS::Angle const& angle) { - return Formatter::format(builder, angle.to_string()); + return Formatter::format(builder, angle.to_deprecated_string()); } }; diff --git a/Userland/Libraries/LibWeb/CSS/CSSFontFaceRule.cpp b/Userland/Libraries/LibWeb/CSS/CSSFontFaceRule.cpp index c5e1b001a0f..b4a784d66bc 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSFontFaceRule.cpp +++ b/Userland/Libraries/LibWeb/CSS/CSSFontFaceRule.cpp @@ -56,9 +56,9 @@ DeprecatedString CSSFontFaceRule::serialized() const // 2. The result of invoking serialize a comma-separated list on performing serialize a URL or serialize a LOCAL for each source on the source list. serialize_a_comma_separated_list(builder, m_font_face.sources(), [&](FontFace::Source source) { if (source.url.cannot_be_a_base_url()) { - serialize_a_url(builder, source.url.to_string()); + serialize_a_url(builder, source.url.to_deprecated_string()); } else { - serialize_a_local(builder, source.url.to_string()); + serialize_a_local(builder, source.url.to_deprecated_string()); } // NOTE: No spec currently exists for format() @@ -106,7 +106,7 @@ DeprecatedString CSSFontFaceRule::serialized() const // 12. A single SPACE (U+0020), followed by the string "}", i.e., RIGHT CURLY BRACKET (U+007D). builder.append(" }"sv); - return builder.to_string(); + return builder.to_deprecated_string(); } } diff --git a/Userland/Libraries/LibWeb/CSS/CSSImportRule.cpp b/Userland/Libraries/LibWeb/CSS/CSSImportRule.cpp index 3f3c9e7d2a5..e4ec8b58832 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSImportRule.cpp +++ b/Userland/Libraries/LibWeb/CSS/CSSImportRule.cpp @@ -60,7 +60,7 @@ DeprecatedString CSSImportRule::serialized() const // 2. The result of performing serialize a URL on the rule’s location. // FIXME: Look into the correctness of this serialization builder.append("url("sv); - builder.append(m_url.to_string()); + builder.append(m_url.to_deprecated_string()); builder.append(')'); // FIXME: 3. If the rule’s associated media list is not empty, a single SPACE (U+0020) followed by the result of performing serialize a media query list on the media list. @@ -68,7 +68,7 @@ DeprecatedString CSSImportRule::serialized() const // 4. The string ";", i.e., SEMICOLON (U+003B). builder.append(';'); - return builder.to_string(); + return builder.to_deprecated_string(); } void CSSImportRule::resource_did_fail() diff --git a/Userland/Libraries/LibWeb/CSS/CSSImportRule.h b/Userland/Libraries/LibWeb/CSS/CSSImportRule.h index 077d8894d69..9d013690c73 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSImportRule.h +++ b/Userland/Libraries/LibWeb/CSS/CSSImportRule.h @@ -27,7 +27,7 @@ public: AK::URL const& url() const { return m_url; } // FIXME: This should return only the specified part of the url. eg, "stuff/foo.css", not "https://example.com/stuff/foo.css". - DeprecatedString href() const { return m_url.to_string(); } + DeprecatedString href() const { return m_url.to_deprecated_string(); } bool has_import_result() const { return !m_style_sheet; } CSSStyleSheet* loaded_style_sheet() { return m_style_sheet; } diff --git a/Userland/Libraries/LibWeb/CSS/CSSMediaRule.cpp b/Userland/Libraries/LibWeb/CSS/CSSMediaRule.cpp index 0b0a7006406..c8393713477 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSMediaRule.cpp +++ b/Userland/Libraries/LibWeb/CSS/CSSMediaRule.cpp @@ -63,7 +63,7 @@ DeprecatedString CSSMediaRule::serialized() const // 5. A newline, followed by the string "}", i.e., RIGHT CURLY BRACKET (U+007D) builder.append("\n}"sv); - return builder.to_string(); + return builder.to_deprecated_string(); } } diff --git a/Userland/Libraries/LibWeb/CSS/CSSStyleDeclaration.cpp b/Userland/Libraries/LibWeb/CSS/CSSStyleDeclaration.cpp index 60be8ed766b..d5c4d286543 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSStyleDeclaration.cpp +++ b/Userland/Libraries/LibWeb/CSS/CSSStyleDeclaration.cpp @@ -201,7 +201,7 @@ DeprecatedString CSSStyleDeclaration::get_property_value(StringView property_nam auto maybe_property = property(property_id); if (!maybe_property.has_value()) return {}; - return maybe_property->value->to_string(); + return maybe_property->value->to_deprecated_string(); } // https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-getpropertypriority @@ -265,7 +265,7 @@ static DeprecatedString serialize_a_css_declaration(CSS::PropertyID property, De builder.append(';'); // 7. Return s. - return builder.to_string(); + return builder.to_deprecated_string(); } // https://www.w3.org/TR/cssom/#serialize-a-css-declaration-block @@ -291,7 +291,7 @@ DeprecatedString PropertyOwningCSSStyleDeclaration::serialized() const // FIXME: 4. Shorthand loop: For each shorthand in shorthands, follow these substeps: ... // 5. Let value be the result of invoking serialize a CSS value of declaration. - auto value = declaration.value->to_string(); + auto value = declaration.value->to_deprecated_string(); // 6. Let serialized declaration be the result of invoking serialize a CSS declaration with property name property, value value, // and the important flag set if declaration has its important flag set. @@ -307,7 +307,7 @@ DeprecatedString PropertyOwningCSSStyleDeclaration::serialized() const // 4. Return list joined with " " (U+0020). StringBuilder builder; builder.join(' ', list); - return builder.to_string(); + return builder.to_deprecated_string(); } static CSS::PropertyID property_id_from_name(StringView name) @@ -340,7 +340,7 @@ JS::ThrowCompletionOr CSSStyleDeclaration::internal_get(JS::PropertyK if (property_id == CSS::PropertyID::Invalid) return Base::internal_get(name, receiver); if (auto maybe_property = property(property_id); maybe_property.has_value()) - return { js_string(vm(), maybe_property->value->to_string()) }; + return { js_string(vm(), maybe_property->value->to_deprecated_string()) }; return { js_string(vm(), DeprecatedString::empty()) }; } diff --git a/Userland/Libraries/LibWeb/CSS/CSSStyleRule.cpp b/Userland/Libraries/LibWeb/CSS/CSSStyleRule.cpp index 1534f8cbf96..bef547ead4f 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSStyleRule.cpp +++ b/Userland/Libraries/LibWeb/CSS/CSSStyleRule.cpp @@ -55,7 +55,7 @@ DeprecatedString CSSStyleRule::serialized() const // 4. If decls and rules are both null, append " }" to s (i.e. a single SPACE (U+0020) followed by RIGHT CURLY BRACKET (U+007D)) and return s. if (decls.is_null() && rules.is_null()) { builder.append(" }"sv); - return builder.to_string(); + return builder.to_deprecated_string(); } // 5. If rules is null: @@ -67,7 +67,7 @@ DeprecatedString CSSStyleRule::serialized() const // 3. Append " }" to s (i.e. a single SPACE (U+0020) followed by RIGHT CURLY BRACKET (U+007D)). builder.append(" }"sv); // 4. Return s. - return builder.to_string(); + return builder.to_deprecated_string(); } // FIXME: 6. Otherwise: diff --git a/Userland/Libraries/LibWeb/CSS/CSSStyleSheet.cpp b/Userland/Libraries/LibWeb/CSS/CSSStyleSheet.cpp index c4639d0cd13..92ee1f3fcfe 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSStyleSheet.cpp +++ b/Userland/Libraries/LibWeb/CSS/CSSStyleSheet.cpp @@ -26,7 +26,7 @@ CSSStyleSheet::CSSStyleSheet(JS::Realm& realm, CSSRuleList& rules, MediaList& me set_prototype(&Bindings::ensure_web_prototype(realm, "CSSStyleSheet")); if (location.has_value()) - set_location(location->to_string()); + set_location(location->to_deprecated_string()); for (auto& rule : *m_rules) rule.set_parent_style_sheet(this); diff --git a/Userland/Libraries/LibWeb/CSS/CSSSupportsRule.cpp b/Userland/Libraries/LibWeb/CSS/CSSSupportsRule.cpp index 8270dc04299..ee5eda4895f 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSSupportsRule.cpp +++ b/Userland/Libraries/LibWeb/CSS/CSSSupportsRule.cpp @@ -25,7 +25,7 @@ CSSSupportsRule::CSSSupportsRule(JS::Realm& realm, NonnullRefPtr&& sup DeprecatedString CSSSupportsRule::condition_text() const { - return m_supports->to_string(); + return m_supports->to_deprecated_string(); } void CSSSupportsRule::set_condition_text(DeprecatedString text) @@ -54,7 +54,7 @@ DeprecatedString CSSSupportsRule::serialized() const } builder.append("\n}"sv); - return builder.to_string(); + return builder.to_deprecated_string(); } } diff --git a/Userland/Libraries/LibWeb/CSS/Display.cpp b/Userland/Libraries/LibWeb/CSS/Display.cpp index 084f695b48a..45844cef7f5 100644 --- a/Userland/Libraries/LibWeb/CSS/Display.cpp +++ b/Userland/Libraries/LibWeb/CSS/Display.cpp @@ -8,7 +8,7 @@ namespace Web::CSS { -DeprecatedString Display::to_string() const +DeprecatedString Display::to_deprecated_string() const { StringBuilder builder; switch (m_type) { @@ -99,7 +99,7 @@ DeprecatedString Display::to_string() const } break; }; - return builder.to_string(); + return builder.to_deprecated_string(); } } diff --git a/Userland/Libraries/LibWeb/CSS/Display.h b/Userland/Libraries/LibWeb/CSS/Display.h index 3787edc1fe2..294846d1085 100644 --- a/Userland/Libraries/LibWeb/CSS/Display.h +++ b/Userland/Libraries/LibWeb/CSS/Display.h @@ -16,7 +16,7 @@ public: Display() = default; ~Display() = default; - DeprecatedString to_string() const; + DeprecatedString to_deprecated_string() const; bool operator==(Display const& other) const { diff --git a/Userland/Libraries/LibWeb/CSS/Frequency.cpp b/Userland/Libraries/LibWeb/CSS/Frequency.cpp index 6f10359ce05..73dd09f0a60 100644 --- a/Userland/Libraries/LibWeb/CSS/Frequency.cpp +++ b/Userland/Libraries/LibWeb/CSS/Frequency.cpp @@ -40,10 +40,10 @@ Frequency Frequency::percentage_of(Percentage const& percentage) const return Frequency { percentage.as_fraction() * m_value, m_type }; } -DeprecatedString Frequency::to_string() const +DeprecatedString Frequency::to_deprecated_string() const { if (is_calculated()) - return m_calculated_style->to_string(); + return m_calculated_style->to_deprecated_string(); return DeprecatedString::formatted("{}{}", m_value, unit_name()); } diff --git a/Userland/Libraries/LibWeb/CSS/Frequency.h b/Userland/Libraries/LibWeb/CSS/Frequency.h index eeb3b91d6a3..acf4ad1e431 100644 --- a/Userland/Libraries/LibWeb/CSS/Frequency.h +++ b/Userland/Libraries/LibWeb/CSS/Frequency.h @@ -30,7 +30,7 @@ public: bool is_calculated() const { return m_type == Type::Calculated; } NonnullRefPtr calculated_style_value() const; - DeprecatedString to_string() const; + DeprecatedString to_deprecated_string() const; float to_hertz() const; bool operator==(Frequency const& other) const @@ -54,6 +54,6 @@ template<> struct AK::Formatter : Formatter { ErrorOr format(FormatBuilder& builder, Web::CSS::Frequency const& frequency) { - return Formatter::format(builder, frequency.to_string()); + return Formatter::format(builder, frequency.to_deprecated_string()); } }; diff --git a/Userland/Libraries/LibWeb/CSS/GridTrackPlacement.cpp b/Userland/Libraries/LibWeb/CSS/GridTrackPlacement.cpp index 3a62a033851..f771f6c5176 100644 --- a/Userland/Libraries/LibWeb/CSS/GridTrackPlacement.cpp +++ b/Userland/Libraries/LibWeb/CSS/GridTrackPlacement.cpp @@ -33,12 +33,12 @@ GridTrackPlacement::GridTrackPlacement() { } -DeprecatedString GridTrackPlacement::to_string() const +DeprecatedString GridTrackPlacement::to_deprecated_string() const { StringBuilder builder; if (is_auto()) { builder.append("auto"sv); - return builder.to_string(); + return builder.to_deprecated_string(); } if (is_span()) { builder.append("span"sv); @@ -51,7 +51,7 @@ DeprecatedString GridTrackPlacement::to_string() const if (has_line_name()) { builder.append(m_line_name); } - return builder.to_string(); + return builder.to_deprecated_string(); } } diff --git a/Userland/Libraries/LibWeb/CSS/GridTrackPlacement.h b/Userland/Libraries/LibWeb/CSS/GridTrackPlacement.h index 048b0193b97..78300e134b5 100644 --- a/Userland/Libraries/LibWeb/CSS/GridTrackPlacement.h +++ b/Userland/Libraries/LibWeb/CSS/GridTrackPlacement.h @@ -36,7 +36,7 @@ public: Type type() const { return m_type; } DeprecatedString line_name() const { return m_line_name; } - DeprecatedString to_string() const; + DeprecatedString to_deprecated_string() const; bool operator==(GridTrackPlacement const& other) const { return m_type == other.type() && m_span_count_or_position == other.raw_value(); diff --git a/Userland/Libraries/LibWeb/CSS/GridTrackSize.cpp b/Userland/Libraries/LibWeb/CSS/GridTrackSize.cpp index 04905b638b5..801dd37f7a5 100644 --- a/Userland/Libraries/LibWeb/CSS/GridTrackSize.cpp +++ b/Userland/Libraries/LibWeb/CSS/GridTrackSize.cpp @@ -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(); } } diff --git a/Userland/Libraries/LibWeb/CSS/GridTrackSize.h b/Userland/Libraries/LibWeb/CSS/GridTrackSize.h index f30d96490f3..59ea90d020a 100644 --- a/Userland/Libraries/LibWeb/CSS/GridTrackSize.h +++ b/Userland/Libraries/LibWeb/CSS/GridTrackSize.h @@ -52,7 +52,7 @@ public: return (m_type == Type::Length && !m_length.is_auto()) || is_percentage(); } - DeprecatedString to_string() const; + DeprecatedString to_deprecated_string() const; bool operator==(GridSize const& other) const { return m_type == other.type() @@ -78,7 +78,7 @@ public: GridSize min_grid_size() const& { return m_min_grid_size; } GridSize max_grid_size() const& { return m_max_grid_size; } - DeprecatedString to_string() const; + DeprecatedString to_deprecated_string() const; bool operator==(GridMinMax const& other) const { return m_min_grid_size == other.min_grid_size() @@ -100,7 +100,7 @@ public: Vector track_list() const { return m_track_list; } Vector> line_names() const { return m_line_names; } - DeprecatedString to_string() const; + DeprecatedString to_deprecated_string() const; bool operator==(GridTrackSizeList const& other) const { return m_line_names == other.line_names() && m_track_list == other.track_list(); @@ -133,7 +133,7 @@ public: GridTrackSizeList grid_track_size_list() const& { return m_grid_track_size_list; } Type type() const& { return m_type; } - DeprecatedString to_string() const; + DeprecatedString to_deprecated_string() const; bool operator==(GridRepeat const& other) const { if (m_type != other.type()) @@ -183,7 +183,7 @@ public: Type type() const { return m_type; } - DeprecatedString to_string() const; + DeprecatedString to_deprecated_string() const; bool operator==(ExplicitGridTrack const& other) const { if (is_repeat() && other.is_repeat()) diff --git a/Userland/Libraries/LibWeb/CSS/Length.cpp b/Userland/Libraries/LibWeb/CSS/Length.cpp index bb6efa3a2ff..071ffbe478a 100644 --- a/Userland/Libraries/LibWeb/CSS/Length.cpp +++ b/Userland/Libraries/LibWeb/CSS/Length.cpp @@ -112,10 +112,10 @@ float Length::to_px(Layout::Node const& layout_node) const return to_px(viewport_rect, layout_node.font().pixel_metrics(), layout_node.computed_values().font_size(), root_element->layout_node()->computed_values().font_size()); } -DeprecatedString Length::to_string() const +DeprecatedString Length::to_deprecated_string() const { if (is_calculated()) - return m_calculated_style->to_string(); + return m_calculated_style->to_deprecated_string(); if (is_auto()) return "auto"; return DeprecatedString::formatted("{}{}", m_value, unit_name()); diff --git a/Userland/Libraries/LibWeb/CSS/Length.h b/Userland/Libraries/LibWeb/CSS/Length.h index a8a8d3c639e..f1685595159 100644 --- a/Userland/Libraries/LibWeb/CSS/Length.h +++ b/Userland/Libraries/LibWeb/CSS/Length.h @@ -116,7 +116,7 @@ public: } } - DeprecatedString to_string() const; + DeprecatedString to_deprecated_string() const; // We have a RefPtr member, but can't include the header StyleValue.h as it includes // this file already. To break the cyclic dependency, we must move all method definitions out. @@ -139,6 +139,6 @@ template<> struct AK::Formatter : Formatter { ErrorOr format(FormatBuilder& builder, Web::CSS::Length const& length) { - return Formatter::format(builder, length.to_string()); + return Formatter::format(builder, length.to_deprecated_string()); } }; diff --git a/Userland/Libraries/LibWeb/CSS/MediaList.cpp b/Userland/Libraries/LibWeb/CSS/MediaList.cpp index 623bd833dc6..1d4ec36ede1 100644 --- a/Userland/Libraries/LibWeb/CSS/MediaList.cpp +++ b/Userland/Libraries/LibWeb/CSS/MediaList.cpp @@ -49,7 +49,7 @@ DeprecatedString MediaList::item(u32 index) const if (!is_supported_property_index(index)) return {}; - return m_media[index].to_string(); + return m_media[index].to_deprecated_string(); } // https://www.w3.org/TR/cssom-1/#dom-medialist-appendmedium @@ -70,7 +70,7 @@ void MediaList::delete_medium(DeprecatedString medium) if (!m) return; m_media.remove_all_matching([&](auto& existing) -> bool { - return m->to_string() == existing->to_string(); + return m->to_deprecated_string() == existing->to_deprecated_string(); }); // FIXME: If nothing was removed, then throw a NotFoundError exception. } @@ -100,7 +100,7 @@ JS::Value MediaList::item_value(size_t index) const { if (index >= m_media.size()) return JS::js_undefined(); - return JS::js_string(vm(), m_media[index].to_string()); + return JS::js_string(vm(), m_media[index].to_deprecated_string()); } } diff --git a/Userland/Libraries/LibWeb/CSS/MediaQuery.cpp b/Userland/Libraries/LibWeb/CSS/MediaQuery.cpp index e04e5995bb5..84e50987bf1 100644 --- a/Userland/Libraries/LibWeb/CSS/MediaQuery.cpp +++ b/Userland/Libraries/LibWeb/CSS/MediaQuery.cpp @@ -20,13 +20,13 @@ NonnullRefPtr MediaQuery::create_not_all() return adopt_ref(*media_query); } -DeprecatedString MediaFeatureValue::to_string() const +DeprecatedString MediaFeatureValue::to_deprecated_string() const { return m_value.visit( [](ValueID const& ident) { return DeprecatedString { string_from_value_id(ident) }; }, - [](Length const& length) { return length.to_string(); }, - [](Ratio const& ratio) { return ratio.to_string(); }, - [](Resolution const& resolution) { return resolution.to_string(); }, + [](Length const& length) { return length.to_deprecated_string(); }, + [](Ratio const& ratio) { return ratio.to_deprecated_string(); }, + [](Resolution const& resolution) { return resolution.to_deprecated_string(); }, [](float number) { return DeprecatedString::number(number); }); } @@ -40,7 +40,7 @@ bool MediaFeatureValue::is_same_type(MediaFeatureValue const& other) const [&](float) { return other.is_number(); }); } -DeprecatedString MediaFeature::to_string() const +DeprecatedString MediaFeature::to_deprecated_string() const { auto comparison_string = [](Comparison comparison) -> StringView { switch (comparison) { @@ -62,16 +62,16 @@ DeprecatedString MediaFeature::to_string() const case Type::IsTrue: return string_from_media_feature_id(m_id); case Type::ExactValue: - return DeprecatedString::formatted("{}:{}", string_from_media_feature_id(m_id), m_value->to_string()); + return DeprecatedString::formatted("{}:{}", string_from_media_feature_id(m_id), m_value->to_deprecated_string()); case Type::MinValue: - return DeprecatedString::formatted("min-{}:{}", string_from_media_feature_id(m_id), m_value->to_string()); + return DeprecatedString::formatted("min-{}:{}", string_from_media_feature_id(m_id), m_value->to_deprecated_string()); case Type::MaxValue: - return DeprecatedString::formatted("max-{}:{}", string_from_media_feature_id(m_id), m_value->to_string()); + return DeprecatedString::formatted("max-{}:{}", string_from_media_feature_id(m_id), m_value->to_deprecated_string()); case Type::Range: if (!m_range->right_comparison.has_value()) - return DeprecatedString::formatted("{} {} {}", m_range->left_value.to_string(), comparison_string(m_range->left_comparison), string_from_media_feature_id(m_id)); + return DeprecatedString::formatted("{} {} {}", m_range->left_value.to_deprecated_string(), comparison_string(m_range->left_comparison), string_from_media_feature_id(m_id)); - return DeprecatedString::formatted("{} {} {} {} {}", m_range->left_value.to_string(), comparison_string(m_range->left_comparison), string_from_media_feature_id(m_id), comparison_string(*m_range->right_comparison), m_range->right_value->to_string()); + return DeprecatedString::formatted("{} {} {} {} {}", m_range->left_value.to_deprecated_string(), comparison_string(m_range->left_comparison), string_from_media_feature_id(m_id), comparison_string(*m_range->right_comparison), m_range->right_value->to_deprecated_string()); } VERIFY_NOT_REACHED(); @@ -275,17 +275,17 @@ NonnullOwnPtr MediaCondition::from_or_list(NonnullOwnPtrVectorto_string()); + builder.append(feature->to_deprecated_string()); break; case Type::Not: builder.append("not "sv); - builder.append(conditions.first().to_string()); + builder.append(conditions.first().to_deprecated_string()); break; case Type::And: builder.join(" and "sv, conditions); @@ -298,7 +298,7 @@ DeprecatedString MediaCondition::to_string() const break; } builder.append(')'); - return builder.to_string(); + return builder.to_deprecated_string(); } MatchResult MediaCondition::evaluate(HTML::Window const& window) const @@ -318,7 +318,7 @@ MatchResult MediaCondition::evaluate(HTML::Window const& window) const VERIFY_NOT_REACHED(); } -DeprecatedString MediaQuery::to_string() const +DeprecatedString MediaQuery::to_deprecated_string() const { StringBuilder builder; @@ -332,10 +332,10 @@ DeprecatedString MediaQuery::to_string() const } if (m_media_condition) { - builder.append(m_media_condition->to_string()); + builder.append(m_media_condition->to_deprecated_string()); } - return builder.to_string(); + return builder.to_deprecated_string(); } bool MediaQuery::evaluate(HTML::Window const& window) @@ -389,7 +389,7 @@ DeprecatedString serialize_a_media_query_list(NonnullRefPtrVector co // appear in the media query list, and then serialize the list. StringBuilder builder; builder.join(", "sv, media_queries); - return builder.to_string(); + return builder.to_deprecated_string(); } bool is_media_feature_name(StringView name) diff --git a/Userland/Libraries/LibWeb/CSS/MediaQuery.h b/Userland/Libraries/LibWeb/CSS/MediaQuery.h index 32388fb62a8..45aab1b8f01 100644 --- a/Userland/Libraries/LibWeb/CSS/MediaQuery.h +++ b/Userland/Libraries/LibWeb/CSS/MediaQuery.h @@ -47,7 +47,7 @@ public: { } - DeprecatedString to_string() const; + DeprecatedString to_deprecated_string() const; bool is_ident() const { return m_value.has(); } bool is_length() const { return m_value.has(); } @@ -146,7 +146,7 @@ public: } bool evaluate(HTML::Window const&) const; - DeprecatedString to_string() const; + DeprecatedString to_deprecated_string() const; private: enum class Type { @@ -202,7 +202,7 @@ struct MediaCondition { static NonnullOwnPtr from_or_list(NonnullOwnPtrVector&&); MatchResult evaluate(HTML::Window const&) const; - DeprecatedString to_string() const; + DeprecatedString to_deprecated_string() const; private: MediaCondition() = default; @@ -241,7 +241,7 @@ public: bool matches() const { return m_matches; } bool evaluate(HTML::Window const&); - DeprecatedString to_string() const; + DeprecatedString to_deprecated_string() const; private: MediaQuery() = default; @@ -270,7 +270,7 @@ template<> struct Formatter : Formatter { ErrorOr format(FormatBuilder& builder, Web::CSS::MediaFeature const& media_feature) { - return Formatter::format(builder, media_feature.to_string()); + return Formatter::format(builder, media_feature.to_deprecated_string()); } }; @@ -278,7 +278,7 @@ template<> struct Formatter : Formatter { ErrorOr format(FormatBuilder& builder, Web::CSS::MediaCondition const& media_condition) { - return Formatter::format(builder, media_condition.to_string()); + return Formatter::format(builder, media_condition.to_deprecated_string()); } }; @@ -286,7 +286,7 @@ template<> struct Formatter : Formatter { ErrorOr format(FormatBuilder& builder, Web::CSS::MediaQuery const& media_query) { - return Formatter::format(builder, media_query.to_string()); + return Formatter::format(builder, media_query.to_deprecated_string()); } }; diff --git a/Userland/Libraries/LibWeb/CSS/Number.h b/Userland/Libraries/LibWeb/CSS/Number.h index 15c0f34d0f2..90f3f825bbb 100644 --- a/Userland/Libraries/LibWeb/CSS/Number.h +++ b/Userland/Libraries/LibWeb/CSS/Number.h @@ -69,7 +69,7 @@ public: return { Type::Number, m_value / other.m_value }; } - DeprecatedString to_string() const + DeprecatedString to_deprecated_string() const { if (m_type == Type::IntegerWithExplicitSign) return DeprecatedString::formatted("{:+}", m_value); @@ -91,6 +91,6 @@ template<> struct AK::Formatter : Formatter { ErrorOr format(FormatBuilder& builder, Web::CSS::Number const& number) { - return Formatter::format(builder, number.to_string()); + return Formatter::format(builder, number.to_deprecated_string()); } }; diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Block.cpp b/Userland/Libraries/LibWeb/CSS/Parser/Block.cpp index 8eefb53c1ab..be951d037a5 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/Block.cpp +++ b/Userland/Libraries/LibWeb/CSS/Parser/Block.cpp @@ -17,7 +17,7 @@ Block::Block(Token token, Vector&& values) Block::~Block() = default; -DeprecatedString Block::to_string() const +DeprecatedString Block::to_deprecated_string() const { StringBuilder builder; @@ -25,7 +25,7 @@ DeprecatedString Block::to_string() const builder.join(' ', m_values); builder.append(m_token.bracket_mirror_string()); - return builder.to_string(); + return builder.to_deprecated_string(); } } diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Block.h b/Userland/Libraries/LibWeb/CSS/Parser/Block.h index 1e996104e6b..8168dc70789 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/Block.h +++ b/Userland/Libraries/LibWeb/CSS/Parser/Block.h @@ -32,7 +32,7 @@ public: Vector const& values() const { return m_values; } - DeprecatedString to_string() const; + DeprecatedString to_deprecated_string() const; private: Block(Token, Vector&&); diff --git a/Userland/Libraries/LibWeb/CSS/Parser/ComponentValue.cpp b/Userland/Libraries/LibWeb/CSS/Parser/ComponentValue.cpp index f74c4305ddb..d30bd5e8de7 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/ComponentValue.cpp +++ b/Userland/Libraries/LibWeb/CSS/Parser/ComponentValue.cpp @@ -26,12 +26,12 @@ ComponentValue::ComponentValue(NonnullRefPtr block) ComponentValue::~ComponentValue() = default; -DeprecatedString ComponentValue::to_string() const +DeprecatedString ComponentValue::to_deprecated_string() const { return m_value.visit( - [](Token const& token) { return token.to_string(); }, - [](NonnullRefPtr const& block) { return block->to_string(); }, - [](NonnullRefPtr const& function) { return function->to_string(); }); + [](Token const& token) { return token.to_deprecated_string(); }, + [](NonnullRefPtr const& block) { return block->to_deprecated_string(); }, + [](NonnullRefPtr const& function) { return function->to_deprecated_string(); }); } DeprecatedString ComponentValue::to_debug_string() const @@ -41,10 +41,10 @@ DeprecatedString ComponentValue::to_debug_string() const return DeprecatedString::formatted("Token: {}", token.to_debug_string()); }, [](NonnullRefPtr const& block) { - return DeprecatedString::formatted("Block: {}", block->to_string()); + return DeprecatedString::formatted("Block: {}", block->to_deprecated_string()); }, [](NonnullRefPtr const& function) { - return DeprecatedString::formatted("Function: {}", function->to_string()); + return DeprecatedString::formatted("Function: {}", function->to_deprecated_string()); }); } diff --git a/Userland/Libraries/LibWeb/CSS/Parser/ComponentValue.h b/Userland/Libraries/LibWeb/CSS/Parser/ComponentValue.h index 67604311e87..4ad73f70282 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/ComponentValue.h +++ b/Userland/Libraries/LibWeb/CSS/Parser/ComponentValue.h @@ -33,7 +33,7 @@ public: Token const& token() const { return m_value.get(); } operator Token() const { return m_value.get(); } - DeprecatedString to_string() const; + DeprecatedString to_deprecated_string() const; DeprecatedString to_debug_string() const; private: @@ -45,6 +45,6 @@ template<> struct AK::Formatter : Formatter { ErrorOr format(FormatBuilder& builder, Web::CSS::Parser::ComponentValue const& component_value) { - return Formatter::format(builder, component_value.to_string()); + return Formatter::format(builder, component_value.to_deprecated_string()); } }; diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Declaration.cpp b/Userland/Libraries/LibWeb/CSS/Parser/Declaration.cpp index c893c9128c5..572efe143c8 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/Declaration.cpp +++ b/Userland/Libraries/LibWeb/CSS/Parser/Declaration.cpp @@ -19,7 +19,7 @@ Declaration::Declaration(FlyString name, Vector values, Importan Declaration::~Declaration() = default; -DeprecatedString Declaration::to_string() const +DeprecatedString Declaration::to_deprecated_string() const { StringBuilder builder; @@ -30,7 +30,7 @@ DeprecatedString Declaration::to_string() const if (m_important == Important::Yes) builder.append(" !important"sv); - return builder.to_string(); + return builder.to_deprecated_string(); } } diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Declaration.h b/Userland/Libraries/LibWeb/CSS/Parser/Declaration.h index a3a44121355..fd0e2e1c77c 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/Declaration.h +++ b/Userland/Libraries/LibWeb/CSS/Parser/Declaration.h @@ -22,7 +22,7 @@ public: Vector const& values() const { return m_values; } Important importance() const { return m_important; } - DeprecatedString to_string() const; + DeprecatedString to_deprecated_string() const; private: FlyString m_name; diff --git a/Userland/Libraries/LibWeb/CSS/Parser/DeclarationOrAtRule.cpp b/Userland/Libraries/LibWeb/CSS/Parser/DeclarationOrAtRule.cpp index a861a103f8c..e26ee5ec289 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/DeclarationOrAtRule.cpp +++ b/Userland/Libraries/LibWeb/CSS/Parser/DeclarationOrAtRule.cpp @@ -24,20 +24,20 @@ DeclarationOrAtRule::DeclarationOrAtRule(Declaration declaration) DeclarationOrAtRule::~DeclarationOrAtRule() = default; -DeprecatedString DeclarationOrAtRule::to_string() const +DeprecatedString DeclarationOrAtRule::to_deprecated_string() const { StringBuilder builder; switch (m_type) { default: case DeclarationType::At: - builder.append(m_at->to_string()); + builder.append(m_at->to_deprecated_string()); break; case DeclarationType::Declaration: - builder.append(m_declaration->to_string()); + builder.append(m_declaration->to_deprecated_string()); break; } - return builder.to_string(); + return builder.to_deprecated_string(); } } diff --git a/Userland/Libraries/LibWeb/CSS/Parser/DeclarationOrAtRule.h b/Userland/Libraries/LibWeb/CSS/Parser/DeclarationOrAtRule.h index 939c4f863d2..d0d6ced4602 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/DeclarationOrAtRule.h +++ b/Userland/Libraries/LibWeb/CSS/Parser/DeclarationOrAtRule.h @@ -37,7 +37,7 @@ public: return *m_declaration; } - DeprecatedString to_string() const; + DeprecatedString to_deprecated_string() const; private: DeclarationType m_type; diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Function.cpp b/Userland/Libraries/LibWeb/CSS/Parser/Function.cpp index de2e5740730..fdd15a7359a 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/Function.cpp +++ b/Userland/Libraries/LibWeb/CSS/Parser/Function.cpp @@ -18,7 +18,7 @@ Function::Function(FlyString name, Vector&& values) Function::~Function() = default; -DeprecatedString Function::to_string() const +DeprecatedString Function::to_deprecated_string() const { StringBuilder builder; @@ -27,7 +27,7 @@ DeprecatedString Function::to_string() const builder.join(' ', m_values); builder.append(')'); - return builder.to_string(); + return builder.to_deprecated_string(); } } diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Function.h b/Userland/Libraries/LibWeb/CSS/Parser/Function.h index 481f26bd462..f45be687610 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/Function.h +++ b/Userland/Libraries/LibWeb/CSS/Parser/Function.h @@ -28,7 +28,7 @@ public: StringView name() const { return m_name; } Vector const& values() const { return m_values; } - DeprecatedString to_string() const; + DeprecatedString to_deprecated_string() const; private: Function(FlyString name, Vector&& values); diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp index d7ad6c9218c..18d32ebd1fd 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp +++ b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp @@ -562,7 +562,7 @@ Parser::ParseErrorOr Parser::parse_pseudo_simple_selec } // FIXME: Support multiple, comma-separated, language ranges. Vector languages; - languages.append(pseudo_function.values().first().token().to_string()); + languages.append(pseudo_function.values().first().token().to_deprecated_string()); return Selector::SimpleSelector { .type = Selector::SimpleSelector::Type::PseudoClass, .value = Selector::SimpleSelector::PseudoClass { @@ -1395,7 +1395,7 @@ Optional Parser::parse_supports_feature(TokenStreamto_string() } + Supports::Declaration { declaration->to_deprecated_string() } }; } } @@ -1405,10 +1405,10 @@ Optional Parser::parse_supports_feature(TokenStream Parser::parse_general_enclosed(TokenStream ? ) ]` if (first_token.is_function()) { transaction.commit(); - return GeneralEnclosed { first_token.to_string() }; + return GeneralEnclosed { first_token.to_deprecated_string() }; } // `( ? )` if (first_token.is_block() && first_token.block().is_paren()) { transaction.commit(); - return GeneralEnclosed { first_token.to_string() }; + return GeneralEnclosed { first_token.to_deprecated_string() }; } return {}; @@ -3385,7 +3385,7 @@ Optional Parser::parse_unicode_range(TokenStream& return DeprecatedString::formatted("{:+}", int_value); } - return component_value.to_string(); + return component_value.to_deprecated_string(); }; auto create_unicode_range = [&](StringView text, auto& local_transaction) -> Optional { @@ -3920,13 +3920,13 @@ Optional Parser::parse_color(ComponentValue const& component_value) serialization_builder.append(cv.token().dimension_unit()); // 5. If serialization consists of fewer than six characters, prepend zeros (U+0030) so that it becomes six characters. - serialization = serialization_builder.to_string(); + serialization = serialization_builder.to_deprecated_string(); if (serialization_builder.length() < 6) { StringBuilder builder; for (size_t i = 0; i < (6 - serialization_builder.length()); i++) builder.append('0'); builder.append(serialization_builder.string_view()); - serialization = builder.to_string(); + serialization = builder.to_deprecated_string(); } } // 3. Otherwise, cv is an ; let serialization be cv’s value. diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Rule.cpp b/Userland/Libraries/LibWeb/CSS/Parser/Rule.cpp index b078b1b2a75..7b313764495 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/Rule.cpp +++ b/Userland/Libraries/LibWeb/CSS/Parser/Rule.cpp @@ -20,7 +20,7 @@ Rule::Rule(Rule::Type type, FlyString name, Vector prelude, RefP Rule::~Rule() = default; -DeprecatedString Rule::to_string() const +DeprecatedString Rule::to_deprecated_string() const { StringBuilder builder; @@ -32,11 +32,11 @@ DeprecatedString Rule::to_string() const builder.join(' ', m_prelude); if (m_block) - builder.append(m_block->to_string()); + builder.append(m_block->to_deprecated_string()); else builder.append(';'); - return builder.to_string(); + return builder.to_deprecated_string(); } } diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Rule.h b/Userland/Libraries/LibWeb/CSS/Parser/Rule.h index ddd0d41f563..7afd9135389 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/Rule.h +++ b/Userland/Libraries/LibWeb/CSS/Parser/Rule.h @@ -41,7 +41,7 @@ public: RefPtr block() const { return m_block; } StringView at_rule_name() const { return m_at_rule_name; } - DeprecatedString to_string() const; + DeprecatedString to_deprecated_string() const; private: Rule(Type, FlyString name, Vector prelude, RefPtr); diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Token.cpp b/Userland/Libraries/LibWeb/CSS/Parser/Token.cpp index 175ff73063e..172bc09cfb8 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/Token.cpp +++ b/Userland/Libraries/LibWeb/CSS/Parser/Token.cpp @@ -11,7 +11,7 @@ namespace Web::CSS::Parser { -DeprecatedString Token::to_string() const +DeprecatedString Token::to_deprecated_string() const { StringBuilder builder; diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Token.h b/Userland/Libraries/LibWeb/CSS/Parser/Token.h index c5b8b505ed9..93fa0712f31 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/Token.h +++ b/Userland/Libraries/LibWeb/CSS/Parser/Token.h @@ -145,7 +145,7 @@ public: DeprecatedString bracket_string() const; DeprecatedString bracket_mirror_string() const; - DeprecatedString to_string() const; + DeprecatedString to_deprecated_string() const; DeprecatedString to_debug_string() const; Position const& start_position() const { return m_start_position; } diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Tokenizer.cpp b/Userland/Libraries/LibWeb/CSS/Parser/Tokenizer.cpp index 69ed1e3b740..ab0eb47350d 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/Tokenizer.cpp +++ b/Userland/Libraries/LibWeb/CSS/Parser/Tokenizer.cpp @@ -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 (�). 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; }; diff --git a/Userland/Libraries/LibWeb/CSS/Percentage.h b/Userland/Libraries/LibWeb/CSS/Percentage.h index 7ef19ccc909..c43c52060a7 100644 --- a/Userland/Libraries/LibWeb/CSS/Percentage.h +++ b/Userland/Libraries/LibWeb/CSS/Percentage.h @@ -31,7 +31,7 @@ public: float value() const { return m_value; } float as_fraction() const { return m_value * 0.01f; } - DeprecatedString to_string() const + DeprecatedString to_deprecated_string() const { return DeprecatedString::formatted("{}%", m_value); } @@ -128,12 +128,12 @@ public: }); } - DeprecatedString to_string() const + DeprecatedString to_deprecated_string() const { if (is_percentage()) - return m_value.template get().to_string(); + return m_value.template get().to_deprecated_string(); - return m_value.template get().to_string(); + return m_value.template get().to_deprecated_string(); } bool operator==(PercentageOr const& other) const @@ -231,7 +231,7 @@ template<> struct AK::Formatter : Formatter { ErrorOr format(FormatBuilder& builder, Web::CSS::Percentage const& percentage) { - return Formatter::format(builder, percentage.to_string()); + return Formatter::format(builder, percentage.to_deprecated_string()); } }; @@ -239,7 +239,7 @@ template<> struct AK::Formatter : Formatter { ErrorOr format(FormatBuilder& builder, Web::CSS::AnglePercentage const& angle_percentage) { - return Formatter::format(builder, angle_percentage.to_string()); + return Formatter::format(builder, angle_percentage.to_deprecated_string()); } }; @@ -247,7 +247,7 @@ template<> struct AK::Formatter : Formatter { ErrorOr format(FormatBuilder& builder, Web::CSS::FrequencyPercentage const& frequency_percentage) { - return Formatter::format(builder, frequency_percentage.to_string()); + return Formatter::format(builder, frequency_percentage.to_deprecated_string()); } }; @@ -255,7 +255,7 @@ template<> struct AK::Formatter : Formatter { ErrorOr format(FormatBuilder& builder, Web::CSS::LengthPercentage const& length_percentage) { - return Formatter::format(builder, length_percentage.to_string()); + return Formatter::format(builder, length_percentage.to_deprecated_string()); } }; @@ -263,6 +263,6 @@ template<> struct AK::Formatter : Formatter { ErrorOr format(FormatBuilder& builder, Web::CSS::TimePercentage const& time_percentage) { - return Formatter::format(builder, time_percentage.to_string()); + return Formatter::format(builder, time_percentage.to_deprecated_string()); } }; diff --git a/Userland/Libraries/LibWeb/CSS/Ratio.cpp b/Userland/Libraries/LibWeb/CSS/Ratio.cpp index 8d9e070e302..7c3cb89b103 100644 --- a/Userland/Libraries/LibWeb/CSS/Ratio.cpp +++ b/Userland/Libraries/LibWeb/CSS/Ratio.cpp @@ -22,7 +22,7 @@ bool Ratio::is_degenerate() const || !isfinite(m_second_value) || m_second_value == 0; } -DeprecatedString Ratio::to_string() const +DeprecatedString Ratio::to_deprecated_string() const { return DeprecatedString::formatted("{} / {}", m_first_value, m_second_value); } diff --git a/Userland/Libraries/LibWeb/CSS/Ratio.h b/Userland/Libraries/LibWeb/CSS/Ratio.h index 7d324918239..022b78be04f 100644 --- a/Userland/Libraries/LibWeb/CSS/Ratio.h +++ b/Userland/Libraries/LibWeb/CSS/Ratio.h @@ -17,7 +17,7 @@ public: float value() const { return m_first_value / m_second_value; } bool is_degenerate() const; - DeprecatedString to_string() const; + DeprecatedString to_deprecated_string() const; private: float m_first_value { 0 }; diff --git a/Userland/Libraries/LibWeb/CSS/Resolution.cpp b/Userland/Libraries/LibWeb/CSS/Resolution.cpp index 870dee9da4f..22251ffc547 100644 --- a/Userland/Libraries/LibWeb/CSS/Resolution.cpp +++ b/Userland/Libraries/LibWeb/CSS/Resolution.cpp @@ -21,7 +21,7 @@ Resolution::Resolution(float value, Type type) { } -DeprecatedString Resolution::to_string() const +DeprecatedString Resolution::to_deprecated_string() const { return DeprecatedString::formatted("{}{}", m_value, unit_name()); } diff --git a/Userland/Libraries/LibWeb/CSS/Resolution.h b/Userland/Libraries/LibWeb/CSS/Resolution.h index a9d71dec05e..bb810c533b5 100644 --- a/Userland/Libraries/LibWeb/CSS/Resolution.h +++ b/Userland/Libraries/LibWeb/CSS/Resolution.h @@ -24,7 +24,7 @@ public: Resolution(int value, Type type); Resolution(float value, Type type); - DeprecatedString to_string() const; + DeprecatedString to_deprecated_string() const; float to_dots_per_pixel() const; bool operator==(Resolution const& other) const diff --git a/Userland/Libraries/LibWeb/CSS/Selector.cpp b/Userland/Libraries/LibWeb/CSS/Selector.cpp index b31a4dc44ca..59f6fcce02c 100644 --- a/Userland/Libraries/LibWeb/CSS/Selector.cpp +++ b/Userland/Libraries/LibWeb/CSS/Selector.cpp @@ -275,7 +275,7 @@ DeprecatedString Selector::SimpleSelector::serialize() const dbgln("FIXME: Unsupported simple selector serialization for type {}", to_underlying(type)); break; } - return s.to_string(); + return s.to_deprecated_string(); } // https://www.w3.org/TR/cssom/#serialize-a-selector @@ -333,7 +333,7 @@ DeprecatedString Selector::serialize() const } } - return s.to_string(); + return s.to_deprecated_string(); } // https://www.w3.org/TR/cssom/#serialize-a-group-of-selectors @@ -342,7 +342,7 @@ DeprecatedString serialize_a_group_of_selectors(NonnullRefPtrVector co // To serialize a group of selectors serialize each selector in the group of selectors and then serialize a comma-separated list of these serializations. StringBuilder builder; builder.join(", "sv, selectors); - return builder.to_string(); + return builder.to_deprecated_string(); } Optional pseudo_element_from_string(StringView name) diff --git a/Userland/Libraries/LibWeb/CSS/Selector.h b/Userland/Libraries/LibWeb/CSS/Selector.h index 3ac08fad0bd..2dcb26db22b 100644 --- a/Userland/Libraries/LibWeb/CSS/Selector.h +++ b/Userland/Libraries/LibWeb/CSS/Selector.h @@ -80,7 +80,7 @@ public: result.appendff("{}", offset); // 5. Return result. - return result.to_string(); + return result.to_deprecated_string(); } }; diff --git a/Userland/Libraries/LibWeb/CSS/Serialize.cpp b/Userland/Libraries/LibWeb/CSS/Serialize.cpp index 3896cca1e1c..be68aac192c 100644 --- a/Userland/Libraries/LibWeb/CSS/Serialize.cpp +++ b/Userland/Libraries/LibWeb/CSS/Serialize.cpp @@ -113,7 +113,7 @@ void serialize_a_url(StringBuilder& builder, StringView url) // To serialize a URL means to create a string represented by "url(", // followed by the serialization of the URL as a string, followed by ")". builder.append("url("sv); - serialize_a_string(builder, url.to_string()); + serialize_a_string(builder, url.to_deprecated_string()); builder.append(')'); } @@ -123,7 +123,7 @@ void serialize_a_local(StringBuilder& builder, StringView path) // To serialize a LOCAL means to create a string represented by "local(", // followed by the serialization of the LOCAL as a string, followed by ")". builder.append("local("sv); - serialize_a_string(builder, path.to_string()); + serialize_a_string(builder, path.to_deprecated_string()); builder.append(')'); } @@ -131,7 +131,7 @@ void serialize_a_local(StringBuilder& builder, StringView path) void serialize_unicode_ranges(StringBuilder& builder, Vector const& unicode_ranges) { serialize_a_comma_separated_list(builder, unicode_ranges, [&](UnicodeRange unicode_range) { - serialize_a_string(builder, unicode_range.to_string()); + serialize_a_string(builder, unicode_range.to_deprecated_string()); }); } @@ -151,42 +151,42 @@ DeprecatedString escape_a_character(u32 character) { StringBuilder builder; escape_a_character(builder, character); - return builder.to_string(); + return builder.to_deprecated_string(); } DeprecatedString escape_a_character_as_code_point(u32 character) { StringBuilder builder; escape_a_character_as_code_point(builder, character); - return builder.to_string(); + return builder.to_deprecated_string(); } DeprecatedString serialize_an_identifier(StringView ident) { StringBuilder builder; serialize_an_identifier(builder, ident); - return builder.to_string(); + return builder.to_deprecated_string(); } DeprecatedString serialize_a_string(StringView string) { StringBuilder builder; serialize_a_string(builder, string); - return builder.to_string(); + return builder.to_deprecated_string(); } DeprecatedString serialize_a_url(StringView url) { StringBuilder builder; serialize_a_url(builder, url); - return builder.to_string(); + return builder.to_deprecated_string(); } DeprecatedString serialize_a_srgb_value(Color color) { StringBuilder builder; serialize_a_srgb_value(builder, color); - return builder.to_string(); + return builder.to_deprecated_string(); } } diff --git a/Userland/Libraries/LibWeb/CSS/Size.cpp b/Userland/Libraries/LibWeb/CSS/Size.cpp index cd90466ed94..504aac03525 100644 --- a/Userland/Libraries/LibWeb/CSS/Size.cpp +++ b/Userland/Libraries/LibWeb/CSS/Size.cpp @@ -74,20 +74,20 @@ bool Size::contains_percentage() const } } -DeprecatedString Size::to_string() const +DeprecatedString Size::to_deprecated_string() const { switch (m_type) { case Type::Auto: return "auto"; case Type::Length: case Type::Percentage: - return m_length_percentage.to_string(); + return m_length_percentage.to_deprecated_string(); case Type::MinContent: return "min-content"; case Type::MaxContent: return "max-content"; case Type::FitContent: - return DeprecatedString::formatted("fit-content({})", m_length_percentage.to_string()); + return DeprecatedString::formatted("fit-content({})", m_length_percentage.to_deprecated_string()); case Type::None: return "none"; } diff --git a/Userland/Libraries/LibWeb/CSS/Size.h b/Userland/Libraries/LibWeb/CSS/Size.h index 200cbabf277..dc52c3cdc7a 100644 --- a/Userland/Libraries/LibWeb/CSS/Size.h +++ b/Userland/Libraries/LibWeb/CSS/Size.h @@ -63,7 +63,7 @@ public: return m_length_percentage.length(); } - DeprecatedString to_string() const; + DeprecatedString to_deprecated_string() const; private: Size(Type type, LengthPercentage); @@ -78,6 +78,6 @@ template<> struct AK::Formatter : Formatter { ErrorOr format(FormatBuilder& builder, Web::CSS::Size const& size) { - return Formatter::format(builder, size.to_string()); + return Formatter::format(builder, size.to_deprecated_string()); } }; diff --git a/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp b/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp index 1c6e3f09e9c..35937a906c9 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp @@ -1168,7 +1168,7 @@ void StyleComputer::compute_font(StyleProperties& style, DOM::Element const* ele if (family.is_identifier()) { found_font = find_generic_font(family.to_identifier()); } else if (family.is_string()) { - found_font = find_font(family.to_string()); + found_font = find_font(family.to_deprecated_string()); } if (found_font) break; @@ -1176,7 +1176,7 @@ void StyleComputer::compute_font(StyleProperties& style, DOM::Element const* ele } else if (family_value->is_identifier()) { found_font = find_generic_font(family_value->to_identifier()); } else if (family_value->is_string()) { - found_font = find_font(family_value->to_string()); + found_font = find_font(family_value->to_deprecated_string()); } if (!found_font) { @@ -1477,7 +1477,7 @@ void StyleComputer::load_fonts_from_sheet(CSSStyleSheet const& sheet) continue; LoadRequest request; - auto url = m_document.parse_url(candidate_url.value().to_string()); + auto url = m_document.parse_url(candidate_url.value().to_deprecated_string()); auto loader = make(const_cast(*this), font_face.font_family(), move(url)); const_cast(*this).m_loaded_fonts.set(font_face.font_family(), move(loader)); } diff --git a/Userland/Libraries/LibWeb/CSS/StyleProperties.cpp b/Userland/Libraries/LibWeb/CSS/StyleProperties.cpp index 0af11f79e56..07d76e58b22 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleProperties.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleProperties.cpp @@ -81,7 +81,7 @@ CSS::Size StyleProperties::size_value(CSS::PropertyID id) const } // FIXME: Support `fit-content()` - dbgln("FIXME: Unsupported size value: `{}`, treating as `auto`", value->to_string()); + dbgln("FIXME: Unsupported size value: `{}`, treating as `auto`", value->to_deprecated_string()); return CSS::Size::make_auto(); } @@ -201,13 +201,13 @@ float StyleProperties::opacity() const if (maybe_percentage.has_value()) unclamped_opacity = maybe_percentage->as_fraction(); else - dbgln("Unable to resolve calc() as opacity (percentage): {}", value->to_string()); + dbgln("Unable to resolve calc() as opacity (percentage): {}", value->to_deprecated_string()); } else { auto maybe_number = value->as_calculated().resolve_number(); if (maybe_number.has_value()) unclamped_opacity = maybe_number.value(); else - dbgln("Unable to resolve calc() as opacity (number): {}", value->to_string()); + dbgln("Unable to resolve calc() as opacity (number): {}", value->to_deprecated_string()); } } else if (value->is_percentage()) { unclamped_opacity = value->as_percentage().percentage().as_fraction(); @@ -498,24 +498,24 @@ CSS::ContentData StyleProperties::content() const StringBuilder builder; for (auto const& item : content_style_value.content().values()) { if (item.is_string()) { - builder.append(item.to_string()); + builder.append(item.to_deprecated_string()); } else { // TODO: Implement quotes, counters, images, and other things. } } content_data.type = ContentData::Type::String; - content_data.data = builder.to_string(); + content_data.data = builder.to_deprecated_string(); if (content_style_value.has_alt_text()) { StringBuilder alt_text_builder; for (auto const& item : content_style_value.alt_text()->values()) { if (item.is_string()) { - alt_text_builder.append(item.to_string()); + alt_text_builder.append(item.to_deprecated_string()); } else { // TODO: Implement counters } } - content_data.alt_text = alt_text_builder.to_string(); + content_data.alt_text = alt_text_builder.to_deprecated_string(); } return content_data; @@ -608,7 +608,7 @@ Vector StyleProperties::text_decoration_line() const if (value->is_identifier() && value->to_identifier() == ValueID::None) return {}; - dbgln("FIXME: Unsupported value for text-decoration-line: {}", value->to_string()); + dbgln("FIXME: Unsupported value for text-decoration-line: {}", value->to_deprecated_string()); return {}; } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValue.cpp b/Userland/Libraries/LibWeb/CSS/StyleValue.cpp index 8d91e78475d..25a9642616d 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValue.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleValue.cpp @@ -313,16 +313,16 @@ BackgroundStyleValue::BackgroundStyleValue( VERIFY(!m_color->is_value_list()); } -DeprecatedString BackgroundStyleValue::to_string() const +DeprecatedString BackgroundStyleValue::to_deprecated_string() const { if (m_layer_count == 1) { - return DeprecatedString::formatted("{} {} {} {} {} {} {} {}", m_color->to_string(), m_image->to_string(), m_position->to_string(), m_size->to_string(), m_repeat->to_string(), m_attachment->to_string(), m_origin->to_string(), m_clip->to_string()); + return DeprecatedString::formatted("{} {} {} {} {} {} {} {}", m_color->to_deprecated_string(), m_image->to_deprecated_string(), m_position->to_deprecated_string(), m_size->to_deprecated_string(), m_repeat->to_deprecated_string(), m_attachment->to_deprecated_string(), m_origin->to_deprecated_string(), m_clip->to_deprecated_string()); } auto get_layer_value_string = [](NonnullRefPtr const& style_value, size_t index) { if (style_value->is_value_list()) - return style_value->as_value_list().value_at(index, true)->to_string(); - return style_value->to_string(); + return style_value->as_value_list().value_at(index, true)->to_deprecated_string(); + return style_value->to_deprecated_string(); }; StringBuilder builder; @@ -330,11 +330,11 @@ DeprecatedString BackgroundStyleValue::to_string() const if (i) builder.append(", "sv); if (i == m_layer_count - 1) - builder.appendff("{} ", m_color->to_string()); + builder.appendff("{} ", m_color->to_deprecated_string()); builder.appendff("{} {} {} {} {} {} {}", get_layer_value_string(m_image, i), get_layer_value_string(m_position, i), get_layer_value_string(m_size, i), get_layer_value_string(m_repeat, i), get_layer_value_string(m_attachment, i), get_layer_value_string(m_origin, i), get_layer_value_string(m_clip, i)); } - return builder.to_string(); + return builder.to_deprecated_string(); } bool BackgroundStyleValue::equals(StyleValue const& other) const @@ -352,7 +352,7 @@ bool BackgroundStyleValue::equals(StyleValue const& other) const && m_clip->equals(typed_other.m_clip); } -DeprecatedString BackgroundRepeatStyleValue::to_string() const +DeprecatedString BackgroundRepeatStyleValue::to_deprecated_string() const { return DeprecatedString::formatted("{} {}", CSS::to_string(m_repeat_x), CSS::to_string(m_repeat_y)); } @@ -365,9 +365,9 @@ bool BackgroundRepeatStyleValue::equals(StyleValue const& other) const return m_repeat_x == typed_other.m_repeat_x && m_repeat_y == typed_other.m_repeat_y; } -DeprecatedString BackgroundSizeStyleValue::to_string() const +DeprecatedString BackgroundSizeStyleValue::to_deprecated_string() const { - return DeprecatedString::formatted("{} {}", m_size_x.to_string(), m_size_y.to_string()); + return DeprecatedString::formatted("{} {}", m_size_x.to_deprecated_string(), m_size_y.to_deprecated_string()); } bool BackgroundSizeStyleValue::equals(StyleValue const& other) const @@ -378,9 +378,9 @@ bool BackgroundSizeStyleValue::equals(StyleValue const& other) const return m_size_x == typed_other.m_size_x && m_size_y == typed_other.m_size_y; } -DeprecatedString BorderStyleValue::to_string() const +DeprecatedString BorderStyleValue::to_deprecated_string() const { - return DeprecatedString::formatted("{} {} {}", m_border_width->to_string(), m_border_style->to_string(), m_border_color->to_string()); + return DeprecatedString::formatted("{} {} {}", m_border_width->to_deprecated_string(), m_border_style->to_deprecated_string(), m_border_color->to_deprecated_string()); } bool BorderStyleValue::equals(StyleValue const& other) const @@ -393,11 +393,11 @@ bool BorderStyleValue::equals(StyleValue const& other) const && m_border_color->equals(typed_other.m_border_color); } -DeprecatedString BorderRadiusStyleValue::to_string() const +DeprecatedString BorderRadiusStyleValue::to_deprecated_string() const { if (m_horizontal_radius == m_vertical_radius) - return m_horizontal_radius.to_string(); - return DeprecatedString::formatted("{} / {}", m_horizontal_radius.to_string(), m_vertical_radius.to_string()); + return m_horizontal_radius.to_deprecated_string(); + return DeprecatedString::formatted("{} / {}", m_horizontal_radius.to_deprecated_string(), m_vertical_radius.to_deprecated_string()); } bool BorderRadiusStyleValue::equals(StyleValue const& other) const @@ -410,9 +410,9 @@ bool BorderRadiusStyleValue::equals(StyleValue const& other) const && m_vertical_radius == typed_other.m_vertical_radius; } -DeprecatedString BorderRadiusShorthandStyleValue::to_string() const +DeprecatedString BorderRadiusShorthandStyleValue::to_deprecated_string() const { - return DeprecatedString::formatted("{} {} {} {} / {} {} {} {}", m_top_left->horizontal_radius().to_string(), m_top_right->horizontal_radius().to_string(), m_bottom_right->horizontal_radius().to_string(), m_bottom_left->horizontal_radius().to_string(), m_top_left->vertical_radius().to_string(), m_top_right->vertical_radius().to_string(), m_bottom_right->vertical_radius().to_string(), m_bottom_left->vertical_radius().to_string()); + return DeprecatedString::formatted("{} {} {} {} / {} {} {} {}", m_top_left->horizontal_radius().to_deprecated_string(), m_top_right->horizontal_radius().to_deprecated_string(), m_bottom_right->horizontal_radius().to_deprecated_string(), m_bottom_left->horizontal_radius().to_deprecated_string(), m_top_left->vertical_radius().to_deprecated_string(), m_top_right->vertical_radius().to_deprecated_string(), m_bottom_right->vertical_radius().to_deprecated_string(), m_bottom_left->vertical_radius().to_deprecated_string()); } bool BorderRadiusShorthandStyleValue::equals(StyleValue const& other) const @@ -615,9 +615,9 @@ void CalculatedStyleValue::CalculationResult::divide_by(CalculationResult const& }); } -DeprecatedString CalculatedStyleValue::to_string() const +DeprecatedString CalculatedStyleValue::to_deprecated_string() const { - return DeprecatedString::formatted("calc({})", m_expression->to_string()); + return DeprecatedString::formatted("calc({})", m_expression->to_deprecated_string()); } bool CalculatedStyleValue::equals(StyleValue const& other) const @@ -625,81 +625,81 @@ bool CalculatedStyleValue::equals(StyleValue const& other) const if (type() != other.type()) return false; // This is a case where comparing the strings actually makes sense. - return to_string() == other.to_string(); + return to_deprecated_string() == other.to_deprecated_string(); } -DeprecatedString CalculatedStyleValue::CalcNumberValue::to_string() const +DeprecatedString CalculatedStyleValue::CalcNumberValue::to_deprecated_string() const { return value.visit( [](Number const& number) { return DeprecatedString::number(number.value()); }, - [](NonnullOwnPtr const& sum) { return DeprecatedString::formatted("({})", sum->to_string()); }); + [](NonnullOwnPtr const& sum) { return DeprecatedString::formatted("({})", sum->to_deprecated_string()); }); } -DeprecatedString CalculatedStyleValue::CalcValue::to_string() const +DeprecatedString CalculatedStyleValue::CalcValue::to_deprecated_string() const { return value.visit( [](Number const& number) { return DeprecatedString::number(number.value()); }, - [](NonnullOwnPtr const& sum) { return DeprecatedString::formatted("({})", sum->to_string()); }, - [](auto const& v) { return v.to_string(); }); + [](NonnullOwnPtr const& sum) { return DeprecatedString::formatted("({})", sum->to_deprecated_string()); }, + [](auto const& v) { return v.to_deprecated_string(); }); } -DeprecatedString CalculatedStyleValue::CalcSum::to_string() const +DeprecatedString CalculatedStyleValue::CalcSum::to_deprecated_string() const { StringBuilder builder; - builder.append(first_calc_product->to_string()); + builder.append(first_calc_product->to_deprecated_string()); for (auto const& item : zero_or_more_additional_calc_products) - builder.append(item.to_string()); - return builder.to_string(); + builder.append(item.to_deprecated_string()); + return builder.to_deprecated_string(); } -DeprecatedString CalculatedStyleValue::CalcNumberSum::to_string() const +DeprecatedString CalculatedStyleValue::CalcNumberSum::to_deprecated_string() const { StringBuilder builder; - builder.append(first_calc_number_product->to_string()); + builder.append(first_calc_number_product->to_deprecated_string()); for (auto const& item : zero_or_more_additional_calc_number_products) - builder.append(item.to_string()); - return builder.to_string(); + builder.append(item.to_deprecated_string()); + return builder.to_deprecated_string(); } -DeprecatedString CalculatedStyleValue::CalcProduct::to_string() const +DeprecatedString CalculatedStyleValue::CalcProduct::to_deprecated_string() const { StringBuilder builder; - builder.append(first_calc_value.to_string()); + builder.append(first_calc_value.to_deprecated_string()); for (auto const& item : zero_or_more_additional_calc_values) - builder.append(item.to_string()); - return builder.to_string(); + builder.append(item.to_deprecated_string()); + return builder.to_deprecated_string(); } -DeprecatedString CalculatedStyleValue::CalcSumPartWithOperator::to_string() const +DeprecatedString CalculatedStyleValue::CalcSumPartWithOperator::to_deprecated_string() const { - return DeprecatedString::formatted(" {} {}", op == SumOperation::Add ? "+"sv : "-"sv, value->to_string()); + return DeprecatedString::formatted(" {} {}", op == SumOperation::Add ? "+"sv : "-"sv, value->to_deprecated_string()); } -DeprecatedString CalculatedStyleValue::CalcProductPartWithOperator::to_string() const +DeprecatedString CalculatedStyleValue::CalcProductPartWithOperator::to_deprecated_string() const { auto value_string = value.visit( - [](CalcValue const& v) { return v.to_string(); }, - [](CalcNumberValue const& v) { return v.to_string(); }); + [](CalcValue const& v) { return v.to_deprecated_string(); }, + [](CalcNumberValue const& v) { return v.to_deprecated_string(); }); return DeprecatedString::formatted(" {} {}", op == ProductOperation::Multiply ? "*"sv : "/"sv, value_string); } -DeprecatedString CalculatedStyleValue::CalcNumberProduct::to_string() const +DeprecatedString CalculatedStyleValue::CalcNumberProduct::to_deprecated_string() const { StringBuilder builder; - builder.append(first_calc_number_value.to_string()); + builder.append(first_calc_number_value.to_deprecated_string()); for (auto const& item : zero_or_more_additional_calc_number_values) - builder.append(item.to_string()); - return builder.to_string(); + builder.append(item.to_deprecated_string()); + return builder.to_deprecated_string(); } -DeprecatedString CalculatedStyleValue::CalcNumberProductPartWithOperator::to_string() const +DeprecatedString CalculatedStyleValue::CalcNumberProductPartWithOperator::to_deprecated_string() const { - return DeprecatedString::formatted(" {} {}", op == ProductOperation::Multiply ? "*"sv : "/"sv, value.to_string()); + return DeprecatedString::formatted(" {} {}", op == ProductOperation::Multiply ? "*"sv : "/"sv, value.to_deprecated_string()); } -DeprecatedString CalculatedStyleValue::CalcNumberSumPartWithOperator::to_string() const +DeprecatedString CalculatedStyleValue::CalcNumberSumPartWithOperator::to_deprecated_string() const { - return DeprecatedString::formatted(" {} {}", op == SumOperation::Add ? "+"sv : "-"sv, value->to_string()); + return DeprecatedString::formatted(" {} {}", op == SumOperation::Add ? "+"sv : "-"sv, value->to_deprecated_string()); } Optional CalculatedStyleValue::resolve_angle() const @@ -1149,7 +1149,7 @@ CalculatedStyleValue::CalculationResult CalculatedStyleValue::CalcNumberSumPartW return value->resolve(layout_node, percentage_basis); } -DeprecatedString ColorStyleValue::to_string() const +DeprecatedString ColorStyleValue::to_deprecated_string() const { return serialize_a_srgb_value(m_color); } @@ -1161,11 +1161,11 @@ bool ColorStyleValue::equals(StyleValue const& other) const return m_color == other.as_color().m_color; } -DeprecatedString ContentStyleValue::to_string() const +DeprecatedString ContentStyleValue::to_deprecated_string() const { if (has_alt_text()) - return DeprecatedString::formatted("{} / {}", m_content->to_string(), m_alt_text->to_string()); - return m_content->to_string(); + return DeprecatedString::formatted("{} / {}", m_content->to_deprecated_string(), m_alt_text->to_deprecated_string()); + return m_content->to_deprecated_string(); } bool ContentStyleValue::equals(StyleValue const& other) const @@ -1223,7 +1223,7 @@ float Filter::Color::resolved_amount() const return 1.0f; } -DeprecatedString FilterValueListStyleValue::to_string() const +DeprecatedString FilterValueListStyleValue::to_deprecated_string() const { StringBuilder builder {}; bool first = true; @@ -1234,13 +1234,13 @@ DeprecatedString FilterValueListStyleValue::to_string() const [&](Filter::Blur const& blur) { builder.append("blur("sv); if (blur.radius.has_value()) - builder.append(blur.radius->to_string()); + builder.append(blur.radius->to_deprecated_string()); }, [&](Filter::DropShadow const& drop_shadow) { builder.appendff("drop-shadow({} {}"sv, drop_shadow.offset_x, drop_shadow.offset_y); if (drop_shadow.radius.has_value()) - builder.appendff(" {}", drop_shadow.radius->to_string()); + builder.appendff(" {}", drop_shadow.radius->to_deprecated_string()); if (drop_shadow.color.has_value()) { builder.append(' '); serialize_a_srgb_value(builder, *drop_shadow.color); @@ -1251,7 +1251,7 @@ DeprecatedString FilterValueListStyleValue::to_string() const if (hue_rotate.angle.has_value()) { hue_rotate.angle->visit( [&](Angle const& angle) { - builder.append(angle.to_string()); + builder.append(angle.to_deprecated_string()); }, [&](auto&) { builder.append('0'); @@ -1281,12 +1281,12 @@ DeprecatedString FilterValueListStyleValue::to_string() const } }()); if (color.amount.has_value()) - builder.append(color.amount->to_string()); + builder.append(color.amount->to_deprecated_string()); }); builder.append(')'); first = false; } - return builder.to_string(); + return builder.to_deprecated_string(); } static bool operator==(Filter::Blur const& a, Filter::Blur const& b) @@ -1347,9 +1347,9 @@ bool FilterValueListStyleValue::equals(StyleValue const& other) const return true; } -DeprecatedString FlexStyleValue::to_string() const +DeprecatedString FlexStyleValue::to_deprecated_string() const { - return DeprecatedString::formatted("{} {} {}", m_grow->to_string(), m_shrink->to_string(), m_basis->to_string()); + return DeprecatedString::formatted("{} {} {}", m_grow->to_deprecated_string(), m_shrink->to_deprecated_string(), m_basis->to_deprecated_string()); } bool FlexStyleValue::equals(StyleValue const& other) const @@ -1362,9 +1362,9 @@ bool FlexStyleValue::equals(StyleValue const& other) const && m_basis->equals(typed_other.m_basis); } -DeprecatedString FlexFlowStyleValue::to_string() const +DeprecatedString FlexFlowStyleValue::to_deprecated_string() const { - return DeprecatedString::formatted("{} {}", m_flex_direction->to_string(), m_flex_wrap->to_string()); + return DeprecatedString::formatted("{} {}", m_flex_direction->to_deprecated_string(), m_flex_wrap->to_deprecated_string()); } bool FlexFlowStyleValue::equals(StyleValue const& other) const @@ -1376,9 +1376,9 @@ bool FlexFlowStyleValue::equals(StyleValue const& other) const && m_flex_wrap->equals(typed_other.m_flex_wrap); } -DeprecatedString FontStyleValue::to_string() const +DeprecatedString FontStyleValue::to_deprecated_string() const { - return DeprecatedString::formatted("{} {} {} / {} {}", m_font_style->to_string(), m_font_weight->to_string(), m_font_size->to_string(), m_line_height->to_string(), m_font_families->to_string()); + return DeprecatedString::formatted("{} {} {} / {} {}", m_font_style->to_deprecated_string(), m_font_weight->to_deprecated_string(), m_font_size->to_deprecated_string(), m_line_height->to_deprecated_string(), m_font_families->to_deprecated_string()); } bool FontStyleValue::equals(StyleValue const& other) const @@ -1400,11 +1400,11 @@ bool FrequencyStyleValue::equals(StyleValue const& other) const return m_frequency == other.as_frequency().m_frequency; } -DeprecatedString GridTrackPlacementShorthandStyleValue::to_string() const +DeprecatedString GridTrackPlacementShorthandStyleValue::to_deprecated_string() const { if (m_end->grid_track_placement().is_auto()) - return DeprecatedString::formatted("{}", m_start->grid_track_placement().to_string()); - return DeprecatedString::formatted("{} / {}", m_start->grid_track_placement().to_string(), m_end->grid_track_placement().to_string()); + return DeprecatedString::formatted("{}", m_start->grid_track_placement().to_deprecated_string()); + return DeprecatedString::formatted("{} / {}", m_start->grid_track_placement().to_deprecated_string(), m_end->grid_track_placement().to_deprecated_string()); } bool GridTrackPlacementShorthandStyleValue::equals(StyleValue const& other) const @@ -1416,9 +1416,9 @@ bool GridTrackPlacementShorthandStyleValue::equals(StyleValue const& other) cons && m_end->equals(typed_other.m_end); } -DeprecatedString GridTrackPlacementStyleValue::to_string() const +DeprecatedString GridTrackPlacementStyleValue::to_deprecated_string() const { - return m_grid_track_placement.to_string(); + return m_grid_track_placement.to_deprecated_string(); } bool GridTrackPlacementStyleValue::equals(StyleValue const& other) const @@ -1429,9 +1429,9 @@ bool GridTrackPlacementStyleValue::equals(StyleValue const& other) const return m_grid_track_placement == typed_other.grid_track_placement(); } -DeprecatedString GridTrackSizeStyleValue::to_string() const +DeprecatedString GridTrackSizeStyleValue::to_deprecated_string() const { - return m_grid_track_size_list.to_string(); + return m_grid_track_size_list.to_deprecated_string(); } bool GridTrackSizeStyleValue::equals(StyleValue const& other) const @@ -1442,7 +1442,7 @@ bool GridTrackSizeStyleValue::equals(StyleValue const& other) const return m_grid_track_size_list == typed_other.grid_track_size_list(); } -DeprecatedString IdentifierStyleValue::to_string() const +DeprecatedString IdentifierStyleValue::to_deprecated_string() const { return CSS::string_from_value_id(m_id); } @@ -1706,9 +1706,9 @@ Gfx::Bitmap const* ImageStyleValue::bitmap(size_t frame_index) const return resource()->bitmap(frame_index); } -DeprecatedString ImageStyleValue::to_string() const +DeprecatedString ImageStyleValue::to_deprecated_string() const { - return serialize_a_url(m_url.to_string()); + return serialize_a_url(m_url.to_deprecated_string()); } bool ImageStyleValue::equals(StyleValue const& other) const @@ -1746,22 +1746,22 @@ static void serialize_color_stop_list(StringBuilder& builder, auto const& color_ builder.append(", "sv); if (element.transition_hint.has_value()) { - builder.appendff("{}, "sv, element.transition_hint->value.to_string()); + builder.appendff("{}, "sv, element.transition_hint->value.to_deprecated_string()); } serialize_a_srgb_value(builder, element.color_stop.color); for (auto position : Array { &element.color_stop.position, &element.color_stop.second_position }) { if (position->has_value()) - builder.appendff(" {}"sv, (*position)->to_string()); + builder.appendff(" {}"sv, (*position)->to_deprecated_string()); } first = false; } } -DeprecatedString LinearGradientStyleValue::to_string() const +DeprecatedString LinearGradientStyleValue::to_deprecated_string() const { StringBuilder builder; - auto side_or_corner_to_string = [](SideOrCorner value) { + auto side_or_corner_to_deprecated_string = [](SideOrCorner value) { switch (value) { case SideOrCorner::Top: return "top"sv; @@ -1791,15 +1791,15 @@ DeprecatedString LinearGradientStyleValue::to_string() const builder.append("linear-gradient("sv); m_direction.visit( [&](SideOrCorner side_or_corner) { - builder.appendff("{}{}, "sv, m_gradient_type == GradientType::Standard ? "to "sv : ""sv, side_or_corner_to_string(side_or_corner)); + builder.appendff("{}{}, "sv, m_gradient_type == GradientType::Standard ? "to "sv : ""sv, side_or_corner_to_deprecated_string(side_or_corner)); }, [&](Angle const& angle) { - builder.appendff("{}, "sv, angle.to_string()); + builder.appendff("{}, "sv, angle.to_deprecated_string()); }); serialize_color_stop_list(builder, m_color_stop_list); builder.append(")"sv); - return builder.to_string(); + return builder.to_deprecated_string(); } static bool operator==(LinearGradientStyleValue::GradientDirection const& a, LinearGradientStyleValue::GradientDirection const& b) @@ -1947,7 +1947,7 @@ void PositionValue::serialize(StringBuilder& builder) const }()); }, [&](LengthPercentage length_percentage) { - builder.append(length_percentage.to_string()); + builder.append(length_percentage.to_deprecated_string()); }); builder.append(' '); if (has_relative_edges) @@ -1968,7 +1968,7 @@ void PositionValue::serialize(StringBuilder& builder) const }()); }, [&](LengthPercentage length_percentage) { - builder.append(length_percentage.to_string()); + builder.append(length_percentage.to_deprecated_string()); }); } @@ -1981,7 +1981,7 @@ bool PositionValue::operator==(PositionValue const& other) const && variant_equals(vertical_position, other.vertical_position)); } -DeprecatedString RadialGradientStyleValue::to_string() const +DeprecatedString RadialGradientStyleValue::to_deprecated_string() const { StringBuilder builder; if (is_repeating()) @@ -2006,8 +2006,8 @@ DeprecatedString RadialGradientStyleValue::to_string() const } }()); }, - [&](CircleSize const& circle_size) { builder.append(circle_size.radius.to_string()); }, - [&](EllipseSize const& ellipse_size) { builder.appendff("{} {}", ellipse_size.radius_a.to_string(), ellipse_size.radius_b.to_string()); }); + [&](CircleSize const& circle_size) { builder.append(circle_size.radius.to_deprecated_string()); }, + [&](EllipseSize const& ellipse_size) { builder.appendff("{} {}", ellipse_size.radius_a.to_deprecated_string(), ellipse_size.radius_b.to_deprecated_string()); }); if (m_position != PositionValue::center()) { builder.appendff(" at "sv); @@ -2017,7 +2017,7 @@ DeprecatedString RadialGradientStyleValue::to_string() const builder.append(", "sv); serialize_color_stop_list(builder, m_color_stop_list); builder.append(')'); - return builder.to_string(); + return builder.to_deprecated_string(); } Gfx::FloatSize RadialGradientStyleValue::resolve_size(Layout::Node const& node, Gfx::FloatPoint center, Gfx::FloatRect const& size) const @@ -2181,7 +2181,7 @@ void RadialGradientStyleValue::paint(PaintContext& context, Gfx::IntRect const& Painting::paint_radial_gradient(context, dest_rect, m_resolved->data, m_resolved->center.to_rounded(), m_resolved->gradient_size); } -DeprecatedString ConicGradientStyleValue::to_string() const +DeprecatedString ConicGradientStyleValue::to_deprecated_string() const { StringBuilder builder; if (is_repeating()) @@ -2190,7 +2190,7 @@ DeprecatedString ConicGradientStyleValue::to_string() const bool has_from_angle = false; bool has_at_position = false; if ((has_from_angle = m_from_angle.to_degrees() != 0)) - builder.appendff("from {}", m_from_angle.to_string()); + builder.appendff("from {}", m_from_angle.to_deprecated_string()); if ((has_at_position = m_position != PositionValue::center())) { if (has_from_angle) builder.append(' '); @@ -2201,7 +2201,7 @@ DeprecatedString ConicGradientStyleValue::to_string() const builder.append(", "sv); serialize_color_stop_list(builder, m_color_stop_list); builder.append(')'); - return builder.to_string(); + return builder.to_deprecated_string(); } void ConicGradientStyleValue::resolve_for_size(Layout::Node const& node, Gfx::FloatSize const& size) const @@ -2250,9 +2250,9 @@ bool LengthStyleValue::equals(StyleValue const& other) const return m_length == other.as_length().m_length; } -DeprecatedString ListStyleStyleValue::to_string() const +DeprecatedString ListStyleStyleValue::to_deprecated_string() const { - return DeprecatedString::formatted("{} {} {}", m_position->to_string(), m_image->to_string(), m_style_type->to_string()); + return DeprecatedString::formatted("{} {} {}", m_position->to_deprecated_string(), m_image->to_deprecated_string(), m_style_type->to_deprecated_string()); } bool ListStyleStyleValue::equals(StyleValue const& other) const @@ -2265,7 +2265,7 @@ bool ListStyleStyleValue::equals(StyleValue const& other) const && m_style_type->equals(typed_other.m_style_type); } -DeprecatedString NumericStyleValue::to_string() const +DeprecatedString NumericStyleValue::to_deprecated_string() const { return m_value.visit( [](float value) { @@ -2287,9 +2287,9 @@ bool NumericStyleValue::equals(StyleValue const& other) const return m_value.get() == other.as_numeric().m_value.get(); } -DeprecatedString OverflowStyleValue::to_string() const +DeprecatedString OverflowStyleValue::to_deprecated_string() const { - return DeprecatedString::formatted("{} {}", m_overflow_x->to_string(), m_overflow_y->to_string()); + return DeprecatedString::formatted("{} {}", m_overflow_x->to_deprecated_string(), m_overflow_y->to_deprecated_string()); } bool OverflowStyleValue::equals(StyleValue const& other) const @@ -2301,9 +2301,9 @@ bool OverflowStyleValue::equals(StyleValue const& other) const && m_overflow_y->equals(typed_other.m_overflow_y); } -DeprecatedString PercentageStyleValue::to_string() const +DeprecatedString PercentageStyleValue::to_deprecated_string() const { - return m_percentage.to_string(); + return m_percentage.to_deprecated_string(); } bool PercentageStyleValue::equals(StyleValue const& other) const @@ -2313,9 +2313,9 @@ bool PercentageStyleValue::equals(StyleValue const& other) const return m_percentage == other.as_percentage().m_percentage; } -DeprecatedString PositionStyleValue::to_string() const +DeprecatedString PositionStyleValue::to_deprecated_string() const { - auto to_string = [](PositionEdge edge) { + auto to_deprecated_string = [](PositionEdge edge) { switch (edge) { case PositionEdge::Left: return "left"; @@ -2329,7 +2329,7 @@ DeprecatedString PositionStyleValue::to_string() const VERIFY_NOT_REACHED(); }; - return DeprecatedString::formatted("{} {} {} {}", to_string(m_edge_x), m_offset_x.to_string(), to_string(m_edge_y), m_offset_y.to_string()); + return DeprecatedString::formatted("{} {} {} {}", to_deprecated_string(m_edge_x), m_offset_x.to_deprecated_string(), to_deprecated_string(m_edge_y), m_offset_y.to_deprecated_string()); } bool PositionStyleValue::equals(StyleValue const& other) const @@ -2343,7 +2343,7 @@ bool PositionStyleValue::equals(StyleValue const& other) const && m_offset_y == typed_other.m_offset_y; } -DeprecatedString RectStyleValue::to_string() const +DeprecatedString RectStyleValue::to_deprecated_string() const { return DeprecatedString::formatted("rect({} {} {} {})", m_rect.top_edge, m_rect.right_edge, m_rect.bottom_edge, m_rect.left_edge); } @@ -2363,13 +2363,13 @@ bool ResolutionStyleValue::equals(StyleValue const& other) const return m_resolution == other.as_resolution().m_resolution; } -DeprecatedString ShadowStyleValue::to_string() const +DeprecatedString ShadowStyleValue::to_deprecated_string() const { StringBuilder builder; - builder.appendff("{} {} {} {} {}", m_color.to_string(), m_offset_x.to_string(), m_offset_y.to_string(), m_blur_radius.to_string(), m_spread_distance.to_string()); + builder.appendff("{} {} {} {} {}", m_color.to_deprecated_string(), m_offset_x.to_deprecated_string(), m_offset_y.to_deprecated_string(), m_blur_radius.to_deprecated_string(), m_spread_distance.to_deprecated_string()); if (m_placement == ShadowPlacement::Inner) builder.append(" inset"sv); - return builder.to_string(); + return builder.to_deprecated_string(); } bool ShadowStyleValue::equals(StyleValue const& other) const @@ -2392,9 +2392,9 @@ bool StringStyleValue::equals(StyleValue const& other) const return m_string == other.as_string().m_string; } -DeprecatedString TextDecorationStyleValue::to_string() const +DeprecatedString TextDecorationStyleValue::to_deprecated_string() const { - return DeprecatedString::formatted("{} {} {} {}", m_line->to_string(), m_thickness->to_string(), m_style->to_string(), m_color->to_string()); + return DeprecatedString::formatted("{} {} {} {}", m_line->to_deprecated_string(), m_thickness->to_deprecated_string(), m_style->to_deprecated_string(), m_color->to_deprecated_string()); } bool TextDecorationStyleValue::equals(StyleValue const& other) const @@ -2415,7 +2415,7 @@ bool TimeStyleValue::equals(StyleValue const& other) const return m_time == other.as_time().m_time; } -DeprecatedString TransformationStyleValue::to_string() const +DeprecatedString TransformationStyleValue::to_deprecated_string() const { StringBuilder builder; builder.append(CSS::to_string(m_transform_function)); @@ -2423,7 +2423,7 @@ DeprecatedString TransformationStyleValue::to_string() const builder.join(", "sv, m_values); builder.append(')'); - return builder.to_string(); + return builder.to_deprecated_string(); } bool TransformationStyleValue::equals(StyleValue const& other) const @@ -2442,12 +2442,12 @@ bool TransformationStyleValue::equals(StyleValue const& other) const return true; } -DeprecatedString UnresolvedStyleValue::to_string() const +DeprecatedString UnresolvedStyleValue::to_deprecated_string() const { StringBuilder builder; for (auto& value : m_values) - builder.append(value.to_string()); - return builder.to_string(); + builder.append(value.to_deprecated_string()); + return builder.to_deprecated_string(); } bool UnresolvedStyleValue::equals(StyleValue const& other) const @@ -2455,7 +2455,7 @@ bool UnresolvedStyleValue::equals(StyleValue const& other) const if (type() != other.type()) return false; // This is a case where comparing the strings actually makes sense. - return to_string() == other.to_string(); + return to_deprecated_string() == other.to_deprecated_string(); } bool UnsetStyleValue::equals(StyleValue const& other) const @@ -2463,7 +2463,7 @@ bool UnsetStyleValue::equals(StyleValue const& other) const return type() == other.type(); } -DeprecatedString StyleValueList::to_string() const +DeprecatedString StyleValueList::to_deprecated_string() const { DeprecatedString separator = ""; switch (m_separator) { diff --git a/Userland/Libraries/LibWeb/CSS/StyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValue.h index fa0f70c77a1..eebf701b75e 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValue.h @@ -403,7 +403,7 @@ public: virtual Length to_length() const { VERIFY_NOT_REACHED(); } virtual float to_number() const { return 0; } virtual float to_integer() const { return 0; } - virtual DeprecatedString to_string() const = 0; + virtual DeprecatedString to_deprecated_string() const = 0; bool operator==(StyleValue const& other) const { return equals(other); } @@ -426,7 +426,7 @@ public: Angle const& angle() const { return m_angle; } - virtual DeprecatedString to_string() const override { return m_angle.to_string(); } + virtual DeprecatedString to_deprecated_string() const override { return m_angle.to_deprecated_string(); } virtual bool equals(StyleValue const& other) const override { @@ -472,7 +472,7 @@ public: NonnullRefPtr repeat() const { return m_repeat; } NonnullRefPtr size() const { return m_size; } - virtual DeprecatedString to_string() const override; + virtual DeprecatedString to_deprecated_string() const override; virtual bool equals(StyleValue const& other) const override; private: @@ -509,7 +509,7 @@ public: Repeat repeat_x() const { return m_repeat_x; } Repeat repeat_y() const { return m_repeat_y; } - virtual DeprecatedString to_string() const override; + virtual DeprecatedString to_deprecated_string() const override; virtual bool equals(StyleValue const& other) const override; private: @@ -536,7 +536,7 @@ public: LengthPercentage size_x() const { return m_size_x; } LengthPercentage size_y() const { return m_size_y; } - virtual DeprecatedString to_string() const override; + virtual DeprecatedString to_deprecated_string() const override; virtual bool equals(StyleValue const& other) const override; private: @@ -566,7 +566,7 @@ public: NonnullRefPtr border_style() const { return m_border_style; } NonnullRefPtr border_color() const { return m_border_color; } - virtual DeprecatedString to_string() const override; + virtual DeprecatedString to_deprecated_string() const override; virtual bool equals(StyleValue const& other) const override; private: @@ -598,7 +598,7 @@ public: LengthPercentage const& vertical_radius() const { return m_vertical_radius; } bool is_elliptical() const { return m_is_elliptical; } - virtual DeprecatedString to_string() const override; + virtual DeprecatedString to_deprecated_string() const override; virtual bool equals(StyleValue const& other) const override; private: @@ -630,7 +630,7 @@ public: NonnullRefPtr bottom_right() const { return m_bottom_right; } NonnullRefPtr bottom_left() const { return m_bottom_left; } - virtual DeprecatedString to_string() const override; + virtual DeprecatedString to_deprecated_string() const override; virtual bool equals(StyleValue const& other) const override; private: @@ -702,14 +702,14 @@ public: struct CalcNumberValue { Variant> value; - DeprecatedString to_string() const; + DeprecatedString to_deprecated_string() const; Optional resolved_type() const; CalculationResult resolve(Layout::Node const*, PercentageBasis const& percentage_basis) const; }; struct CalcValue { Variant> value; - DeprecatedString to_string() const; + DeprecatedString to_deprecated_string() const; Optional resolved_type() const; CalculationResult resolve(Layout::Node const*, PercentageBasis const& percentage_basis) const; bool contains_percentage() const; @@ -724,7 +724,7 @@ public: NonnullOwnPtr first_calc_product; NonnullOwnPtrVector zero_or_more_additional_calc_products; - DeprecatedString to_string() const; + DeprecatedString to_deprecated_string() const; Optional resolved_type() const; CalculationResult resolve(Layout::Node const*, PercentageBasis const& percentage_basis) const; @@ -739,7 +739,7 @@ public: NonnullOwnPtr first_calc_number_product; NonnullOwnPtrVector zero_or_more_additional_calc_number_products; - DeprecatedString to_string() const; + DeprecatedString to_deprecated_string() const; Optional resolved_type() const; CalculationResult resolve(Layout::Node const*, PercentageBasis const& percentage_basis) const; }; @@ -748,7 +748,7 @@ public: CalcValue first_calc_value; NonnullOwnPtrVector zero_or_more_additional_calc_values; - DeprecatedString to_string() const; + DeprecatedString to_deprecated_string() const; Optional resolved_type() const; CalculationResult resolve(Layout::Node const*, PercentageBasis const& percentage_basis) const; bool contains_percentage() const; @@ -762,7 +762,7 @@ public: SumOperation op; NonnullOwnPtr value; - DeprecatedString to_string() const; + DeprecatedString to_deprecated_string() const; Optional resolved_type() const; CalculationResult resolve(Layout::Node const*, PercentageBasis const& percentage_basis) const; bool contains_percentage() const; @@ -772,7 +772,7 @@ public: ProductOperation op; Variant value; - DeprecatedString to_string() const; + DeprecatedString to_deprecated_string() const; Optional resolved_type() const; CalculationResult resolve(Layout::Node const*, PercentageBasis const& percentage_basis) const; @@ -783,7 +783,7 @@ public: CalcNumberValue first_calc_number_value; NonnullOwnPtrVector zero_or_more_additional_calc_number_values; - DeprecatedString to_string() const; + DeprecatedString to_deprecated_string() const; Optional resolved_type() const; CalculationResult resolve(Layout::Node const*, PercentageBasis const& percentage_basis) const; }; @@ -792,7 +792,7 @@ public: ProductOperation op; CalcNumberValue value; - DeprecatedString to_string() const; + DeprecatedString to_deprecated_string() const; Optional resolved_type() const; CalculationResult resolve(Layout::Node const*, PercentageBasis const& percentage_basis) const; }; @@ -805,7 +805,7 @@ public: SumOperation op; NonnullOwnPtr value; - DeprecatedString to_string() const; + DeprecatedString to_deprecated_string() const; Optional resolved_type() const; CalculationResult resolve(Layout::Node const*, PercentageBasis const& percentage_basis) const; }; @@ -815,7 +815,7 @@ public: return adopt_ref(*new CalculatedStyleValue(move(calc_sum), resolved_type)); } - DeprecatedString to_string() const override; + DeprecatedString to_deprecated_string() const override; virtual bool equals(StyleValue const& other) const override; ResolvedType resolved_type() const { return m_resolved_type; } NonnullOwnPtr const& expression() const { return m_expression; } @@ -864,7 +864,7 @@ public: virtual ~ColorStyleValue() override = default; Color color() const { return m_color; } - virtual DeprecatedString to_string() const override; + virtual DeprecatedString to_deprecated_string() const override; virtual bool has_color() const override { return true; } virtual Color to_color(Layout::NodeWithStyle const&) const override { return m_color; } @@ -891,7 +891,7 @@ public: bool has_alt_text() const { return !m_alt_text.is_null(); } StyleValueList const* alt_text() const { return m_alt_text; } - virtual DeprecatedString to_string() const override; + virtual DeprecatedString to_deprecated_string() const override; virtual bool equals(StyleValue const& other) const override; private: @@ -917,7 +917,7 @@ public: Vector const& filter_value_list() const { return m_filter_value_list; } - virtual DeprecatedString to_string() const override; + virtual DeprecatedString to_deprecated_string() const override; virtual bool equals(StyleValue const& other) const override; virtual ~FilterValueListStyleValue() override = default; @@ -948,7 +948,7 @@ public: NonnullRefPtr shrink() const { return m_shrink; } NonnullRefPtr basis() const { return m_basis; } - virtual DeprecatedString to_string() const override; + virtual DeprecatedString to_deprecated_string() const override; virtual bool equals(StyleValue const& other) const override; private: @@ -979,7 +979,7 @@ public: NonnullRefPtr flex_direction() const { return m_flex_direction; } NonnullRefPtr flex_wrap() const { return m_flex_wrap; } - virtual DeprecatedString to_string() const override; + virtual DeprecatedString to_deprecated_string() const override; virtual bool equals(StyleValue const& other) const override; private: @@ -1005,7 +1005,7 @@ public: NonnullRefPtr line_height() const { return m_line_height; } NonnullRefPtr font_families() const { return m_font_families; } - virtual DeprecatedString to_string() const override; + virtual DeprecatedString to_deprecated_string() const override; virtual bool equals(StyleValue const& other) const override; private: @@ -1037,7 +1037,7 @@ public: Frequency const& frequency() const { return m_frequency; } - virtual DeprecatedString to_string() const override { return m_frequency.to_string(); } + virtual DeprecatedString to_deprecated_string() const override { return m_frequency.to_deprecated_string(); } virtual bool equals(StyleValue const& other) const override; private: @@ -1056,7 +1056,7 @@ public: virtual ~GridTrackPlacementStyleValue() override = default; CSS::GridTrackPlacement const& grid_track_placement() const { return m_grid_track_placement; } - virtual DeprecatedString to_string() const override; + virtual DeprecatedString to_deprecated_string() const override; virtual bool equals(StyleValue const& other) const override; private: @@ -1084,7 +1084,7 @@ public: NonnullRefPtr start() const { return m_start; } NonnullRefPtr end() const { return m_end; } - virtual DeprecatedString to_string() const override; + virtual DeprecatedString to_deprecated_string() const override; virtual bool equals(StyleValue const& other) const override; private: @@ -1108,7 +1108,7 @@ public: CSS::GridTrackSizeList grid_track_size_list() const { return m_grid_track_size_list; } - virtual DeprecatedString to_string() const override; + virtual DeprecatedString to_deprecated_string() const override; virtual bool equals(StyleValue const& other) const override; private: @@ -1136,7 +1136,7 @@ public: virtual CSS::ValueID to_identifier() const override { return m_id; } virtual bool has_color() const override; virtual Color to_color(Layout::NodeWithStyle const& node) const override; - virtual DeprecatedString to_string() const override; + virtual DeprecatedString to_deprecated_string() const override; virtual bool equals(StyleValue const& other) const override; private: @@ -1170,7 +1170,7 @@ public: static NonnullRefPtr create(AK::URL const& url) { return adopt_ref(*new ImageStyleValue(url)); } virtual ~ImageStyleValue() override = default; - virtual DeprecatedString to_string() const override; + virtual DeprecatedString to_deprecated_string() const override; virtual bool equals(StyleValue const& other) const override; virtual void load_any_resources(DOM::Document&) override; @@ -1238,7 +1238,7 @@ public: return adopt_ref(*new RadialGradientStyleValue(ending_shape, size, position, move(color_stop_list), repeating)); } - virtual DeprecatedString to_string() const override; + virtual DeprecatedString to_deprecated_string() const override; void paint(PaintContext&, Gfx::IntRect const& dest_rect, CSS::ImageRendering) const override; @@ -1293,7 +1293,7 @@ public: return adopt_ref(*new ConicGradientStyleValue(from_angle, position, move(color_stop_list), repeating)); } - virtual DeprecatedString to_string() const override; + virtual DeprecatedString to_deprecated_string() const override; void paint(PaintContext&, Gfx::IntRect const& dest_rect, CSS::ImageRendering) const override; @@ -1355,7 +1355,7 @@ public: return adopt_ref(*new LinearGradientStyleValue(direction, move(color_stop_list), type, repeating)); } - virtual DeprecatedString to_string() const override; + virtual DeprecatedString to_deprecated_string() const override; virtual ~LinearGradientStyleValue() override = default; virtual bool equals(StyleValue const& other) const override; @@ -1405,7 +1405,7 @@ public: } virtual ~InheritStyleValue() override = default; - DeprecatedString to_string() const override { return "inherit"; } + DeprecatedString to_deprecated_string() const override { return "inherit"; } virtual bool equals(StyleValue const& other) const override; private: @@ -1424,7 +1424,7 @@ public: } virtual ~InitialStyleValue() override = default; - DeprecatedString to_string() const override { return "initial"; } + DeprecatedString to_deprecated_string() const override { return "initial"; } virtual bool equals(StyleValue const& other) const override; private: @@ -1444,7 +1444,7 @@ public: virtual bool has_auto() const override { return m_length.is_auto(); } virtual bool has_length() const override { return true; } virtual bool has_identifier() const override { return has_auto(); } - virtual DeprecatedString to_string() const override { return m_length.to_string(); } + virtual DeprecatedString to_deprecated_string() const override { return m_length.to_deprecated_string(); } virtual Length to_length() const override { return m_length; } virtual ValueID to_identifier() const override { return has_auto() ? ValueID::Auto : ValueID::Invalid; } virtual NonnullRefPtr absolutized(Gfx::IntRect const& viewport_rect, Gfx::FontPixelMetrics const& font_metrics, float font_size, float root_font_size) const override; @@ -1475,7 +1475,7 @@ public: NonnullRefPtr image() const { return m_image; } NonnullRefPtr style_type() const { return m_style_type; } - virtual DeprecatedString to_string() const override; + virtual DeprecatedString to_deprecated_string() const override; virtual bool equals(StyleValue const& other) const override; private: @@ -1521,7 +1521,7 @@ public: virtual bool has_integer() const override { return m_value.has(); } virtual float to_integer() const override { return m_value.get(); } - virtual DeprecatedString to_string() const override; + virtual DeprecatedString to_deprecated_string() const override; virtual bool equals(StyleValue const& other) const override; private: @@ -1545,7 +1545,7 @@ public: NonnullRefPtr overflow_x() const { return m_overflow_x; } NonnullRefPtr overflow_y() const { return m_overflow_y; } - virtual DeprecatedString to_string() const override; + virtual DeprecatedString to_deprecated_string() const override; virtual bool equals(StyleValue const& other) const override; private: @@ -1571,7 +1571,7 @@ public: Percentage const& percentage() const { return m_percentage; } Percentage& percentage() { return m_percentage; } - virtual DeprecatedString to_string() const override; + virtual DeprecatedString to_deprecated_string() const override; virtual bool equals(StyleValue const& other) const override; private: @@ -1597,7 +1597,7 @@ public: PositionEdge edge_y() const { return m_edge_y; } LengthPercentage const& offset_y() const { return m_offset_y; } - virtual DeprecatedString to_string() const override; + virtual DeprecatedString to_deprecated_string() const override; virtual bool equals(StyleValue const& other) const override; private: @@ -1626,7 +1626,7 @@ public: Resolution const& resolution() const { return m_resolution; } - virtual DeprecatedString to_string() const override { return m_resolution.to_string(); } + virtual DeprecatedString to_deprecated_string() const override { return m_resolution.to_deprecated_string(); } virtual bool equals(StyleValue const& other) const override; private: @@ -1655,7 +1655,7 @@ public: Length const& spread_distance() const { return m_spread_distance; } ShadowPlacement placement() const { return m_placement; } - virtual DeprecatedString to_string() const override; + virtual DeprecatedString to_deprecated_string() const override; virtual bool equals(StyleValue const& other) const override; private: @@ -1688,7 +1688,7 @@ public: } virtual ~StringStyleValue() override = default; - DeprecatedString to_string() const override { return m_string; } + DeprecatedString to_deprecated_string() const override { return m_string; } virtual bool equals(StyleValue const& other) const override; private: @@ -1718,7 +1718,7 @@ public: NonnullRefPtr style() const { return m_style; } NonnullRefPtr color() const { return m_color; } - virtual DeprecatedString to_string() const override; + virtual DeprecatedString to_deprecated_string() const override; virtual bool equals(StyleValue const& other) const override; private: @@ -1751,7 +1751,7 @@ public: Time const& time() const { return m_time; } - virtual DeprecatedString to_string() const override { return m_time.to_string(); } + virtual DeprecatedString to_deprecated_string() const override { return m_time.to_deprecated_string(); } virtual bool equals(StyleValue const& other) const override; private: @@ -1775,7 +1775,7 @@ public: CSS::TransformFunction transform_function() const { return m_transform_function; } NonnullRefPtrVector values() const { return m_values; } - virtual DeprecatedString to_string() const override; + virtual DeprecatedString to_deprecated_string() const override; virtual bool equals(StyleValue const& other) const override; private: @@ -1798,7 +1798,7 @@ public: } virtual ~UnresolvedStyleValue() override = default; - virtual DeprecatedString to_string() const override; + virtual DeprecatedString to_deprecated_string() const override; virtual bool equals(StyleValue const& other) const override; Vector const& values() const { return m_values; } @@ -1825,7 +1825,7 @@ public: } virtual ~UnsetStyleValue() override = default; - DeprecatedString to_string() const override { return "unset"; } + DeprecatedString to_deprecated_string() const override { return "unset"; } virtual bool equals(StyleValue const& other) const override; private: @@ -1852,7 +1852,7 @@ public: return m_values[i]; } - virtual DeprecatedString to_string() const override; + virtual DeprecatedString to_deprecated_string() const override; virtual bool equals(StyleValue const& other) const override; private: @@ -1873,7 +1873,7 @@ public: virtual ~RectStyleValue() override = default; EdgeRect rect() const { return m_rect; } - virtual DeprecatedString to_string() const override; + virtual DeprecatedString to_deprecated_string() const override; virtual bool has_rect() const override { return true; } virtual EdgeRect to_rect() const override { return m_rect; } virtual bool equals(StyleValue const& other) const override; @@ -1894,6 +1894,6 @@ template<> struct AK::Formatter : Formatter { ErrorOr format(FormatBuilder& builder, Web::CSS::StyleValue const& style_value) { - return Formatter::format(builder, style_value.to_string()); + return Formatter::format(builder, style_value.to_deprecated_string()); } }; diff --git a/Userland/Libraries/LibWeb/CSS/Supports.cpp b/Userland/Libraries/LibWeb/CSS/Supports.cpp index d0ad51e3821..41287f0b8c3 100644 --- a/Userland/Libraries/LibWeb/CSS/Supports.cpp +++ b/Userland/Libraries/LibWeb/CSS/Supports.cpp @@ -73,33 +73,34 @@ bool Supports::Feature::evaluate() const }); } -DeprecatedString Supports::Declaration::to_string() const +DeprecatedString Supports::Declaration::to_deprecated_string() const { return DeprecatedString::formatted("({})", declaration); } -DeprecatedString Supports::Selector::to_string() const +DeprecatedString Supports::Selector::to_deprecated_string() const { return DeprecatedString::formatted("selector({})", selector); } -DeprecatedString Supports::Feature::to_string() const +DeprecatedString Supports::Feature::to_deprecated_string() const { - return value.visit([](auto& it) { return it.to_string(); }); + return value.visit([](auto& it) { return it.to_deprecated_string(); }); } -DeprecatedString Supports::InParens::to_string() const +DeprecatedString Supports::InParens::to_deprecated_string() const { return value.visit( - [](NonnullOwnPtr const& condition) -> DeprecatedString { return DeprecatedString::formatted("({})", condition->to_string()); }, - [](auto& it) -> DeprecatedString { return it.to_string(); }); + [](NonnullOwnPtr const& condition) -> DeprecatedString { return DeprecatedString::formatted("({})", condition->to_deprecated_string()); }, + [](Supports::Feature const& it) -> DeprecatedString { return it.to_deprecated_string(); }, + [](GeneralEnclosed const& it) -> DeprecatedString { return it.to_string(); }); } -DeprecatedString Supports::Condition::to_string() const +DeprecatedString Supports::Condition::to_deprecated_string() const { switch (type) { case Type::Not: - return DeprecatedString::formatted("not {}", children.first().to_string()); + return DeprecatedString::formatted("not {}", children.first().to_deprecated_string()); case Type::And: return DeprecatedString::join(" and "sv, children); case Type::Or: @@ -108,9 +109,9 @@ DeprecatedString Supports::Condition::to_string() const VERIFY_NOT_REACHED(); } -DeprecatedString Supports::to_string() const +DeprecatedString Supports::to_deprecated_string() const { - return m_condition->to_string(); + return m_condition->to_deprecated_string(); } } diff --git a/Userland/Libraries/LibWeb/CSS/Supports.h b/Userland/Libraries/LibWeb/CSS/Supports.h index e6e6fb369ff..385fc5eb7fa 100644 --- a/Userland/Libraries/LibWeb/CSS/Supports.h +++ b/Userland/Libraries/LibWeb/CSS/Supports.h @@ -24,19 +24,19 @@ public: struct Declaration { DeprecatedString declaration; bool evaluate() const; - DeprecatedString to_string() const; + DeprecatedString to_deprecated_string() const; }; struct Selector { DeprecatedString selector; bool evaluate() const; - DeprecatedString to_string() const; + DeprecatedString to_deprecated_string() const; }; struct Feature { Variant value; bool evaluate() const; - DeprecatedString to_string() const; + DeprecatedString to_deprecated_string() const; }; struct Condition; @@ -44,7 +44,7 @@ public: Variant, Feature, GeneralEnclosed> value; bool evaluate() const; - DeprecatedString to_string() const; + DeprecatedString to_deprecated_string() const; }; struct Condition { @@ -57,7 +57,7 @@ public: Vector children; bool evaluate() const; - DeprecatedString to_string() const; + DeprecatedString to_deprecated_string() const; }; static NonnullRefPtr create(NonnullOwnPtr&& condition) @@ -66,7 +66,7 @@ public: } bool matches() const { return m_matches; } - DeprecatedString to_string() const; + DeprecatedString to_deprecated_string() const; private: Supports(NonnullOwnPtr&&); @@ -81,6 +81,6 @@ template<> struct AK::Formatter : AK::Formatter { ErrorOr format(FormatBuilder& builder, Web::CSS::Supports::InParens const& in_parens) { - return Formatter::format(builder, in_parens.to_string()); + return Formatter::format(builder, in_parens.to_deprecated_string()); } }; diff --git a/Userland/Libraries/LibWeb/CSS/Time.cpp b/Userland/Libraries/LibWeb/CSS/Time.cpp index 724d8b8648d..fa685cf7de4 100644 --- a/Userland/Libraries/LibWeb/CSS/Time.cpp +++ b/Userland/Libraries/LibWeb/CSS/Time.cpp @@ -40,10 +40,10 @@ Time Time::percentage_of(Percentage const& percentage) const return Time { percentage.as_fraction() * m_value, m_type }; } -DeprecatedString Time::to_string() const +DeprecatedString Time::to_deprecated_string() const { if (is_calculated()) - return m_calculated_style->to_string(); + return m_calculated_style->to_deprecated_string(); return DeprecatedString::formatted("{}{}", m_value, unit_name()); } diff --git a/Userland/Libraries/LibWeb/CSS/Time.h b/Userland/Libraries/LibWeb/CSS/Time.h index 9655241effe..42dfa1d3dd6 100644 --- a/Userland/Libraries/LibWeb/CSS/Time.h +++ b/Userland/Libraries/LibWeb/CSS/Time.h @@ -31,7 +31,7 @@ public: bool is_calculated() const { return m_type == Type::Calculated; } NonnullRefPtr calculated_style_value() const; - DeprecatedString to_string() const; + DeprecatedString to_deprecated_string() const; float to_seconds() const; bool operator==(Time const& other) const @@ -55,6 +55,6 @@ template<> struct AK::Formatter : Formatter { ErrorOr format(FormatBuilder& builder, Web::CSS::Time const& time) { - return Formatter::format(builder, time.to_string()); + return Formatter::format(builder, time.to_deprecated_string()); } }; diff --git a/Userland/Libraries/LibWeb/CSS/UnicodeRange.h b/Userland/Libraries/LibWeb/CSS/UnicodeRange.h index 505532b3c1d..4443e3d6cb8 100644 --- a/Userland/Libraries/LibWeb/CSS/UnicodeRange.h +++ b/Userland/Libraries/LibWeb/CSS/UnicodeRange.h @@ -29,7 +29,7 @@ public: return m_min_code_point <= code_point && code_point <= m_max_code_point; } - DeprecatedString to_string() const + DeprecatedString to_deprecated_string() const { if (m_min_code_point == m_max_code_point) return DeprecatedString::formatted("U+{:x}", m_min_code_point); diff --git a/Userland/Libraries/LibWeb/Crypto/Crypto.cpp b/Userland/Libraries/LibWeb/Crypto/Crypto.cpp index dc627525a51..3f418470656 100644 --- a/Userland/Libraries/LibWeb/Crypto/Crypto.cpp +++ b/Userland/Libraries/LibWeb/Crypto/Crypto.cpp @@ -111,7 +111,7 @@ DeprecatedString Crypto::random_uuid() const builder.appendff("{:02x}{:02x}-", bytes[6], bytes[7]); builder.appendff("{:02x}{:02x}-", bytes[8], bytes[9]); builder.appendff("{:02x}{:02x}{:02x}{:02x}{:02x}{:02x}", bytes[10], bytes[11], bytes[12], bytes[13], bytes[14], bytes[15]); - return builder.to_string(); + return builder.to_deprecated_string(); } void Crypto::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/DOM/CharacterData.cpp b/Userland/Libraries/LibWeb/DOM/CharacterData.cpp index 39fccecab6d..fcd298bd0e0 100644 --- a/Userland/Libraries/LibWeb/DOM/CharacterData.cpp +++ b/Userland/Libraries/LibWeb/DOM/CharacterData.cpp @@ -73,7 +73,7 @@ WebIDL::ExceptionOr CharacterData::replace_data(size_t offset, size_t coun builder.append(this->data().substring_view(0, offset)); builder.append(data); builder.append(this->data().substring_view(offset + count)); - m_data = builder.to_string(); + m_data = builder.to_deprecated_string(); // 8. For each live range whose start node is node and start offset is greater than offset but less than or equal to offset plus count, set its start offset to offset. for (auto& range : Range::live_ranges()) { diff --git a/Userland/Libraries/LibWeb/DOM/Document.cpp b/Userland/Libraries/LibWeb/DOM/Document.cpp index b2a52929cc1..17d2c32d85b 100644 --- a/Userland/Libraries/LibWeb/DOM/Document.cpp +++ b/Userland/Libraries/LibWeb/DOM/Document.cpp @@ -663,7 +663,7 @@ DeprecatedString Document::title() const last_was_space = false; } } - return builder.to_string(); + return builder.to_deprecated_string(); } void Document::set_title(DeprecatedString const& title) @@ -1595,7 +1595,7 @@ DeprecatedString Document::dump_dom_tree_as_json() const serialize_tree_as_json(json); MUST(json.finish()); - return builder.to_string(); + return builder.to_deprecated_string(); } // https://html.spec.whatwg.org/multipage/semantics.html#has-a-style-sheet-that-is-blocking-scripts diff --git a/Userland/Libraries/LibWeb/DOM/Document.h b/Userland/Libraries/LibWeb/DOM/Document.h index eb661c7a2ff..50a9461f72c 100644 --- a/Userland/Libraries/LibWeb/DOM/Document.h +++ b/Userland/Libraries/LibWeb/DOM/Document.h @@ -108,8 +108,8 @@ public: void update_base_element(Badge); JS::GCPtr first_base_element_with_href_in_tree_order() const; - DeprecatedString url_string() const { return m_url.to_string(); } - DeprecatedString document_uri() const { return m_url.to_string(); } + DeprecatedString url_string() const { return m_url.to_deprecated_string(); } + DeprecatedString document_uri() const { return m_url.to_deprecated_string(); } HTML::Origin origin() const; void set_origin(HTML::Origin const& origin); diff --git a/Userland/Libraries/LibWeb/DOM/Element.cpp b/Userland/Libraries/LibWeb/DOM/Element.cpp index 7c186a6d596..f79fa7065cc 100644 --- a/Userland/Libraries/LibWeb/DOM/Element.cpp +++ b/Userland/Libraries/LibWeb/DOM/Element.cpp @@ -315,7 +315,7 @@ JS::GCPtr Element::create_layout_node_for_display_type(DOM::Docume return document.heap().allocate_without_realm(document, element, move(style)); if (display.is_flex_inside()) return document.heap().allocate_without_realm(document, element, move(style)); - dbgln_if(LIBWEB_CSS_DEBUG, "FIXME: Support display: {}", display.to_string()); + dbgln_if(LIBWEB_CSS_DEBUG, "FIXME: Support display: {}", display.to_deprecated_string()); return document.heap().allocate_without_realm(document, element, move(style)); } diff --git a/Userland/Libraries/LibWeb/DOM/EventTarget.cpp b/Userland/Libraries/LibWeb/DOM/EventTarget.cpp index 329ffe6a38f..ed54f665210 100644 --- a/Userland/Libraries/LibWeb/DOM/EventTarget.cpp +++ b/Userland/Libraries/LibWeb/DOM/EventTarget.cpp @@ -386,7 +386,7 @@ WebIDL::CallbackType* EventTarget::get_current_value_of_event_handler(FlyString builder.appendff("function {}(event) {{\n{}\n}}", name, body); } - auto source_text = builder.to_string(); + auto source_text = builder.to_deprecated_string(); auto parser = JS::Parser(JS::Lexer(source_text)); @@ -454,7 +454,7 @@ WebIDL::CallbackType* EventTarget::get_current_value_of_event_handler(FlyString // 6. Return scope. (NOTE: Not necessary) - auto* function = JS::ECMAScriptFunctionObject::create(realm, name, builder.to_string(), program->body(), program->parameters(), program->function_length(), scope, nullptr, JS::FunctionKind::Normal, program->is_strict_mode(), program->might_need_arguments_object(), is_arrow_function); + auto* function = JS::ECMAScriptFunctionObject::create(realm, name, builder.to_deprecated_string(), program->body(), program->parameters(), program->function_length(), scope, nullptr, JS::FunctionKind::Normal, program->is_strict_mode(), program->might_need_arguments_object(), is_arrow_function); VERIFY(function); // 10. Remove settings object's realm execution context from the JavaScript execution context stack. diff --git a/Userland/Libraries/LibWeb/DOM/Node.cpp b/Userland/Libraries/LibWeb/DOM/Node.cpp index 58b3bc8133b..7f672fbece3 100644 --- a/Userland/Libraries/LibWeb/DOM/Node.cpp +++ b/Userland/Libraries/LibWeb/DOM/Node.cpp @@ -105,7 +105,7 @@ void Node::visit_edges(Cell::Visitor& visitor) DeprecatedString Node::base_uri() const { // Return this’s node document’s document base URL, serialized. - return document().base_url().to_string(); + return document().base_url().to_deprecated_string(); } const HTML::HTMLAnchorElement* Node::enclosing_link_element() const @@ -142,7 +142,7 @@ DeprecatedString Node::descendant_text_content() const builder.append(text_node.data()); return IterationDecision::Continue; }); - return builder.to_string(); + return builder.to_deprecated_string(); } // https://dom.spec.whatwg.org/#dom-node-textcontent @@ -1318,7 +1318,7 @@ DeprecatedString Node::debug_description() const for (auto const& class_name : element.class_names()) builder.appendff(".{}", class_name); } - return builder.to_string(); + return builder.to_deprecated_string(); } // https://dom.spec.whatwg.org/#concept-node-length diff --git a/Userland/Libraries/LibWeb/DOM/Position.cpp b/Userland/Libraries/LibWeb/DOM/Position.cpp index f827b85334e..6c1cc31cefc 100644 --- a/Userland/Libraries/LibWeb/DOM/Position.cpp +++ b/Userland/Libraries/LibWeb/DOM/Position.cpp @@ -18,7 +18,7 @@ Position::Position(Node& node, unsigned offset) { } -DeprecatedString Position::to_string() const +DeprecatedString Position::to_deprecated_string() const { if (!node()) return DeprecatedString::formatted("DOM::Position(nullptr, {})", offset()); diff --git a/Userland/Libraries/LibWeb/DOM/Position.h b/Userland/Libraries/LibWeb/DOM/Position.h index 739e3505067..ee7fe84eaa0 100644 --- a/Userland/Libraries/LibWeb/DOM/Position.h +++ b/Userland/Libraries/LibWeb/DOM/Position.h @@ -35,7 +35,7 @@ public: return m_node.ptr() == other.m_node.ptr() && m_offset == other.m_offset; } - DeprecatedString to_string() const; + DeprecatedString to_deprecated_string() const; private: JS::Handle m_node; @@ -49,7 +49,7 @@ template<> struct Formatter : Formatter { ErrorOr format(FormatBuilder& builder, Web::DOM::Position const& value) { - return Formatter::format(builder, value.to_string()); + return Formatter::format(builder, value.to_deprecated_string()); } }; diff --git a/Userland/Libraries/LibWeb/DOM/Range.cpp b/Userland/Libraries/LibWeb/DOM/Range.cpp index 219b07644a0..c8af80e6afa 100644 --- a/Userland/Libraries/LibWeb/DOM/Range.cpp +++ b/Userland/Libraries/LibWeb/DOM/Range.cpp @@ -516,7 +516,7 @@ WebIDL::ExceptionOr Range::compare_point(Node const& node, u32 offset) cons } // https://dom.spec.whatwg.org/#dom-range-stringifier -DeprecatedString Range::to_string() const +DeprecatedString Range::to_deprecated_string() const { // 1. Let s be the empty string. StringBuilder builder; @@ -541,7 +541,7 @@ DeprecatedString Range::to_string() const builder.append(static_cast(*end_container()).data().substring_view(0, end_offset())); // 6. Return s. - return builder.to_string(); + return builder.to_deprecated_string(); } // https://dom.spec.whatwg.org/#dom-range-extractcontents diff --git a/Userland/Libraries/LibWeb/DOM/Range.h b/Userland/Libraries/LibWeb/DOM/Range.h index 3f958ee3eef..21f7b89be14 100644 --- a/Userland/Libraries/LibWeb/DOM/Range.h +++ b/Userland/Libraries/LibWeb/DOM/Range.h @@ -78,7 +78,7 @@ public: WebIDL::ExceptionOr insert_node(JS::NonnullGCPtr); WebIDL::ExceptionOr surround_contents(JS::NonnullGCPtr new_parent); - DeprecatedString to_string() const; + DeprecatedString to_deprecated_string() const; static HashTable& live_ranges(); diff --git a/Userland/Libraries/LibWeb/DOMParsing/XMLSerializer.cpp b/Userland/Libraries/LibWeb/DOMParsing/XMLSerializer.cpp index 04cc04beec5..c72d5da40cd 100644 --- a/Userland/Libraries/LibWeb/DOMParsing/XMLSerializer.cpp +++ b/Userland/Libraries/LibWeb/DOMParsing/XMLSerializer.cpp @@ -455,7 +455,7 @@ static WebIDL::ExceptionOr serialize_element_attributes(DOM::E } // 4. Return the value of result. - return result.to_string(); + return result.to_deprecated_string(); } // https://w3c.github.io/DOM-Parsing/#xml-serializing-an-element-node @@ -524,7 +524,7 @@ static WebIDL::ExceptionOr serialize_element(DOM::Element cons qualified_name.append(element.local_name()); // 4. Append the value of qualified name to markup. - markup.append(qualified_name.to_string()); + markup.append(qualified_name.to_deprecated_string()); } // 12. Otherwise, inherited ns is not equal to ns (the node's own namespace is different from the context namespace of its parent). Run these sub-steps: @@ -561,7 +561,7 @@ static WebIDL::ExceptionOr serialize_element(DOM::Element cons } // 3. Append the value of qualified name to markup. - markup.append(qualified_name.to_string()); + markup.append(qualified_name.to_deprecated_string()); } // 5. Otherwise, if prefix is not null, then: @@ -577,7 +577,7 @@ static WebIDL::ExceptionOr serialize_element(DOM::Element cons qualified_name.appendff("{}:{}", prefix, element.local_name()); // 4. Append the value of qualified name to markup. - markup.append(qualified_name.to_string()); + markup.append(qualified_name.to_deprecated_string()); // 5. Append the following to markup, in the order listed: // 1. " " (U+0020 SPACE); @@ -618,7 +618,7 @@ static WebIDL::ExceptionOr serialize_element(DOM::Element cons inherited_ns = ns; // 4. Append the value of qualified name to markup. - markup.append(qualified_name.to_string()); + markup.append(qualified_name.to_deprecated_string()); // 5. Append the following to markup, in the order listed: // 1. " " (U+0020 SPACE); @@ -641,7 +641,7 @@ static WebIDL::ExceptionOr serialize_element(DOM::Element cons qualified_name.append(element.local_name()); inherited_ns = ns; - markup.append(qualified_name.to_string()); + markup.append(qualified_name.to_deprecated_string()); } } @@ -671,7 +671,7 @@ static WebIDL::ExceptionOr serialize_element(DOM::Element cons // 17. If the value of skip end tag is true, then return the value of markup and skip the remaining steps. The node is a leaf-node. if (skip_end_tag) - return markup.to_string(); + return markup.to_deprecated_string(); // 18. If ns is the HTML namespace, and the node's localName matches the string "template", then this is a template element. if (ns == Namespace::HTML && element.local_name() == HTML::TagNames::template_) { @@ -691,13 +691,13 @@ static WebIDL::ExceptionOr serialize_element(DOM::Element cons markup.append("" (U+003E GREATER-THAN SIGN). markup.append('>'); // 21. Return the value of markup. - return markup.to_string(); + return markup.to_deprecated_string(); } // https://w3c.github.io/DOM-Parsing/#xml-serializing-a-document-node @@ -717,7 +717,7 @@ static WebIDL::ExceptionOr serialize_document(DOM::Document co serialized_document.append(TRY(serialize_node_to_xml_string_impl(*child, namespace_, namespace_prefix_map, prefix_index, require_well_formed))); // 3. Return the value of serialized document. - return serialized_document.to_string(); + return serialized_document.to_deprecated_string(); } // https://w3c.github.io/DOM-Parsing/#xml-serializing-a-comment-node @@ -774,7 +774,7 @@ static WebIDL::ExceptionOr serialize_document_fragment(DOM::Do markup.append(TRY(serialize_node_to_xml_string_impl(*child, namespace_, namespace_prefix_map, prefix_index, require_well_formed))); // 3. Return the value of markup. - return markup.to_string(); + return markup.to_deprecated_string(); } // https://w3c.github.io/DOM-Parsing/#xml-serializing-a-documenttype-node @@ -840,7 +840,7 @@ static WebIDL::ExceptionOr serialize_document_type(DOM::Docume markup.append('>'); // 11. Return the value of markup. - return markup.to_string(); + return markup.to_deprecated_string(); } // https://w3c.github.io/DOM-Parsing/#dfn-xml-serializing-a-processinginstruction-node @@ -881,7 +881,7 @@ static WebIDL::ExceptionOr serialize_processing_instruction(DO markup.append("?>"sv); // 4. Return the value of markup. - return markup.to_string(); + return markup.to_deprecated_string(); } } diff --git a/Userland/Libraries/LibWeb/Dump.cpp b/Userland/Libraries/LibWeb/Dump.cpp index 9fa8443cfb2..a9aef46eda7 100644 --- a/Userland/Libraries/LibWeb/Dump.cpp +++ b/Userland/Libraries/LibWeb/Dump.cpp @@ -113,7 +113,7 @@ void dump_tree(StringBuilder& builder, Layout::Node const& layout_node, bool sho builder.append('.'); builder.append(class_name); } - identifier = builder.to_string(); + identifier = builder.to_deprecated_string(); } StringView nonbox_color_on = ""sv; @@ -264,7 +264,7 @@ void dump_tree(StringBuilder& builder, Layout::Node const& layout_node, bool sho builder.appendff("start: {}, length: {}, rect: {}\n", fragment.start(), fragment.length(), - fragment.absolute_rect().to_string()); + fragment.absolute_rect().to_deprecated_string()); if (is(fragment.layout_node())) { for (size_t i = 0; i < indent; ++i) builder.append(" "sv); @@ -283,7 +283,7 @@ void dump_tree(StringBuilder& builder, Layout::Node const& layout_node, bool sho }; Vector properties; verify_cast(*layout_node.dom_node()).computed_css_values()->for_each_property([&](auto property_id, auto& value) { - properties.append({ CSS::string_from_property_id(property_id), value.to_string() }); + properties.append({ CSS::string_from_property_id(property_id), value.to_deprecated_string() }); }); quick_sort(properties, [](auto& a, auto& b) { return a.name < b.name; }); @@ -602,7 +602,7 @@ void dump_font_face_rule(StringBuilder& builder, CSS::CSSFontFaceRule const& rul builder.append("unicode-ranges:\n"sv); for (auto const& unicode_range : font_face.unicode_ranges()) { indent(builder, indent_levels + 2); - builder.appendff("{}\n", unicode_range.to_string()); + builder.appendff("{}\n", unicode_range.to_deprecated_string()); } } @@ -642,14 +642,14 @@ void dump_style_rule(StringBuilder& builder, CSS::CSSStyleRule const& rule, int auto& style_declaration = verify_cast(rule.declaration()); for (auto& property : style_declaration.properties()) { indent(builder, indent_levels); - builder.appendff(" {}: '{}'", CSS::string_from_property_id(property.property_id), property.value->to_string()); + builder.appendff(" {}: '{}'", CSS::string_from_property_id(property.property_id), property.value->to_deprecated_string()); if (property.important == CSS::Important::Yes) builder.append(" \033[31;1m!important\033[0m"sv); builder.append('\n'); } for (auto& property : style_declaration.custom_properties()) { indent(builder, indent_levels); - builder.appendff(" {}: '{}'", property.key, property.value.value->to_string()); + builder.appendff(" {}: '{}'", property.key, property.value.value->to_deprecated_string()); if (property.value.important == CSS::Important::Yes) builder.append(" \033[31;1m!important\033[0m"sv); builder.append('\n'); diff --git a/Userland/Libraries/LibWeb/Fetch/Body.cpp b/Userland/Libraries/LibWeb/Fetch/Body.cpp index 21134d3070c..45ab82ed806 100644 --- a/Userland/Libraries/LibWeb/Fetch/Body.cpp +++ b/Userland/Libraries/LibWeb/Fetch/Body.cpp @@ -162,7 +162,7 @@ JS::NonnullGCPtr consume_body(JS::Realm& realm, BodyMixin const& ob // 4. Let steps be to return the result of package data with the first argument given, type, and object’s MIME type. auto steps = [&realm, &object, type](JS::Value value) -> WebIDL::ExceptionOr { VERIFY(value.is_string()); - auto bytes = TRY_OR_RETURN_OOM(realm, ByteBuffer::copy(value.as_string().string().bytes())); + auto bytes = TRY_OR_RETURN_OOM(realm, ByteBuffer::copy(value.as_string().deprecated_string().bytes())); return package_data(realm, move(bytes), type, object.mime_type_impl()); }; diff --git a/Userland/Libraries/LibWeb/Fetch/BodyInit.cpp b/Userland/Libraries/LibWeb/Fetch/BodyInit.cpp index b44c7ac14a8..621d16991f5 100644 --- a/Userland/Libraries/LibWeb/Fetch/BodyInit.cpp +++ b/Userland/Libraries/LibWeb/Fetch/BodyInit.cpp @@ -87,7 +87,7 @@ WebIDL::ExceptionOr extract_body(JS::Realm& realm, }, [&](JS::Handle const& url_search_params) -> WebIDL::ExceptionOr { // Set source to the result of running the application/x-www-form-urlencoded serializer with object’s list. - source = url_search_params->to_string().to_byte_buffer(); + source = url_search_params->to_deprecated_string().to_byte_buffer(); // Set type to `application/x-www-form-urlencoded;charset=UTF-8`. type = TRY_OR_RETURN_OOM(realm, ByteBuffer::copy("application/x-www-form-urlencoded;charset=UTF-8"sv.bytes())); return {}; diff --git a/Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP.cpp b/Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP.cpp index 08f53f71c04..1f7338bd0ad 100644 --- a/Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP.cpp +++ b/Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP.cpp @@ -69,7 +69,7 @@ DeprecatedString collect_an_http_quoted_string(GenericLexer& lexer, HttpQuotedSt // 6. If the extract-value flag is set, then return value. if (extract_value == HttpQuotedStringExtractValue::Yes) - return value.to_string(); + return value.to_deprecated_string(); // 7. Return the code points from positionStart to position, inclusive, within input. auto position = lexer.tell(); diff --git a/Userland/Libraries/LibWeb/FileAPI/Blob.cpp b/Userland/Libraries/LibWeb/FileAPI/Blob.cpp index a53b6a6d8fa..fe00283ae54 100644 --- a/Userland/Libraries/LibWeb/FileAPI/Blob.cpp +++ b/Userland/Libraries/LibWeb/FileAPI/Blob.cpp @@ -63,7 +63,7 @@ ErrorOr convert_line_endings_to_native(DeprecatedString const& TRY(result.try_append(lexer.consume_until(is_any_of("\n\r"sv)))); } // 5. Return result. - return result.to_string(); + return result.to_deprecated_string(); } // https://w3c.github.io/FileAPI/#process-blob-parts diff --git a/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp b/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp index 8cf8aec1936..07cda36dae3 100644 --- a/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp +++ b/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp @@ -512,7 +512,7 @@ DeprecatedString BrowsingContext::selected_text() const builder.append(text.substring(0, selection.end().index_in_node)); } - return builder.to_string(); + return builder.to_deprecated_string(); } void BrowsingContext::select_all() diff --git a/Userland/Libraries/LibWeb/HTML/Canvas/CanvasFillStrokeStyles.h b/Userland/Libraries/LibWeb/HTML/Canvas/CanvasFillStrokeStyles.h index a39e780acca..e5fa17a78ed 100644 --- a/Userland/Libraries/LibWeb/HTML/Canvas/CanvasFillStrokeStyles.h +++ b/Userland/Libraries/LibWeb/HTML/Canvas/CanvasFillStrokeStyles.h @@ -28,7 +28,7 @@ public: DeprecatedString fill_style() const { - return my_drawing_state().fill_style.to_string(); + return my_drawing_state().fill_style.to_deprecated_string(); } void set_stroke_style(DeprecatedString style) @@ -39,7 +39,7 @@ public: DeprecatedString stroke_style() const { - return my_drawing_state().stroke_style.to_string(); + return my_drawing_state().stroke_style.to_deprecated_string(); } JS::NonnullGCPtr create_radial_gradient(double x0, double y0, double r0, double x1, double y1, double r1) diff --git a/Userland/Libraries/LibWeb/HTML/DOMParser.cpp b/Userland/Libraries/LibWeb/HTML/DOMParser.cpp index 6fc6c459127..6aa861bdf28 100644 --- a/Userland/Libraries/LibWeb/HTML/DOMParser.cpp +++ b/Userland/Libraries/LibWeb/HTML/DOMParser.cpp @@ -31,7 +31,7 @@ JS::NonnullGCPtr DOMParser::parse_from_string(DeprecatedString co { // 1. Let document be a new Document, whose content type is type and url is this's relevant global object's associated Document's URL. auto document = DOM::Document::create(realm(), verify_cast(relevant_global_object(*this)).associated_document().url()); - document->set_content_type(Bindings::idl_enum_to_string(type)); + document->set_content_type(Bindings::idl_enum_to_deprecated_string(type)); // 2. Switch on type: if (type == Bindings::DOMParserSupportedType::Text_Html) { diff --git a/Userland/Libraries/LibWeb/HTML/DOMStringMap.cpp b/Userland/Libraries/LibWeb/HTML/DOMStringMap.cpp index 976e41bf0af..60dff8eb6d8 100644 --- a/Userland/Libraries/LibWeb/HTML/DOMStringMap.cpp +++ b/Userland/Libraries/LibWeb/HTML/DOMStringMap.cpp @@ -74,7 +74,7 @@ Vector DOMStringMap::get_name_value_pairs() const builder.append(current_character); } - list.append({ builder.to_string(), value }); + list.append({ builder.to_deprecated_string(), value }); }); // 4. Return list. @@ -139,7 +139,7 @@ WebIDL::ExceptionOr DOMStringMap::set_value_of_new_named_property(Deprecat builder.append(current_character); } - auto data_name = builder.to_string(); + auto data_name = builder.to_deprecated_string(); // FIXME: 4. If name does not match the XML Name production, throw an "InvalidCharacterError" DOMException. @@ -176,7 +176,7 @@ bool DOMStringMap::delete_existing_named_property(DeprecatedString const& name) } // Remove an attribute by name given name and the DOMStringMap's associated element. - auto data_name = builder.to_string(); + auto data_name = builder.to_deprecated_string(); m_associated_element->remove_attribute(data_name); // The spec doesn't have the step. This indicates that the deletion was successful. diff --git a/Userland/Libraries/LibWeb/HTML/HTMLBaseElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLBaseElement.cpp index d533f934c7b..66d41240df1 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLBaseElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLBaseElement.cpp @@ -94,7 +94,7 @@ DeprecatedString HTMLBaseElement::href() const return url; // 5. Return the serialization of urlRecord. - return url_record.to_string(); + return url_record.to_deprecated_string(); } // https://html.spec.whatwg.org/multipage/semantics.html#dom-base-href diff --git a/Userland/Libraries/LibWeb/HTML/HTMLCanvasElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLCanvasElement.cpp index d2bbadc429f..587eddd6832 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLCanvasElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLCanvasElement.cpp @@ -177,7 +177,7 @@ DeprecatedString HTMLCanvasElement::to_data_url(DeprecatedString const& type, [[ if (type != "image/png") return {}; auto encoded_bitmap = Gfx::PNGWriter::encode(*m_bitmap); - return AK::URL::create_with_data(type, encode_base64(encoded_bitmap), true).to_string(); + return AK::URL::create_with_data(type, encode_base64(encoded_bitmap), true).to_deprecated_string(); } void HTMLCanvasElement::present() diff --git a/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp index 2a32de5ad34..cd281a7ea30 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp @@ -157,7 +157,7 @@ DeprecatedString HTMLElement::inner_text() }; recurse(*layout_node()); - return builder.to_string(); + return builder.to_deprecated_string(); } // // https://drafts.csswg.org/cssom-view/#dom-htmlelement-offsettop diff --git a/Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp index fa0669e55b9..93a39dea6a4 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp @@ -158,7 +158,7 @@ DeprecatedString HTMLFormElement::action() const // Return the current URL if the action attribute is null or an empty string if (value.is_null() || value.is_empty()) { - return document().url().to_string(); + return document().url().to_deprecated_string(); } return value; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLHyperlinkElementUtils.cpp b/Userland/Libraries/LibWeb/HTML/HTMLHyperlinkElementUtils.cpp index dfcc28de18e..110263cf81e 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLHyperlinkElementUtils.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLHyperlinkElementUtils.cpp @@ -504,7 +504,7 @@ void HTMLHyperlinkElementUtils::follow_the_hyperlink(Optional auto url = source->active_document()->parse_url(href()); // 10. If that is successful, let URL be the resulting URL string. - auto url_string = url.to_string(); + auto url_string = url.to_deprecated_string(); // 11. Otherwise, if parsing the URL failed, the user agent may report the // error to the user in a user-agent-specific manner, may queue an element @@ -519,7 +519,7 @@ void HTMLHyperlinkElementUtils::follow_the_hyperlink(Optional url_builder.append(url_string); url_builder.append(*hyperlink_suffix); - url_string = url_builder.to_string(); + url_string = url_builder.to_deprecated_string(); } // FIXME: 13. Let request be a new request whose URL is URL and whose diff --git a/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp index 5642e926f51..aa8d45a4341 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp @@ -352,7 +352,7 @@ Optional HTMLInputElement::placeholder_value() const if (ch != '\r' && ch != '\n') builder.append(ch); } - placeholder = builder.to_string(); + placeholder = builder.to_deprecated_string(); } return placeholder; @@ -477,7 +477,7 @@ DeprecatedString HTMLInputElement::value_sanitization_algorithm(DeprecatedString if (!(c == '\r' || c == '\n')) builder.append(c); } - return builder.to_string(); + return builder.to_deprecated_string(); } } else if (type_state() == HTMLInputElement::TypeAttributeState::URL) { // Strip newlines from the value, then strip leading and trailing ASCII whitespace from the value. diff --git a/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.cpp index 5470f44e604..10a81b0c6e8 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.cpp @@ -36,7 +36,7 @@ void HTMLObjectElement::parse_attribute(FlyString const& name, DeprecatedString DeprecatedString HTMLObjectElement::data() const { auto data = attribute(HTML::AttributeNames::data); - return document().parse_url(data).to_string(); + return document().parse_url(data).to_deprecated_string(); } JS::GCPtr HTMLObjectElement::create_layout_node(NonnullRefPtr style) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp index 3cd643d792b..4a39299a277 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp @@ -361,7 +361,7 @@ void HTMLScriptElement::prepare_script() if (m_script_type == ScriptType::Classic) { // 1. Let script be the result of creating a classic script using source text, settings object, base URL, and options. // FIXME: Pass options. - auto script = ClassicScript::create(m_document->url().to_string(), source_text, settings_object, base_url, m_source_line_number); + auto script = ClassicScript::create(m_document->url().to_deprecated_string(), source_text, settings_object, base_url, m_source_line_number); // 2. Mark as ready el given script. mark_as_ready(Result(move(script))); @@ -373,7 +373,7 @@ void HTMLScriptElement::prepare_script() // 2. Fetch an inline module script graph, given source text, base URL, settings object, options, and with the following steps given result: // FIXME: Pass options - fetch_inline_module_script_graph(m_document->url().to_string(), source_text, base_url, document().relevant_settings_object(), [this](auto const* result) { + fetch_inline_module_script_graph(m_document->url().to_deprecated_string(), source_text, base_url, document().relevant_settings_object(), [this](auto const* result) { // 1. Mark as ready el given result. if (!result) mark_as_ready(ResultState::Null {}); @@ -510,7 +510,7 @@ void HTMLScriptElement::resource_did_load() } } - auto script = ClassicScript::create(resource()->url().to_string(), data, document().relevant_settings_object(), AK::URL()); + auto script = ClassicScript::create(resource()->url().to_deprecated_string(), data, document().relevant_settings_object(), AK::URL()); // When the chosen algorithm asynchronously completes, set the script's script to the result. At that time, the script is ready. mark_as_ready(Result(script)); diff --git a/Userland/Libraries/LibWeb/HTML/Origin.h b/Userland/Libraries/LibWeb/HTML/Origin.h index 1f4f5654777..62f32dc03a5 100644 --- a/Userland/Libraries/LibWeb/HTML/Origin.h +++ b/Userland/Libraries/LibWeb/HTML/Origin.h @@ -89,7 +89,7 @@ public: result.append(DeprecatedString::number(port())); } // 6. Return result - return result.to_string(); + return result.to_deprecated_string(); } // https://html.spec.whatwg.org/multipage/origin.html#concept-origin-effective-domain diff --git a/Userland/Libraries/LibWeb/HTML/Parser/HTMLEncodingDetection.cpp b/Userland/Libraries/LibWeb/HTML/Parser/HTMLEncodingDetection.cpp index 72485438f72..74a688b68c7 100644 --- a/Userland/Libraries/LibWeb/HTML/Parser/HTMLEncodingDetection.cpp +++ b/Userland/Libraries/LibWeb/HTML/Parser/HTMLEncodingDetection.cpp @@ -109,7 +109,7 @@ JS::GCPtr prescan_get_attribute(DOM::Document& document, ByteBuffer c } else if (input[position] == '\t' || input[position] == '\n' || input[position] == '\f' || input[position] == '\r' || input[position] == ' ') goto spaces; else if (input[position] == '/' || input[position] == '>') - return *DOM::Attr::create(document, attribute_name.to_string(), ""); + return *DOM::Attr::create(document, attribute_name.to_deprecated_string(), ""); else attribute_name.append_as_lowercase(input[position]); ++position; @@ -121,7 +121,7 @@ spaces: if (!prescan_skip_whitespace_and_slashes(input, position)) return {}; if (input[position] != '=') - return DOM::Attr::create(document, attribute_name.to_string(), ""); + return DOM::Attr::create(document, attribute_name.to_deprecated_string(), ""); ++position; value: @@ -134,13 +134,13 @@ value: ++position; for (; !prescan_should_abort(input, position); ++position) { if (input[position] == quote_character) - return DOM::Attr::create(document, attribute_name.to_string(), attribute_value.to_string()); + return DOM::Attr::create(document, attribute_name.to_deprecated_string(), attribute_value.to_deprecated_string()); else attribute_value.append_as_lowercase(input[position]); } return {}; } else if (input[position] == '>') - return DOM::Attr::create(document, attribute_name.to_string(), ""); + return DOM::Attr::create(document, attribute_name.to_deprecated_string(), ""); else attribute_value.append_as_lowercase(input[position]); @@ -150,7 +150,7 @@ value: for (; !prescan_should_abort(input, position); ++position) { if (input[position] == '\t' || input[position] == '\n' || input[position] == '\f' || input[position] == '\r' || input[position] == ' ' || input[position] == '>') - return DOM::Attr::create(document, attribute_name.to_string(), attribute_value.to_string()); + return DOM::Attr::create(document, attribute_name.to_deprecated_string(), attribute_value.to_deprecated_string()); else attribute_value.append_as_lowercase(input[position]); } diff --git a/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp b/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp index 6da35de9519..fb12da26a6d 100644 --- a/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp +++ b/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp @@ -170,7 +170,7 @@ void HTMLParser::run() break; auto& token = optional_token.value(); - dbgln_if(HTML_PARSER_DEBUG, "[{}] {}", insertion_mode_name(), token.to_string()); + dbgln_if(HTML_PARSER_DEBUG, "[{}] {}", insertion_mode_name(), token.to_deprecated_string()); // https://html.spec.whatwg.org/multipage/parsing.html#tree-construction-dispatcher // As each token is emitted from the tokenizer, the user agent must follow the appropriate steps from the following list, known as the tree construction dispatcher: @@ -954,7 +954,7 @@ void HTMLParser::flush_character_insertions() { if (m_character_insertion_builder.is_empty()) return; - m_character_insertion_node->set_data(m_character_insertion_builder.to_string()); + m_character_insertion_node->set_data(m_character_insertion_builder.to_deprecated_string()); m_character_insertion_node->parent()->children_changed(); m_character_insertion_builder.clear(); } @@ -3604,7 +3604,7 @@ DeprecatedString HTMLParser::serialize_html_fragment(DOM::Node const& node) else builder.append(ch); } - return builder.to_string(); + return builder.to_deprecated_string(); }; // 2. Let s be a string, and initialize it to the empty string. @@ -3752,7 +3752,7 @@ DeprecatedString HTMLParser::serialize_html_fragment(DOM::Node const& node) }); // 5. Return s. - return builder.to_string(); + return builder.to_deprecated_string(); } // https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#current-dimension-value diff --git a/Userland/Libraries/LibWeb/HTML/Parser/HTMLToken.cpp b/Userland/Libraries/LibWeb/HTML/Parser/HTMLToken.cpp index 3bcc635007b..f77a6f91dae 100644 --- a/Userland/Libraries/LibWeb/HTML/Parser/HTMLToken.cpp +++ b/Userland/Libraries/LibWeb/HTML/Parser/HTMLToken.cpp @@ -8,7 +8,7 @@ namespace Web::HTML { -DeprecatedString HTMLToken::to_string() const +DeprecatedString HTMLToken::to_deprecated_string() const { StringBuilder builder; @@ -70,7 +70,7 @@ DeprecatedString HTMLToken::to_string() const builder.appendff("@{}:{}-{}:{}", m_start_position.line, m_start_position.column, m_end_position.line, m_end_position.column); } - return builder.to_string(); + return builder.to_deprecated_string(); } } diff --git a/Userland/Libraries/LibWeb/HTML/Parser/HTMLToken.h b/Userland/Libraries/LibWeb/HTML/Parser/HTMLToken.h index 65230149315..d42562d7741 100644 --- a/Userland/Libraries/LibWeb/HTML/Parser/HTMLToken.h +++ b/Userland/Libraries/LibWeb/HTML/Parser/HTMLToken.h @@ -315,7 +315,7 @@ public: Type type() const { return m_type; } - DeprecatedString to_string() const; + DeprecatedString to_deprecated_string() const; Position const& start_position() const { return m_start_position; } Position const& end_position() const { return m_end_position; } diff --git a/Userland/Libraries/LibWeb/HTML/Parser/HTMLTokenizer.cpp b/Userland/Libraries/LibWeb/HTML/Parser/HTMLTokenizer.cpp index bd992f124ee..aa4c0661938 100644 --- a/Userland/Libraries/LibWeb/HTML/Parser/HTMLTokenizer.cpp +++ b/Userland/Libraries/LibWeb/HTML/Parser/HTMLTokenizer.cpp @@ -2887,7 +2887,7 @@ void HTMLTokenizer::restore_to(Utf8CodePointIterator const& new_iterator) DeprecatedString HTMLTokenizer::consume_current_builder() { - auto string = m_current_builder.to_string(); + auto string = m_current_builder.to_deprecated_string(); m_current_builder.clear(); return string; } diff --git a/Userland/Libraries/LibWeb/HTML/Scripting/ClassicScript.cpp b/Userland/Libraries/LibWeb/HTML/Scripting/ClassicScript.cpp index 39abf3ffe74..2fdc9088219 100644 --- a/Userland/Libraries/LibWeb/HTML/Scripting/ClassicScript.cpp +++ b/Userland/Libraries/LibWeb/HTML/Scripting/ClassicScript.cpp @@ -53,7 +53,7 @@ JS::NonnullGCPtr ClassicScript::create(DeprecatedString filename, // 11. If result is a list of errors, then: if (result.is_error()) { auto& parse_error = result.error().first(); - dbgln_if(HTML_SCRIPT_DEBUG, "ClassicScript: Failed to parse: {}", parse_error.to_string()); + dbgln_if(HTML_SCRIPT_DEBUG, "ClassicScript: Failed to parse: {}", parse_error.to_deprecated_string()); // FIXME: 1. Set script's parse error and its error to rethrow to result[0]. // We do not have parse error as it would currently go unused. @@ -90,7 +90,7 @@ JS::Completion ClassicScript::run(RethrowErrors rethrow_errors) // 5. If script's error to rethrow is not null, then set evaluationStatus to Completion { [[Type]]: throw, [[Value]]: script's error to rethrow, [[Target]]: empty }. if (m_error_to_rethrow.has_value()) { - evaluation_status = vm.throw_completion(m_error_to_rethrow.value().to_string()); + evaluation_status = vm.throw_completion(m_error_to_rethrow.value().to_deprecated_string()); } else { auto timer = Core::ElapsedTimer::start_new(); diff --git a/Userland/Libraries/LibWeb/HTML/Scripting/ModuleMap.h b/Userland/Libraries/LibWeb/HTML/Scripting/ModuleMap.h index 3599207b0b8..7d177b26954 100644 --- a/Userland/Libraries/LibWeb/HTML/Scripting/ModuleMap.h +++ b/Userland/Libraries/LibWeb/HTML/Scripting/ModuleMap.h @@ -74,7 +74,7 @@ template<> struct Traits : public GenericTraits { static unsigned hash(Web::HTML::ModuleLocationTuple const& tuple) { - return pair_int_hash(tuple.url().to_string().hash(), tuple.type().hash()); + return pair_int_hash(tuple.url().to_deprecated_string().hash(), tuple.type().hash()); } }; diff --git a/Userland/Libraries/LibWeb/HTML/Scripting/ModuleScript.cpp b/Userland/Libraries/LibWeb/HTML/Scripting/ModuleScript.cpp index daac2b986f6..b0536be3b70 100644 --- a/Userland/Libraries/LibWeb/HTML/Scripting/ModuleScript.cpp +++ b/Userland/Libraries/LibWeb/HTML/Scripting/ModuleScript.cpp @@ -57,7 +57,7 @@ JS::GCPtr JavaScriptModuleScript::create(DeprecatedStrin // 8. If result is a list of errors, then: if (result.is_error()) { auto& parse_error = result.error().first(); - dbgln("JavaScriptModuleScript: Failed to parse: {}", parse_error.to_string()); + dbgln("JavaScriptModuleScript: Failed to parse: {}", parse_error.to_deprecated_string()); // FIXME: 1. Set script's parse error to result[0]. diff --git a/Userland/Libraries/LibWeb/HTML/SyntaxHighlighter/SyntaxHighlighter.cpp b/Userland/Libraries/LibWeb/HTML/SyntaxHighlighter/SyntaxHighlighter.cpp index 44e5b74c392..feb247cde8d 100644 --- a/Userland/Libraries/LibWeb/HTML/SyntaxHighlighter/SyntaxHighlighter.cpp +++ b/Userland/Libraries/LibWeb/HTML/SyntaxHighlighter/SyntaxHighlighter.cpp @@ -71,7 +71,7 @@ void SyntaxHighlighter::rehighlight(Palette const& palette) auto token = tokenizer.next_token(); if (!token.has_value() || token.value().is_end_of_file()) break; - dbgln_if(SYNTAX_HIGHLIGHTING_DEBUG, "(HTML::SyntaxHighlighter) got token of type {}", token->to_string()); + dbgln_if(SYNTAX_HIGHLIGHTING_DEBUG, "(HTML::SyntaxHighlighter) got token of type {}", token->to_deprecated_string()); if (token->is_start_tag()) { if (token->tag_name() == "script"sv) { diff --git a/Userland/Libraries/LibWeb/HTML/Worker.cpp b/Userland/Libraries/LibWeb/HTML/Worker.cpp index 06d0cf1d084..23ad8dc99a3 100644 --- a/Userland/Libraries/LibWeb/HTML/Worker.cpp +++ b/Userland/Libraries/LibWeb/HTML/Worker.cpp @@ -247,7 +247,7 @@ void Worker::run_a_worker(AK::URL& url, EnvironmentSettingsObject& outside_setti // Asynchronously complete the perform the fetch steps with response. dbgln_if(WEB_WORKER_DEBUG, "WebWorker: Script ready!"); - auto script = ClassicScript::create(url.to_string(), data, *m_inner_settings, AK::URL()); + auto script = ClassicScript::create(url.to_deprecated_string(), data, *m_inner_settings, AK::URL()); // NOTE: Steps 15-31 below pick up after step 14 in the main context, steps 1-10 above // are only for validation when used in a top-level case (ie: from a Window) diff --git a/Userland/Libraries/LibWeb/Infra/JSON.cpp b/Userland/Libraries/LibWeb/Infra/JSON.cpp index c1db9ad8741..66d2b3e74e2 100644 --- a/Userland/Libraries/LibWeb/Infra/JSON.cpp +++ b/Userland/Libraries/LibWeb/Infra/JSON.cpp @@ -48,7 +48,7 @@ WebIDL::ExceptionOr serialize_javascript_value_to_json_string( VERIFY(result.is_string()); // 4. Return result. - return result.as_string().string(); + return result.as_string().deprecated_string(); } // https://infra.spec.whatwg.org/#serialize-a-javascript-value-to-json-bytes diff --git a/Userland/Libraries/LibWeb/Layout/AvailableSpace.cpp b/Userland/Libraries/LibWeb/Layout/AvailableSpace.cpp index fa4c131e9e4..f452d877cc3 100644 --- a/Userland/Libraries/LibWeb/Layout/AvailableSpace.cpp +++ b/Userland/Libraries/LibWeb/Layout/AvailableSpace.cpp @@ -29,7 +29,7 @@ AvailableSize AvailableSize::make_max_content() return AvailableSize { Type::MaxContent, INFINITY }; } -DeprecatedString AvailableSize::to_string() const +DeprecatedString AvailableSize::to_deprecated_string() const { switch (m_type) { case Type::Definite: @@ -44,7 +44,7 @@ DeprecatedString AvailableSize::to_string() const VERIFY_NOT_REACHED(); } -DeprecatedString AvailableSpace::to_string() const +DeprecatedString AvailableSpace::to_deprecated_string() const { return DeprecatedString::formatted("{} x {}", width, height); } diff --git a/Userland/Libraries/LibWeb/Layout/AvailableSpace.h b/Userland/Libraries/LibWeb/Layout/AvailableSpace.h index 5ca85a71879..ce6de61beb5 100644 --- a/Userland/Libraries/LibWeb/Layout/AvailableSpace.h +++ b/Userland/Libraries/LibWeb/Layout/AvailableSpace.h @@ -44,7 +44,7 @@ public: return m_value; } - DeprecatedString to_string() const; + DeprecatedString to_deprecated_string() const; private: AvailableSize(Type type, float); @@ -64,7 +64,7 @@ public: AvailableSize width; AvailableSize height; - DeprecatedString to_string() const; + DeprecatedString to_deprecated_string() const; }; } @@ -73,7 +73,7 @@ template<> struct AK::Formatter : Formatter { ErrorOr format(FormatBuilder& builder, Web::Layout::AvailableSize const& available_size) { - return Formatter::format(builder, available_size.to_string()); + return Formatter::format(builder, available_size.to_deprecated_string()); } }; @@ -81,6 +81,6 @@ template<> struct AK::Formatter : Formatter { ErrorOr format(FormatBuilder& builder, Web::Layout::AvailableSpace const& available_space) { - return Formatter::format(builder, available_space.to_string()); + return Formatter::format(builder, available_space.to_deprecated_string()); } }; diff --git a/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp index 69b9080ad17..edf2f8d1b1d 100644 --- a/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp +++ b/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp @@ -160,7 +160,7 @@ OwnPtr FormattingContext::create_independent_formatting_conte // The child box is a block container that doesn't create its own BFC. // It will be formatted by this BFC. if (!child_display.is_flow_inside()) { - dbgln("FIXME: Child box doesn't create BFC, but inside is also not flow! display={}", child_display.to_string()); + dbgln("FIXME: Child box doesn't create BFC, but inside is also not flow! display={}", child_display.to_deprecated_string()); // HACK: Instead of crashing, create a dummy formatting context that does nothing. // FIXME: Remove this once it's no longer needed. It currently swallows problem with standalone // table-related boxes that don't get fixed up by CSS anonymous table box generation. diff --git a/Userland/Libraries/LibWeb/Layout/Node.cpp b/Userland/Libraries/LibWeb/Layout/Node.cpp index 8ed3275e06c..d2dd45beb0c 100644 --- a/Userland/Libraries/LibWeb/Layout/Node.cpp +++ b/Userland/Libraries/LibWeb/Layout/Node.cpp @@ -601,7 +601,7 @@ DeprecatedString Node::debug_description() const } else { builder.append("(anonymous)"sv); } - return builder.to_string(); + return builder.to_deprecated_string(); } CSS::Display Node::display() const diff --git a/Userland/Libraries/LibWeb/Layout/TextNode.cpp b/Userland/Libraries/LibWeb/Layout/TextNode.cpp index a2e0fd3fe08..49023390462 100644 --- a/Userland/Libraries/LibWeb/Layout/TextNode.cpp +++ b/Userland/Libraries/LibWeb/Layout/TextNode.cpp @@ -88,7 +88,7 @@ void TextNode::compute_text_for_rendering(bool collapse) } } - m_text_for_rendering = builder.to_string(); + m_text_for_rendering = builder.to_deprecated_string(); } TextNode::ChunkIterator::ChunkIterator(StringView text, bool wrap_lines, bool respect_linebreaks, bool is_generated_empty_string) diff --git a/Userland/Libraries/LibWeb/Loader/ContentFilter.cpp b/Userland/Libraries/LibWeb/Loader/ContentFilter.cpp index dc402a2fab3..4caabbef1d0 100644 --- a/Userland/Libraries/LibWeb/Loader/ContentFilter.cpp +++ b/Userland/Libraries/LibWeb/Loader/ContentFilter.cpp @@ -24,7 +24,7 @@ bool ContentFilter::is_filtered(const AK::URL& url) const if (url.scheme() == "data") return false; - auto url_string = url.to_string(); + auto url_string = url.to_deprecated_string(); for (auto& pattern : m_patterns) { if (url_string.matches(pattern.text, CaseSensitivity::CaseSensitive)) @@ -41,7 +41,7 @@ void ContentFilter::add_pattern(DeprecatedString const& pattern) builder.append(pattern); if (!pattern.ends_with('*')) builder.append('*'); - m_patterns.empend(builder.to_string()); + m_patterns.empend(builder.to_deprecated_string()); } } diff --git a/Userland/Libraries/LibWeb/Loader/FrameLoader.cpp b/Userland/Libraries/LibWeb/Loader/FrameLoader.cpp index 1143882422b..8c0f8de9127 100644 --- a/Userland/Libraries/LibWeb/Loader/FrameLoader.cpp +++ b/Userland/Libraries/LibWeb/Loader/FrameLoader.cpp @@ -150,7 +150,7 @@ static bool build_image_document(DOM::Document& document, ByteBuffer const& data MUST(html_element->append_child(body_element)); auto image_element = document.create_element("img").release_value(); - MUST(image_element->set_attribute(HTML::AttributeNames::src, document.url().to_string())); + MUST(image_element->set_attribute(HTML::AttributeNames::src, document.url().to_deprecated_string())); MUST(body_element->append_child(image_element)); return true; @@ -342,7 +342,7 @@ void FrameLoader::load_error_page(const AK::URL& failed_url, DeprecatedString co VERIFY(!data.is_null()); StringBuilder builder; SourceGenerator generator { builder }; - generator.set("failed_url", escape_html_entities(failed_url.to_string())); + generator.set("failed_url", escape_html_entities(failed_url.to_deprecated_string())); generator.set("error", escape_html_entities(error)); generator.append(data); load_html(generator.as_string_view(), failed_url); diff --git a/Userland/Libraries/LibWeb/Loader/LoadRequest.h b/Userland/Libraries/LibWeb/Loader/LoadRequest.h index 244336cfa55..ff21d0dc4a1 100644 --- a/Userland/Libraries/LibWeb/Loader/LoadRequest.h +++ b/Userland/Libraries/LibWeb/Loader/LoadRequest.h @@ -45,7 +45,7 @@ public: { auto body_hash = string_hash((char const*)m_body.data(), m_body.size()); auto body_and_headers_hash = pair_int_hash(body_hash, m_headers.hash()); - auto url_and_method_hash = pair_int_hash(m_url.to_string().hash(), m_method.hash()); + auto url_and_method_hash = pair_int_hash(m_url.to_deprecated_string().hash(), m_method.hash()); return pair_int_hash(body_and_headers_hash, url_and_method_hash); } diff --git a/Userland/Libraries/LibWeb/Loader/ProxyMappings.cpp b/Userland/Libraries/LibWeb/Loader/ProxyMappings.cpp index e3792e968e7..687ea485fea 100644 --- a/Userland/Libraries/LibWeb/Loader/ProxyMappings.cpp +++ b/Userland/Libraries/LibWeb/Loader/ProxyMappings.cpp @@ -14,7 +14,7 @@ Web::ProxyMappings& Web::ProxyMappings::the() Core::ProxyData Web::ProxyMappings::proxy_for_url(AK::URL const& url) const { - auto url_string = url.to_string(); + auto url_string = url.to_deprecated_string(); for (auto& it : m_mappings) { if (url_string.matches(it.key)) { auto result = Core::ProxyData::parse_url(m_proxies[it.value]); diff --git a/Userland/Libraries/LibWeb/Loader/ResourceLoader.cpp b/Userland/Libraries/LibWeb/Loader/ResourceLoader.cpp index b041aa44c21..ef061baa0be 100644 --- a/Userland/Libraries/LibWeb/Loader/ResourceLoader.cpp +++ b/Userland/Libraries/LibWeb/Loader/ResourceLoader.cpp @@ -122,7 +122,7 @@ static DeprecatedString sanitized_url_for_logging(AK::URL const& url) { if (url.scheme() == "data"sv) return DeprecatedString::formatted("[data URL, mime-type={}, size={}]", url.data_mime_type(), url.data_payload().length()); - return url.to_string(); + return url.to_deprecated_string(); } static void emit_signpost(DeprecatedString const& message, int id) @@ -307,7 +307,7 @@ void ResourceLoader::load(LoadRequest& request, Functiondata().substring_view(0, range.start_offset())); builder.append(end->data().substring_view(range.end_offset())); - start->set_data(builder.to_string()); + start->set_data(builder.to_deprecated_string()); } else { // Remove all the nodes that are fully enclosed in the range. HashTable queued_for_deletion; @@ -90,7 +90,7 @@ void EditEventHandler::handle_delete(DOM::Range& range) builder.append(start->data().substring_view(0, range.start_offset())); builder.append(end->data().substring_view(range.end_offset())); - start->set_data(builder.to_string()); + start->set_data(builder.to_deprecated_string()); end->remove(); } @@ -111,7 +111,7 @@ void EditEventHandler::handle_insert(DOM::Position position, u32 code_point) builder.append(node.data().substring_view(0, position.offset())); builder.append_code_point(code_point); builder.append(node.data().substring_view(position.offset())); - node.set_data(builder.to_string()); + node.set_data(builder.to_deprecated_string()); node.invalidate_style(); } diff --git a/Userland/Libraries/LibWeb/Painting/PaintableBox.cpp b/Userland/Libraries/LibWeb/Painting/PaintableBox.cpp index 73b87f496d9..c54f758d5fb 100644 --- a/Userland/Libraries/LibWeb/Painting/PaintableBox.cpp +++ b/Userland/Libraries/LibWeb/Painting/PaintableBox.cpp @@ -201,7 +201,7 @@ void PaintableBox::paint(PaintContext& context, PaintPhase phase) const else builder.append(layout_box().debug_description()); builder.appendff(" {}x{} @ {},{}", border_rect.width(), border_rect.height(), border_rect.x(), border_rect.y()); - auto size_text = builder.to_string(); + auto size_text = builder.to_deprecated_string(); auto size_text_rect = border_rect; size_text_rect.set_y(border_rect.y() + border_rect.height()); size_text_rect.set_top(size_text_rect.top()); diff --git a/Userland/Libraries/LibWeb/Painting/StackingContext.cpp b/Userland/Libraries/LibWeb/Painting/StackingContext.cpp index 7c71d31ac7b..747008ab464 100644 --- a/Userland/Libraries/LibWeb/Painting/StackingContext.cpp +++ b/Userland/Libraries/LibWeb/Painting/StackingContext.cpp @@ -319,7 +319,7 @@ Gfx::FloatMatrix4x4 StackingContext::get_transformation_matrix(CSS::Transformati return Gfx::rotation_matrix({ 0.0f, 0.0f, 1.0f }, value(0)); break; default: - dbgln_if(LIBWEB_CSS_DEBUG, "FIXME: Unhandled transformation function {}", CSS::TransformationStyleValue::create(transformation.function, {})->to_string()); + dbgln_if(LIBWEB_CSS_DEBUG, "FIXME: Unhandled transformation function {}", CSS::TransformationStyleValue::create(transformation.function, {})->to_deprecated_string()); } return Gfx::FloatMatrix4x4::identity(); } diff --git a/Userland/Libraries/LibWeb/SecureContexts/AbstractOperations.cpp b/Userland/Libraries/LibWeb/SecureContexts/AbstractOperations.cpp index 6e94b6f44fb..9163e1d7859 100644 --- a/Userland/Libraries/LibWeb/SecureContexts/AbstractOperations.cpp +++ b/Userland/Libraries/LibWeb/SecureContexts/AbstractOperations.cpp @@ -30,7 +30,7 @@ Trustworthiness is_origin_potentially_trustworthy(HTML::Origin const& origin) // 4. If origin’s host matches one of the CIDR notations 127.0.0.0/8 or ::1/128 [RFC4632], return "Potentially Trustworthy". if (auto ipv4_address = IPv4Address::from_string(origin.host()); ipv4_address.has_value() && (ipv4_address->to_u32() & 0xff000000) != 0) return Trustworthiness::PotentiallyTrustworthy; - if (auto ipv6_address = IPv6Address::from_string(origin.host()); ipv6_address.has_value() && ipv6_address->to_string() == "::1") + if (auto ipv6_address = IPv6Address::from_string(origin.host()); ipv6_address.has_value() && ipv6_address->to_deprecated_string() == "::1") return Trustworthiness::PotentiallyTrustworthy; // 5. If the user agent conforms to the name resolution rules in [let-localhost-be-localhost] and one of the following is true: diff --git a/Userland/Libraries/LibWeb/Selection/Selection.cpp b/Userland/Libraries/LibWeb/Selection/Selection.cpp index 953f3e3e36b..8f6cc66a58e 100644 --- a/Userland/Libraries/LibWeb/Selection/Selection.cpp +++ b/Userland/Libraries/LibWeb/Selection/Selection.cpp @@ -329,13 +329,13 @@ bool Selection::contains_node(JS::NonnullGCPtr node, bool allow_parti && (end_relative_position == DOM::RelativeBoundaryPointPosition::Equal || end_relative_position == DOM::RelativeBoundaryPointPosition::After); } -DeprecatedString Selection::to_string() const +DeprecatedString Selection::to_deprecated_string() const { // FIXME: This needs more work to be compatible with other engines. // See https://www.w3.org/Bugs/Public/show_bug.cgi?id=10583 if (!m_range) return DeprecatedString::empty(); - return m_range->to_string(); + return m_range->to_deprecated_string(); } } diff --git a/Userland/Libraries/LibWeb/Selection/Selection.h b/Userland/Libraries/LibWeb/Selection/Selection.h index bad87c5307b..fbccc7e7803 100644 --- a/Userland/Libraries/LibWeb/Selection/Selection.h +++ b/Userland/Libraries/LibWeb/Selection/Selection.h @@ -48,7 +48,7 @@ public: delete_from_document(); bool contains_node(JS::NonnullGCPtr, bool allow_partial_containment) const; - DeprecatedString to_string() const; + DeprecatedString to_deprecated_string() const; private: Selection(JS::NonnullGCPtr, JS::NonnullGCPtr); diff --git a/Userland/Libraries/LibWeb/URL/URLSearchParams.cpp b/Userland/Libraries/LibWeb/URL/URLSearchParams.cpp index 0c4c3815ac0..808380be92f 100644 --- a/Userland/Libraries/LibWeb/URL/URLSearchParams.cpp +++ b/Userland/Libraries/LibWeb/URL/URLSearchParams.cpp @@ -38,7 +38,7 @@ DeprecatedString url_encode(Vector const& pairs, AK::URL::PercentEnc if (i != pairs.size() - 1) builder.append('&'); } - return builder.to_string(); + return builder.to_deprecated_string(); } Vector url_decode(StringView input) @@ -156,7 +156,7 @@ void URLSearchParams::update() if (!m_url) return; // 2. Let serializedQuery be the serialization of query’s list. - auto serialized_query = to_string(); + auto serialized_query = to_deprecated_string(); // 3. If serializedQuery is the empty string, then set serializedQuery to null. if (serialized_query.is_empty()) serialized_query = {}; @@ -255,7 +255,7 @@ void URLSearchParams::sort() update(); } -DeprecatedString URLSearchParams::to_string() const +DeprecatedString URLSearchParams::to_deprecated_string() const { // return the serialization of this’s list. return url_encode(m_list, AK::URL::PercentEncodeSet::ApplicationXWWWFormUrlencoded); diff --git a/Userland/Libraries/LibWeb/URL/URLSearchParams.h b/Userland/Libraries/LibWeb/URL/URLSearchParams.h index 05a72ffa4e1..02f5fb708ee 100644 --- a/Userland/Libraries/LibWeb/URL/URLSearchParams.h +++ b/Userland/Libraries/LibWeb/URL/URLSearchParams.h @@ -37,7 +37,7 @@ public: void sort(); - DeprecatedString to_string() const; + DeprecatedString to_deprecated_string() const; using ForEachCallback = Function(DeprecatedString const&, DeprecatedString const&)>; JS::ThrowCompletionOr for_each(ForEachCallback); diff --git a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyObject.cpp b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyObject.cpp index e20b0285235..4d28a8362e4 100644 --- a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyObject.cpp +++ b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyObject.cpp @@ -141,7 +141,7 @@ JS::ThrowCompletionOr parse_module(JS::VM& vm, JS::Object* buffer_object }; if (module_result.is_error()) { // FIXME: Throw CompileError instead. - return vm.throw_completion(Wasm::parse_error_to_string(module_result.error())); + return vm.throw_completion(Wasm::parse_error_to_deprecated_string(module_result.error())); } if (auto validation_result = WebAssemblyObject::s_abstract_machine.validate(module_result.value()); validation_result.is_error()) { diff --git a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyTableConstructor.cpp b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyTableConstructor.cpp index 6b7076fbadf..ca14bc3d8bd 100644 --- a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyTableConstructor.cpp +++ b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyTableConstructor.cpp @@ -35,7 +35,7 @@ JS::ThrowCompletionOr WebAssemblyTableConstructor::construct(Functi auto element_value = TRY(descriptor->get("element")); if (!element_value.is_string()) return vm.throw_completion(JS::ErrorType::InvalidHint, element_value.to_string_without_side_effects()); - auto& element = element_value.as_string().string(); + auto& element = element_value.as_string().deprecated_string(); Optional reference_type; if (element == "anyfunc"sv) diff --git a/Userland/Libraries/LibWeb/WebDriver/Client.cpp b/Userland/Libraries/LibWeb/WebDriver/Client.cpp index 175e6bc87f6..05e1d0564a2 100644 --- a/Userland/Libraries/LibWeb/WebDriver/Client.cpp +++ b/Userland/Libraries/LibWeb/WebDriver/Client.cpp @@ -106,7 +106,7 @@ static constexpr auto s_webdriver_endpoints = Array { // https://w3c.github.io/webdriver/#dfn-match-a-request static ErrorOr match_route(HTTP::HttpRequest const& request) { - dbgln_if(WEBDRIVER_DEBUG, "match_route({}, {})", HTTP::to_string(request.method()), request.resource()); + dbgln_if(WEBDRIVER_DEBUG, "match_route({}, {})", HTTP::to_deprecated_string(request.method()), request.resource()); auto request_path = request.resource().view(); Vector parameters; @@ -125,7 +125,7 @@ static ErrorOr match_route(HTTP::HttpRequest const& request }; for (auto const& route : s_webdriver_endpoints) { - dbgln_if(WEBDRIVER_DEBUG, "- Checking {} {}", HTTP::to_string(route.method), route.path); + dbgln_if(WEBDRIVER_DEBUG, "- Checking {} {}", HTTP::to_deprecated_string(route.method), route.path); if (route.method != request.method()) continue; @@ -252,7 +252,7 @@ ErrorOr Client::handle_request(JsonValue body) if constexpr (WEBDRIVER_DEBUG) { dbgln("Got HTTP request: {} {}", m_request->method_name(), m_request->resource()); if (!body.is_null()) - dbgln("Body: {}", body.to_string()); + dbgln("Body: {}", body.to_deprecated_string()); } auto const& [handler, parameters] = TRY(match_route(*m_request)); @@ -325,7 +325,7 @@ ErrorOr Client::send_error_response(Error const& err void Client::log_response(unsigned code) { - outln("{} :: {:03d} :: {} {}", Core::DateTime::now().to_string(), code, m_request->method_name(), m_request->resource()); + outln("{} :: {:03d} :: {} {}", Core::DateTime::now().to_deprecated_string(), code, m_request->method_name(), m_request->resource()); } } diff --git a/Userland/Libraries/LibWeb/WebDriver/ExecuteScript.cpp b/Userland/Libraries/LibWeb/WebDriver/ExecuteScript.cpp index 0909fbf36e5..28a801f15af 100644 --- a/Userland/Libraries/LibWeb/WebDriver/ExecuteScript.cpp +++ b/Userland/Libraries/LibWeb/WebDriver/ExecuteScript.cpp @@ -95,7 +95,7 @@ static ErrorOr internal_json_clone_algorithm if (value.is_number()) return JsonValue { value.as_double() }; if (value.is_string()) - return JsonValue { value.as_string().string() }; + return JsonValue { value.as_string().deprecated_string() }; // NOTE: BigInt and Symbol not mentioned anywhere in the WebDriver spec, as it references ES5. // It assumes that all primitives are handled above, and the value is an object for the remaining steps. @@ -114,7 +114,7 @@ static ErrorOr internal_json_clone_algorithm auto to_json_result = TRY_OR_JS_ERROR(to_json.as_function().internal_call(value, JS::MarkedVector { vm.heap() })); if (!to_json_result.is_string()) return ExecuteScriptResultType::JavaScriptError; - return to_json_result.as_string().string(); + return to_json_result.as_string().deprecated_string(); } // -> Otherwise diff --git a/Userland/Libraries/LibWeb/WebSockets/WebSocket.h b/Userland/Libraries/LibWeb/WebSockets/WebSocket.h index efeb2f5f16f..d931c5a8100 100644 --- a/Userland/Libraries/LibWeb/WebSockets/WebSocket.h +++ b/Userland/Libraries/LibWeb/WebSockets/WebSocket.h @@ -41,7 +41,7 @@ public: virtual ~WebSocket() override; - DeprecatedString url() const { return m_url.to_string(); } + DeprecatedString url() const { return m_url.to_deprecated_string(); } #undef __ENUMERATE #define __ENUMERATE(attribute_name, event_name) \ diff --git a/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp b/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp index 1c46f01c0d8..a5885d1a0c8 100644 --- a/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp +++ b/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp @@ -439,7 +439,7 @@ WebIDL::ExceptionOr XMLHttpRequest::send(Optionaldowncast())); } - AK::URL request_url = m_window->associated_document().parse_url(m_request_url.to_string()); + AK::URL request_url = m_window->associated_document().parse_url(m_request_url.to_deprecated_string()); dbgln("XHR send from {} to {}", m_window->associated_document().url(), request_url); // TODO: Add support for preflight requests to support CORS requests @@ -587,7 +587,7 @@ DeprecatedString XMLHttpRequest::get_all_response_headers() const builder.append(m_response_headers.get(key).value()); builder.append("\r\n"sv); } - return builder.to_string(); + return builder.to_deprecated_string(); } // https://xhr.spec.whatwg.org/#dom-xmlhttprequest-overridemimetype diff --git a/Userland/Libraries/LibWeb/XML/XMLDocumentBuilder.cpp b/Userland/Libraries/LibWeb/XML/XMLDocumentBuilder.cpp index 8257a8fbb6f..b7e09dce758 100644 --- a/Userland/Libraries/LibWeb/XML/XMLDocumentBuilder.cpp +++ b/Userland/Libraries/LibWeb/XML/XMLDocumentBuilder.cpp @@ -132,7 +132,7 @@ void XMLDocumentBuilder::text(DeprecatedString const& data) auto& text_node = static_cast(*last); text_builder.append(text_node.data()); text_builder.append(data); - text_node.set_data(text_builder.to_string()); + text_node.set_data(text_builder.to_deprecated_string()); text_builder.clear(); } else { auto node = m_document.create_text_node(data); diff --git a/Userland/Libraries/LibWebSocket/ConnectionInfo.cpp b/Userland/Libraries/LibWebSocket/ConnectionInfo.cpp index 99af1bda706..88db1d07d7e 100644 --- a/Userland/Libraries/LibWebSocket/ConnectionInfo.cpp +++ b/Userland/Libraries/LibWebSocket/ConnectionInfo.cpp @@ -35,7 +35,7 @@ DeprecatedString ConnectionInfo::resource_name() const builder.append('?'); // the query component builder.append(m_url.query()); - return builder.to_string(); + return builder.to_deprecated_string(); } } diff --git a/Userland/Libraries/LibWebSocket/Impl/WebSocketImplSerenity.cpp b/Userland/Libraries/LibWebSocket/Impl/WebSocketImplSerenity.cpp index 608bdb79b32..0f2004a3369 100644 --- a/Userland/Libraries/LibWebSocket/Impl/WebSocketImplSerenity.cpp +++ b/Userland/Libraries/LibWebSocket/Impl/WebSocketImplSerenity.cpp @@ -83,7 +83,7 @@ ErrorOr WebSocketImplSerenity::read_line(size_t size) { auto buffer = TRY(ByteBuffer::create_uninitialized(size)); auto line = TRY(m_socket->read_line(buffer)); - return line.to_string(); + return line.to_deprecated_string(); } } diff --git a/Userland/Libraries/LibWebSocket/WebSocket.cpp b/Userland/Libraries/LibWebSocket/WebSocket.cpp index c13b15737df..78147eb608d 100644 --- a/Userland/Libraries/LibWebSocket/WebSocket.cpp +++ b/Userland/Libraries/LibWebSocket/WebSocket.cpp @@ -213,7 +213,7 @@ void WebSocket::send_client_handshake() builder.append("\r\n"sv); m_state = WebSocket::InternalState::WaitingForServerHandshake; - auto success = m_impl->send(builder.to_string().bytes()); + auto success = m_impl->send(builder.to_deprecated_string().bytes()); VERIFY(success); } diff --git a/Userland/Libraries/LibWebView/DOMTreeModel.cpp b/Userland/Libraries/LibWebView/DOMTreeModel.cpp index ac15dcc34b2..c0f55566f27 100644 --- a/Userland/Libraries/LibWebView/DOMTreeModel.cpp +++ b/Userland/Libraries/LibWebView/DOMTreeModel.cpp @@ -113,7 +113,7 @@ static DeprecatedString with_whitespace_collapsed(StringView string) } builder.append(string[i]); } - return builder.to_string(); + return builder.to_deprecated_string(); } GUI::Variant DOMTreeModel::data(const GUI::ModelIndex& index, GUI::ModelRole role) const @@ -167,12 +167,12 @@ GUI::Variant DOMTreeModel::data(const GUI::ModelIndex& index, GUI::ModelRole rol builder.append(name); builder.append('='); builder.append('"'); - builder.append(value.to_string()); + builder.append(value.to_deprecated_string()); builder.append('"'); }); } builder.append('>'); - return builder.to_string(); + return builder.to_deprecated_string(); } return {}; } diff --git a/Userland/Libraries/LibWebView/OutOfProcessWebView.cpp b/Userland/Libraries/LibWebView/OutOfProcessWebView.cpp index 523c7932f0e..a9e7953f8d0 100644 --- a/Userland/Libraries/LibWebView/OutOfProcessWebView.cpp +++ b/Userland/Libraries/LibWebView/OutOfProcessWebView.cpp @@ -45,17 +45,17 @@ void OutOfProcessWebView::handle_web_content_process_crash() handle_resize(); StringBuilder builder; builder.append("Crashed: "sv); - builder.append(escape_html_entities(m_url.to_string())); + builder.append(escape_html_entities(m_url.to_deprecated_string())); builder.append(""sv); builder.append("

Web page crashed"sv); if (!m_url.host().is_empty()) { builder.appendff(" on {}", escape_html_entities(m_url.host())); } builder.append("

"sv); - auto escaped_url = escape_html_entities(m_url.to_string()); + auto escaped_url = escape_html_entities(m_url.to_deprecated_string()); builder.appendff("The web page {} has crashed.

You can reload the page to try again.", escaped_url, escaped_url); builder.append(""sv); - load_html(builder.to_string(), m_url); + load_html(builder.to_deprecated_string(), m_url); } void OutOfProcessWebView::create_client() diff --git a/Userland/Libraries/LibWebView/StylePropertiesModel.cpp b/Userland/Libraries/LibWebView/StylePropertiesModel.cpp index 86a979daaf6..8484d115b74 100644 --- a/Userland/Libraries/LibWebView/StylePropertiesModel.cpp +++ b/Userland/Libraries/LibWebView/StylePropertiesModel.cpp @@ -16,7 +16,7 @@ StylePropertiesModel::StylePropertiesModel(JsonObject properties) m_properties.for_each_member([&](auto& property_name, auto& property_value) { Value value; value.name = property_name; - value.value = property_value.to_string(); + value.value = property_value.to_deprecated_string(); m_values.append(value); }); diff --git a/Userland/Libraries/LibX86/Instruction.cpp b/Userland/Libraries/LibX86/Instruction.cpp index 2f7ae0976f0..115bddec882 100644 --- a/Userland/Libraries/LibX86/Instruction.cpp +++ b/Userland/Libraries/LibX86/Instruction.cpp @@ -1290,105 +1290,105 @@ StringView Instruction::reg64_name() const return register_name(static_cast(register_index())); } -DeprecatedString MemoryOrRegisterReference::to_string_o8(Instruction const& insn) const +DeprecatedString MemoryOrRegisterReference::to_deprecated_string_o8(Instruction const& insn) const { if (is_register()) return register_name(reg8()); - return DeprecatedString::formatted("[{}]", to_string(insn)); + return DeprecatedString::formatted("[{}]", to_deprecated_string(insn)); } -DeprecatedString MemoryOrRegisterReference::to_string_o16(Instruction const& insn) const +DeprecatedString MemoryOrRegisterReference::to_deprecated_string_o16(Instruction const& insn) const { if (is_register()) return register_name(reg16()); - return DeprecatedString::formatted("[{}]", to_string(insn)); + return DeprecatedString::formatted("[{}]", to_deprecated_string(insn)); } -DeprecatedString MemoryOrRegisterReference::to_string_o32(Instruction const& insn) const +DeprecatedString MemoryOrRegisterReference::to_deprecated_string_o32(Instruction const& insn) const { if (is_register()) return register_name(reg32()); - return DeprecatedString::formatted("[{}]", to_string(insn)); + return DeprecatedString::formatted("[{}]", to_deprecated_string(insn)); } -DeprecatedString MemoryOrRegisterReference::to_string_o64(Instruction const& insn) const +DeprecatedString MemoryOrRegisterReference::to_deprecated_string_o64(Instruction const& insn) const { if (is_register()) return register_name(reg64()); - return DeprecatedString::formatted("[{}]", to_string(insn)); + return DeprecatedString::formatted("[{}]", to_deprecated_string(insn)); } -DeprecatedString MemoryOrRegisterReference::to_string_fpu_reg() const +DeprecatedString MemoryOrRegisterReference::to_deprecated_string_fpu_reg() const { VERIFY(is_register()); return register_name(reg_fpu()); } -DeprecatedString MemoryOrRegisterReference::to_string_fpu_mem(Instruction const& insn) const +DeprecatedString MemoryOrRegisterReference::to_deprecated_string_fpu_mem(Instruction const& insn) const { VERIFY(!is_register()); - return DeprecatedString::formatted("[{}]", to_string(insn)); + return DeprecatedString::formatted("[{}]", to_deprecated_string(insn)); } -DeprecatedString MemoryOrRegisterReference::to_string_fpu_ax16() const +DeprecatedString MemoryOrRegisterReference::to_deprecated_string_fpu_ax16() const { VERIFY(is_register()); return register_name(reg16()); } -DeprecatedString MemoryOrRegisterReference::to_string_fpu16(Instruction const& insn) const +DeprecatedString MemoryOrRegisterReference::to_deprecated_string_fpu16(Instruction const& insn) const { if (is_register()) return register_name(reg_fpu()); - return DeprecatedString::formatted("word ptr [{}]", to_string(insn)); + return DeprecatedString::formatted("word ptr [{}]", to_deprecated_string(insn)); } -DeprecatedString MemoryOrRegisterReference::to_string_fpu32(Instruction const& insn) const +DeprecatedString MemoryOrRegisterReference::to_deprecated_string_fpu32(Instruction const& insn) const { if (is_register()) return register_name(reg_fpu()); - return DeprecatedString::formatted("dword ptr [{}]", to_string(insn)); + return DeprecatedString::formatted("dword ptr [{}]", to_deprecated_string(insn)); } -DeprecatedString MemoryOrRegisterReference::to_string_fpu64(Instruction const& insn) const +DeprecatedString MemoryOrRegisterReference::to_deprecated_string_fpu64(Instruction const& insn) const { if (is_register()) return register_name(reg_fpu()); - return DeprecatedString::formatted("qword ptr [{}]", to_string(insn)); + return DeprecatedString::formatted("qword ptr [{}]", to_deprecated_string(insn)); } -DeprecatedString MemoryOrRegisterReference::to_string_fpu80(Instruction const& insn) const +DeprecatedString MemoryOrRegisterReference::to_deprecated_string_fpu80(Instruction const& insn) const { VERIFY(!is_register()); - return DeprecatedString::formatted("tbyte ptr [{}]", to_string(insn)); + return DeprecatedString::formatted("tbyte ptr [{}]", to_deprecated_string(insn)); } -DeprecatedString MemoryOrRegisterReference::to_string_mm(Instruction const& insn) const +DeprecatedString MemoryOrRegisterReference::to_deprecated_string_mm(Instruction const& insn) const { if (is_register()) return register_name(static_cast(m_register_index)); - return DeprecatedString::formatted("[{}]", to_string(insn)); + return DeprecatedString::formatted("[{}]", to_deprecated_string(insn)); } -DeprecatedString MemoryOrRegisterReference::to_string_xmm(Instruction const& insn) const +DeprecatedString MemoryOrRegisterReference::to_deprecated_string_xmm(Instruction const& insn) const { if (is_register()) return register_name(static_cast(m_register_index)); - return DeprecatedString::formatted("[{}]", to_string(insn)); + return DeprecatedString::formatted("[{}]", to_deprecated_string(insn)); } -DeprecatedString MemoryOrRegisterReference::to_string(Instruction const& insn) const +DeprecatedString MemoryOrRegisterReference::to_deprecated_string(Instruction const& insn) const { switch (insn.address_size()) { case AddressSize::Size64: - return to_string_a64(); + return to_deprecated_string_a64(); case AddressSize::Size32: - return insn.mode() == ProcessorMode::Long ? to_string_a64() : to_string_a32(); + return insn.mode() == ProcessorMode::Long ? to_deprecated_string_a64() : to_deprecated_string_a32(); case AddressSize::Size16: - return to_string_a16(); + return to_deprecated_string_a16(); } VERIFY_NOT_REACHED(); } -DeprecatedString MemoryOrRegisterReference::to_string_a16() const +DeprecatedString MemoryOrRegisterReference::to_deprecated_string_a16() const { DeprecatedString base; bool hasDisplacement = false; @@ -1435,7 +1435,7 @@ DeprecatedString MemoryOrRegisterReference::to_string_a16() const return DeprecatedString::formatted("{}{:+#x}", base, (i16)m_displacement16); } -DeprecatedString MemoryOrRegisterReference::sib_to_string(ProcessorMode mode) const +DeprecatedString MemoryOrRegisterReference::sib_to_deprecated_string(ProcessorMode mode) const { DeprecatedString scale; DeprecatedString index; @@ -1476,10 +1476,10 @@ DeprecatedString MemoryOrRegisterReference::sib_to_string(ProcessorMode mode) co builder.append(index); builder.append(scale); } - return builder.to_string(); + return builder.to_deprecated_string(); } -DeprecatedString MemoryOrRegisterReference::to_string_a64() const +DeprecatedString MemoryOrRegisterReference::to_deprecated_string_a64() const { if (is_register()) return register_name(static_cast(m_register_index)); @@ -1505,7 +1505,7 @@ DeprecatedString MemoryOrRegisterReference::to_string_a64() const base = "rbp"; break; case 4: - base = sib_to_string(ProcessorMode::Long); + base = sib_to_deprecated_string(ProcessorMode::Long); break; default: base = register_name(RegisterIndex64(m_rm)); @@ -1517,7 +1517,7 @@ DeprecatedString MemoryOrRegisterReference::to_string_a64() const return DeprecatedString::formatted("{}{:+#x}", base, (i32)m_displacement32); } -DeprecatedString MemoryOrRegisterReference::to_string_a32() const +DeprecatedString MemoryOrRegisterReference::to_deprecated_string_a32() const { if (is_register()) return register_name(static_cast(m_register_index)); @@ -1540,7 +1540,7 @@ DeprecatedString MemoryOrRegisterReference::to_string_a32() const base = "ebp"; break; case 4: - base = sib_to_string(ProcessorMode::Protected); + base = sib_to_deprecated_string(ProcessorMode::Protected); break; default: base = register_name(RegisterIndex32(m_rm)); @@ -1569,7 +1569,7 @@ static DeprecatedString relative_address(u32 origin, bool x32, i32 imm) return DeprecatedString::formatted("{:x}", w + si); } -DeprecatedString Instruction::to_string(u32 origin, SymbolProvider const* symbol_provider, bool x32) const +DeprecatedString Instruction::to_deprecated_string(u32 origin, SymbolProvider const* symbol_provider, bool x32) const { StringBuilder builder; if (has_segment_prefix()) @@ -1605,11 +1605,11 @@ DeprecatedString Instruction::to_string(u32 origin, SymbolProvider const* symbol // Note: SSE instructions use these to toggle between packed and single data if (has_rep_prefix() && !(m_descriptor->format > __SSE && m_descriptor->format < __EndFormatsWithRMByte)) builder.append(m_rep_prefix == Prefix::REPNZ ? "repnz "sv : "repz "sv); - to_string_internal(builder, origin, symbol_provider, x32); - return builder.to_string(); + to_deprecated_string_internal(builder, origin, symbol_provider, x32); + return builder.to_deprecated_string(); } -void Instruction::to_string_internal(StringBuilder& builder, u32 origin, SymbolProvider const* symbol_provider, bool x32) const +void Instruction::to_deprecated_string_internal(StringBuilder& builder, u32 origin, SymbolProvider const* symbol_provider, bool x32) const { if (!m_descriptor) { builder.appendff("db {:02x}", m_op); @@ -1635,22 +1635,22 @@ void Instruction::to_string_internal(StringBuilder& builder, u32 origin, SymbolP } }; - auto append_rm8 = [&] { builder.append(m_modrm.to_string_o8(*this)); }; - auto append_rm16 = [&] { builder.append(m_modrm.to_string_o16(*this)); }; + auto append_rm8 = [&] { builder.append(m_modrm.to_deprecated_string_o8(*this)); }; + auto append_rm16 = [&] { builder.append(m_modrm.to_deprecated_string_o16(*this)); }; auto append_rm32 = [&] { if (m_operand_size == OperandSize::Size64) - builder.append(m_modrm.to_string_o64(*this)); + builder.append(m_modrm.to_deprecated_string_o64(*this)); else - builder.append(m_modrm.to_string_o32(*this)); + builder.append(m_modrm.to_deprecated_string_o32(*this)); }; - auto append_rm64 = [&] { builder.append(m_modrm.to_string_o64(*this)); }; - auto append_fpu_reg = [&] { builder.append(m_modrm.to_string_fpu_reg()); }; - auto append_fpu_mem = [&] { builder.append(m_modrm.to_string_fpu_mem(*this)); }; - auto append_fpu_ax16 = [&] { builder.append(m_modrm.to_string_fpu_ax16()); }; - auto append_fpu_rm16 = [&] { builder.append(m_modrm.to_string_fpu16(*this)); }; - auto append_fpu_rm32 = [&] { builder.append(m_modrm.to_string_fpu32(*this)); }; - auto append_fpu_rm64 = [&] { builder.append(m_modrm.to_string_fpu64(*this)); }; - auto append_fpu_rm80 = [&] { builder.append(m_modrm.to_string_fpu80(*this)); }; + auto append_rm64 = [&] { builder.append(m_modrm.to_deprecated_string_o64(*this)); }; + auto append_fpu_reg = [&] { builder.append(m_modrm.to_deprecated_string_fpu_reg()); }; + auto append_fpu_mem = [&] { builder.append(m_modrm.to_deprecated_string_fpu_mem(*this)); }; + auto append_fpu_ax16 = [&] { builder.append(m_modrm.to_deprecated_string_fpu_ax16()); }; + auto append_fpu_rm16 = [&] { builder.append(m_modrm.to_deprecated_string_fpu16(*this)); }; + auto append_fpu_rm32 = [&] { builder.append(m_modrm.to_deprecated_string_fpu32(*this)); }; + auto append_fpu_rm64 = [&] { builder.append(m_modrm.to_deprecated_string_fpu64(*this)); }; + auto append_fpu_rm80 = [&] { builder.append(m_modrm.to_deprecated_string_fpu80(*this)); }; auto append_imm8 = [&] { builder.appendff("{:#02x}", imm8()); }; auto append_imm8_2 = [&] { builder.appendff("{:#02x}", imm8_2()); }; auto append_imm16 = [&] { builder.appendff("{:#04x}", imm16()); }; @@ -1693,12 +1693,12 @@ void Instruction::to_string_internal(StringBuilder& builder, u32 origin, SymbolP auto append_relative_imm32 = [&] { formatted_address(origin + 5, x32, i32(imm32())); }; auto append_mm = [&] { builder.appendff("mm{}", register_index()); }; - auto append_mmrm32 = [&] { builder.append(m_modrm.to_string_mm(*this)); }; - auto append_mmrm64 = [&] { builder.append(m_modrm.to_string_mm(*this)); }; + auto append_mmrm32 = [&] { builder.append(m_modrm.to_deprecated_string_mm(*this)); }; + auto append_mmrm64 = [&] { builder.append(m_modrm.to_deprecated_string_mm(*this)); }; auto append_xmm = [&] { builder.appendff("xmm{}", register_index()); }; - auto append_xmmrm32 = [&] { builder.append(m_modrm.to_string_xmm(*this)); }; - auto append_xmmrm64 = [&] { builder.append(m_modrm.to_string_xmm(*this)); }; - auto append_xmmrm128 = [&] { builder.append(m_modrm.to_string_xmm(*this)); }; + auto append_xmmrm32 = [&] { builder.append(m_modrm.to_deprecated_string_xmm(*this)); }; + auto append_xmmrm64 = [&] { builder.append(m_modrm.to_deprecated_string_xmm(*this)); }; + auto append_xmmrm128 = [&] { builder.append(m_modrm.to_deprecated_string_xmm(*this)); }; auto append_mm_or_xmm = [&] { if (has_operand_size_override_prefix()) diff --git a/Userland/Libraries/LibX86/Instruction.h b/Userland/Libraries/LibX86/Instruction.h index a1207df9b21..10ea32addab 100644 --- a/Userland/Libraries/LibX86/Instruction.h +++ b/Userland/Libraries/LibX86/Instruction.h @@ -518,20 +518,20 @@ class MemoryOrRegisterReference { friend class Instruction; public: - DeprecatedString to_string_o8(Instruction const&) const; - DeprecatedString to_string_o16(Instruction const&) const; - DeprecatedString to_string_o32(Instruction const&) const; - DeprecatedString to_string_o64(Instruction const&) const; - DeprecatedString to_string_fpu_reg() const; - DeprecatedString to_string_fpu_mem(Instruction const&) const; - DeprecatedString to_string_fpu_ax16() const; - DeprecatedString to_string_fpu16(Instruction const&) const; - DeprecatedString to_string_fpu32(Instruction const&) const; - DeprecatedString to_string_fpu64(Instruction const&) const; - DeprecatedString to_string_fpu80(Instruction const&) const; - DeprecatedString to_string_mm(Instruction const&) const; - DeprecatedString to_string_xmm(Instruction const&) const; - DeprecatedString sib_to_string(ProcessorMode) const; + DeprecatedString to_deprecated_string_o8(Instruction const&) const; + DeprecatedString to_deprecated_string_o16(Instruction const&) const; + DeprecatedString to_deprecated_string_o32(Instruction const&) const; + DeprecatedString to_deprecated_string_o64(Instruction const&) const; + DeprecatedString to_deprecated_string_fpu_reg() const; + DeprecatedString to_deprecated_string_fpu_mem(Instruction const&) const; + DeprecatedString to_deprecated_string_fpu_ax16() const; + DeprecatedString to_deprecated_string_fpu16(Instruction const&) const; + DeprecatedString to_deprecated_string_fpu32(Instruction const&) const; + DeprecatedString to_deprecated_string_fpu64(Instruction const&) const; + DeprecatedString to_deprecated_string_fpu80(Instruction const&) const; + DeprecatedString to_deprecated_string_mm(Instruction const&) const; + DeprecatedString to_deprecated_string_xmm(Instruction const&) const; + DeprecatedString sib_to_deprecated_string(ProcessorMode) const; bool is_register() const { return m_register_index != 0x7f; } @@ -580,10 +580,10 @@ public: private: MemoryOrRegisterReference() = default; - DeprecatedString to_string(Instruction const&) const; - DeprecatedString to_string_a16() const; - DeprecatedString to_string_a32() const; - DeprecatedString to_string_a64() const; + DeprecatedString to_deprecated_string(Instruction const&) const; + DeprecatedString to_deprecated_string_a16() const; + DeprecatedString to_deprecated_string_a32() const; + DeprecatedString to_deprecated_string_a64() const; template void decode(InstructionStreamType&, AddressSize, bool has_rex_r, bool has_rex_x, bool has_rex_b); @@ -695,13 +695,13 @@ public: OperandSize operand_size() const { return m_operand_size; } ProcessorMode mode() const { return m_mode; } - DeprecatedString to_string(u32 origin, SymbolProvider const* = nullptr, bool x32 = true) const; + DeprecatedString to_deprecated_string(u32 origin, SymbolProvider const* = nullptr, bool x32 = true) const; private: template Instruction(InstructionStreamType&, OperandSize, AddressSize); - void to_string_internal(StringBuilder&, u32 origin, SymbolProvider const*, bool x32) const; + void to_deprecated_string_internal(StringBuilder&, u32 origin, SymbolProvider const*, bool x32) const; StringView reg8_name() const; StringView reg16_name() const; diff --git a/Userland/Libraries/LibXML/Parser/Parser.cpp b/Userland/Libraries/LibXML/Parser/Parser.cpp index 1091f015c48..7fa6a81f2b4 100644 --- a/Userland/Libraries/LibXML/Parser/Parser.cpp +++ b/Userland/Libraries/LibXML/Parser/Parser.cpp @@ -547,7 +547,7 @@ ErrorOr Parser::parse_name() builder.append(rest); rollback.disarm(); - return builder.to_string(); + return builder.to_deprecated_string(); } // 2.8.28. doctypedecl, https://www.w3.org/TR/2006/REC-xml11-20060816/#NT-doctypedecl @@ -732,7 +732,7 @@ ErrorOr Parser::parse_attribute_value_inner(String builder.append(m_lexer.consume()); } } - return builder.to_string(); + return builder.to_deprecated_string(); } // Char ::= [#x1-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF] @@ -781,7 +781,7 @@ ErrorOr, ParseError> Parser:: builder.append_code_point(*code_point); rollback.disarm(); - return builder.to_string(); + return builder.to_deprecated_string(); } auto name = name_result.release_value(); @@ -1637,7 +1637,7 @@ ErrorOr Parser::parse_entity_value() TRY(expect(quote)); rollback.disarm(); - return builder.to_string(); + return builder.to_deprecated_string(); } // 2.7.18 CDSect, https://www.w3.org/TR/2006/REC-xml11-20060816/#NT-CDSect diff --git a/Userland/Services/DHCPClient/DHCPv4.h b/Userland/Services/DHCPClient/DHCPv4.h index 50403abd9df..239468f7a42 100644 --- a/Userland/Services/DHCPClient/DHCPv4.h +++ b/Userland/Services/DHCPClient/DHCPv4.h @@ -151,7 +151,7 @@ struct ParsedDHCPv4Options { return values; } - DeprecatedString to_string() const + DeprecatedString to_deprecated_string() const { StringBuilder builder; builder.append("DHCP Options ("sv); diff --git a/Userland/Services/DHCPClient/DHCPv4Client.cpp b/Userland/Services/DHCPClient/DHCPv4Client.cpp index 9631b33cb5f..0542c780a17 100644 --- a/Userland/Services/DHCPClient/DHCPv4Client.cpp +++ b/Userland/Services/DHCPClient/DHCPv4Client.cpp @@ -191,13 +191,13 @@ ErrorOr DHCPv4Client::get_discoverable_interfaces() json.value().as_array().for_each([&ifnames_to_immediately_discover, &ifnames_to_attempt_later](auto& value) { auto if_object = value.as_object(); - if (if_object.get("class_name"sv).to_string() == "LoopbackAdapter") + if (if_object.get("class_name"sv).to_deprecated_string() == "LoopbackAdapter") return; - auto name = if_object.get("name"sv).to_string(); - auto mac = if_object.get("mac_address"sv).to_string(); + auto name = if_object.get("name"sv).to_deprecated_string(); + auto mac = if_object.get("mac_address"sv).to_deprecated_string(); auto is_up = if_object.get("link_up"sv).to_bool(); - auto ipv4_addr_maybe = IPv4Address::from_string(if_object.get("ipv4_address"sv).to_string()); + auto ipv4_addr_maybe = IPv4Address::from_string(if_object.get("ipv4_address"sv).to_deprecated_string()); auto ipv4_addr = ipv4_addr_maybe.has_value() ? ipv4_addr_maybe.value() : IPv4Address { 0, 0, 0, 0 }; if (is_up) { dbgln_if(DHCPV4_DEBUG, "Found adapter '{}' with mac {}, and it was up!", name, mac); @@ -216,7 +216,7 @@ ErrorOr DHCPv4Client::get_discoverable_interfaces() void DHCPv4Client::handle_offer(DHCPv4Packet const& packet, ParsedDHCPv4Options const& options) { - dbgln("We were offered {} for {}", packet.yiaddr().to_string(), options.get(DHCPOption::IPAddressLeaseTime).value_or(0)); + dbgln("We were offered {} for {}", packet.yiaddr().to_deprecated_string(), options.get(DHCPOption::IPAddressLeaseTime).value_or(0)); auto* transaction = const_cast(m_ongoing_transactions.get(packet.xid()).value_or(nullptr)); if (!transaction) { dbgln("we're not looking for {}", packet.xid()); @@ -237,8 +237,8 @@ void DHCPv4Client::handle_offer(DHCPv4Packet const& packet, ParsedDHCPv4Options void DHCPv4Client::handle_ack(DHCPv4Packet const& packet, ParsedDHCPv4Options const& options) { if constexpr (DHCPV4CLIENT_DEBUG) { - dbgln("The DHCP server handed us {}", packet.yiaddr().to_string()); - dbgln("Here are the options: {}", options.to_string()); + dbgln("The DHCP server handed us {}", packet.yiaddr().to_deprecated_string()); + dbgln("Here are the options: {}", options.to_deprecated_string()); } auto* transaction = const_cast(m_ongoing_transactions.get(packet.xid()).value_or(nullptr)); @@ -270,8 +270,8 @@ void DHCPv4Client::handle_ack(DHCPv4Packet const& packet, ParsedDHCPv4Options co void DHCPv4Client::handle_nak(DHCPv4Packet const& packet, ParsedDHCPv4Options const& options) { - dbgln("The DHCP server told us to go chase our own tail about {}", packet.yiaddr().to_string()); - dbgln("Here are the options: {}", options.to_string()); + dbgln("The DHCP server told us to go chase our own tail about {}", packet.yiaddr().to_deprecated_string()); + dbgln("Here are the options: {}", options.to_deprecated_string()); // make another request a bit later :shrug: auto* transaction = const_cast(m_ongoing_transactions.get(packet.xid()).value_or(nullptr)); if (!transaction) { @@ -293,7 +293,7 @@ void DHCPv4Client::process_incoming(DHCPv4Packet const& packet) { auto options = packet.parse_options(); - dbgln_if(DHCPV4CLIENT_DEBUG, "Here are the options: {}", options.to_string()); + dbgln_if(DHCPV4CLIENT_DEBUG, "Here are the options: {}", options.to_deprecated_string()); auto value_or_error = options.get(DHCPOption::DHCPMessageType); if (!value_or_error.has_value()) @@ -332,7 +332,7 @@ void DHCPv4Client::dhcp_discover(InterfaceDescriptor const& iface) if constexpr (DHCPV4CLIENT_DEBUG) { dbgln("Trying to lease an IP for {} with ID {}", iface.ifname, transaction_id); if (!iface.current_ip_address.is_zero()) - dbgln("going to request the server to hand us {}", iface.current_ip_address.to_string()); + dbgln("going to request the server to hand us {}", iface.current_ip_address.to_deprecated_string()); } DHCPv4PacketBuilder builder; @@ -360,7 +360,7 @@ void DHCPv4Client::dhcp_discover(InterfaceDescriptor const& iface) void DHCPv4Client::dhcp_request(DHCPv4Transaction& transaction, DHCPv4Packet const& offer) { auto& iface = transaction.interface; - dbgln("Leasing the IP {} for adapter {}", offer.yiaddr().to_string(), iface.ifname); + dbgln("Leasing the IP {} for adapter {}", offer.yiaddr().to_deprecated_string(), iface.ifname); DHCPv4PacketBuilder builder; DHCPv4Packet& packet = builder.peek(); diff --git a/Userland/Services/FileOperation/main.cpp b/Userland/Services/FileOperation/main.cpp index 522505bbb0a..2e6b7f7c66d 100644 --- a/Userland/Services/FileOperation/main.cpp +++ b/Userland/Services/FileOperation/main.cpp @@ -359,5 +359,5 @@ DeprecatedString deduplicate_destination_file_name(DeprecatedString const& desti basename.append(destination_path.extension()); } - return LexicalPath::join(destination_path.dirname(), basename.to_string()).string(); + return LexicalPath::join(destination_path.dirname(), basename.to_deprecated_string()).string(); } diff --git a/Userland/Services/InspectorServer/InspectableProcess.cpp b/Userland/Services/InspectorServer/InspectableProcess.cpp index 260b95a43b6..c5826d9e9bc 100644 --- a/Userland/Services/InspectorServer/InspectableProcess.cpp +++ b/Userland/Services/InspectorServer/InspectableProcess.cpp @@ -75,7 +75,7 @@ DeprecatedString InspectableProcess::wait_for_response() void InspectableProcess::send_request(JsonObject const& request) { - auto serialized = request.to_string(); + auto serialized = request.to_deprecated_string(); u32 length = serialized.length(); // FIXME: Propagate errors diff --git a/Userland/Services/LaunchServer/Launcher.cpp b/Userland/Services/LaunchServer/Launcher.cpp index 3443d7dfded..b5875320981 100644 --- a/Userland/Services/LaunchServer/Launcher.cpp +++ b/Userland/Services/LaunchServer/Launcher.cpp @@ -199,7 +199,7 @@ bool Launcher::open_url(const URL& url, DeprecatedString const& handler_name) if (url.scheme() == "file") return open_file_url(url); - return open_with_user_preferences(m_protocol_handlers, url.scheme(), { url.to_string() }); + return open_with_user_preferences(m_protocol_handlers, url.scheme(), { url.to_deprecated_string() }); } bool Launcher::open_with_handler_name(const URL& url, DeprecatedString const& handler_name) @@ -213,7 +213,7 @@ bool Launcher::open_with_handler_name(const URL& url, DeprecatedString const& ha if (url.scheme() == "file") argument = url.path(); else - argument = url.to_string(); + argument = url.to_deprecated_string(); return spawn(handler.executable, { argument }); } diff --git a/Userland/Services/LookupServer/LookupServer.cpp b/Userland/Services/LookupServer/LookupServer.cpp index 635a9ce4902..9f946c4fc7b 100644 --- a/Userland/Services/LookupServer/LookupServer.cpp +++ b/Userland/Services/LookupServer/LookupServer.cpp @@ -118,9 +118,9 @@ void LookupServer::load_etc_hosts() add_answer(name, RecordType::A, DeprecatedString { (char const*)&raw_addr, sizeof(raw_addr) }); StringBuilder builder; - builder.append(maybe_address->to_string_reversed()); + builder.append(maybe_address->to_deprecated_string_reversed()); builder.append(".in-addr.arpa"sv); - add_answer(builder.to_string(), RecordType::PTR, name.as_string()); + add_answer(builder.to_deprecated_string(), RecordType::PTR, name.as_string()); } } diff --git a/Userland/Services/LookupServer/MulticastDNS.cpp b/Userland/Services/LookupServer/MulticastDNS.cpp index 9ce29575d89..b6cfbabe9f3 100644 --- a/Userland/Services/LookupServer/MulticastDNS.cpp +++ b/Userland/Services/LookupServer/MulticastDNS.cpp @@ -127,7 +127,7 @@ Vector MulticastDNS::local_addresses() const json.as_array().for_each([&addresses](auto& value) { auto if_object = value.as_object(); - auto address = if_object.get("ipv4_address"sv).to_string(); + auto address = if_object.get("ipv4_address"sv).to_deprecated_string(); auto ipv4_address = IPv4Address::from_string(address); // Skip unconfigured interfaces. if (!ipv4_address.has_value()) diff --git a/Userland/Services/NetworkServer/main.cpp b/Userland/Services/NetworkServer/main.cpp index 4a9798832ca..2c50879ea7e 100644 --- a/Userland/Services/NetworkServer/main.cpp +++ b/Userland/Services/NetworkServer/main.cpp @@ -51,7 +51,7 @@ ErrorOr serenity_main(Main::Arguments) Vector interfaces_with_dhcp_enabled; proc_net_adapters_json.as_array().for_each([&](auto& value) { auto& if_object = value.as_object(); - auto ifname = if_object.get("name"sv).to_string(); + auto ifname = if_object.get("name"sv).to_deprecated_string(); if (ifname == "loop"sv) return; diff --git a/Userland/Services/SQLServer/SQLStatement.cpp b/Userland/Services/SQLServer/SQLStatement.cpp index 275e24622b1..c9d61fcd06b 100644 --- a/Userland/Services/SQLServer/SQLStatement.cpp +++ b/Userland/Services/SQLServer/SQLStatement.cpp @@ -99,7 +99,7 @@ SQL::ResultOr SQLStatement::parse() m_statement = parser.next_statement(); if (parser.has_errors()) - return SQL::Result { SQL::SQLCommand::Unknown, SQL::SQLErrorCode::SyntaxError, parser.errors()[0].to_string() }; + return SQL::Result { SQL::SQLCommand::Unknown, SQL::SQLErrorCode::SyntaxError, parser.errors()[0].to_deprecated_string() }; return {}; } @@ -129,7 +129,7 @@ void SQLStatement::next() } if (m_index < m_result->size()) { auto& tuple = m_result->at(m_index++).row; - client_connection->async_next_result(statement_id(), tuple.to_string_vector()); + client_connection->async_next_result(statement_id(), tuple.to_deprecated_string_vector()); deferred_invoke([this]() { next(); }); diff --git a/Userland/Services/SystemServer/Service.cpp b/Userland/Services/SystemServer/Service.cpp index b9ff2001a63..729987ac270 100644 --- a/Userland/Services/SystemServer/Service.cpp +++ b/Userland/Services/SystemServer/Service.cpp @@ -209,7 +209,7 @@ void Service::spawn(int socket_fd) if (!m_sockets.is_empty()) { // The new descriptor is !CLOEXEC here. - setenv("SOCKET_TAKEOVER", builder.to_string().characters(), true); + setenv("SOCKET_TAKEOVER", builder.to_deprecated_string().characters(), true); } if (m_account.has_value() && m_account.value().uid() != getuid()) { diff --git a/Userland/Services/Taskbar/ClockWidget.cpp b/Userland/Services/Taskbar/ClockWidget.cpp index d8e05d90155..a876faf9b46 100644 --- a/Userland/Services/Taskbar/ClockWidget.cpp +++ b/Userland/Services/Taskbar/ClockWidget.cpp @@ -32,7 +32,7 @@ ClockWidget::ClockWidget() if (now != last_update_time) { tick_clock(); last_update_time = now; - set_tooltip(Core::DateTime::now().to_string("%Y-%m-%d"sv)); + set_tooltip(Core::DateTime::now().to_deprecated_string("%Y-%m-%d"sv)); } }); @@ -158,14 +158,14 @@ ClockWidget::ClockWidget() void ClockWidget::update_format(DeprecatedString const& format) { m_time_format = format; - m_time_width = font().width(Core::DateTime::create(122, 2, 22, 22, 22, 22).to_string(format)); + m_time_width = font().width(Core::DateTime::create(122, 2, 22, 22, 22, 22).to_deprecated_string(format)); set_fixed_size(m_time_width + 20, 21); } void ClockWidget::paint_event(GUI::PaintEvent& event) { GUI::Frame::paint_event(event); - auto time_text = Core::DateTime::now().to_string(m_time_format); + auto time_text = Core::DateTime::now().to_deprecated_string(m_time_format); GUI::Painter painter(*this); painter.add_clip_rect(frame_inner_rect()); diff --git a/Userland/Services/TelnetServer/Command.h b/Userland/Services/TelnetServer/Command.h index 8d3f9a8429a..f7e806252e4 100644 --- a/Userland/Services/TelnetServer/Command.h +++ b/Userland/Services/TelnetServer/Command.h @@ -21,7 +21,7 @@ struct Command { u8 command; u8 subcommand; - DeprecatedString to_string() const + DeprecatedString to_deprecated_string() const { StringBuilder builder; @@ -57,6 +57,6 @@ struct Command { break; } - return builder.to_string(); + return builder.to_deprecated_string(); }; }; diff --git a/Userland/Services/WebContent/ConnectionFromClient.cpp b/Userland/Services/WebContent/ConnectionFromClient.cpp index 2932d3201e8..eb65517bd6b 100644 --- a/Userland/Services/WebContent/ConnectionFromClient.cpp +++ b/Userland/Services/WebContent/ConnectionFromClient.cpp @@ -306,11 +306,11 @@ Messages::WebContentServer::InspectDomNodeResponse ConnectionFromClient::inspect auto serializer = MUST(JsonObjectSerializer<>::try_create(builder)); properties.for_each_property([&](auto property_id, auto& value) { - MUST(serializer.add(Web::CSS::string_from_property_id(property_id), value.to_string())); + MUST(serializer.add(Web::CSS::string_from_property_id(property_id), value.to_deprecated_string())); }); MUST(serializer.finish()); - return builder.to_string(); + return builder.to_deprecated_string(); }; auto serialize_custom_properties_json = [](Web::DOM::Element const& element) -> DeprecatedString { @@ -323,7 +323,7 @@ Messages::WebContentServer::InspectDomNodeResponse ConnectionFromClient::inspect for (auto const& property : element_to_check->custom_properties()) { if (!seen_properties.contains(property.key)) { seen_properties.set(property.key); - MUST(serializer.add(property.key, property.value.value->to_string())); + MUST(serializer.add(property.key, property.value.value->to_deprecated_string())); } } @@ -332,7 +332,7 @@ Messages::WebContentServer::InspectDomNodeResponse ConnectionFromClient::inspect MUST(serializer.finish()); - return builder.to_string(); + return builder.to_deprecated_string(); }; auto serialize_node_box_sizing_json = [](Web::Layout::Node const* layout_node) -> DeprecatedString { if (!layout_node || !layout_node->is_box()) { @@ -363,7 +363,7 @@ Messages::WebContentServer::InspectDomNodeResponse ConnectionFromClient::inspect } MUST(serializer.finish()); - return builder.to_string(); + return builder.to_deprecated_string(); }; if (pseudo_element.has_value()) { @@ -490,7 +490,7 @@ Messages::WebContentServer::DumpLayoutTreeResponse ConnectionFromClient::dump_la return DeprecatedString { "(no layout tree)" }; StringBuilder builder; Web::dump_tree(builder, *layout_root); - return builder.to_string(); + return builder.to_deprecated_string(); } void ConnectionFromClient::set_content_filters(Vector const& filters) diff --git a/Userland/Services/WebContent/WebDriverConnection.cpp b/Userland/Services/WebContent/WebDriverConnection.cpp index b90f07a5ba8..dd5a46d1445 100644 --- a/Userland/Services/WebContent/WebDriverConnection.cpp +++ b/Userland/Services/WebContent/WebDriverConnection.cpp @@ -369,7 +369,7 @@ Messages::WebDriverClient::GetCurrentUrlResponse WebDriverConnection::get_curren TRY(handle_any_user_prompts()); // 3. Let url be the serialization of the current top-level browsing context’s active document’s document URL. - auto url = m_page_client.page().top_level_browsing_context().active_document()->url().to_string(); + auto url = m_page_client.page().top_level_browsing_context().active_document()->url().to_deprecated_string(); // 4. Return success with data url. return url; @@ -1063,7 +1063,7 @@ Messages::WebDriverClient::GetElementCssValueResponse WebDriverConnection::get_e auto property = Web::CSS::property_id_from_string(name); if (auto* computed_values = element->computed_css_values()) - computed_value = computed_values->property(property)->to_string(); + computed_value = computed_values->property(property)->to_deprecated_string(); } // -> Otherwise else { diff --git a/Userland/Services/WebServer/Client.cpp b/Userland/Services/WebServer/Client.cpp index b80e130b746..2571f886848 100644 --- a/Userland/Services/WebServer/Client.cpp +++ b/Userland/Services/WebServer/Client.cpp @@ -127,7 +127,7 @@ ErrorOr Client::handle_request(ReadonlyBytes raw_request) StringBuilder path_builder; path_builder.append(Configuration::the().root_path()); path_builder.append(requested_path); - auto real_path = path_builder.to_string(); + auto real_path = path_builder.to_deprecated_string(); if (Core::File::is_directory(real_path)) { @@ -137,14 +137,14 @@ ErrorOr Client::handle_request(ReadonlyBytes raw_request) red.append(requested_path); red.append("/"sv); - TRY(send_redirect(red.to_string(), request)); + TRY(send_redirect(red.to_deprecated_string(), request)); return true; } StringBuilder index_html_path_builder; index_html_path_builder.append(real_path); index_html_path_builder.append("/index.html"sv); - auto index_html_path = index_html_path_builder.to_string(); + auto index_html_path = index_html_path_builder.to_deprecated_string(); if (!Core::File::exists(index_html_path)) { TRY(handle_directory_listing(requested_path, real_path, request)); return true; @@ -295,7 +295,7 @@ ErrorOr Client::handle_directory_listing(DeprecatedString const& requested struct stat st; memset(&st, 0, sizeof(st)); - int rc = stat(path_builder.to_string().characters(), &st); + int rc = stat(path_builder.to_deprecated_string().characters(), &st); if (rc < 0) { perror("stat"); } @@ -316,7 +316,7 @@ ErrorOr Client::handle_directory_listing(DeprecatedString const& requested builder.appendff("{:10} ", st.st_size); builder.append(""sv); - builder.append(Core::DateTime::from_timestamp(st.st_mtime).to_string()); + builder.append(Core::DateTime::from_timestamp(st.st_mtime).to_deprecated_string()); builder.append(""sv); builder.append("\n"sv); } @@ -327,7 +327,7 @@ ErrorOr Client::handle_directory_listing(DeprecatedString const& requested builder.append("\n"sv); builder.append("\n"sv); - auto response = builder.to_string(); + auto response = builder.to_deprecated_string(); InputMemoryStream stream { response.bytes() }; return send_response(stream, request, { .type = "text/html", .length = response.length() }); } @@ -363,7 +363,7 @@ ErrorOr Client::send_error_response(unsigned code, HTTP::HttpRequest const void Client::log_response(unsigned code, HTTP::HttpRequest const& request) { - outln("{} :: {:03d} :: {} {}", Core::DateTime::now().to_string(), code, request.method_name(), request.url().serialize().substring(1)); + outln("{} :: {:03d} :: {} {}", Core::DateTime::now().to_deprecated_string(), code, request.method_name(), request.url().serialize().substring(1)); } bool Client::verify_credentials(Vector const& headers) diff --git a/Userland/Services/WindowServer/KeymapSwitcher.cpp b/Userland/Services/WindowServer/KeymapSwitcher.cpp index e7f4cd2416a..ae110f539a5 100644 --- a/Userland/Services/WindowServer/KeymapSwitcher.cpp +++ b/Userland/Services/WindowServer/KeymapSwitcher.cpp @@ -97,7 +97,7 @@ DeprecatedString KeymapSwitcher::get_current_keymap() const auto json = JsonValue::from_string(proc_keymap->read_all()).release_value_but_fixme_should_propagate_errors(); auto const& keymap_object = json.as_object(); VERIFY(keymap_object.has("keymap"sv)); - return keymap_object.get("keymap"sv).to_string(); + return keymap_object.get("keymap"sv).to_deprecated_string(); } void KeymapSwitcher::set_keymap(const AK::DeprecatedString& keymap) diff --git a/Userland/Services/WindowServer/Overlays.cpp b/Userland/Services/WindowServer/Overlays.cpp index cc8ff7ad73b..9ffecde9589 100644 --- a/Userland/Services/WindowServer/Overlays.cpp +++ b/Userland/Services/WindowServer/Overlays.cpp @@ -241,7 +241,7 @@ void WindowGeometryOverlay::update_rect() int height_steps = (window->height() - window->base_size().height()) / window->size_increment().height(); m_label = DeprecatedString::formatted("{} ({}x{})", window->rect(), width_steps, height_steps); } else { - m_label = window->rect().to_string(); + m_label = window->rect().to_deprecated_string(); } m_label_rect = Gfx::IntRect { 0, 0, wm.font().width(m_label) + 16, wm.font().glyph_height() + 10 }; diff --git a/Userland/Services/WindowServer/WindowManager.cpp b/Userland/Services/WindowServer/WindowManager.cpp index 398ec80da81..6907d510df2 100644 --- a/Userland/Services/WindowServer/WindowManager.cpp +++ b/Userland/Services/WindowServer/WindowManager.cpp @@ -2044,7 +2044,7 @@ void WindowManager::set_accepts_drag(bool accepts) void WindowManager::invalidate_after_theme_or_font_change() { - Compositor::the().set_background_color(m_config->read_entry("Background", "Color", palette().desktop_background().to_string())); + Compositor::the().set_background_color(m_config->read_entry("Background", "Color", palette().desktop_background().to_deprecated_string())); WindowFrame::reload_config(); for_each_window_stack([&](auto& window_stack) { window_stack.for_each_window([&](Window& window) { @@ -2281,7 +2281,7 @@ void WindowManager::set_cursor_highlight_color(Gfx::Color const& color) { m_cursor_highlight_color = color; Compositor::the().invalidate_cursor(); - m_config->write_entry("Mouse", "CursorHighlightColor", color.to_string()); + m_config->write_entry("Mouse", "CursorHighlightColor", color.to_deprecated_string()); sync_config_to_disk(); } diff --git a/Userland/Services/WindowServer/WindowSwitcher.cpp b/Userland/Services/WindowServer/WindowSwitcher.cpp index 2c0aaa19548..7cf11923b7b 100644 --- a/Userland/Services/WindowServer/WindowSwitcher.cpp +++ b/Userland/Services/WindowServer/WindowSwitcher.cpp @@ -203,7 +203,7 @@ void WindowSwitcher::draw() painter.blit(icon_rect.location(), window.icon(), window.icon().rect()); painter.draw_text(item_rect.translated(thumbnail_width() + 12, 0).translated(1, 1), window.computed_title(), WindowManager::the().window_title_font(), Gfx::TextAlignment::CenterLeft, text_color.inverted()); painter.draw_text(item_rect.translated(thumbnail_width() + 12, 0), window.computed_title(), WindowManager::the().window_title_font(), Gfx::TextAlignment::CenterLeft, text_color); - auto window_details = m_windows_on_multiple_stacks ? DeprecatedString::formatted("{} on {}:{}", window.rect().to_string(), window.window_stack().row() + 1, window.window_stack().column() + 1) : window.rect().to_string(); + auto window_details = m_windows_on_multiple_stacks ? DeprecatedString::formatted("{} on {}:{}", window.rect().to_deprecated_string(), window.window_stack().row() + 1, window.window_stack().column() + 1) : window.rect().to_deprecated_string(); painter.draw_text(item_rect, window_details, Gfx::TextAlignment::CenterRight, rect_text_color); } } diff --git a/Userland/Shell/AST.cpp b/Userland/Shell/AST.cpp index 66258f4a60a..35e0cc810f6 100644 --- a/Userland/Shell/AST.cpp +++ b/Userland/Shell/AST.cpp @@ -630,7 +630,7 @@ void BarewordLiteral::highlight_in_editor(Line::Editor& editor, Shell& shell, Hi auto name = shell.help_path_for({}, *runnable); if (name.has_value()) { auto url = URL::create_with_help_scheme(name.release_value(), shell.hostname); - style = bold.unified_with(Line::Style::Hyperlink(url.to_string())); + style = bold.unified_with(Line::Style::Hyperlink(url.to_deprecated_string())); } } #endif @@ -662,7 +662,7 @@ void BarewordLiteral::highlight_in_editor(Line::Editor& editor, Shell& shell, Hi auto realpath = shell.resolve_path(m_text); auto url = URL::create_with_file_scheme(realpath); url.set_host(shell.hostname); - editor.stylize({ m_position.start_offset, m_position.end_offset }, { Line::Style::Hyperlink(url.to_string()) }); + editor.stylize({ m_position.start_offset, m_position.end_offset }, { Line::Style::Hyperlink(url.to_deprecated_string()) }); } } @@ -966,7 +966,7 @@ RefPtr DoubleQuotedString::run(RefPtr shell) builder.join(""sv, values); - return make_ref_counted(builder.to_string()); + return make_ref_counted(builder.to_deprecated_string()); } void DoubleQuotedString::highlight_in_editor(Line::Editor& editor, Shell& shell, HighlightMetadata metadata) @@ -1397,7 +1397,7 @@ RefPtr Heredoc::run(RefPtr shell) builder.append('\n'); } - return make_ref_counted(builder.to_string()); + return make_ref_counted(builder.to_deprecated_string()); } void Heredoc::highlight_in_editor(Line::Editor& editor, Shell& shell, HighlightMetadata metadata) @@ -2171,7 +2171,7 @@ RefPtr MatchExpr::run(RefPtr shell) spans.ensure_capacity(match.n_capture_groups); for (size_t i = 0; i < match.n_capture_groups; ++i) { auto& capture = match.capture_group_matches[0][i]; - spans.append(capture.view.to_string()); + spans.append(capture.view.to_deprecated_string()); } return true; } else { @@ -2498,7 +2498,7 @@ void PathRedirectionNode::highlight_in_editor(Line::Editor& editor, Shell& shell path = DeprecatedString::formatted("{}/{}", shell.cwd, path); auto url = URL::create_with_file_scheme(path); url.set_host(shell.hostname); - editor.stylize({ position.start_offset, position.end_offset }, { Line::Style::Hyperlink(url.to_string()) }); + editor.stylize({ position.start_offset, position.end_offset }, { Line::Style::Hyperlink(url.to_deprecated_string()) }); } } @@ -2558,12 +2558,12 @@ RefPtr Range::run(RefPtr shell) for (u32 code_point = start_code_point; code_point != end_code_point; code_point += step) { builder.clear(); builder.append_code_point(code_point); - values.append(make_ref_counted(builder.to_string())); + values.append(make_ref_counted(builder.to_deprecated_string())); } // Append the ending code point too, most shells treat this as inclusive. builder.clear(); builder.append_code_point(end_code_point); - values.append(make_ref_counted(builder.to_string())); + values.append(make_ref_counted(builder.to_deprecated_string())); } else { // Could be two numbers? auto start_int = start_str.to_int(); @@ -2667,7 +2667,7 @@ RefPtr ReadRedirection::run(RefPtr shell) StringBuilder builder; builder.join(' ', path_segments); - command.redirections.append(PathRedirection::create(builder.to_string(), m_fd, PathRedirection::Read)); + command.redirections.append(PathRedirection::create(builder.to_deprecated_string(), m_fd, PathRedirection::Read)); return make_ref_counted(move(command)); } @@ -2697,7 +2697,7 @@ RefPtr ReadWriteRedirection::run(RefPtr shell) StringBuilder builder; builder.join(' ', path_segments); - command.redirections.append(PathRedirection::create(builder.to_string(), m_fd, PathRedirection::ReadWrite)); + command.redirections.append(PathRedirection::create(builder.to_deprecated_string(), m_fd, PathRedirection::ReadWrite)); return make_ref_counted(move(command)); } @@ -3016,7 +3016,7 @@ RefPtr Juxtaposition::run(RefPtr shell) builder.append(left[0]); builder.append(right[0]); - return make_ref_counted(builder.to_string()); + return make_ref_counted(builder.to_deprecated_string()); } // Otherwise, treat them as lists and create a list product. @@ -3031,7 +3031,7 @@ RefPtr Juxtaposition::run(RefPtr shell) for (auto& right_element : right) { builder.append(left_element); builder.append(right_element); - result.append(builder.to_string()); + result.append(builder.to_deprecated_string()); builder.clear(); } } @@ -3054,13 +3054,13 @@ void Juxtaposition::highlight_in_editor(Line::Editor& editor, Shell& shell, High path_builder.append(tilde_value); path_builder.append('/'); path_builder.append(bareword_value); - auto path = path_builder.to_string(); + auto path = path_builder.to_deprecated_string(); if (Core::File::exists(path)) { auto realpath = shell.resolve_path(path); auto url = URL::create_with_file_scheme(realpath); url.set_host(shell.hostname); - editor.stylize({ m_position.start_offset, m_position.end_offset }, { Line::Style::Hyperlink(url.to_string()) }); + editor.stylize({ m_position.start_offset, m_position.end_offset }, { Line::Style::Hyperlink(url.to_deprecated_string()) }); } } else { @@ -3186,7 +3186,7 @@ RefPtr StringPartCompose::run(RefPtr shell) builder.join(' ', left); builder.join(' ', right); - return make_ref_counted(builder.to_string()); + return make_ref_counted(builder.to_deprecated_string()); } void StringPartCompose::highlight_in_editor(Line::Editor& editor, Shell& shell, HighlightMetadata metadata) @@ -3319,7 +3319,7 @@ DeprecatedString Tilde::text() const StringBuilder builder; builder.append('~'); builder.append(m_username); - return builder.to_string(); + return builder.to_deprecated_string(); } Tilde::Tilde(Position position, DeprecatedString username) @@ -3349,7 +3349,7 @@ RefPtr WriteAppendRedirection::run(RefPtr shell) StringBuilder builder; builder.join(' ', path_segments); - command.redirections.append(PathRedirection::create(builder.to_string(), m_fd, PathRedirection::WriteAppend)); + command.redirections.append(PathRedirection::create(builder.to_deprecated_string(), m_fd, PathRedirection::WriteAppend)); return make_ref_counted(move(command)); } @@ -3379,7 +3379,7 @@ RefPtr WriteRedirection::run(RefPtr shell) StringBuilder builder; builder.join(' ', path_segments); - command.redirections.append(PathRedirection::create(builder.to_string(), m_fd, PathRedirection::Write)); + command.redirections.append(PathRedirection::create(builder.to_deprecated_string(), m_fd, PathRedirection::Write)); return make_ref_counted(move(command)); } @@ -3728,9 +3728,9 @@ Vector TildeValue::resolve_as_list(RefPtr shell) builder.append(m_username); if (!shell) - return { resolve_slices(shell, builder.to_string(), m_slices) }; + return { resolve_slices(shell, builder.to_deprecated_string(), m_slices) }; - return { resolve_slices(shell, shell->expand_tilde(builder.to_string()), m_slices) }; + return { resolve_slices(shell, shell->expand_tilde(builder.to_deprecated_string()), m_slices) }; } ErrorOr> CloseRedirection::apply() const diff --git a/Userland/Shell/Builtin.cpp b/Userland/Shell/Builtin.cpp index 15b8f906ef6..989b3031c98 100644 --- a/Userland/Shell/Builtin.cpp +++ b/Userland/Shell/Builtin.cpp @@ -449,7 +449,7 @@ int Shell::builtin_export(int argc, char const** argv) auto values = value->resolve_as_list(*this); StringBuilder builder; builder.join(' ', values); - parts.append(builder.to_string()); + parts.append(builder.to_deprecated_string()); } else { // Ignore the export. continue; @@ -745,7 +745,7 @@ int Shell::builtin_pushd(int argc, char const** argv) } } - auto real_path = LexicalPath::canonicalized_path(path_builder.to_string()); + auto real_path = LexicalPath::canonicalized_path(path_builder.to_deprecated_string()); struct stat st; int rc = stat(real_path.characters(), &st); diff --git a/Userland/Shell/Formatter.cpp b/Userland/Shell/Formatter.cpp index f291d727502..6eefc869497 100644 --- a/Userland/Shell/Formatter.cpp +++ b/Userland/Shell/Formatter.cpp @@ -44,7 +44,7 @@ DeprecatedString Formatter::format() if (!string.ends_with(' ')) current_builder().append(m_trivia); - return current_builder().to_string(); + return current_builder().to_deprecated_string(); } void Formatter::with_added_indent(int indent, Function callback) @@ -70,7 +70,7 @@ DeprecatedString Formatter::in_new_builder(Function callback, StringBuil { m_builders.append(move(new_builder)); callback(); - return m_builders.take_last().to_string(); + return m_builders.take_last().to_deprecated_string(); } void Formatter::test_and_update_output_cursor(const AST::Node* node) diff --git a/Userland/Shell/ImmediateFunctions.cpp b/Userland/Shell/ImmediateFunctions.cpp index 5771058e2d9..93e89186e2b 100644 --- a/Userland/Shell/ImmediateFunctions.cpp +++ b/Userland/Shell/ImmediateFunctions.cpp @@ -450,7 +450,7 @@ RefPtr Shell::immediate_join(AST::ImmediateExpression& invoking_node, StringBuilder builder; builder.join(delimiter_str, value->resolve_as_list(*this)); - return AST::make_ref_counted(invoking_node.position(), builder.to_string(), AST::StringLiteral::EnclosureType::None); + return AST::make_ref_counted(invoking_node.position(), builder.to_deprecated_string(), AST::StringLiteral::EnclosureType::None); } RefPtr Shell::run_immediate_function(StringView str, AST::ImmediateExpression& invoking_node, NonnullRefPtrVector const& arguments) diff --git a/Userland/Shell/Parser.cpp b/Userland/Shell/Parser.cpp index 72907c8408b..f299260c1ff 100644 --- a/Userland/Shell/Parser.cpp +++ b/Userland/Shell/Parser.cpp @@ -1459,7 +1459,7 @@ RefPtr Parser::parse_string_inner(StringEndCondition condition) continue; } if (peek() == '$') { - auto string_literal = create(builder.to_string(), AST::StringLiteral::EnclosureType::DoubleQuotes); // String Literal + auto string_literal = create(builder.to_deprecated_string(), AST::StringLiteral::EnclosureType::DoubleQuotes); // String Literal auto read_concat = [&](auto&& node) { auto inner = create( move(string_literal), @@ -1485,7 +1485,7 @@ RefPtr Parser::parse_string_inner(StringEndCondition condition) builder.append(consume()); } - return create(builder.to_string(), AST::StringLiteral::EnclosureType::DoubleQuotes); // String Literal + return create(builder.to_deprecated_string(), AST::StringLiteral::EnclosureType::DoubleQuotes); // String Literal } RefPtr Parser::parse_variable() @@ -1895,7 +1895,7 @@ RefPtr Parser::parse_bareword() auto current_end = m_offset; auto current_line = line(); - auto string = builder.to_string(); + auto string = builder.to_deprecated_string(); if (string.starts_with('~')) { DeprecatedString username; RefPtr tilde, text; @@ -1988,7 +1988,7 @@ RefPtr Parser::parse_glob() } } - return create(textbuilder.to_string()); // Glob + return create(textbuilder.to_deprecated_string()); // Glob } return bareword_part; diff --git a/Userland/Shell/Shell.cpp b/Userland/Shell/Shell.cpp index a3ec7960853..4476bc7f56f 100644 --- a/Userland/Shell/Shell.cpp +++ b/Userland/Shell/Shell.cpp @@ -87,7 +87,7 @@ DeprecatedString Shell::prompt() const StringBuilder builder; builder.appendff("\033]0;{}@{}:{}\007", username, hostname, cwd); builder.appendff("\033[31;1m{}\033[0m@\033[37;1m{}\033[0m:\033[32;1m{}\033[0m$> ", username, hostname, cwd); - return builder.to_string(); + return builder.to_deprecated_string(); } StringBuilder builder; @@ -130,7 +130,7 @@ DeprecatedString Shell::prompt() const } builder.append(*ptr); } - return builder.to_string(); + return builder.to_deprecated_string(); }; return build_prompt(); @@ -159,17 +159,17 @@ DeprecatedString Shell::expand_tilde(StringView expression) if (!home) { auto passwd = getpwuid(getuid()); VERIFY(passwd && passwd->pw_dir); - return DeprecatedString::formatted("{}/{}", passwd->pw_dir, path.to_string()); + return DeprecatedString::formatted("{}/{}", passwd->pw_dir, path.to_deprecated_string()); } - return DeprecatedString::formatted("{}/{}", home, path.to_string()); + return DeprecatedString::formatted("{}/{}", home, path.to_deprecated_string()); } - auto passwd = getpwnam(login_name.to_string().characters()); + auto passwd = getpwnam(login_name.to_deprecated_string().characters()); if (!passwd) return expression; VERIFY(passwd->pw_dir); - return DeprecatedString::formatted("{}/{}", passwd->pw_dir, path.to_string()); + return DeprecatedString::formatted("{}/{}", passwd->pw_dir, path.to_deprecated_string()); } bool Shell::is_glob(StringView s) @@ -391,7 +391,7 @@ DeprecatedString Shell::local_variable_or(StringView name, DeprecatedString cons if (value) { StringBuilder builder; builder.join(' ', value->resolve_as_list(*this)); - return builder.to_string(); + return builder.to_deprecated_string(); } return replacement; } @@ -520,7 +520,7 @@ DeprecatedString Shell::resolve_alias(StringView name) const Optional Shell::runnable_path_for(StringView name) { auto parts = name.split_view('/'); - auto path = name.to_string(); + auto path = name.to_deprecated_string(); if (parts.size() > 1) { auto file = Core::File::open(path.characters(), Core::OpenMode::ReadOnly); if (!file.is_error() && !file.value()->is_directory() && access(path.characters(), X_OK) == 0) @@ -914,7 +914,7 @@ void Shell::execute_process(Vector&& argv) if (!line.starts_with("#!"sv)) break; GenericLexer shebang_lexer { line.substring_view(2) }; - auto shebang = shebang_lexer.consume_until(is_any_of("\n\r"sv)).to_string(); + auto shebang = shebang_lexer.consume_until(is_any_of("\n\r"sv)).to_deprecated_string(); argv.prepend(shebang.characters()); int rc = execvp(argv[0], const_cast(argv.data())); if (rc < 0) { @@ -1911,7 +1911,7 @@ ErrorOr> Shell::complete_via_program_itself(s dbgln("LibLine: Unhandled completion kind: {}", kind); } } else { - suggestions.append(parsed.to_string()); + suggestions.append(parsed.to_deprecated_string()); } return IterationDecision::Continue; @@ -2172,7 +2172,7 @@ Shell::Shell() if (path.length()) path.append(":"sv); path.append(DEFAULT_PATH_SV); - setenv("PATH", path.to_string().characters(), true); + setenv("PATH", path.to_deprecated_string().characters(), true); } cache_path(); diff --git a/Userland/Utilities/arp.cpp b/Userland/Utilities/arp.cpp index 4254a920b7a..1f27f4a552f 100644 --- a/Userland/Utilities/arp.cpp +++ b/Userland/Utilities/arp.cpp @@ -95,13 +95,13 @@ ErrorOr serenity_main(Main::Arguments arguments) Vector sorted_regions = json.as_array().values(); quick_sort(sorted_regions, [](auto& a, auto& b) { - return a.as_object().get("ip_address"sv).to_string() < b.as_object().get("ip_address"sv).to_string(); + return a.as_object().get("ip_address"sv).to_deprecated_string() < b.as_object().get("ip_address"sv).to_deprecated_string(); }); for (auto& value : sorted_regions) { auto& if_object = value.as_object(); - auto ip_address = if_object.get("ip_address"sv).to_string(); + auto ip_address = if_object.get("ip_address"sv).to_deprecated_string(); if (!flag_numeric) { auto from_string = IPv4Address::from_string(ip_address); @@ -114,7 +114,7 @@ ErrorOr serenity_main(Main::Arguments arguments) } } - auto mac_address = if_object.get("mac_address"sv).to_string(); + auto mac_address = if_object.get("mac_address"sv).to_deprecated_string(); if (proto_address_column != -1) columns[proto_address_column].buffer = ip_address; diff --git a/Userland/Utilities/checksum.cpp b/Userland/Utilities/checksum.cpp index 611a50f2976..5ac56e8cb47 100644 --- a/Userland/Utilities/checksum.cpp +++ b/Userland/Utilities/checksum.cpp @@ -33,7 +33,7 @@ ErrorOr serenity_main(Main::Arguments arguments) exit(1); } - auto hash_name = program_name.substring_view(0, program_name.length() - 3).to_string().to_uppercase(); + auto hash_name = program_name.substring_view(0, program_name.length() - 3).to_deprecated_string().to_uppercase(); auto paths_help_string = DeprecatedString::formatted("File(s) to print {} checksum of", hash_name); bool verify_from_paths = false; diff --git a/Userland/Utilities/copy.cpp b/Userland/Utilities/copy.cpp index 3ebeea0918b..1a6f80de9f3 100644 --- a/Userland/Utilities/copy.cpp +++ b/Userland/Utilities/copy.cpp @@ -51,7 +51,7 @@ static ErrorOr parse_options(Main::Arguments arguments) // Copy the rest of our command-line args. StringBuilder builder; builder.join(' ', text); - options.data = builder.to_string(); + options.data = builder.to_deprecated_string(); } return options; diff --git a/Userland/Utilities/cpp-lexer.cpp b/Userland/Utilities/cpp-lexer.cpp index 57cee27959e..1bce9e6f7fe 100644 --- a/Userland/Utilities/cpp-lexer.cpp +++ b/Userland/Utilities/cpp-lexer.cpp @@ -23,7 +23,7 @@ ErrorOr serenity_main(Main::Arguments arguments) Cpp::Lexer lexer(content); lexer.lex_iterable([](auto token) { - outln("{}", token.to_string()); + outln("{}", token.to_deprecated_string()); }); return 0; diff --git a/Userland/Utilities/cpp-preprocessor.cpp b/Userland/Utilities/cpp-preprocessor.cpp index dd992d65587..e3c97fa848f 100644 --- a/Userland/Utilities/cpp-preprocessor.cpp +++ b/Userland/Utilities/cpp-preprocessor.cpp @@ -37,7 +37,7 @@ ErrorOr serenity_main(Main::Arguments arguments) } for (auto& token : tokens) { - outln("{}", token.to_string()); + outln("{}", token.to_deprecated_string()); } return 0; diff --git a/Userland/Utilities/date.cpp b/Userland/Utilities/date.cpp index 65b2244b3e8..c43f102e2e9 100644 --- a/Userland/Utilities/date.cpp +++ b/Userland/Utilities/date.cpp @@ -58,17 +58,17 @@ ErrorOr serenity_main(Main::Arguments arguments) warnln("date: Format string must start with '+'"); return 1; } - outln("{}", date.to_string(format_string.substring_view(1))); + outln("{}", date.to_deprecated_string(format_string.substring_view(1))); } else if (print_unix_date) { outln("{}", date.timestamp()); } else if (print_iso_8601) { - outln("{}", date.to_string("%Y-%m-%dT%H:%M:%S%:z"sv)); + outln("{}", date.to_deprecated_string("%Y-%m-%dT%H:%M:%S%:z"sv)); } else if (print_rfc_5322) { - outln("{}", date.to_string("%a, %d %b %Y %H:%M:%S %z"sv)); + outln("{}", date.to_deprecated_string("%a, %d %b %Y %H:%M:%S %z"sv)); } else if (print_rfc_3339) { - outln("{}", date.to_string("%Y-%m-%d %H:%M:%S%:z"sv)); + outln("{}", date.to_deprecated_string("%Y-%m-%d %H:%M:%S%:z"sv)); } else { - outln("{}", date.to_string("%Y-%m-%d %H:%M:%S %Z"sv)); + outln("{}", date.to_deprecated_string("%Y-%m-%d %H:%M:%S %Z"sv)); } return 0; } diff --git a/Userland/Utilities/dd.cpp b/Userland/Utilities/dd.cpp index a45ba01808a..6c472a9eafd 100644 --- a/Userland/Utilities/dd.cpp +++ b/Userland/Utilities/dd.cpp @@ -54,7 +54,7 @@ static int handle_io_file_arguments(int& fd, int flags, StringView argument) return -1; } - fd = open(value.to_string().characters(), flags, 0666); + fd = open(value.to_deprecated_string().characters(), flags, 0666); if (fd == -1) { warnln("Unable to open: {}", value); return -1; diff --git a/Userland/Utilities/df.cpp b/Userland/Utilities/df.cpp index fe59ac0e5fa..d53e90bed31 100644 --- a/Userland/Utilities/df.cpp +++ b/Userland/Utilities/df.cpp @@ -45,13 +45,13 @@ ErrorOr serenity_main(Main::Arguments arguments) auto const& json = json_result.as_array(); json.for_each([](auto& value) { auto& fs_object = value.as_object(); - auto fs = fs_object.get("class_name"sv).to_string(); + auto fs = fs_object.get("class_name"sv).to_deprecated_string(); auto total_block_count = fs_object.get("total_block_count"sv).to_u64(); auto free_block_count = fs_object.get("free_block_count"sv).to_u64(); [[maybe_unused]] auto total_inode_count = fs_object.get("total_inode_count"sv).to_u64(); [[maybe_unused]] auto free_inode_count = fs_object.get("free_inode_count"sv).to_u64(); auto block_size = fs_object.get("block_size"sv).to_u64(); - auto mount_point = fs_object.get("mount_point"sv).to_string(); + auto mount_point = fs_object.get("mount_point"sv).to_deprecated_string(); out("{:10}", fs); diff --git a/Userland/Utilities/disasm.cpp b/Userland/Utilities/disasm.cpp index 5876295398b..a8985bd7448 100644 --- a/Userland/Utilities/disasm.cpp +++ b/Userland/Utilities/disasm.cpp @@ -141,7 +141,7 @@ ErrorOr serenity_main(Main::Arguments args) builder.append(" "sv); } builder.append(" "sv); - builder.append(insn.value().to_string(virtual_offset, symbol_provider)); + builder.append(insn.value().to_deprecated_string(virtual_offset, symbol_provider)); outln("{}", builder.string_view()); for (size_t bytes_printed = 7; bytes_printed < length; bytes_printed += 7) { diff --git a/Userland/Utilities/du.cpp b/Userland/Utilities/du.cpp index c8fa86c49ba..938dd5d9bec 100644 --- a/Userland/Utilities/du.cpp +++ b/Userland/Utilities/du.cpp @@ -193,7 +193,7 @@ ErrorOr print_space_usage(DeprecatedString const& path, DuOption const& du_ break; } - auto const formatted_time = Core::DateTime::from_timestamp(time).to_string(); + auto const formatted_time = Core::DateTime::from_timestamp(time).to_deprecated_string(); outln("\t{}\t{}", formatted_time, path); } diff --git a/Userland/Utilities/fgrep.cpp b/Userland/Utilities/fgrep.cpp index 9bbd625df52..8fddc99f965 100644 --- a/Userland/Utilities/fgrep.cpp +++ b/Userland/Utilities/fgrep.cpp @@ -25,6 +25,6 @@ ErrorOr serenity_main(Main::Arguments arguments) TRY(Core::System::write(1, str.bytes())); if (feof(stdin)) return 0; - VERIFY(str.to_string().characters()); + VERIFY(str.to_deprecated_string().characters()); } } diff --git a/Userland/Utilities/fortune.cpp b/Userland/Utilities/fortune.cpp index fa8bfe40850..87b2d19bf8e 100644 --- a/Userland/Utilities/fortune.cpp +++ b/Userland/Utilities/fortune.cpp @@ -106,11 +106,11 @@ ErrorOr serenity_main(Main::Arguments arguments) outln(); // Tasteful spacing - out("\033]8;;{}\033\\", chosen_quote.url()); // Begin link - out("\033[34m({})\033[m", datetime.to_string()); // Datetime - out(" \033[34;1m<{}>\033[m", chosen_quote.author()); // Author - out(" \033[32m{}\033[m", chosen_quote.quote()); // Quote itself - out("\033]8;;\033\\"); // End link + out("\033]8;;{}\033\\", chosen_quote.url()); // Begin link + out("\033[34m({})\033[m", datetime.to_deprecated_string()); // Datetime + out(" \033[34;1m<{}>\033[m", chosen_quote.author()); // Author + out(" \033[32m{}\033[m", chosen_quote.quote()); // Quote itself + out("\033]8;;\033\\"); // End link outln(); if (chosen_quote.context().has_value()) diff --git a/Userland/Utilities/grep.cpp b/Userland/Utilities/grep.cpp index a328d6526dd..2eba86e520f 100644 --- a/Userland/Utilities/grep.cpp +++ b/Userland/Utilities/grep.cpp @@ -178,7 +178,7 @@ ErrorOr serenity_main(Main::Arguments args) auto pre_match_length = match.global_offset - last_printed_char_pos; out(colored_output ? "{}\x1B[32m{}\x1B[0m"sv : "{}{}"sv, pre_match_length > 0 ? StringView(&str[last_printed_char_pos], pre_match_length) : ""sv, - match.view.to_string()); + match.view.to_deprecated_string()); last_printed_char_pos = match.global_offset + match.view.length(); } auto remaining_length = str.length() - last_printed_char_pos; diff --git a/Userland/Utilities/ifconfig.cpp b/Userland/Utilities/ifconfig.cpp index 5932c23faae..b532594f0c1 100644 --- a/Userland/Utilities/ifconfig.cpp +++ b/Userland/Utilities/ifconfig.cpp @@ -38,11 +38,11 @@ ErrorOr serenity_main(Main::Arguments arguments) json.as_array().for_each([](auto& value) { auto& if_object = value.as_object(); - auto name = if_object.get("name"sv).to_string(); - auto class_name = if_object.get("class_name"sv).to_string(); - auto mac_address = if_object.get("mac_address"sv).to_string(); - auto ipv4_address = if_object.get("ipv4_address"sv).to_string(); - auto netmask = if_object.get("ipv4_netmask"sv).to_string(); + auto name = if_object.get("name"sv).to_deprecated_string(); + auto class_name = if_object.get("class_name"sv).to_deprecated_string(); + auto mac_address = if_object.get("mac_address"sv).to_deprecated_string(); + auto ipv4_address = if_object.get("ipv4_address"sv).to_deprecated_string(); + auto netmask = if_object.get("ipv4_netmask"sv).to_deprecated_string(); auto packets_in = if_object.get("packets_in"sv).to_u32(); auto bytes_in = if_object.get("bytes_in"sv).to_u32(); auto packets_out = if_object.get("packets_out"sv).to_u32(); diff --git a/Userland/Utilities/js.cpp b/Userland/Utilities/js.cpp index fddb645f7e4..2f58e5c49fa 100644 --- a/Userland/Utilities/js.cpp +++ b/Userland/Utilities/js.cpp @@ -182,7 +182,7 @@ static DeprecatedString read_next_piece() } } while (s_repl_line_level + line_level_delta_for_next_line > 0); - return piece.to_string(); + return piece.to_deprecated_string(); } static bool write_to_file(DeprecatedString const& path) @@ -227,7 +227,7 @@ static ErrorOr parse_and_run(JS::Interpreter& interpreter, StringView sour if (JS::Bytecode::g_dump_bytecode || s_run_bytecode) { auto executable_result = JS::Bytecode::Generator::generate(script_or_module->parse_node()); if (executable_result.is_error()) { - result = g_vm->throw_completion(executable_result.error().to_string()); + result = g_vm->throw_completion(executable_result.error().to_deprecated_string()); return ReturnEarly::No; } @@ -266,8 +266,8 @@ static ErrorOr parse_and_run(JS::Interpreter& interpreter, StringView sour auto hint = error.source_location_hint(source); if (!hint.is_empty()) outln("{}", hint); - outln("{}", error.to_string()); - result = interpreter.vm().throw_completion(error.to_string()); + outln("{}", error.to_deprecated_string()); + result = interpreter.vm().throw_completion(error.to_deprecated_string()); } else { auto return_early = run_script_or_module(script_or_error.value()); if (return_early == ReturnEarly::Yes) @@ -280,8 +280,8 @@ static ErrorOr parse_and_run(JS::Interpreter& interpreter, StringView sour auto hint = error.source_location_hint(source); if (!hint.is_empty()) outln("{}", hint); - outln(error.to_string()); - result = interpreter.vm().throw_completion(error.to_string()); + outln(error.to_deprecated_string()); + result = interpreter.vm().throw_completion(error.to_deprecated_string()); } else { auto return_early = run_script_or_module(module_or_error.value()); if (return_early == ReturnEarly::Yes) diff --git a/Userland/Utilities/json.cpp b/Userland/Utilities/json.cpp index 38aba094821..d88542af518 100644 --- a/Userland/Utilities/json.cpp +++ b/Userland/Utilities/json.cpp @@ -110,7 +110,7 @@ void print(JsonValue const& value, int spaces_per_indent, int indent, bool use_c } if (value.is_string()) out("\""); - out("{}", value.to_string()); + out("{}", value.to_deprecated_string()); if (value.is_string()) out("\""); if (use_color) diff --git a/Userland/Utilities/ls.cpp b/Userland/Utilities/ls.cpp index 561551930cd..065466e4335 100644 --- a/Userland/Utilities/ls.cpp +++ b/Userland/Utilities/ls.cpp @@ -362,7 +362,7 @@ static bool print_filesystem_object(DeprecatedString const& path, DeprecatedStri } } - printf(" %s ", Core::DateTime::from_timestamp(st.st_mtime).to_string().characters()); + printf(" %s ", Core::DateTime::from_timestamp(st.st_mtime).to_deprecated_string().characters()); print_name(st, name, path.characters(), path.characters()); @@ -419,7 +419,7 @@ static int do_file_system_object_long(char const* path) builder.append({ path, strlen(path) }); builder.append('/'); builder.append(metadata.name); - metadata.path = builder.to_string(); + metadata.path = builder.to_deprecated_string(); VERIFY(!metadata.path.is_null()); int rc = lstat(metadata.path.characters(), &metadata.stat); if (rc < 0) @@ -463,7 +463,7 @@ static bool print_names(char const* path, size_t longest_name, Vector longest_name) @@ -531,7 +531,7 @@ int do_file_system_object_short(char const* path) builder.append({ path, strlen(path) }); builder.append('/'); builder.append(metadata.name); - metadata.path = builder.to_string(); + metadata.path = builder.to_deprecated_string(); VERIFY(!metadata.path.is_null()); int rc = lstat(metadata.path.characters(), &metadata.stat); if (rc < 0) diff --git a/Userland/Utilities/lsirq.cpp b/Userland/Utilities/lsirq.cpp index 73e839e8890..37f41868c72 100644 --- a/Userland/Utilities/lsirq.cpp +++ b/Userland/Utilities/lsirq.cpp @@ -34,15 +34,15 @@ ErrorOr serenity_main(Main::Arguments) json.as_array().for_each([cpu_count](JsonValue const& value) { auto& handler = value.as_object(); - auto purpose = handler.get("purpose"sv).to_string(); - auto interrupt = handler.get("interrupt_line"sv).to_string(); - auto controller = handler.get("controller"sv).to_string(); + auto purpose = handler.get("purpose"sv).to_deprecated_string(); + auto interrupt = handler.get("interrupt_line"sv).to_deprecated_string(); + auto controller = handler.get("controller"sv).to_deprecated_string(); auto call_counts = handler.get("per_cpu_call_counts"sv).as_array(); out("{:>4}: ", interrupt); for (size_t i = 0; i < cpu_count; ++i) - out("{:>10}", call_counts[i].to_string()); + out("{:>10}", call_counts[i].to_deprecated_string()); outln(" {:10} {:30}", controller, purpose); }); diff --git a/Userland/Utilities/lsjails.cpp b/Userland/Utilities/lsjails.cpp index e817164b6c8..4ec5e234f03 100644 --- a/Userland/Utilities/lsjails.cpp +++ b/Userland/Utilities/lsjails.cpp @@ -25,8 +25,8 @@ ErrorOr serenity_main(Main::Arguments) auto json = TRY(JsonValue::from_string(file_contents)); json.as_array().for_each([](auto& value) { auto& jail = value.as_object(); - auto index = jail.get("index"sv).to_string(); - auto name = jail.get("name"sv).to_string(); + auto index = jail.get("index"sv).to_deprecated_string(); + auto name = jail.get("name"sv).to_deprecated_string(); outln("{:4} {:10}", index, name); }); diff --git a/Userland/Utilities/lsof.cpp b/Userland/Utilities/lsof.cpp index 24674dfe2a8..2e829c01c14 100644 --- a/Userland/Utilities/lsof.cpp +++ b/Userland/Utilities/lsof.cpp @@ -89,7 +89,7 @@ static Vector get_open_files_by_pid(pid_t pid) open_file.pid = pid; open_file.fd = object.as_object().get("fd"sv).to_int(); - DeprecatedString name = object.as_object().get("absolute_path"sv).to_string(); + DeprecatedString name = object.as_object().get("absolute_path"sv).to_deprecated_string(); VERIFY(parse_name(name, open_file)); open_file.full_name = name; diff --git a/Userland/Utilities/matroska.cpp b/Userland/Utilities/matroska.cpp index f3e3b7bebb3..716250bbea3 100644 --- a/Userland/Utilities/matroska.cpp +++ b/Userland/Utilities/matroska.cpp @@ -40,8 +40,8 @@ ErrorOr serenity_main(Main::Arguments arguments) outln("DocTypeVersion is {}", reader.header().doc_type_version); auto segment_information = TRY_PARSE(reader.segment_information()); outln("Timestamp scale is {}", segment_information.timestamp_scale()); - outln("Muxing app is \"{}\"", segment_information.muxing_app().as_string().to_string().characters()); - outln("Writing app is \"{}\"", segment_information.writing_app().as_string().to_string().characters()); + outln("Muxing app is \"{}\"", segment_information.muxing_app().as_string().to_deprecated_string().characters()); + outln("Writing app is \"{}\"", segment_information.writing_app().as_string().to_deprecated_string().characters()); outln("Document has {} tracks", TRY_PARSE(reader.track_count())); TRY_PARSE(reader.for_each_track([&](Video::Matroska::TrackEntry const& track_entry) -> Video::DecoderErrorOr { diff --git a/Userland/Utilities/mktemp.cpp b/Userland/Utilities/mktemp.cpp index dc41d396aa0..653538c3a72 100644 --- a/Userland/Utilities/mktemp.cpp +++ b/Userland/Utilities/mktemp.cpp @@ -27,7 +27,7 @@ static DeprecatedString generate_random_filename(DeprecatedString const& pattern new_filename.append(pattern[i]); } - return new_filename.to_string(); + return new_filename.to_deprecated_string(); } static ErrorOr make_temp(DeprecatedString const& pattern, bool directory, bool dry_run) diff --git a/Userland/Utilities/mount.cpp b/Userland/Utilities/mount.cpp index d03f21e6057..bee21b39a00 100644 --- a/Userland/Utilities/mount.cpp +++ b/Userland/Utilities/mount.cpp @@ -155,8 +155,8 @@ static ErrorOr print_mounts() json.as_array().for_each([](auto& value) { auto& fs_object = value.as_object(); - auto class_name = fs_object.get("class_name"sv).to_string(); - auto mount_point = fs_object.get("mount_point"sv).to_string(); + auto class_name = fs_object.get("class_name"sv).to_deprecated_string(); + auto mount_point = fs_object.get("mount_point"sv).to_deprecated_string(); auto source = fs_object.get("source"sv).as_string_or("none"); auto readonly = fs_object.get("readonly"sv).to_bool(); auto mount_flags = fs_object.get("mount_flags"sv).to_int(); diff --git a/Userland/Utilities/netstat.cpp b/Userland/Utilities/netstat.cpp index 8d77300b4ea..02f18540b29 100644 --- a/Userland/Utilities/netstat.cpp +++ b/Userland/Utilities/netstat.cpp @@ -171,10 +171,10 @@ ErrorOr serenity_main(Main::Arguments arguments) for (auto& value : sorted_regions) { auto& if_object = value.as_object(); - auto bytes_in = if_object.get("bytes_in"sv).to_string(); - auto bytes_out = if_object.get("bytes_out"sv).to_string(); + auto bytes_in = if_object.get("bytes_in"sv).to_deprecated_string(); + auto bytes_out = if_object.get("bytes_out"sv).to_deprecated_string(); - auto peer_address = if_object.get("peer_address"sv).to_string(); + auto peer_address = if_object.get("peer_address"sv).to_deprecated_string(); if (!flag_numeric) { auto from_string = IPv4Address::from_string(peer_address); auto addr = from_string.value().to_in_addr_t(); @@ -186,7 +186,7 @@ ErrorOr serenity_main(Main::Arguments arguments) } } - auto peer_port = if_object.get("peer_port"sv).to_string(); + auto peer_port = if_object.get("peer_port"sv).to_deprecated_string(); if (!flag_numeric) { auto service = getservbyport(htons(if_object.get("peer_port"sv).to_u32()), "tcp"); if (service != nullptr) { @@ -196,7 +196,7 @@ ErrorOr serenity_main(Main::Arguments arguments) } } - auto local_address = if_object.get("local_address"sv).to_string(); + auto local_address = if_object.get("local_address"sv).to_deprecated_string(); if (!flag_numeric) { auto from_string = IPv4Address::from_string(local_address); auto addr = from_string.value().to_in_addr_t(); @@ -208,7 +208,7 @@ ErrorOr serenity_main(Main::Arguments arguments) } } - auto local_port = if_object.get("local_port"sv).to_string(); + auto local_port = if_object.get("local_port"sv).to_deprecated_string(); if (!flag_numeric) { auto service = getservbyport(htons(if_object.get("local_port"sv).to_u32()), "tcp"); if (service != nullptr) { @@ -218,7 +218,7 @@ ErrorOr serenity_main(Main::Arguments arguments) } } - auto state = if_object.get("state"sv).to_string(); + auto state = if_object.get("state"sv).to_deprecated_string(); auto origin_pid = (if_object.has("origin_pid"sv)) ? if_object.get("origin_pid"sv).to_u32() : -1; if (!flag_all && ((state == "Listen" && !flag_list) || (state != "Listen" && flag_list))) @@ -258,7 +258,7 @@ ErrorOr serenity_main(Main::Arguments arguments) for (auto& value : sorted_regions) { auto& if_object = value.as_object(); - auto local_address = if_object.get("local_address"sv).to_string(); + auto local_address = if_object.get("local_address"sv).to_deprecated_string(); if (!flag_numeric) { auto from_string = IPv4Address::from_string(local_address); auto addr = from_string.value().to_in_addr_t(); @@ -270,7 +270,7 @@ ErrorOr serenity_main(Main::Arguments arguments) } } - auto local_port = if_object.get("local_port"sv).to_string(); + auto local_port = if_object.get("local_port"sv).to_deprecated_string(); if (!flag_numeric) { auto service = getservbyport(htons(if_object.get("local_port"sv).to_u32()), "udp"); if (service != nullptr) { @@ -280,7 +280,7 @@ ErrorOr serenity_main(Main::Arguments arguments) } } - auto peer_address = if_object.get("peer_address"sv).to_string(); + auto peer_address = if_object.get("peer_address"sv).to_deprecated_string(); if (!flag_numeric) { auto from_string = IPv4Address::from_string(peer_address); auto addr = from_string.value().to_in_addr_t(); @@ -292,7 +292,7 @@ ErrorOr serenity_main(Main::Arguments arguments) } } - auto peer_port = if_object.get("peer_port"sv).to_string(); + auto peer_port = if_object.get("peer_port"sv).to_deprecated_string(); if (!flag_numeric) { auto service = getservbyport(htons(if_object.get("peer_port"sv).to_u32()), "udp"); if (service != nullptr) { diff --git a/Userland/Utilities/pmap.cpp b/Userland/Utilities/pmap.cpp index e6a45222980..b38fcbbc205 100644 --- a/Userland/Utilities/pmap.cpp +++ b/Userland/Utilities/pmap.cpp @@ -53,7 +53,7 @@ ErrorOr serenity_main(Main::Arguments arguments) for (auto& value : sorted_regions) { auto& map = value.as_object(); auto address = map.get("address"sv).to_addr(); - auto size = map.get("size"sv).to_string(); + auto size = map.get("size"sv).to_deprecated_string(); auto access = DeprecatedString::formatted("{}{}{}{}{}", (map.get("readable"sv).to_bool() ? "r" : "-"), @@ -65,13 +65,13 @@ ErrorOr serenity_main(Main::Arguments arguments) out("{:p} ", address); out("{:>10} ", size); if (extended) { - auto resident = map.get("amount_resident"sv).to_string(); - auto dirty = map.get("amount_dirty"sv).to_string(); - auto vmobject = map.get("vmobject"sv).to_string(); + auto resident = map.get("amount_resident"sv).to_deprecated_string(); + auto dirty = map.get("amount_dirty"sv).to_deprecated_string(); + auto vmobject = map.get("vmobject"sv).to_deprecated_string(); if (vmobject.ends_with("VMObject"sv)) vmobject = vmobject.substring(0, vmobject.length() - 8); - auto purgeable = map.get("purgeable"sv).to_string(); - auto cow_pages = map.get("cow_pages"sv).to_string(); + auto purgeable = map.get("purgeable"sv).to_deprecated_string(); + auto cow_pages = map.get("cow_pages"sv).to_deprecated_string(); out("{:>10} ", resident); out("{:>10} ", dirty); out("{:6} ", access); @@ -81,7 +81,7 @@ ErrorOr serenity_main(Main::Arguments arguments) } else { out("{:6} ", access); } - auto name = map.get("name"sv).to_string(); + auto name = map.get("name"sv).to_deprecated_string(); out("{:20}", name); outln(); } diff --git a/Userland/Utilities/readelf.cpp b/Userland/Utilities/readelf.cpp index a4936a7df2e..bb798dad7d9 100644 --- a/Userland/Utilities/readelf.cpp +++ b/Userland/Utilities/readelf.cpp @@ -463,9 +463,9 @@ ErrorOr serenity_main(Main::Arguments arguments) found_dynamic_section = true; if (section.entry_count()) { - outln("Dynamic section '{}' at offset {:#08x} contains {} entries.", section.name().to_string(), section.offset(), section.entry_count()); + outln("Dynamic section '{}' at offset {:#08x} contains {} entries.", section.name().to_deprecated_string(), section.offset(), section.entry_count()); } else { - outln("Dynamic section '{}' at offset {:#08x} contains zero entries.", section.name().to_string(), section.offset()); + outln("Dynamic section '{}' at offset {:#08x} contains zero entries.", section.name().to_deprecated_string(), section.offset()); } return IterationDecision::Break; diff --git a/Userland/Utilities/route.cpp b/Userland/Utilities/route.cpp index 767c2dfb8fe..633bb58595c 100644 --- a/Userland/Utilities/route.cpp +++ b/Userland/Utilities/route.cpp @@ -101,16 +101,16 @@ ErrorOr serenity_main(Main::Arguments arguments) Vector sorted_regions = json.as_array().values(); quick_sort(sorted_regions, [](auto& a, auto& b) { - return a.as_object().get("destination"sv).to_string() < b.as_object().get("destination"sv).to_string(); + return a.as_object().get("destination"sv).to_deprecated_string() < b.as_object().get("destination"sv).to_deprecated_string(); }); for (auto& value : sorted_regions) { auto& if_object = value.as_object(); - auto destination = if_object.get("destination"sv).to_string(); - auto gateway = if_object.get("gateway"sv).to_string(); - auto genmask = if_object.get("genmask"sv).to_string(); - auto interface = if_object.get("interface"sv).to_string(); + auto destination = if_object.get("destination"sv).to_deprecated_string(); + auto gateway = if_object.get("gateway"sv).to_deprecated_string(); + auto genmask = if_object.get("genmask"sv).to_deprecated_string(); + auto interface = if_object.get("interface"sv).to_deprecated_string(); auto flags = if_object.get("flags"sv).to_u32(); StringBuilder flags_builder; diff --git a/Userland/Utilities/run-tests.cpp b/Userland/Utilities/run-tests.cpp index 5f64b34d6ec..fa93cfaa466 100644 --- a/Userland/Utilities/run-tests.cpp +++ b/Userland/Utilities/run-tests.cpp @@ -159,7 +159,7 @@ void TestRunner::do_run_single_test(DeprecatedString const& test_path, size_t cu auto tid = thread_info.tid; // Note: Yoinking this out of the struct because we can't pass a reference to it (as it's a misaligned field in a packed struct) dbgln("Thread {}", tid); for (auto const& entry : thread_backtrace.entries()) - dbgln("- {}", entry.to_string(true)); + dbgln("- {}", entry.to_deprecated_string(true)); return IterationDecision::Continue; }); break; diff --git a/Userland/Utilities/shot.cpp b/Userland/Utilities/shot.cpp index 569d960eb1f..394d65d2c3e 100644 --- a/Userland/Utilities/shot.cpp +++ b/Userland/Utilities/shot.cpp @@ -110,7 +110,7 @@ ErrorOr serenity_main(Main::Arguments arguments) args_parser.parse(arguments); if (output_path.is_empty()) { - output_path = Core::DateTime::now().to_string("screenshot-%Y-%m-%d-%H-%M-%S.png"sv); + output_path = Core::DateTime::now().to_deprecated_string("screenshot-%Y-%m-%d-%H-%M-%S.png"sv); } auto app = TRY(GUI::Application::try_create(arguments)); @@ -157,7 +157,7 @@ ErrorOr serenity_main(Main::Arguments arguments) return 1; } if (edit_image) - output_path = Core::DateTime::now().to_string("/tmp/screenshot-%Y-%m-%d-%H-%M-%S.png"sv); + output_path = Core::DateTime::now().to_deprecated_string("/tmp/screenshot-%Y-%m-%d-%H-%M-%S.png"sv); auto file_or_error = Core::Stream::File::open(output_path, Core::Stream::OpenMode::ReadWrite); if (file_or_error.is_error()) { diff --git a/Userland/Utilities/sql.cpp b/Userland/Utilities/sql.cpp index b2adac663fe..f271e2a27dd 100644 --- a/Userland/Utilities/sql.cpp +++ b/Userland/Utilities/sql.cpp @@ -270,7 +270,7 @@ private: m_repl_line_level = last_token_ended_statement ? 0 : (m_repl_line_level > 0 ? m_repl_line_level : 1); } while ((m_repl_line_level > 0) || piece.is_empty()); - return piece.to_string(); + return piece.to_deprecated_string(); } void read_sql() diff --git a/Userland/Utilities/stat.cpp b/Userland/Utilities/stat.cpp index 6ea6c60221b..7f240831bfa 100644 --- a/Userland/Utilities/stat.cpp +++ b/Userland/Utilities/stat.cpp @@ -73,7 +73,7 @@ static ErrorOr stat(StringView file, bool should_follow_links) outln(")"); auto print_time = [](timespec t) { - outln("{}.{:09}", Core::DateTime::from_timestamp(t.tv_sec).to_string(), t.tv_nsec); + outln("{}.{:09}", Core::DateTime::from_timestamp(t.tv_sec).to_deprecated_string(), t.tv_nsec); }; out("Accessed: "); diff --git a/Userland/Utilities/strace.cpp b/Userland/Utilities/strace.cpp index 7ed71672c38..f895c833931 100644 --- a/Userland/Utilities/strace.cpp +++ b/Userland/Utilities/strace.cpp @@ -602,7 +602,7 @@ struct Formatter : StandardFormatter { builder.appendff( ", sin_port={}, sin_addr={}", address_in->sin_port, - IPv4Address(address_in->sin_addr.s_addr).to_string()); + IPv4Address(address_in->sin_addr.s_addr).to_deprecated_string()); } else if (address.sa_family == AF_UNIX) { auto* address_un = (const struct sockaddr_un*)&address; builder.appendff( diff --git a/Userland/Utilities/stty.cpp b/Userland/Utilities/stty.cpp index 19bdd99303f..44eac1434d7 100644 --- a/Userland/Utilities/stty.cpp +++ b/Userland/Utilities/stty.cpp @@ -212,7 +212,7 @@ void print_human_readable(termios const& modes, winsize const& ws, bool verbose_ } else { sb.append(ch); } - return sb.to_string(); + return sb.to_deprecated_string(); }; auto print_control_characters = [&] { diff --git a/Userland/Utilities/syscall.cpp b/Userland/Utilities/syscall.cpp index fd41a57cce3..1802ed660a2 100644 --- a/Userland/Utilities/syscall.cpp +++ b/Userland/Utilities/syscall.cpp @@ -128,7 +128,7 @@ static FlatPtr as_buf(Vector params_vec) builder.appendff(" {:p}", params_vec[i]); } builder.appendff(" ] at {:p}", (FlatPtr)buf); - dbgln("{}", builder.to_string()); + dbgln("{}", builder.to_deprecated_string()); } // Leak the buffer here. We need to keep it until the special syscall happens, diff --git a/Userland/Utilities/tar.cpp b/Userland/Utilities/tar.cpp index 19076e95a7f..f726c9f666d 100644 --- a/Userland/Utilities/tar.cpp +++ b/Userland/Utilities/tar.cpp @@ -150,7 +150,7 @@ ErrorOr serenity_main(Main::Arguments arguments) long_name.append(reinterpret_cast(slice.data()), slice.size()); } - local_overrides.set("path", long_name.to_string()); + local_overrides.set("path", long_name.to_deprecated_string()); TRY(tar_stream->advance()); continue; } diff --git a/Userland/Utilities/tr.cpp b/Userland/Utilities/tr.cpp index 6dfbc7890a2..c018215dad4 100644 --- a/Userland/Utilities/tr.cpp +++ b/Userland/Utilities/tr.cpp @@ -88,7 +88,7 @@ static ErrorOr build_set(StringView specification) TRY(out.try_append(lexer.consume(1))); } - return out.to_string(); + return out.to_deprecated_string(); } ErrorOr serenity_main(Main::Arguments arguments) @@ -134,7 +134,7 @@ ErrorOr serenity_main(Main::Arguments arguments) if (!from_str.contains(static_cast(ch))) TRY(complement_set.try_append(static_cast(ch))); } - from_str = complement_set.to_string(); + from_str = complement_set.to_deprecated_string(); } auto to_str = TRY(build_set(to_chars)); diff --git a/Userland/Utilities/tree.cpp b/Userland/Utilities/tree.cpp index b5e0e417c58..47fe53e34fd 100644 --- a/Userland/Utilities/tree.cpp +++ b/Userland/Utilities/tree.cpp @@ -73,7 +73,7 @@ static void print_directory_tree(DeprecatedString const& root_path, int depth, D builder.append('/'); } builder.append(name); - DeprecatedString full_path = builder.to_string(); + DeprecatedString full_path = builder.to_deprecated_string(); struct stat st; int rc = lstat(full_path.characters(), &st); diff --git a/Userland/Utilities/uname.cpp b/Userland/Utilities/uname.cpp index 41248af7166..9edae1cf172 100644 --- a/Userland/Utilities/uname.cpp +++ b/Userland/Utilities/uname.cpp @@ -54,6 +54,6 @@ ErrorOr serenity_main(Main::Arguments arguments) parts.append(uts.machine); StringBuilder builder; builder.join(' ', parts); - puts(builder.to_string().characters()); + puts(builder.to_deprecated_string().characters()); return 0; } diff --git a/Userland/Utilities/utmpupdate.cpp b/Userland/Utilities/utmpupdate.cpp index d91c6a1ce26..7c011243f1a 100644 --- a/Userland/Utilities/utmpupdate.cpp +++ b/Userland/Utilities/utmpupdate.cpp @@ -72,7 +72,7 @@ ErrorOr serenity_main(Main::Arguments arguments) TRY(file->seek(0, Core::Stream::SeekMode::SetPosition)); TRY(file->truncate(0)); - TRY(file->write(json.to_string().bytes())); + TRY(file->write(json.to_deprecated_string().bytes())); return 0; } diff --git a/Userland/Utilities/w.cpp b/Userland/Utilities/w.cpp index 6c9b4c7587d..1c905dae809 100644 --- a/Userland/Utilities/w.cpp +++ b/Userland/Utilities/w.cpp @@ -48,7 +48,7 @@ ErrorOr serenity_main(Main::Arguments) [[maybe_unused]] auto pid = entry.get("pid"sv).to_i32(); auto login_time = Core::DateTime::from_timestamp(entry.get("login_at"sv).to_number()); - auto login_at = login_time.to_string("%b%d %H:%M:%S"sv); + auto login_at = login_time.to_deprecated_string("%b%d %H:%M:%S"sv); auto* pw = getpwuid(uid); DeprecatedString username; @@ -64,7 +64,7 @@ ErrorOr serenity_main(Main::Arguments) auto idle_time = now - st.st_mtime; if (idle_time >= 0) { builder.appendff("{}s", idle_time); - idle_string = builder.to_string(); + idle_string = builder.to_deprecated_string(); } } diff --git a/Userland/Utilities/wasm.cpp b/Userland/Utilities/wasm.cpp index 290cd7a8d81..fabb40c2c14 100644 --- a/Userland/Utilities/wasm.cpp +++ b/Userland/Utilities/wasm.cpp @@ -256,7 +256,7 @@ static Optional parse(StringView filename) auto parse_result = Wasm::Module::parse(stream); if (parse_result.is_error()) { warnln("Something went wrong, either the file is invalid, or there's a bug with LibWasm!"); - warnln("The parse error was {}", Wasm::parse_error_to_string(parse_result.error())); + warnln("The parse error was {}", Wasm::parse_error_to_deprecated_string(parse_result.error())); return {}; } return parse_result.release_value(); @@ -405,7 +405,7 @@ ErrorOr serenity_main(Main::Arguments arguments) ByteBuffer buffer = stream.copy_into_contiguous_buffer(); argument_builder.append(StringView(buffer).trim_whitespace()); } - dbgln("[wasm runtime] Stub function {} was called with the following arguments: {}", name, argument_builder.to_string()); + dbgln("[wasm runtime] Stub function {} was called with the following arguments: {}", name, argument_builder.to_deprecated_string()); Vector result; result.ensure_capacity(type.results().size()); for (auto& result_type : type.results()) diff --git a/Userland/Utilities/xargs.cpp b/Userland/Utilities/xargs.cpp index 6fac3399a20..a1afb74d875 100644 --- a/Userland/Utilities/xargs.cpp +++ b/Userland/Utilities/xargs.cpp @@ -198,7 +198,7 @@ bool run_command(Vector&& child_argv, bool verbose, bool is_stdin, int de if (verbose) { StringBuilder builder; builder.join(' ', child_argv); - warnln("xargs: {}", builder.to_string()); + warnln("xargs: {}", builder.to_deprecated_string()); } auto pid = fork(); @@ -266,6 +266,6 @@ void ParsedInitialArguments::for_each_joined_argument(StringView separator, Func for (auto& parts : m_all_parts) { builder.clear(); builder.join(separator, parts); - callback(builder.to_string()); + callback(builder.to_deprecated_string()); } } diff --git a/Userland/Utilities/xml.cpp b/Userland/Utilities/xml.cpp index e3636a86739..fc91876e3f2 100644 --- a/Userland/Utilities/xml.cpp +++ b/Userland/Utilities/xml.cpp @@ -430,7 +430,7 @@ static void do_run_tests(XML::Document& document) path_builder.append(entry); path_builder.append('/'); } - auto test_base_path = path_builder.to_string(); + auto test_base_path = path_builder.to_deprecated_string(); path_builder.append(suite.attributes.find("URI")->value); auto url = URL::create_with_file_scheme(path_builder.string_view());