1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 12:07:45 +00:00

AK+Everywhere: Rename String to DeprecatedString

We have a new, improved string type coming up in AK (OOM aware, no null
state), and while it's going to use UTF-8, the name UTF8String is a
mouthful - so let's free up the String name by renaming the existing
class.
Making the old one have an annoying name will hopefully also help with
quick adoption :^)
This commit is contained in:
Linus Groh 2022-12-04 18:02:33 +00:00 committed by Andreas Kling
parent f74251606d
commit 6e19ab2bbc
2006 changed files with 11635 additions and 11636 deletions

View file

@ -6,8 +6,8 @@
#pragma once
#include <AK/DeprecatedString.h>
#include <AK/Span.h>
#include <AK/String.h>
#include <AK/Variant.h>
#include <AK/Vector.h>
#include <LibJS/Forward.h>
@ -21,36 +21,36 @@ namespace JS::Intl {
struct LocaleOptions {
Value locale_matcher;
Optional<String> ca; // [[Calendar]]
Optional<String> co; // [[Collation]]
Optional<String> hc; // [[HourCycle]]
Optional<String> kf; // [[CaseFirst]]
Optional<String> kn; // [[Numeric]]
Optional<String> nu; // [[NumberingSystem]]
Optional<DeprecatedString> ca; // [[Calendar]]
Optional<DeprecatedString> co; // [[Collation]]
Optional<DeprecatedString> hc; // [[HourCycle]]
Optional<DeprecatedString> kf; // [[CaseFirst]]
Optional<DeprecatedString> kn; // [[Numeric]]
Optional<DeprecatedString> nu; // [[NumberingSystem]]
};
struct LocaleResult {
String locale;
String data_locale;
Optional<String> ca; // [[Calendar]]
Optional<String> co; // [[Collation]]
Optional<String> hc; // [[HourCycle]]
Optional<String> kf; // [[CaseFirst]]
Optional<String> kn; // [[Numeric]]
Optional<String> nu; // [[NumberingSystem]]
DeprecatedString locale;
DeprecatedString data_locale;
Optional<DeprecatedString> ca; // [[Calendar]]
Optional<DeprecatedString> co; // [[Collation]]
Optional<DeprecatedString> hc; // [[HourCycle]]
Optional<DeprecatedString> kf; // [[CaseFirst]]
Optional<DeprecatedString> kn; // [[Numeric]]
Optional<DeprecatedString> nu; // [[NumberingSystem]]
};
struct PatternPartition {
PatternPartition() = default;
PatternPartition(StringView type_string, String value_string)
PatternPartition(StringView type_string, DeprecatedString value_string)
: type(type_string)
, value(move(value_string))
{
}
StringView type;
String value;
DeprecatedString value;
};
struct PatternPartitionWithSource : public PatternPartition {
@ -80,16 +80,16 @@ struct PatternPartitionWithSource : public PatternPartition {
using StringOrBoolean = Variant<StringView, bool>;
Optional<::Locale::LocaleID> is_structurally_valid_language_tag(StringView locale);
String canonicalize_unicode_locale_id(::Locale::LocaleID& locale);
DeprecatedString canonicalize_unicode_locale_id(::Locale::LocaleID& locale);
bool is_well_formed_currency_code(StringView currency);
bool is_well_formed_unit_identifier(StringView unit_identifier);
ThrowCompletionOr<Vector<String>> canonicalize_locale_list(VM&, Value locales);
Optional<String> best_available_locale(StringView locale);
String insert_unicode_extension_and_canonicalize(::Locale::LocaleID locale_id, ::Locale::LocaleExtension extension);
LocaleResult resolve_locale(Vector<String> const& requested_locales, LocaleOptions const& options, Span<StringView const> relevant_extension_keys);
Vector<String> lookup_supported_locales(Vector<String> const& requested_locales);
Vector<String> best_fit_supported_locales(Vector<String> const& requested_locales);
ThrowCompletionOr<Array*> supported_locales(VM&, Vector<String> const& requested_locales, Value options);
ThrowCompletionOr<Vector<DeprecatedString>> canonicalize_locale_list(VM&, Value locales);
Optional<DeprecatedString> best_available_locale(StringView locale);
DeprecatedString insert_unicode_extension_and_canonicalize(::Locale::LocaleID locale_id, ::Locale::LocaleExtension extension);
LocaleResult resolve_locale(Vector<DeprecatedString> const& requested_locales, LocaleOptions const& options, Span<StringView const> relevant_extension_keys);
Vector<DeprecatedString> lookup_supported_locales(Vector<DeprecatedString> const& requested_locales);
Vector<DeprecatedString> best_fit_supported_locales(Vector<DeprecatedString> const& requested_locales);
ThrowCompletionOr<Array*> supported_locales(VM&, Vector<DeprecatedString> const& requested_locales, Value options);
ThrowCompletionOr<Object*> coerce_options_to_object(VM&, Value options);
ThrowCompletionOr<StringOrBoolean> get_string_or_boolean_option(VM&, Object const& options, PropertyKey const& property, Span<StringView const> values, StringOrBoolean true_value, StringOrBoolean falsy_value, StringOrBoolean fallback);
ThrowCompletionOr<Optional<int>> default_number_option(VM&, Value value, int minimum, int maximum, Optional<int> fallback);