1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 11:57:36 +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

@ -55,7 +55,7 @@ TEST_CASE(can_write_with_header)
TEST_CASE(can_write_with_different_behaviors)
{
Vector<Vector<String>> data = {
Vector<Vector<DeprecatedString>> data = {
{ "Well", "Hello\"", "Friends" },
{ "We\"ll", "Hello,", " Friends" },
};

View file

@ -6,10 +6,10 @@
#pragma once
#include <AK/DeprecatedString.h>
#include <AK/GenericLexer.h>
#include <AK/OwnPtr.h>
#include <AK/Stream.h>
#include <AK/String.h>
#include <AK/StringView.h>
#include <AK/Types.h>
#include <AK/Vector.h>
@ -35,8 +35,8 @@ inline WriterBehavior operator|(WriterBehavior left, WriterBehavior right)
}
struct WriterTraits {
String separator;
String quote { "\"" };
DeprecatedString separator;
DeprecatedString quote { "\"" };
enum QuoteEscape {
Repeat,
Backslash,
@ -79,7 +79,7 @@ public:
bool has_error() const { return m_error != WriteError::None; }
WriteError error() const { return m_error; }
String error_string() const
DeprecatedString error_string() const
{
switch (m_error) {
#define E(x, y) \
@ -137,7 +137,7 @@ private:
template<typename T>
void write_entry(T&& entry)
{
auto string = String::formatted("{}", FormatIfSupported(entry));
auto string = DeprecatedString::formatted("{}", FormatIfSupported(entry));
auto safe_to_write_normally = (m_behaviors & WriterBehavior::QuoteAll) == WriterBehavior::None
&& !string.contains('\n')