mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 18:17:44 +00:00
AK+Everywhere: Rename FlyString to DeprecatedFlyString
DeprecatedFlyString relies heavily on DeprecatedString's StringImpl, so let's rename it to A) match the name of DeprecatedString, B) write a new FlyString class that is tied to String.
This commit is contained in:
parent
2eacc7aec1
commit
f3db548a3d
316 changed files with 1177 additions and 1177 deletions
|
@ -4,7 +4,7 @@
|
|||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <AK/FlyString.h>
|
||||
#include <AK/DeprecatedFlyString.h>
|
||||
#include <LibJS/Runtime/TypedArray.h>
|
||||
#include <LibWeb/Bindings/Intrinsics.h>
|
||||
#include <LibWeb/Encoding/TextDecoder.h>
|
||||
|
@ -12,7 +12,7 @@
|
|||
|
||||
namespace Web::Encoding {
|
||||
|
||||
WebIDL::ExceptionOr<JS::NonnullGCPtr<TextDecoder>> TextDecoder::construct_impl(JS::Realm& realm, FlyString encoding)
|
||||
WebIDL::ExceptionOr<JS::NonnullGCPtr<TextDecoder>> TextDecoder::construct_impl(JS::Realm& realm, DeprecatedFlyString encoding)
|
||||
{
|
||||
auto decoder = TextCodec::decoder_for(encoding);
|
||||
if (!decoder)
|
||||
|
@ -22,7 +22,7 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<TextDecoder>> TextDecoder::construct_impl(J
|
|||
}
|
||||
|
||||
// https://encoding.spec.whatwg.org/#dom-textdecoder
|
||||
TextDecoder::TextDecoder(JS::Realm& realm, TextCodec::Decoder& decoder, FlyString encoding, bool fatal, bool ignore_bom)
|
||||
TextDecoder::TextDecoder(JS::Realm& realm, TextCodec::Decoder& decoder, DeprecatedFlyString encoding, bool fatal, bool ignore_bom)
|
||||
: PlatformObject(realm)
|
||||
, m_decoder(decoder)
|
||||
, m_encoding(move(encoding))
|
||||
|
|
|
@ -21,22 +21,22 @@ class TextDecoder : public Bindings::PlatformObject {
|
|||
WEB_PLATFORM_OBJECT(TextDecoder, Bindings::PlatformObject);
|
||||
|
||||
public:
|
||||
static WebIDL::ExceptionOr<JS::NonnullGCPtr<TextDecoder>> construct_impl(JS::Realm&, FlyString encoding);
|
||||
static WebIDL::ExceptionOr<JS::NonnullGCPtr<TextDecoder>> construct_impl(JS::Realm&, DeprecatedFlyString encoding);
|
||||
|
||||
virtual ~TextDecoder() override;
|
||||
|
||||
WebIDL::ExceptionOr<DeprecatedString> decode(JS::Handle<JS::Object> const&) const;
|
||||
|
||||
FlyString const& encoding() const { return m_encoding; }
|
||||
DeprecatedFlyString const& encoding() const { return m_encoding; }
|
||||
bool fatal() const { return m_fatal; }
|
||||
bool ignore_bom() const { return m_ignore_bom; };
|
||||
|
||||
private:
|
||||
// https://encoding.spec.whatwg.org/#dom-textdecoder
|
||||
TextDecoder(JS::Realm&, TextCodec::Decoder&, FlyString encoding, bool fatal, bool ignore_bom);
|
||||
TextDecoder(JS::Realm&, TextCodec::Decoder&, DeprecatedFlyString encoding, bool fatal, bool ignore_bom);
|
||||
|
||||
TextCodec::Decoder& m_decoder;
|
||||
FlyString m_encoding;
|
||||
DeprecatedFlyString m_encoding;
|
||||
bool m_fatal { false };
|
||||
bool m_ignore_bom { false };
|
||||
};
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <AK/FlyString.h>
|
||||
#include <AK/DeprecatedFlyString.h>
|
||||
#include <LibJS/Runtime/TypedArray.h>
|
||||
#include <LibWeb/Bindings/Intrinsics.h>
|
||||
#include <LibWeb/Encoding/TextEncoder.h>
|
||||
|
@ -44,9 +44,9 @@ JS::Uint8Array* TextEncoder::encode(DeprecatedString const& input) const
|
|||
}
|
||||
|
||||
// https://encoding.spec.whatwg.org/#dom-textencoder-encoding
|
||||
FlyString const& TextEncoder::encoding()
|
||||
DeprecatedFlyString const& TextEncoder::encoding()
|
||||
{
|
||||
static FlyString encoding = "utf-8"sv;
|
||||
static DeprecatedFlyString encoding = "utf-8"sv;
|
||||
return encoding;
|
||||
}
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ public:
|
|||
|
||||
JS::Uint8Array* encode(DeprecatedString const& input) const;
|
||||
|
||||
static FlyString const& encoding();
|
||||
static DeprecatedFlyString const& encoding();
|
||||
|
||||
protected:
|
||||
// https://encoding.spec.whatwg.org/#dom-textencoder
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue