summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibRegex/RegexMatcher.h
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2022-12-06 01:12:49 +0000
committerAndreas Kling <kling@serenityos.org>2022-12-06 08:54:33 +0100
commit57dc179b1fce5d4b7171311b04667debfe693095 (patch)
treea459d1aef92dc4e49bbf03b32621b1e7e30d4e64 /Userland/Libraries/LibRegex/RegexMatcher.h
parent6e19ab2bbce0b113b628e6f8e9b5c0640053933e (diff)
downloadserenity-57dc179b1fce5d4b7171311b04667debfe693095.zip
Everywhere: Rename to_{string => deprecated_string}() where applicable
This will make it easier to support both string types at the same time while we convert code, and tracking down remaining uses. One big exception is Value::to_string() in LibJS, where the name is dictated by the ToString AO.
Diffstat (limited to 'Userland/Libraries/LibRegex/RegexMatcher.h')
-rw-r--r--Userland/Libraries/LibRegex/RegexMatcher.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/Userland/Libraries/LibRegex/RegexMatcher.h b/Userland/Libraries/LibRegex/RegexMatcher.h
index 4dd739a896..484d207b2d 100644
--- a/Userland/Libraries/LibRegex/RegexMatcher.h
+++ b/Userland/Libraries/LibRegex/RegexMatcher.h
@@ -123,11 +123,11 @@ public:
size_t start_offset = 0;
RegexResult result = matcher->match(view, regex_options);
if (!result.success)
- return view.to_string();
+ return view.to_deprecated_string();
for (size_t i = 0; i < result.matches.size(); ++i) {
auto& match = result.matches[i];
- builder.append(view.substring_view(start_offset, match.global_offset - start_offset).to_string());
+ builder.append(view.substring_view(start_offset, match.global_offset - start_offset).to_deprecated_string());
start_offset = match.global_offset + match.view.length();
GenericLexer lexer(replacement_pattern);
while (!lexer.is_eof()) {
@@ -138,7 +138,7 @@ public:
}
auto number = lexer.consume_while(isdigit);
if (auto index = number.to_uint(); index.has_value() && result.n_capture_groups >= index.value()) {
- builder.append(result.capture_group_matches[i][index.value() - 1].view.to_string());
+ builder.append(result.capture_group_matches[i][index.value() - 1].view.to_deprecated_string());
} else {
builder.appendff("\\{}", number);
}
@@ -148,9 +148,9 @@ public:
}
}
- builder.append(view.substring_view(start_offset, view.length() - start_offset).to_string());
+ builder.append(view.substring_view(start_offset, view.length() - start_offset).to_deprecated_string());
- return builder.to_string();
+ return builder.to_deprecated_string();
}
// FIXME: replace(Vector<RegexStringView> const , ...)