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

@ -7,7 +7,7 @@
#pragma once
#include <AK/Array.h>
#include <AK/String.h>
#include <AK/DeprecatedString.h>
#include <AK/StringView.h>
#include <LibJS/Runtime/Completion.h>
#include <LibJS/Runtime/Intl/AbstractOperations.h>
@ -35,14 +35,14 @@ public:
virtual ~RelativeTimeFormat() override = default;
String const& locale() const { return m_locale; }
void set_locale(String locale) { m_locale = move(locale); }
DeprecatedString const& locale() const { return m_locale; }
void set_locale(DeprecatedString locale) { m_locale = move(locale); }
String const& data_locale() const { return m_data_locale; }
void set_data_locale(String data_locale) { m_data_locale = move(data_locale); }
DeprecatedString const& data_locale() const { return m_data_locale; }
void set_data_locale(DeprecatedString data_locale) { m_data_locale = move(data_locale); }
String const& numbering_system() const { return m_numbering_system; }
void set_numbering_system(String numbering_system) { m_numbering_system = move(numbering_system); }
DeprecatedString const& numbering_system() const { return m_numbering_system; }
void set_numbering_system(DeprecatedString numbering_system) { m_numbering_system = move(numbering_system); }
::Locale::Style style() const { return m_style; }
void set_style(StringView style) { m_style = ::Locale::style_from_string(style); }
@ -63,9 +63,9 @@ private:
virtual void visit_edges(Cell::Visitor&) override;
String m_locale; // [[Locale]]
String m_data_locale; // [[DataLocale]]
String m_numbering_system; // [[NumberingSystem]]
DeprecatedString m_locale; // [[Locale]]
DeprecatedString m_data_locale; // [[DataLocale]]
DeprecatedString m_numbering_system; // [[NumberingSystem]]
::Locale::Style m_style { ::Locale::Style::Long }; // [[Style]]
Numeric m_numeric { Numeric::Always }; // [[Numeric]]
NumberFormat* m_number_format { nullptr }; // [[NumberFormat]]
@ -73,7 +73,7 @@ private:
};
struct PatternPartitionWithUnit : public PatternPartition {
PatternPartitionWithUnit(StringView type, String value, StringView unit_string = {})
PatternPartitionWithUnit(StringView type, DeprecatedString value, StringView unit_string = {})
: PatternPartition(type, move(value))
, unit(unit_string)
{
@ -85,7 +85,7 @@ struct PatternPartitionWithUnit : public PatternPartition {
ThrowCompletionOr<::Locale::TimeUnit> singular_relative_time_unit(VM&, StringView unit);
ThrowCompletionOr<Vector<PatternPartitionWithUnit>> partition_relative_time_pattern(VM&, RelativeTimeFormat&, double value, StringView unit);
Vector<PatternPartitionWithUnit> make_parts_list(StringView pattern, StringView unit, Vector<PatternPartition> parts);
ThrowCompletionOr<String> format_relative_time(VM&, RelativeTimeFormat&, double value, StringView unit);
ThrowCompletionOr<DeprecatedString> format_relative_time(VM&, RelativeTimeFormat&, double value, StringView unit);
ThrowCompletionOr<Array*> format_relative_time_to_parts(VM&, RelativeTimeFormat&, double value, StringView unit);
}