diff options
Diffstat (limited to 'Userland/Libraries/LibTextCodec')
-rw-r--r-- | Userland/Libraries/LibTextCodec/Decoder.cpp | 14 | ||||
-rw-r--r-- | Userland/Libraries/LibTextCodec/Decoder.h | 12 |
2 files changed, 13 insertions, 13 deletions
diff --git a/Userland/Libraries/LibTextCodec/Decoder.cpp b/Userland/Libraries/LibTextCodec/Decoder.cpp index 41058a4de1..71db2563b5 100644 --- a/Userland/Libraries/LibTextCodec/Decoder.cpp +++ b/Userland/Libraries/LibTextCodec/Decoder.cpp @@ -5,7 +5,7 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include <AK/String.h> +#include <AK/DeprecatedString.h> #include <AK/StringBuilder.h> #include <AK/Utf8View.h> #include <LibTextCodec/Decoder.h> @@ -26,7 +26,7 @@ TurkishDecoder s_turkish_decoder; XUserDefinedDecoder s_x_user_defined_decoder; } -Decoder* decoder_for(String const& a_encoding) +Decoder* decoder_for(DeprecatedString const& a_encoding) { auto encoding = get_standardized_encoding(a_encoding); if (encoding.has_value()) { @@ -184,7 +184,7 @@ Decoder* bom_sniff_to_decoder(StringView input) } // https://encoding.spec.whatwg.org/#decode -String convert_input_to_utf8_using_given_decoder_unless_there_is_a_byte_order_mark(Decoder& fallback_decoder, StringView input) +DeprecatedString convert_input_to_utf8_using_given_decoder_unless_there_is_a_byte_order_mark(Decoder& fallback_decoder, StringView input) { Decoder* actual_decoder = &fallback_decoder; @@ -207,7 +207,7 @@ String convert_input_to_utf8_using_given_decoder_unless_there_is_a_byte_order_ma return actual_decoder->to_utf8(input); } -String Decoder::to_utf8(StringView input) +DeprecatedString Decoder::to_utf8(StringView input) { StringBuilder builder(input.length()); process(input, [&builder](u32 c) { builder.append_code_point(c); }); @@ -221,7 +221,7 @@ void UTF8Decoder::process(StringView input, Function<void(u32)> on_code_point) } } -String UTF8Decoder::to_utf8(StringView input) +DeprecatedString UTF8Decoder::to_utf8(StringView input) { // Discard the BOM auto bomless_input = input; @@ -241,7 +241,7 @@ void UTF16BEDecoder::process(StringView input, Function<void(u32)> on_code_point } } -String UTF16BEDecoder::to_utf8(StringView input) +DeprecatedString UTF16BEDecoder::to_utf8(StringView input) { // Discard the BOM auto bomless_input = input; @@ -262,7 +262,7 @@ void UTF16LEDecoder::process(StringView input, Function<void(u32)> on_code_point } } -String UTF16LEDecoder::to_utf8(StringView input) +DeprecatedString UTF16LEDecoder::to_utf8(StringView input) { // Discard the BOM auto bomless_input = input; diff --git a/Userland/Libraries/LibTextCodec/Decoder.h b/Userland/Libraries/LibTextCodec/Decoder.h index 2d826fcafd..6faf61fce5 100644 --- a/Userland/Libraries/LibTextCodec/Decoder.h +++ b/Userland/Libraries/LibTextCodec/Decoder.h @@ -15,7 +15,7 @@ namespace TextCodec { class Decoder { public: virtual void process(StringView, Function<void(u32)> on_code_point) = 0; - virtual String to_utf8(StringView); + virtual DeprecatedString to_utf8(StringView); protected: virtual ~Decoder() = default; @@ -24,19 +24,19 @@ protected: class UTF8Decoder final : public Decoder { public: virtual void process(StringView, Function<void(u32)> on_code_point) override; - virtual String to_utf8(StringView) override; + virtual DeprecatedString to_utf8(StringView) override; }; class UTF16BEDecoder final : public Decoder { public: virtual void process(StringView, Function<void(u32)> on_code_point) override; - virtual String to_utf8(StringView) override; + virtual DeprecatedString to_utf8(StringView) override; }; class UTF16LEDecoder final : public Decoder { public: virtual void process(StringView, Function<void(u32)> on_code_point) override; - virtual String to_utf8(StringView) override; + virtual DeprecatedString to_utf8(StringView) override; }; class Latin1Decoder final : public Decoder { @@ -79,7 +79,7 @@ public: virtual void process(StringView, Function<void(u32)> on_code_point) override; }; -Decoder* decoder_for(String const& encoding); +Decoder* decoder_for(DeprecatedString const& encoding); Optional<StringView> get_standardized_encoding(StringView encoding); // This returns the appropriate Unicode decoder for the sniffed BOM or nullptr if there is no appropriate decoder. @@ -87,6 +87,6 @@ Decoder* bom_sniff_to_decoder(StringView); // NOTE: This has an obnoxious name to discourage usage. Only use this if you absolutely must! For example, XHR in LibWeb uses this. // This will use the given decoder unless there is a byte order mark in the input, in which we will instead use the appropriate Unicode decoder. -String convert_input_to_utf8_using_given_decoder_unless_there_is_a_byte_order_mark(Decoder&, StringView); +DeprecatedString convert_input_to_utf8_using_given_decoder_unless_there_is_a_byte_order_mark(Decoder&, StringView); } |