1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 05:27:45 +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,11 +7,11 @@
#pragma once
#include <AK/ByteBuffer.h>
#include <AK/DeprecatedString.h>
#include <AK/FlyString.h>
#include <AK/HashMap.h>
#include <AK/NonnullOwnPtrVector.h>
#include <AK/OwnPtr.h>
#include <AK/String.h>
#include <AK/Time.h>
#include <AK/Utf8View.h>
#include <LibVideo/Color/CodingIndependentCodePoints.h>
@ -19,7 +19,7 @@
namespace Video::Matroska {
struct EBMLHeader {
String doc_type;
DeprecatedString doc_type;
u32 doc_type_version;
};
@ -28,9 +28,9 @@ public:
u64 timestamp_scale() const { return m_timestamp_scale; }
void set_timestamp_scale(u64 timestamp_scale) { m_timestamp_scale = timestamp_scale; }
Utf8View muxing_app() const { return Utf8View(m_muxing_app); }
void set_muxing_app(String muxing_app) { m_muxing_app = move(muxing_app); }
void set_muxing_app(DeprecatedString muxing_app) { m_muxing_app = move(muxing_app); }
Utf8View writing_app() const { return Utf8View(m_writing_app); }
void set_writing_app(String writing_app) { m_writing_app = move(writing_app); }
void set_writing_app(DeprecatedString writing_app) { m_writing_app = move(writing_app); }
Optional<double> duration_unscaled() const { return m_duration_unscaled; }
void set_duration_unscaled(double duration) { m_duration_unscaled.emplace(duration); }
Optional<Time> duration() const
@ -42,8 +42,8 @@ public:
private:
u64 m_timestamp_scale { 1'000'000 };
String m_muxing_app;
String m_writing_app;
DeprecatedString m_muxing_app;
DeprecatedString m_writing_app;
Optional<double> m_duration_unscaled;
};

View file

@ -949,12 +949,12 @@ DecoderErrorOr<void> SampleIterator::seek_to_cue_point(CuePoint const& cue_point
return {};
}
ErrorOr<String> Streamer::read_string()
ErrorOr<DeprecatedString> Streamer::read_string()
{
auto string_length = TRY(read_variable_size_integer());
if (remaining() < string_length)
return Error::from_string_literal("String length extends past the end of the stream");
auto string_value = String(data_as_chars(), string_length);
auto string_value = DeprecatedString(data_as_chars(), string_length);
TRY(read_raw_octets(string_length));
return string_value;
}

View file

@ -147,7 +147,7 @@ public:
ErrorOr<u64> read_u64();
ErrorOr<double> read_float();
ErrorOr<String> read_string();
ErrorOr<DeprecatedString> read_string();
ErrorOr<void> read_unknown_element();

View file

@ -6,10 +6,10 @@
#pragma once
#include <AK/DeprecatedString.h>
#include <AK/Error.h>
#include <AK/Format.h>
#include <AK/SourceLocation.h>
#include <AK/String.h>
#include <errno.h>
namespace Video {
@ -44,7 +44,7 @@ public:
static DecoderError format(DecoderErrorCategory category, CheckedFormatString<Parameters...>&& format_string, Parameters const&... parameters)
{
AK::VariadicFormatParams variadic_format_params { parameters... };
return DecoderError::with_description(category, String::vformatted(format_string.view(), variadic_format_params));
return DecoderError::with_description(category, DeprecatedString::vformatted(format_string.view(), variadic_format_params));
}
static DecoderError from_source_location(DecoderErrorCategory category, StringView description, SourceLocation location = SourceLocation::current())
@ -67,14 +67,14 @@ public:
StringView string_literal() const { return m_description; }
private:
DecoderError(DecoderErrorCategory category, String description)
DecoderError(DecoderErrorCategory category, DeprecatedString description)
: m_category(category)
, m_description(move(description))
{
}
DecoderErrorCategory m_category { DecoderErrorCategory::Unknown };
String m_description;
DeprecatedString m_description;
};
#define DECODER_TRY(category, expression) \

View file

@ -63,11 +63,11 @@ struct FrameQueueItem {
return error;
}
String debug_string() const
DeprecatedString debug_string() const
{
if (is_error())
return error().string_literal();
return String::formatted("frame at {}ms", timestamp().to_milliseconds());
return DeprecatedString::formatted("frame at {}ms", timestamp().to_milliseconds());
}
private:

View file

@ -5,7 +5,7 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <AK/String.h>
#include <AK/DeprecatedString.h>
#include <LibGfx/Point.h>
#include <LibGfx/Size.h>