summaryrefslogtreecommitdiff
path: root/Meta/Lagom/Tools/CodeGenerators/LibLocale/GenerateRelativeTimeFormatData.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Meta/Lagom/Tools/CodeGenerators/LibLocale/GenerateRelativeTimeFormatData.cpp')
-rw-r--r--Meta/Lagom/Tools/CodeGenerators/LibLocale/GenerateRelativeTimeFormatData.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/Meta/Lagom/Tools/CodeGenerators/LibLocale/GenerateRelativeTimeFormatData.cpp b/Meta/Lagom/Tools/CodeGenerators/LibLocale/GenerateRelativeTimeFormatData.cpp
index b1bf7bdc05..8673f3fe1d 100644
--- a/Meta/Lagom/Tools/CodeGenerators/LibLocale/GenerateRelativeTimeFormatData.cpp
+++ b/Meta/Lagom/Tools/CodeGenerators/LibLocale/GenerateRelativeTimeFormatData.cpp
@@ -5,6 +5,7 @@
*/
#include "../LibUnicode/GeneratorUtil.h" // FIXME: Move this somewhere common.
+#include <AK/DeprecatedString.h>
#include <AK/Format.h>
#include <AK/HashMap.h>
#include <AK/JsonObject.h>
@@ -12,7 +13,6 @@
#include <AK/JsonValue.h>
#include <AK/LexicalPath.h>
#include <AK/SourceGenerator.h>
-#include <AK/String.h>
#include <AK/StringBuilder.h>
#include <LibCore/ArgsParser.h>
#include <LibCore/DirIterator.h>
@@ -40,9 +40,9 @@ struct RelativeTimeFormat {
&& (pattern == other.pattern);
}
- String time_unit;
- String style;
- String plurality;
+ DeprecatedString time_unit;
+ DeprecatedString style;
+ DeprecatedString plurality;
size_t tense_or_number { 0 };
size_t pattern { 0 };
};
@@ -74,10 +74,10 @@ struct CLDR {
UniqueStringStorage unique_strings;
UniqueStorage<RelativeTimeFormat> unique_formats;
- HashMap<String, LocaleData> locales;
+ HashMap<DeprecatedString, LocaleData> locales;
};
-static ErrorOr<void> parse_date_fields(String locale_dates_path, CLDR& cldr, LocaleData& locale)
+static ErrorOr<void> parse_date_fields(DeprecatedString locale_dates_path, CLDR& cldr, LocaleData& locale)
{
LexicalPath date_fields_path(move(locale_dates_path));
date_fields_path = date_fields_path.append("dateFields.json"sv);
@@ -136,11 +136,11 @@ static ErrorOr<void> parse_date_fields(String locale_dates_path, CLDR& cldr, Loc
return {};
}
-static ErrorOr<void> parse_all_locales(String dates_path, CLDR& cldr)
+static ErrorOr<void> parse_all_locales(DeprecatedString dates_path, CLDR& cldr)
{
auto dates_iterator = TRY(path_to_dir_iterator(move(dates_path)));
- auto remove_variants_from_path = [&](String path) -> ErrorOr<String> {
+ auto remove_variants_from_path = [&](DeprecatedString path) -> ErrorOr<DeprecatedString> {
auto parsed_locale = TRY(CanonicalLanguageID::parse(cldr.unique_strings, LexicalPath::basename(path)));
StringBuilder builder;
@@ -227,9 +227,9 @@ struct RelativeTimeFormatImpl {
cldr.unique_formats.generate(generator, "RelativeTimeFormatImpl"sv, "s_relative_time_formats"sv, 10);
- auto append_list = [&](String name, auto const& list) {
+ auto append_list = [&](DeprecatedString name, auto const& list) {
generator.set("name", name);
- generator.set("size", String::number(list.size()));
+ generator.set("size", DeprecatedString::number(list.size()));
generator.append(R"~~~(
static constexpr Array<@relative_time_format_index_type@, @size@> @name@ { {)~~~");
@@ -237,7 +237,7 @@ static constexpr Array<@relative_time_format_index_type@, @size@> @name@ { {)~~~
bool first = true;
for (auto index : list) {
generator.append(first ? " "sv : ", "sv);
- generator.append(String::number(index));
+ generator.append(DeprecatedString::number(index));
first = false;
}