summaryrefslogtreecommitdiff
path: root/Userland/Utilities/gron.cpp
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2022-12-04 18:02:33 +0000
committerAndreas Kling <kling@serenityos.org>2022-12-06 08:54:33 +0100
commit6e19ab2bbce0b113b628e6f8e9b5c0640053933e (patch)
tree372d21b2f5dcff112f5d0089559c6af5798680d4 /Userland/Utilities/gron.cpp
parentf74251606d74b504a1379ebb893fdb5529054ea5 (diff)
downloadserenity-6e19ab2bbce0b113b628e6f8e9b5c0640053933e.zip
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 :^)
Diffstat (limited to 'Userland/Utilities/gron.cpp')
-rw-r--r--Userland/Utilities/gron.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/Userland/Utilities/gron.cpp b/Userland/Utilities/gron.cpp
index deafb76935..d96c44c3cc 100644
--- a/Userland/Utilities/gron.cpp
+++ b/Userland/Utilities/gron.cpp
@@ -15,7 +15,7 @@
#include <unistd.h>
static bool use_color = false;
-static void print(StringView name, JsonValue const&, Vector<String>& trail);
+static void print(StringView name, JsonValue const&, Vector<DeprecatedString>& trail);
static StringView color_name = ""sv;
static StringView color_index = ""sv;
@@ -58,12 +58,12 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
color_off = "\033[0m"sv;
}
- Vector<String> trail;
+ Vector<DeprecatedString> trail;
print("json"sv, json, trail);
return 0;
}
-static void print(StringView name, JsonValue const& value, Vector<String>& trail)
+static void print(StringView name, JsonValue const& value, Vector<DeprecatedString>& trail)
{
for (size_t i = 0; i < trail.size(); ++i)
out("{}", trail[i]);
@@ -72,16 +72,16 @@ static void print(StringView name, JsonValue const& value, Vector<String>& trail
if (value.is_object()) {
outln("{}{{}}{};", color_brace, color_off);
- trail.append(String::formatted("{}{}{}.", color_name, name, color_off));
+ trail.append(DeprecatedString::formatted("{}{}{}.", color_name, name, color_off));
value.as_object().for_each_member([&](auto& on, auto& ov) { print(on, ov, trail); });
trail.take_last();
return;
}
if (value.is_array()) {
outln("{}[]{};", color_brace, color_off);
- trail.append(String::formatted("{}{}{}", color_name, name, color_off));
+ trail.append(DeprecatedString::formatted("{}{}{}", color_name, name, color_off));
for (size_t i = 0; i < value.as_array().size(); ++i) {
- auto element_name = String::formatted("{}{}[{}{}{}{}{}]{}", color_off, color_brace, color_off, color_index, i, color_off, color_brace, color_off);
+ auto element_name = DeprecatedString::formatted("{}{}[{}{}{}{}{}]{}", color_off, color_brace, color_off, color_index, i, color_off, color_brace, color_off);
print(element_name, value.as_array()[i], trail);
}
trail.take_last();